/* ReplyHub × New Kingdom Creative
   Design tokens follow the shadcn/ui pattern (semantic CSS variables), in the NKC palette:
   deep black, electric NKC blue, crisp white. Dark is the signature look; light mode is supported. */
:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --radius: 14px; --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* light */
  --bg: #f2f4f9; --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(31,107,255,.10), transparent 60%);
  --panel: #ffffff; --panel-2: #f5f7fc; --panel-3: #eceff7; --line: #e2e6f0; --line-strong: #cfd6e6;
  --text: #0a0d14; --muted: #5d667c;
  --brand: #0b5cff; --brand-2: #3d7dff; --brand-ink: #ffffff; --brand-soft: rgba(11,92,255,.10); --brand-glow: rgba(11,92,255,.28);
  --green: #12a150; --green-soft: rgba(18,161,80,.12); --red: #e11d48; --red-soft: rgba(225,29,72,.10); --amber: #b7791f; --amber-soft: rgba(245,165,36,.16);
  --side: #000000; --side-2: #0b0f18; --side-line: #161c29; --side-text: #9aa3b8;
  --ig: #e1306c; --tt: #0a0d14;
  --shadow: 0 1px 2px rgba(10,13,20,.04), 0 4px 16px rgba(10,13,20,.05);
  --shadow-lg: 0 24px 80px rgba(10,13,20,.22);
  --spot: rgba(11,92,255,.07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #04060b; --bg-grad: radial-gradient(1100px 600px at 100% -10%, rgba(31,107,255,.16), transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(31,107,255,.08), transparent 60%);
    --panel: #0a0e17; --panel-2: #0f1522; --panel-3: #151c2c; --line: #182033; --line-strong: #24304a;
    --text: #eef2ff; --muted: #8590a8;
    --brand: #1f6bff; --brand-2: #5b93ff; --brand-soft: rgba(31,107,255,.16); --brand-glow: rgba(31,107,255,.45);
    --green: #2fd076; --green-soft: rgba(47,208,118,.13); --red: #ff4d6d; --red-soft: rgba(255,77,109,.13); --amber: #ffb547; --amber-soft: rgba(255,181,71,.13);
    --tt: #eef2ff; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 30px rgba(0,0,0,.35); --shadow-lg: 0 30px 90px rgba(0,0,0,.6);
    --spot: rgba(31,107,255,.12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #04060b; --bg-grad: radial-gradient(1100px 600px at 100% -10%, rgba(31,107,255,.16), transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(31,107,255,.08), transparent 60%);
  --panel: #0a0e17; --panel-2: #0f1522; --panel-3: #151c2c; --line: #182033; --line-strong: #24304a;
  --text: #eef2ff; --muted: #8590a8;
  --brand: #1f6bff; --brand-2: #5b93ff; --brand-soft: rgba(31,107,255,.16); --brand-glow: rgba(31,107,255,.45);
  --green: #2fd076; --green-soft: rgba(47,208,118,.13); --red: #ff4d6d; --red-soft: rgba(255,77,109,.13); --amber: #ffb547; --amber-soft: rgba(255,181,71,.13);
  --tt: #eef2ff; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 30px rgba(0,0,0,.35); --shadow-lg: 0 30px 90px rgba(0,0,0,.6);
  --spot: rgba(31,107,255,.12);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); background: var(--bg-grad), var(--bg); background-attachment: fixed; color: var(--text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--brand); color: #fff; }
a { color: var(--brand-2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font: 700 26px/1.15 var(--display); margin: 0; letter-spacing: -.025em; }
h2 { font: 600 15px/1.3 var(--display); margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: 11.5px; margin: 0 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--panel-3); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { margin-left: auto; } .nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; } .col { display: flex; flex-direction: column; gap: 8px; }
.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ------------------------------ layout ------------------------------ */
.shell { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px; gap: 2px; overflow-y: auto; border-right: 1px solid var(--side-line); position: relative; }
.side::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), #6aa1ff, var(--brand)); background-size: 200% 100%; animation: sheen 6s linear infinite; }
.logo { display: flex; align-items: center; gap: 11px; color: #fff; padding: 6px 8px 18px; }
.logo .mark { width: 36px; height: 36px; border-radius: 10px; background: #000; border: 1px solid #1d2638; display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(31,107,255,.25), 0 6px 24px rgba(31,107,255,.35); flex: none; }
.logo .mark svg, .logo .mark img { width: 24px; height: 24px; object-fit: contain; }
.logo b { font: 700 17px/1 var(--display); letter-spacing: -.02em; display: block; }
.logo small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .14em; color: #6f9bff; margin-top: 4px; text-transform: uppercase; }
.side select { width: 100%; background: var(--side-2); border: 1px solid var(--side-line); color: #fff; padding: 10px 11px; border-radius: 10px; margin-bottom: 14px; cursor: pointer; transition: border-color .15s; }
.side select:hover { border-color: #2a3550; }
.nav { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--side-text); cursor: pointer; font-weight: 500; transition: color .15s, background .2s; }
.nav:hover { background: var(--side-2); color: #fff; }
.nav:hover svg { transform: translateX(1px) scale(1.06); }
.nav.active { color: #fff; background: linear-gradient(90deg, rgba(31,107,255,.22), rgba(31,107,255,.04)); }
.nav.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); box-shadow: 0 0 14px var(--brand); }
.nav.active svg { color: #6f9bff; }
.nav svg { width: 18px; height: 18px; flex: none; transition: transform .2s var(--ease); }
.nav .badge { margin-left: auto; }
.side .me { margin-top: auto; border-top: 1px solid var(--side-line); padding: 14px 8px 2px; font-size: 13px; display: flex; align-items: center; gap: 10px; }
.side .me b { color: #fff; display: block; }
.side .me .grow > span { color: var(--side-text); }
.theme-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--side-line); background: var(--side-2); color: #cdd6ea; display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--ease), border-color .15s; flex: none; }
.theme-btn:hover { border-color: var(--brand); transform: rotate(-12deg); }
.theme-btn svg { width: 16px; height: 16px; }
.main { overflow-y: auto; }
.page { padding: 28px 32px 56px; max-width: 1400px; margin: 0 auto; animation: rise .45s var(--ease) both; }
.head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.head .muted { margin-top: 6px; }
.mobile-bar { display: none; }

/* ---------------------------- components ---------------------------- */
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); isolation: isolate; transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; }
/* cursor spotlight (position set from JS) */
.card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 60%); }
.card:hover::after { opacity: 1; }
.card:hover { border-color: var(--line-strong); }
.grid > .card { animation: rise .5s var(--ease) both; }
.grid > .card:nth-child(2) { animation-delay: .04s; } .grid > .card:nth-child(3) { animation-delay: .08s; } .grid > .card:nth-child(4) { animation-delay: .12s; }
.grid > .card:nth-child(5) { animation-delay: .16s; } .grid > .card:nth-child(6) { animation-delay: .2s; } .grid > .card:nth-child(n+7) { animation-delay: .24s; }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-strong); background: var(--panel); padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; white-space: nowrap; color: var(--text); transition: transform .15s var(--ease), background .15s, border-color .15s, box-shadow .2s, color .15s; }
.btn:hover { background: var(--panel-2); border-color: var(--brand); color: var(--text); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: transparent; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 20px var(--brand-glow); overflow: hidden; }
.btn.primary::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .6s var(--ease); }
.btn.primary:hover { color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 10px 28px var(--brand-glow); transform: translateY(-1px); }
.btn.primary:hover::before { transform: translateX(120%); }
.btn.danger { color: var(--red); } .btn.danger:hover { border-color: var(--red); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-3); border-color: transparent; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--panel-2); padding: 10px 12px; border-radius: var(--radius-sm); outline: none; transition: border-color .15s, box-shadow .2s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 4px var(--brand-soft); }
input[readonly] { color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
textarea { resize: vertical; min-height: 74px; }
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.field { margin-bottom: 15px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel-3); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.brand { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 0 12px var(--brand-glow); }
.badge.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.green::before, .badge.red::before, .badge.amber::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green::before { box-shadow: 0 0 0 0 currentColor; animation: ping 2.2s ease-out infinite; }
.badge.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.purple { background: var(--brand-soft); color: var(--brand-2); border-color: transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.plat { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: #fff; font-size: 9.5px; font-weight: 800; flex: none; letter-spacing: .02em; }
.plat.instagram { background: linear-gradient(135deg, #feda75, #fa7e1e 25%, #d62976 55%, #962fbf 80%, #4f5bd5); }
.plat.tiktok { background: #000; box-shadow: inset 0 0 0 1px #2b2b2b, 1px 0 0 #25f4ee, -1px 0 0 #fe2c55; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 13px; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--line); }

.tabs { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); padding: 3px; border-radius: 11px; }
.tabs button { border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; text-transform: capitalize; transition: color .15s, background .2s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 14px var(--brand-glow); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; transition: background .15s; }
tr.click:hover td { background: var(--brand-soft); }
tr.click td:first-child { transition: box-shadow .2s; }
tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h2 { font-size: 18px; color: var(--text); }

.toggle { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; margin: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--panel-3); border: 1px solid var(--line-strong); border-radius: 999px; transition: background .2s, border-color .2s, box-shadow .2s; }
.toggle span::after { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle input:checked + span { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 14px var(--brand-glow); }
.toggle input:checked + span::after { transform: translateX(18px); }

/* KPI */
.kpi { overflow: hidden; }
.kpi::before { content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); opacity: 0; transition: opacity .3s; }
.kpi:hover::before { opacity: 1; }
.kpi:hover { transform: translateY(-2px); }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi .value { font: 700 32px/1.1 var(--display); letter-spacing: -.03em; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.delta.up { color: var(--green); background: var(--green-soft); } .delta.down { color: var(--red); background: var(--red-soft); }
.chart-box { position: relative; height: 270px; }
.chart-box.sm { height: 210px; }
.funnel-row { display: grid; grid-template-columns: 90px 1fr 50px; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 13px; font-weight: 500; }
.bar { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transform-origin: left; animation: grow .9s var(--ease) both; }
.heat { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10px; color: var(--muted); }
.heat div { aspect-ratio: 1; border-radius: 4px; transition: transform .15s var(--ease); }
.heat div:hover { transform: scale(1.5); position: relative; z-index: 1; box-shadow: 0 0 0 2px var(--panel); }
.feed-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; animation: rise .4s var(--ease) both; }
.feed-item:last-child { border-bottom: 0; }

/* ------------------------------ inbox ------------------------------ */
.inbox { display: grid; grid-template-columns: 340px 1fr 300px; height: 100vh; animation: rise .4s var(--ease) both; }
.inbox > * { min-height: 0; }
.list { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.list-head { padding: 18px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.list-head h1 { font-size: 20px; }
.list-body { overflow-y: auto; flex: 1; }
.conv { position: relative; display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.conv:hover { background: var(--panel-2); }
.conv.on { background: var(--brand-soft); }
.conv.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); box-shadow: 0 0 12px var(--brand); }
.conv .name { font-weight: 600; }
.conv.unread .name::after { content: ''; display: inline-block; width: 7px; height: 7px; background: var(--brand); border-radius: 50%; margin-left: 6px; vertical-align: middle; box-shadow: 0 0 8px var(--brand); }
.conv .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; background: var(--bg); }
.thread-head { padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msgs { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 8px; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }
.msg { max-width: 72%; padding: 10px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; animation: pop .3s var(--ease) both; }
.msg.in { background: var(--panel); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 5px; }
.msg.out { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 5px; box-shadow: 0 6px 18px var(--brand-glow); }
.msg.out.automation { background: linear-gradient(135deg, #0b0f18, #12203f); border: 1px solid rgba(31,107,255,.5); box-shadow: 0 0 0 1px rgba(31,107,255,.1), 0 6px 18px rgba(31,107,255,.2); color: #e8efff; }
.msg-meta { font-size: 11px; color: var(--muted); }
.msg-meta.out { align-self: flex-end; }
.composer { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.composer textarea { min-height: 56px; }
.details { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 20px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); font-size: 12px; font-weight: 600; border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; opacity: .6; }
.chip button:hover { opacity: 1; }

/* ----------------------------- comments ----------------------------- */
.comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); animation: rise .4s var(--ease) both; }
.comment:last-child { border-bottom: 0; }
.reply-line { margin-top: 8px; padding: 7px 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 8px 8px 0; font-size: 13px; }

/* ------------------------- automation builder ----------------------- */
.action-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: var(--panel-2); animation: rise .3s var(--ease) both; transition: border-color .2s; }
.action-card:hover { border-color: var(--line-strong); }
.action-card .row:first-child { margin-bottom: 8px; }
.flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.flow .step { padding: 4px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 500; }
.flow .step:first-child { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, transparent); color: var(--brand-2); }
.flow .arrow { color: var(--brand-2); font-weight: 700; }

/* --------------------------- modal & toast -------------------------- */
.overlay { position: fixed; inset: 0; background: rgba(2,4,9,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .2s ease both; }
.modal { background: var(--panel); border: 1px solid var(--line-strong); border-radius: 18px; width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: zoom .3s var(--ease) both; }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #000; color: #fff; padding: 11px 18px; border-radius: 12px; border: 1px solid rgba(31,107,255,.45); box-shadow: 0 0 0 1px rgba(31,107,255,.15), 0 12px 40px rgba(0,0,0,.4); font-weight: 600; animation: toastIn .35s var(--ease) both; display: flex; gap: 8px; align-items: center; }
.toast::before { content: '✓'; color: #6f9bff; font-weight: 800; }
.toast.err { background: #2a0811; border-color: rgba(255,77,109,.5); }
.toast.err::before { content: '!'; color: #ff8aa0; }
.notice { padding: 12px 15px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-size: 13px; margin-bottom: 16px; border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); }
.notice.info { background: var(--brand-soft); color: var(--brand-2); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.notice a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------- auth ------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; background: #000; }
.auth::before { content: ''; position: absolute; inset: -20%; background:
  radial-gradient(40% 35% at 25% 25%, rgba(31,107,255,.45), transparent 70%),
  radial-gradient(35% 30% at 80% 75%, rgba(31,107,255,.28), transparent 70%),
  radial-gradient(30% 25% at 70% 15%, rgba(120,170,255,.18), transparent 70%);
  filter: blur(20px); animation: aurora 16s ease-in-out infinite alternate; }
.auth::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 20%, transparent 70%); }
.auth .card { width: min(430px, 100%); padding: 32px; z-index: 1; background: rgba(8,11,18,.82); border-color: rgba(31,107,255,.28); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #eef2ff; box-shadow: 0 0 0 1px rgba(31,107,255,.1), 0 40px 120px rgba(0,0,0,.6), 0 0 80px rgba(31,107,255,.15); animation: zoom .5s var(--ease) both; }
.auth .card input { background: rgba(255,255,255,.04); border-color: #1f2a40; color: #eef2ff; }
.auth .card input:focus { background: rgba(255,255,255,.06); }
.auth .card .muted { color: #8590a8; }
.auth .logo { padding: 0 0 22px; }
.auth h1 { font-size: 28px; }

/* ----------------------------- animation ---------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes zoom { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 5px transparent; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes aurora { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(4%, -3%) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ----------------------------- responsive --------------------------- */
@media (max-width: 1200px) { .inbox { grid-template-columns: 300px 1fr; } .details { display: none; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 22% 0 0; z-index: 40; transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: 30px 0 80px rgba(0,0,0,.5); }
  .side.open { transform: none; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #000; color: #fff; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--side-line); }
  .mobile-bar .logo { padding: 0; } .mobile-bar .logo .mark { width: 30px; height: 30px; } .mobile-bar .logo .mark svg, .mobile-bar .logo .mark img { width: 20px; height: 20px; }
  .mobile-bar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 0 4px; }
  .page { padding: 18px 16px 40px; }
  h1 { font-size: 22px; }
  .g3, .g2, .g21 { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; }
  .inbox.has-thread .list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .thread { height: calc(100vh - 55px); }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 24px; } .card { padding: 16px; } }

/* ------------------------------- Jarvis ------------------------------- */
.jv-orb { position: relative; width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #9cc0ff, #1f6bff 45%, #0a2a7a 75%, #020611); box-shadow: 0 0 18px rgba(31,107,255,.7), inset 0 0 8px rgba(255,255,255,.25); }
.jv-orb::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid transparent; border-top-color: #6f9bff; border-left-color: rgba(111,155,255,.35); animation: spin 2.4s linear infinite; }
.jv-orb i { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff, 0 0 20px #6f9bff; animation: breathe 2.6s ease-in-out infinite; }
.jv-fab { position: fixed; right: 22px; bottom: 22px; z-index: 45; display: flex; align-items: center; gap: 10px; padding: 9px 18px 9px 10px; border-radius: 999px; cursor: pointer;
  background: #000; color: #fff; border: 1px solid rgba(31,107,255,.55); font: 600 14px var(--display); letter-spacing: .01em;
  box-shadow: 0 0 0 1px rgba(31,107,255,.15), 0 10px 40px rgba(31,107,255,.35); transition: transform .25s var(--ease), box-shadow .25s, opacity .25s; animation: rise .5s var(--ease) both .3s; }
.jv-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 0 1px rgba(31,107,255,.3), 0 14px 50px rgba(31,107,255,.55); }
body.jv-on .jv-fab { opacity: 0; pointer-events: none; transform: scale(.8); }
.jv { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(430px, calc(100vw - 24px)); z-index: 46; display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); border-radius: 20px; box-shadow: var(--shadow-lg), 0 0 60px rgba(31,107,255,.15);
  transform: translateX(calc(100% + 24px)); transition: transform .4s var(--ease); overflow: hidden; }
.jv.open { transform: none; }
.jv::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); }
.jv-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.jv-head b { font: 700 16px/1.1 var(--display); display: block; letter-spacing: -.01em; }
.jv-head span:not(.jv-orb) { font-size: 12px; color: var(--muted); }
.jv-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.jv-hello { text-align: center; margin: auto 0; padding: 10px 4px; animation: rise .4s var(--ease) both; }
.jv-hello .jv-orb { width: 54px; height: 54px; margin: 0 auto 14px; } .jv-hello .jv-orb i { width: 14px; height: 14px; }
.jv-hello h3 { font: 700 19px/1.2 var(--display); color: var(--text); text-transform: none; letter-spacing: -.02em; margin: 0 0 6px; }
.jv-hello p { color: var(--muted); margin: 0 0 16px; font-size: 13.5px; }
.jv-chips { display: flex; flex-direction: column; gap: 8px; }
.jv-chip { text-align: left; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500; transition: border-color .15s, transform .2s var(--ease), background .15s; }
.jv-chip:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateX(3px); }
.jv-msg { max-width: 92%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.55; animation: pop .3s var(--ease) both; word-wrap: break-word; }
.jv-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 6px 18px var(--brand-glow); white-space: pre-wrap; }
.jv-msg.ai { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; width: 100%; max-width: 100%; }
.jv-msg.ai.err { border-color: color-mix(in srgb, var(--red) 45%, transparent); background: var(--red-soft); }
.jv-msg p { margin: 0 0 8px; } .jv-msg p:last-child { margin-bottom: 0; }
.jv-msg ul, .jv-msg ol { margin: 4px 0 8px; padding-left: 20px; } .jv-msg li { margin: 3px 0; }
.jv-msg .jv-h { font: 700 13.5px var(--display); margin: 10px 0 4px; }
.jv-msg b { color: var(--text); }
.jv-typing { display: flex; align-items: center; gap: 5px; width: auto !important; }
.jv-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: blink 1.2s infinite both; }
.jv-typing span:nth-child(2) { animation-delay: .15s; } .jv-typing span:nth-child(3) { animation-delay: .3s; }
.jv-typing em { font-size: 12px; color: var(--muted); margin-left: 6px; font-style: normal; }
.jv-draft { margin-top: 10px; padding: 11px; border-radius: 12px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); display: flex; flex-direction: column; gap: 8px; }
.jv-draft textarea { min-height: 60px; font-size: 13px; }
.jv-draft.done { border-color: var(--line); opacity: .8; }
.jv-open { margin-top: 10px; margin-right: 6px; }
.jv-compose { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 6px; border-top: 1px solid var(--line); }
.jv-compose textarea { min-height: 44px; max-height: 140px; resize: none; border-radius: 14px; }
.jv-send { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 0; cursor: pointer; color: #fff; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--brand-2), var(--brand)); box-shadow: 0 6px 20px var(--brand-glow); transition: transform .15s var(--ease); }
.jv-send:hover { transform: translateY(-1px) rotate(-8deg); } .jv-send:active { transform: scale(.94); }
.jv-send svg { width: 20px; height: 20px; }
.jv-foot { font-size: 11px; color: var(--muted); padding: 2px 16px 12px; display: flex; justify-content: space-between; gap: 8px; }
kbd { font: 600 10.5px var(--font); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--panel-3); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(.85); opacity: .8; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 900px) {
  .jv { inset: 0; width: 100%; border-radius: 0; border: 0; }
  .jv-fab { right: 14px; bottom: 14px; padding: 8px; } .jv-fab-label { display: none; }
}

/* ===================== Design pass: glass, grouped nav, quick actions, win button ===================== */
:root {
  --glass: color-mix(in srgb, var(--panel) 66%, transparent);
  --glass-strong: color-mix(in srgb, var(--panel) 82%, transparent);
  --glass-line: color-mix(in srgb, var(--line-strong) 72%, transparent);
  --blur: blur(22px) saturate(1.5);
  --amb: .55;
}
:root[data-theme="dark"] { --amb: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --amb: 1; } }

/* Ambient light behind everything, so the frosted panels have something to pick up. */
body::before { content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none; opacity: var(--amb);
  background: radial-gradient(36% 32% at 80% 14%, rgba(31,107,255,.32), transparent 70%), radial-gradient(30% 30% at 10% 86%, rgba(91,147,255,.20), transparent 70%), radial-gradient(24% 24% at 52% 58%, rgba(124,58,237,.12), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(-4%, 3%, 0) scale(1.08); } }

/* Frosted glass on every layered surface */
.card { background: var(--glass); border-color: var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.side { background: color-mix(in srgb, #000 64%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-right-color: rgba(255,255,255,.06); }
.modal { background: var(--glass-strong); border-color: var(--glass-line); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); }
.modal-head, .modal-foot { background: color-mix(in srgb, var(--panel) 78%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.jv { background: var(--glass-strong); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); }
.toast { background: rgba(0,0,0,.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* Mac app: the window itself is translucent, so the desktop seeps through subtly. */
html.native, html.native body { background: transparent; }
html.native body { background: var(--bg-grad), color-mix(in srgb, var(--bg) 62%, transparent); }
html.native .side { background: rgba(0,0,0,.40); padding-top: 46px; }
html.native .topbar { padding-top: 34px; }
html.native .jv { top: 36px; }
html.native .auth { padding-top: 40px; }

/* Left nav: labelled groups, with agency admin folded away */
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #5d6884; padding: 14px 11px 6px; }
.side select + .nav-label { padding-top: 4px; }
summary { list-style: none; cursor: pointer; } summary::-webkit-details-marker { display: none; }
.chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .22s var(--ease); opacity: .55; flex: none; margin-right: 3px; }
details[open] > summary .chev { transform: rotate(45deg); }
.nav-group { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--side-line); }
.nav-sum { font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #7f8aa6; }
.nav-sum .chev { margin-left: auto; }
.nav-sum svg { width: 16px; height: 16px; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 0 19px; padding-left: 9px; border-left: 1px solid var(--side-line); animation: rise .25s var(--ease) both; }
.nav-sub .nav { padding: 8px 10px; font-size: 13.5px; }
.nav-sub .nav.active::before { left: -10px; }

/* Top bar: where you are + the small search widget */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 32px; background: color-mix(in srgb, var(--bg) 52%, transparent); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border-bottom: 1px solid var(--glass-line); }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; } .crumb i { opacity: .4; font-style: normal; }
.kbar { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 32px; width: 236px; padding: 0 7px 0 10px; border-radius: 9px; border: 1px solid var(--glass-line); background: var(--glass); color: var(--muted); cursor: pointer; font-size: 13px; transition: border-color .15s, color .15s, box-shadow .2s; }
.kbar:hover { border-color: var(--brand); color: var(--text); box-shadow: 0 0 0 4px var(--brand-soft); }
.kbar svg { width: 14px; height: 14px; flex: none; } .kbar span { flex: 1; text-align: left; }
kbd { font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); }
.page { padding-top: 22px; }

/* Quick actions (⌘K) */
.pal-overlay { place-items: start center; padding-top: 13vh; }
.palette { width: min(640px, 100%); border-radius: 16px; overflow: hidden; background: var(--glass-strong); border: 1px solid var(--glass-line); backdrop-filter: blur(32px) saturate(1.6); -webkit-backdrop-filter: blur(32px) saturate(1.6); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(31,107,255,.2); animation: palIn .22s var(--ease) both; }
@keyframes palIn { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.pal-in { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--glass-line); }
.pal-in svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pal-in input, .pal-in input:hover, .pal-in input:focus { border: 0; background: transparent; padding: 0; font-size: 16px; box-shadow: none; border-radius: 0; }
.pal-list { max-height: min(54vh, 430px); overflow-y: auto; padding: 6px; }
.pal-group { font-size: 10.5px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 5px; }
.pal-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 9px; cursor: pointer; text-align: left; color: var(--text); font-weight: 500; }
.pal-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pal-item small { color: var(--muted); font-size: 12px; }
.pal-item.sel { background: var(--brand-soft); } .pal-item.sel svg { color: var(--brand-2); }
.pal-foot { display: flex; align-items: center; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--glass-line); font-size: 12px; color: var(--muted); }
.pal-foot kbd { margin-right: 3px; }

/* Accordions for setup and reference content */
.fold { border: 1px solid var(--glass-line); border-radius: var(--radius-sm); margin-top: 10px; background: color-mix(in srgb, var(--panel-2) 55%, transparent); transition: border-color .2s; }
.fold:hover { border-color: var(--line-strong); }
.fold > summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-weight: 600; user-select: none; }
.fold > summary span { flex: 1; }
.fold > summary small { color: var(--muted); font-weight: 400; font-size: 12px; }
.fold-body { padding: 2px 14px 14px; animation: rise .28s var(--ease) both; }
.fold.card { padding: 0; border-radius: var(--radius); background: var(--glass); }
.fold.card > summary { padding: 17px 20px; font: 600 15px/1.3 var(--display); }
.fold.card > .fold-body { padding: 0 20px 20px; }

/* Primary button: label swaps to the win text, the plane flies off and comes back */
.cta { gap: 9px; }
.cta-l { display: inline-grid; overflow: hidden; }
.cta-l > span { grid-area: 1 / 1; text-align: center; white-space: nowrap; transition: transform .38s var(--ease), opacity .25s; }
.cta-l > span:last-child { transform: translateY(115%); opacity: 0; }
.cta:hover:not(:disabled) .cta-l > span:first-child, .cta:focus-visible .cta-l > span:first-child { transform: translateY(-115%); opacity: 0; }
.cta:hover:not(:disabled) .cta-l > span:last-child, .cta:focus-visible .cta-l > span:last-child { transform: none; opacity: 1; }
.cta .plane { width: 15px; height: 15px; flex: none; position: relative; z-index: 1; }
.cta:hover:not(:disabled) .plane { animation: fly 1.5s var(--ease) infinite; }
@keyframes fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  45% { transform: translate(18px, -18px) scale(.7); opacity: 0; }
  46% { transform: translate(-14px, 14px) scale(.7); opacity: 0; }
  100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

@media (max-width: 860px) {
  .topbar { padding: 8px 14px; } .crumb { display: none; } .kbar { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .cta:hover .plane { animation: none; }
  .cta-l > span { transition: none; }
}
/* The inbox fills the space under the top bar */
.inbox { height: calc(100vh - 53px); }
html.native .inbox { height: calc(100vh - 77px); }

/* ---------------------------- Leads + alert bell ---------------------------- */
.bell-wrap { position: relative; margin-left: auto; }
.bell-wrap + .kbar { margin-left: 0; }
.bell { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--glass-line); background: var(--glass); color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s; }
.bell:hover { border-color: var(--brand); color: var(--text); }
.bell svg { width: 15px; height: 15px; }
.bell.ring { color: var(--text); } .bell.ring svg { animation: ring 2.4s var(--ease) infinite; transform-origin: 50% 10%; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(14deg); } 76% { transform: rotate(-12deg); } 84% { transform: rotate(8deg); } 92% { transform: rotate(-4deg); } }
.bell-n { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--brand); color: #fff; font: 700 10px/16px var(--font); text-align: center; box-shadow: 0 0 0 2px var(--bg), 0 0 12px var(--brand-glow); }
.bell-panel { position: absolute; right: 0; top: 40px; width: min(360px, calc(100vw - 28px)); max-height: 430px; overflow-y: auto; z-index: 40; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--glass-line); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); box-shadow: var(--shadow-lg); animation: palIn .2s var(--ease) both; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid var(--glass-line); position: sticky; top: 0; background: color-mix(in srgb, var(--panel) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.bell-head a { font-size: 12.5px; }
.bell-item { display: flex; gap: 11px; align-items: flex-start; padding: 11px 14px; color: var(--text); border-bottom: 1px solid var(--glass-line); transition: background .15s; }
.bell-item:last-child { border-bottom: 0; } .bell-item:hover { background: var(--brand-soft); color: var(--text); }
.bell-item b { font-weight: 600; font-size: 13.5px; display: block; }
.bell-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; box-shadow: 0 0 10px var(--brand-glow); }
.bell-dot.lead_info { background: var(--green); box-shadow: none; }
#l-mail, #l-set, #l-csv { height: 38px; } #l-set svg { width: 15px; height: 15px; }
.modal h3:first-child { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .bell.ring svg { animation: none; } }

/* Content page */
.board td { vertical-align: top; }
.post-cell { align-items: flex-start; gap: 10px; min-width: 260px; }
.thumb { width: 46px; height: 58px; border-radius: 8px; object-fit: cover; flex: none; background: var(--panel-3); border: 1px solid var(--line); }
.thumb.ph { display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.meter { height: 4px; border-radius: 4px; background: var(--panel-3); margin-top: 7px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .6s var(--ease); }
.insight-hero { background: linear-gradient(120deg, var(--brand-soft), transparent 70%); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.sentiment { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--panel-3); }
.sentiment i { display: block; height: 100%; }
.sentiment .pos { background: var(--green); } .sentiment .neu { background: var(--line-strong); } .sentiment .neg { background: var(--red, #ef4444); }
.theme, .idea { padding: 10px 0; border-bottom: 1px solid var(--line); }
.theme:last-child, .idea:last-child { border-bottom: 0; }
.qlist { margin: 6px 0 0; padding-left: 18px; } .qlist li { margin: 4px 0; }
#c-insights h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
.plat-tabs { margin: 0 0 16px; width: fit-content; }
.plat-tabs button { display: inline-flex; align-items: center; gap: 7px; }
.plat-tabs .count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.plat-tabs button.on .count { background: rgba(255,255,255,.2); color: inherit; }

/* Onboarding checklist */
.onb { margin-bottom: 16px; border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: linear-gradient(135deg, var(--brand-soft), transparent 55%), var(--panel); }
.onb-meter { height: 6px; margin: 12px 0 6px; }
.onb-steps { display: grid; gap: 2px; margin-top: 8px; }
.onb-step { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; transition: background .15s; }
.onb-step:hover { background: var(--panel-2); }
.onb-step.is-next { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--brand); }
.onb-dot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 1.5px solid var(--line-strong); color: var(--muted); }
.onb-dot svg, .onb-badge svg { width: 14px; height: 14px; }
.onb-step.is-done .onb-dot { background: var(--green); border-color: var(--green); color: #fff; }
.onb-step.is-done .onb-label { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.onb-step.is-next .onb-dot { border-color: var(--brand); color: var(--brand-2); }
.onb-label { font-weight: 600; }
.onb-done { background: linear-gradient(135deg, var(--green-soft), transparent 60%), var(--panel); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.onb-badge { width: 34px; height: 34px; border-radius: 50%; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
@media (max-width: 720px) { .onb-step { flex-wrap: wrap; } .onb-step > .row { width: 100%; justify-content: flex-end; } }
.btn.danger-solid { background: var(--red); border-color: transparent; color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); color: #fff; }

/* Phone app card */
.phone-steps { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.phone-step { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel-2); }
.phone-step > b { display: block; margin-bottom: 4px; }
@media (max-width: 720px) { .phone-steps { grid-template-columns: 1fr; } }
/* Installed app: respect the iPhone notch and home bar */
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); } }

/* Jarvis reply suggestions (Inbox) */
.sugg { margin-bottom: 10px; }
.sugg:empty { display: none; }
.sugg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.sugg-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sugg-chip { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.sugg-chip:hover, .sugg-chip.on { border-color: var(--brand); background: var(--brand-soft); }
.sugg-chip b { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-2); }
.sugg-chip span { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sugg-note { margin-top: 8px; font-size: 12.5px; color: var(--amber); }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-2); }
.link-btn:hover { text-decoration: underline; }
@media (max-width: 900px) {
  .sugg-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .sugg-chip { flex: 0 0 78%; scroll-snap-align: start; }
}
/* Website sign-ups (Clients) */
.signups { margin-bottom: 16px; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.signup-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .signup-row { flex-direction: column; align-items: stretch; } }

/* Phase 1: client rules bar, tester, activity, keyword warnings, health */
.rules-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.rules-card { padding: 14px 16px; }
.rules-card.on { border-color: var(--green); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent); }
.tester { margin-bottom: 16px; }
.tester-row { display: flex; gap: 8px; margin-top: 10px; }
.tester-row input { min-width: 0; }
.test-out { margin-top: 12px; }
.test-hit { padding: 10px 12px; border-radius: 10px; background: var(--green-soft); margin-bottom: 8px; }
.test-hit.none { background: var(--panel-2); }
.test-msg { margin-top: 6px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.ai-box { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: linear-gradient(160deg, var(--brand-soft), var(--panel) 70%); }
.ai-box input { min-width: 0; }
.activity { display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.act-row { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.act-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--green); }
.act-row.pending .act-dot { background: var(--amber); }
.act-row.failed .act-dot { background: var(--red); }
.kw-warn { margin-top: 6px; font-size: 12.5px; padding: 7px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); }
.kw-warn.high { background: var(--red-soft); color: var(--red); }
.health { font-size: 12px; white-space: nowrap; }
.health.ok { color: var(--green); } .health.warn { color: var(--amber); } .health.bad { color: var(--muted); }
.health-note { font-size: 12px; color: var(--amber); }
@media (max-width: 900px) { .rules-bar { grid-template-columns: 1fr; } .tester-row { flex-wrap: wrap; } .tester-row input { flex: 1 1 100%; max-width: none !important; } }

/* Easier to follow: client label, page help, Home to-do list, page tabs */
.ws-label { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--side-text); opacity: .7; margin: 4px 2px 6px; font-weight: 700; }
.help-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 800; cursor: pointer; vertical-align: 4px; margin-left: 6px; }
.help-btn:hover { color: var(--brand-2); border-color: var(--brand); }
.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; line-height: 1.55; }
.todo { margin-bottom: 18px; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.todo-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.todo-row:first-of-type { margin-top: 10px; }
.todo-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); flex: none; font-size: 16px; }
.todo-row.high .todo-ic { background: var(--red-soft); } .todo-row.medium .todo-ic { background: var(--brand-soft); } .todo-row.info .todo-ic { background: var(--green-soft); }
.todo-empty { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.section-title { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.more-nums { margin-top: 12px; }
.page-tabs { width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 16px; }
.page-tabs button { text-transform: none; white-space: nowrap; }
@media (max-width: 720px) { .todo-row { flex-wrap: wrap; } .todo-row .btn { margin-left: 46px; } }

/* Jarvis co-pilot proposal card */
.jv-prop { margin-top: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line)); background: linear-gradient(160deg, var(--brand-soft), var(--panel) 75%); }
.jv-prop.done { background: var(--panel-2); border-color: var(--line); }
.jv-prop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.jv-prop-line { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.jv-prop-line > span { flex: none; }
.jv-prop-line.bad { color: var(--red); }

/* Client settings page, tour */
.jarvis-ask { margin-bottom: 16px; border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: linear-gradient(160deg, var(--brand-soft), var(--panel) 70%); }
.jarvis-ask input { min-width: 0; }
.jv-orb.sm { width: 22px; height: 22px; }
.click-card { cursor: pointer; transition: border-color .15s, transform .15s; }
.click-card:hover { border-color: var(--brand); transform: translateY(-2px); }
#cs-rules .rules-bar { margin-bottom: 4px; }
.page .section-title { margin-top: 22px; }
.tour { position: fixed; inset: 0; z-index: 2000; }
.tour-dim { position: fixed; inset: 0; background: rgba(4,6,11,.6); }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(4,6,11,.62), 0 0 0 2px var(--brand), 0 0 24px var(--brand-glow, rgba(31,107,255,.5)); pointer-events: none; transition: all .25s ease; }
.tour-card { position: fixed; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; padding: 14px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.tour-card b { display: block; font-size: 15px; margin: 2px 0 4px; }
.tour-card p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* 2-step login */
.qr { margin: 10px 0; width: 190px; padding: 8px; background: #fff; border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.qr .muted { color: #555 !important; }
code.secret { font-size: 13px; letter-spacing: .06em; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codes code { font-size: 15px; padding: 8px 10px; text-align: center; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); letter-spacing: .06em; }

/* Pipeline board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col-lane { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 240px; transition: border-color .15s, background .15s; }
.col-lane.over { border-color: var(--brand); background: var(--brand-soft); }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.lane-body { display: grid; gap: 8px; }
.lane-empty { padding: 18px 8px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.deal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; cursor: grab; display: grid; gap: 4px; }
.deal:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); }
.deal.dragging { opacity: .5; }
.deal-prev { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal-foot { margin-top: 4px; gap: 6px; }
.deal-foot select { width: auto; flex: 1; padding: 4px 6px; font-size: 12px; min-width: 0; }
@media (max-width: 900px) { .board { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; } .col-lane { scroll-snap-align: start; } }
/* Starred chats */
.star-on { color: #f5b301; }
.star-btn { font-size: 16px; line-height: 1; }
.star-btn.on { color: #f5b301; }
