/* ==========================================================================
   LinkHunter — design system
   Brief palette (primary #5B14F8, navy sidebar, slate neutrals) with the
   brand's blue→violet→magenta gradient reserved for one thing: live agent
   activity along the "hunt line" and the logo.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-ext-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Jakarta"; src: url("../fonts/jakarta-latin-wght.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  /* Logo palette: electric blue -> indigo -> violet -> orchid -> hot magenta */
  --brand-blue: #2A1BFA;
  --brand-indigo: #5B14F8;
  --brand-violet: #8A18F8;
  --brand-orchid: #C21CF4;
  --brand-magenta: #FE25CC;
  --primary: #5B14F8;
  --primary-dark: #4A0FD8;
  --primary-soft: #F1ECFF;
  --primary-ink: #4310C9;
  --bg: #F7F6FD;
  --surface: #FFFFFF;
  --surface-2: #F4F2FB;
  --surface-3: #ECE9F7;
  --sidebar: #0B0820;
  --sidebar-2: #161130;
  --sidebar-ink: #CFCAE6;
  --sidebar-muted: #847DA6;
  --text: #120F24;
  --text-2: #625E7A;
  --text-3: #9A96B0;
  --border: #E7E3F3;
  --border-strong: #D3CEE6;
  --success: #10B981;
  --success-soft: #E7F8F1;
  --success-ink: #047857;
  --warning: #F59E0B;
  --warning-soft: #FEF5E2;
  --warning-ink: #B45309;
  --danger: #EF4444;
  --danger-soft: #FDECEC;
  --danger-ink: #B91C1C;
  --info-soft: #ECEBFF;
  --info-ink: #2A1BC9;
  --hunt-1: #2A1BFA;
  --hunt-2: #8A18F8;
  --hunt-3: #FE25CC;
  --hunt: linear-gradient(100deg, var(--hunt-1), var(--hunt-2) 55%, var(--hunt-3));
  --hunt-soft: linear-gradient(100deg, rgba(42,27,250,.10), rgba(138,24,248,.10) 55%, rgba(254,37,204,.10));
  --glow: rgba(91, 20, 248, .38);
  --glow-pink: rgba(254, 37, 204, .30);
  --aurora-a: rgba(91, 20, 248, .14);
  --aurora-b: rgba(254, 37, 204, .09);
  --aurora-c: rgba(42, 27, 250, .07);
  --ring: 0 0 0 3px rgba(91, 20, 248, .25), 0 0 18px -2px rgba(138, 24, 248, .35);
  --shadow-1: 0 1px 2px rgba(18, 15, 36, .05);
  --shadow-2: 0 1px 2px rgba(18, 15, 36, .04), 0 8px 24px -8px rgba(40, 20, 110, .16);
  --shadow-3: 0 24px 60px -14px rgba(30, 12, 90, .32);
  --shadow-glow: 0 1px 2px rgba(18,15,36,.04), 0 14px 40px -14px rgba(91, 20, 248, .35);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Jakarta", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #8B5CFF; --primary-dark: #7340FF; --primary-soft: #221849; --primary-ink: #C9B8FF;
    --bg: #07051A; --surface: #0F0C24; --surface-2: #15112D; --surface-3: #1C1738;
    --sidebar: #050313; --sidebar-2: #120D2A; --sidebar-ink: #CFCAE6; --sidebar-muted: #7D76A0;
    --text: #EEECF8; --text-2: #A7A2C2; --text-3: #6E688C; --border: #241E3F; --border-strong: #352C5A;
    --success-soft: #0F2D25; --success-ink: #4ADE9F; --warning-soft: #33250B; --warning-ink: #FBBF4D;
    --danger-soft: #3A1517; --danger-ink: #FF8A8A; --info-soft: #1A1546; --info-ink: #A9A0FF;
    --glow: rgba(139, 92, 255, .5); --glow-pink: rgba(254, 37, 204, .38);
    --aurora-a: rgba(91, 20, 248, .22); --aurora-b: rgba(254, 37, 204, .12); --aurora-c: rgba(42, 27, 250, .16);
    --hunt-soft: linear-gradient(100deg, rgba(42,27,250,.18), rgba(138,24,248,.18) 55%, rgba(254,37,204,.16));
    --shadow-1: 0 1px 2px rgba(0,0,0,.35);
    --shadow-2: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -10px rgba(0,0,0,.6);
    --shadow-3: 0 24px 60px -12px rgba(0,0,0,.75);
    --shadow-glow: 0 1px 2px rgba(0,0,0,.4), 0 16px 48px -16px rgba(139, 92, 255, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #8B5CFF; --primary-dark: #7340FF; --primary-soft: #221849; --primary-ink: #C9B8FF;
  --bg: #07051A; --surface: #0F0C24; --surface-2: #15112D; --surface-3: #1C1738;
  --sidebar: #050313; --sidebar-2: #120D2A; --sidebar-ink: #CFCAE6; --sidebar-muted: #7D76A0;
  --text: #EEECF8; --text-2: #A7A2C2; --text-3: #6E688C; --border: #241E3F; --border-strong: #352C5A;
  --success-soft: #0F2D25; --success-ink: #4ADE9F; --warning-soft: #33250B; --warning-ink: #FBBF4D;
  --danger-soft: #3A1517; --danger-ink: #FF8A8A; --info-soft: #1A1546; --info-ink: #A9A0FF;
  --glow: rgba(139, 92, 255, .5); --glow-pink: rgba(254, 37, 204, .38);
  --aurora-a: rgba(91, 20, 248, .22); --aurora-b: rgba(254, 37, 204, .12); --aurora-c: rgba(42, 27, 250, .16);
  --hunt-soft: linear-gradient(100deg, rgba(42,27,250,.18), rgba(138,24,248,.18) 55%, rgba(254,37,204,.16));
  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -10px rgba(0,0,0,.6);
  --shadow-3: 0 24px 60px -12px rgba(0,0,0,.75);
  --shadow-glow: 0 1px 2px rgba(0,0,0,.4), 0 16px 48px -16px rgba(139, 92, 255, .45);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.015em; color: var(--text); }
h1 { font-size: 24px; font-weight: 700; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 700; line-height: 1.35; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
::selection { background: rgba(91, 20, 248, .22); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
[data-lucide] { width: 16px; height: 16px; stroke-width: 1.9; flex-shrink: 0; }
svg.lucide { width: 16px; height: 16px; stroke-width: 1.9; flex-shrink: 0; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; padding: 14px 12px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: #fff; }
.brand img { width: 30px; height: 30px; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.03em; color: inherit; }
.wordmark i { font-style: normal; background: linear-gradient(90deg, #C21CF4, #FE25CC); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ws-switch { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--sidebar-2); border: 1px solid rgba(255,255,255,.06); color: #E8ECF5; border-radius: var(--r); padding: 8px 10px; font: inherit; cursor: pointer; text-align: left; }
.ws-switch:hover { border-color: rgba(255,255,255,.14); }
.ws-avatar { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 700 12px var(--display); color: #fff; background: linear-gradient(135deg, #4A0FD8, #8A18F8); flex-shrink: 0; }
.ws-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.ws-role { font-size: 11.5px; color: var(--sidebar-muted); }
.nav { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: var(--sidebar-ink); font-weight: 500; font-size: 13.5px; position: relative; text-decoration: none; transition: background .15s, color .15s; }
.nav a svg { color: var(--sidebar-muted); transition: color .15s; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a:hover svg { color: #C9CFF9; }
.nav a[aria-current="page"] { background: rgba(139, 92, 255, .16); color: #fff; }
.nav a[aria-current="page"] svg { color: #C4B2FF; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--hunt); }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--sidebar-muted); background: rgba(255,255,255,.06); padding: 1px 7px; border-radius: 99px; }
.nav .count.hot { color: #fff; background: rgba(254, 37, 204, .22); }
.nav-label { margin: 18px 10px 6px; font-size: 11.5px; color: var(--sidebar-muted); font-weight: 500; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.plan-card { background: var(--sidebar-2); border: 1px solid rgba(255,255,255,.06); border-radius: var(--r); padding: 12px; }
.plan-card .row { justify-content: space-between; font-size: 12.5px; }
.plan-card b { color: #fff; font-weight: 600; }
.meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--hunt); transition: width .6s var(--ease); }
.plan-card .plan-note { font-size: 11.5px; color: var(--sidebar-muted); margin-top: 7px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.menu-btn { display: none; }
.searchbox { display: flex; align-items: center; gap: 8px; width: min(420px, 100%); height: 34px; padding: 0 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; color: var(--text-3); cursor: text; font: inherit; text-align: left; }
.searchbox:hover { border-color: var(--border-strong); }
.searchbox span { flex: 1; font-size: 13px; }
.kbd { font: 600 11px var(--font); color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 17px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.auto-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 9px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-right: 6px; cursor: pointer; }
.auto-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.auto-pill.live .dot { background: var(--hunt-3); box-shadow: 0 0 0 3px rgba(254, 37, 204,.18); animation: pulse 1.8s ease-in-out infinite; }
.auto-pill.paused .dot { background: var(--warning); }
.icon-btn { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .badge-dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--display); color: #fff; background: linear-gradient(135deg, #5B14F8, #C21CF4); border: 0; cursor: pointer; }

.content { padding: 26px 28px 64px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .lede { color: var(--text-2); margin-top: 4px; max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); border: 1px solid; font-size: 13px; margin-bottom: 18px; }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info-ink) 25%, transparent); color: var(--info-ink); }
.banner.warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 35%, transparent); color: var(--warning-ink); }
.banner.demo { background: linear-gradient(90deg, rgba(42, 27, 250,.08), rgba(254, 37, 204,.08)); border-color: rgba(138, 24, 248,.3); color: var(--text); }
.banner .btn { margin-left: auto; }

/* ---------- buttons ---------- */
.btn { --b: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--b); color: var(--text); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s, transform .08s; box-shadow: var(--shadow-1); }
.btn:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.3), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { color: var(--danger-ink); }
.btn.danger:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--text); }
.field .hint { font-size: 12.5px; color: var(--text-2); }
.field .error { font-size: 12.5px; color: var(--danger-ink); display: none; }
.field.has-error .error { display: block; }
.field.has-error .input, .field.has-error .tags { border-color: var(--danger); }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 400 13.5px var(--font); transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 88px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
select.input { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748B' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input::placeholder { color: var(--text-3); }
.input-group { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.input-group .input { border: 0; box-shadow: none; border-radius: 0; }
.input-group .affix { padding: 0 10px; color: var(--text-2); font-size: 13px; background: var(--surface-2); align-self: stretch; display: grid; place-items: center; border-right: 1px solid var(--border); }
.input-group .affix.end { border-right: 0; border-left: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; }
.check input { margin-top: 3px; accent-color: var(--primary); width: 15px; height: 15px; }
.switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 99px; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }
.switch input:disabled + span { opacity: .55; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: text; }
.tags:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.tags input { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); height: 24px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 4px 0 9px; border-radius: 6px; background: var(--primary-soft); color: var(--primary-ink); font-size: 12.5px; font-weight: 550; }
.tag button { border: 0; background: transparent; color: inherit; cursor: pointer; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; opacity: .7; }
.tag button:hover { opacity: 1; background: rgba(91, 20, 248,.15); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.choice input { accent-color: var(--primary); margin-top: 2px; }
.choice b { display: block; font-size: 13px; font-weight: 600; }
.choice small { display: block; color: var(--text-2); font-size: 12px; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font: 600 12.5px var(--font); color: var(--text-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: 14.5px; }
.panel-head .sub { color: var(--text-2); font-size: 12.5px; }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }
.panel-foot { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list > li.clickable { cursor: pointer; }
.list > li.clickable:hover { background: var(--surface-2); }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; font-size: 13px; }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Stat strip: one panel with dividers rather than a row of identical cards. */
.stats { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.stat { padding: 16px 18px; border-right: 1px solid var(--border); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat .k { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .v { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .v small { font-size: 14px; color: var(--text-2); font-weight: 600; margin-left: 3px; }
.stat .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat.feature .v { font-size: 34px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; }
.mini-stats > div { padding: 12px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mini-stats .k { font-size: 12px; color: var(--text-2); }
.mini-stats .v { font: 700 18px var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- badges & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.green { background: var(--success-soft); color: var(--success-ink); }
.badge.amber { background: var(--warning-soft); color: var(--warning-ink); }
.badge.red { background: var(--danger-soft); color: var(--danger-ink); }
.badge.blue { background: var(--info-soft); color: var(--info-ink); }
.badge.violet { background: var(--primary-soft); color: var(--primary-ink); }
.badge.live { background: linear-gradient(90deg, rgba(42, 27, 250,.1), rgba(254, 37, 204,.12)); color: #A21CAF; }
.badge.live::before { background: var(--hunt-3); animation: pulse 1.6s ease-in-out infinite; }
:root[data-theme="dark"] .badge.live { color: #F0ABFC; }
.score { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
.score .bar { width: 46px; height: 5px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.score .bar span { display: block; height: 100%; border-radius: inherit; }
.na { color: var(--text-3); font-size: 12px; font-style: italic; }

/* ---------- tables (Attio-style density) ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; z-index: 1; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .arrow { opacity: .4; margin-left: 3px; }
.table th.sorted .arrow { opacity: 1; color: var(--primary); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; max-width: 340px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.selected td { background: color-mix(in srgb, var(--primary-soft) 60%, var(--surface)); }
.table .col-check { width: 36px; padding-right: 0; }
.table .col-check input { accent-color: var(--primary); width: 15px; height: 15px; }
.table .right { text-align: right; }
.cell-main { font-weight: 600; color: var(--text); display: block; }
.cell-sub { color: var(--text-2); font-size: 12px; display: block; }
.favicon { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; font: 700 11px var(--display); color: #fff; flex-shrink: 0; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .input { height: 32px; font-size: 13px; }
.toolbar .search { position: relative; width: 260px; max-width: 100%; }
.toolbar .search svg { position: absolute; left: 9px; top: 8px; color: var(--text-3); }
.toolbar .search .input { padding-left: 31px; }
.bulkbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface)); border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--primary-ink); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.pager .btn { height: 28px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 0; background: none; color: var(--text-2); font: 600 13px var(--font); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.tabs .count { font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 0 6px; border-radius: 99px; }

/* ---------- empty, skeleton, feedback ---------- */
.empty { text-align: center; padding: 44px 24px; max-width: 460px; margin: 0 auto; }
.empty .glyph { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--primary); }
.empty .glyph svg { width: 22px; height: 22px; }
.empty h3 { font-family: var(--display); font-size: 15.5px; margin-bottom: 6px; }
.empty p { color: var(--text-2); font-size: 13.5px; }
.empty .actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.empty.compact { padding: 22px 16px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 6px; }
.sk-line { height: 12px; margin: 8px 0; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-3); font-size: 13px; animation: toast-in .25s var(--ease); }
.toast svg { margin-top: 1px; }
.toast.success svg { color: #34D399; }
.toast.error svg { color: #FCA5A5; }
.toast.warning svg { color: #FCD34D; }
.toast.leaving { animation: toast-out .2s ease forwards; }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 12px; font-weight: 500; padding: 5px 8px; border-radius: 6px; white-space: nowrap; z-index: 50; pointer-events: none; max-width: 280px; white-space: normal; width: max-content; }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* ---------- overlays: modal, drawer, menu, palette ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); z-index: 60; animation: fade .15s ease; }
.modal { position: fixed; left: 50%; top: 12vh; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); z-index: 61; animation: pop .18s var(--ease); }
.modal.wide { width: min(780px, calc(100vw - 32px)); }
.modal-head { padding: 16px 20px 0; display: flex; align-items: flex-start; gap: 10px; }
.modal-head p { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-3); z-index: 61; display: flex; flex-direction: column; animation: slide-in .22s var(--ease); }
.drawer.wide { width: min(720px, 100vw); }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.menu { position: fixed; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-3); padding: 5px; z-index: 70; animation: pop .14s var(--ease); }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; background: none; border-radius: 6px; font: 500 13px var(--font); color: var(--text); cursor: pointer; text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover, .menu .active { background: var(--surface-2); text-decoration: none; }
.menu .sep { height: 1px; background: var(--border); margin: 5px 2px; }
.menu .head { padding: 8px 9px 6px; font-size: 12px; color: var(--text-2); }
.menu .danger { color: var(--danger-ink); }
.palette { position: fixed; left: 50%; top: 14vh; transform: translateX(-50%); width: min(620px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-3); z-index: 80; overflow: hidden; animation: pop .16s var(--ease); }
.palette input { width: 100%; border: 0; outline: 0; padding: 16px 18px; font: 500 15px var(--font); background: transparent; color: var(--text); border-bottom: 1px solid var(--border); }
.palette .results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .group { padding: 8px 10px 4px; font-size: 12px; color: var(--text-3); }
.palette .item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette .item.active { background: var(--surface-2); }
.palette .item .sub { color: var(--text-2); font-size: 12.5px; margin-left: auto; }
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 8px; }
.notif:hover { background: var(--surface-2); }
.notif .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.notif.unread b::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); margin-left: 6px; vertical-align: middle; }

/* ==========================================================================
   The hunt line — seven agents as one connected chain.
   ========================================================================== */
.huntline { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; padding: 22px 8px 18px; }
.huntline::before { content: ""; position: absolute; left: calc(100% / 14); right: calc(100% / 14); top: 41px; height: 2px; background: var(--border); border-radius: 2px; }
.huntline .signal { position: absolute; left: calc(100% / 14); right: calc(100% / 14); top: 41px; height: 2px; background: var(--hunt); border-radius: 2px; transform-origin: left; transform: scaleX(var(--progress, 0)); transition: transform 1.2s var(--ease); }
.huntline.animate .signal { transform: scaleX(0); animation: draw 1.4s .15s var(--ease) forwards; }
.hl-node { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 0 6px; color: inherit; text-decoration: none; }
.hl-node:hover { text-decoration: none; }
.hl-dot { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); position: relative; z-index: 1; font: 700 13px var(--display); transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; box-shadow: var(--shadow-1); }
.hl-node:hover .hl-dot { transform: translateY(-2px); border-color: var(--border-strong); }
.hl-node.done .hl-dot { color: var(--primary-ink); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.hl-node.running .hl-dot { color: #fff; border-color: transparent; background: var(--hunt); box-shadow: 0 6px 18px -6px rgba(138, 24, 248, .65); }
.hl-node.running .hl-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 15px; border: 2px solid rgba(254, 37, 204, .35); animation: ring 1.8s ease-out infinite; }
.hl-node.paused .hl-dot { color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }
.hl-node.failed .hl-dot, .hl-node.blocked .hl-dot { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.hl-node.unavailable { opacity: .55; }
.hl-name { font-weight: 600; font-size: 12.5px; line-height: 1.25; }
.hl-value { font: 700 20px var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.hl-label { font-size: 11.5px; color: var(--text-2); }
.hl-state { font-size: 11.5px; color: var(--text-3); min-height: 16px; }
.hl-node.running .hl-state { color: #A21CAF; font-weight: 600; }
:root[data-theme="dark"] .hl-node.running .hl-state { color: #F0ABFC; }

/* Command center agent cards */
.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.agent-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-1); overflow: hidden; }
.agent-card.running { border-color: color-mix(in srgb, var(--hunt-2) 45%, var(--border)); }
.agent-card.running::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--hunt); background-size: 200% 100%; animation: flow 2.2s linear infinite; }
.agent-card .head { display: flex; gap: 12px; align-items: flex-start; }
.agent-card .idx { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 700 14px var(--display); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex-shrink: 0; }
.agent-card.running .idx { background: var(--hunt); color: #fff; border-color: transparent; }
.agent-card .desc { color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.agent-card .task { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); min-height: 34px; display: flex; gap: 8px; align-items: center; }
.agent-card .task b { color: var(--text); font-weight: 600; }
.agent-card .metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.agent-card .metrics > div { padding: 8px 10px; border-right: 1px solid var(--border); }
.agent-card .metrics > div:last-child { border-right: 0; }
.agent-card .metrics .k { font-size: 11.5px; color: var(--text-2); }
.agent-card .metrics .v { font: 700 15px var(--display); font-variant-numeric: tabular-nums; }
.agent-card .controls { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.master { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); margin-bottom: 16px; flex-wrap: wrap; }
.master .state { display: flex; align-items: center; gap: 12px; }
.master .orb { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.master.on .orb { background: var(--hunt); color: #fff; box-shadow: 0 8px 22px -8px rgba(138, 24, 248, .7); }
.master.off .orb { background: var(--warning-soft); color: var(--warning-ink); }

/* Log viewer */
.log { font-size: 12.5px; }
.log li { display: grid; grid-template-columns: 74px 16px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); align-items: start; }
.log time { color: var(--text-3); font-variant-numeric: tabular-nums; }
.log .lvl { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--text-3); }
.log .lvl.success { background: var(--success); } .log .lvl.warning { background: var(--warning); } .log .lvl.error { background: var(--danger); } .log .lvl.info { background: var(--primary); }

/* Feed */
.feed li { align-items: flex-start; }
.feed .who { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 11px var(--display); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex-shrink: 0; }
.feed .feed-msg { font-size: 13px; line-height: 1.45; }
.feed .meta { font-size: 12px; color: var(--text-3); }

/* ---------- wizard ---------- */
.wizard { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.stepper { position: sticky; top: calc(var(--topbar-h) + 20px); list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stepper li { position: relative; display: flex; gap: 12px; padding: 0 0 18px; }
.stepper li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--border); }
.stepper li:last-child::before { display: none; }
.stepper li.done::before { background: var(--primary); }
.stepper button { all: unset; display: flex; gap: 12px; cursor: pointer; border-radius: 8px; }
.stepper button:focus-visible { box-shadow: var(--ring); }
.stepper .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 12.5px var(--display); background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--text-2); flex-shrink: 0; position: relative; z-index: 1; transition: all .2s; }
.stepper li.done .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper li.current .n { border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 4px var(--primary-soft); }
.stepper .t { font-weight: 600; font-size: 13.5px; line-height: 28px; }
.stepper .s { display: block; font-size: 12px; color: var(--text-2); margin-top: -4px; }
.stepper li.current .t { color: var(--primary-ink); }
.wizard-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.wizard-card .body { padding: 24px 26px; }
.wizard-card .foot { display: flex; align-items: center; gap: 8px; padding: 14px 26px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.step-title { font-size: 20px; margin-bottom: 4px; }
.step-lede { color: var(--text-2); margin-bottom: 22px; max-width: 64ch; }
.recommend { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13px; color: var(--text-2); margin-bottom: 18px; }
.auto-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.auto-list label { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.auto-list label:last-child { border-bottom: 0; }
.auto-list .n { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 700 11px var(--display); background: var(--surface-2); color: var(--text-2); }
.auto-list .locked { background: var(--surface-2); cursor: default; }
.review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.review section { border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
.review h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.review h3 button { margin-left: auto; }

/* ---------- inbox ---------- */

/* ---------- auth & onboarding ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-side { position: relative; background: var(--sidebar); color: #DCE2F0; padding: 40px 48px; display: flex; flex-direction: column; overflow: hidden; }
.auth-side .brand { padding: 0; }
.auth-side .quote { margin-top: auto; max-width: 440px; }
.auth-side h2 { color: #fff; font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.025em; }
.auth-side p { color: #9AA5BE; margin-top: 10px; font-size: 14.5px; }
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(20px, 6vw, 88px); }
.auth-form { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-form h1 { font-size: 26px; margin-bottom: 6px; }
.auth-form .lede { color: var(--text-2); margin-bottom: 26px; }
.auth-form form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .alt { margin-top: 20px; font-size: 13.5px; color: var(--text-2); text-align: center; }
.form-error { display: none; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger-ink); font-size: 13px; }
.form-error.show { display: block; }
.form-ok { padding: 12px 14px; border-radius: 8px; background: var(--success-soft); color: var(--success-ink); font-size: 13.5px; }
.onb-progress { display: flex; gap: 6px; margin-bottom: 28px; }
.onb-progress span { flex: 1; height: 4px; border-radius: 99px; background: var(--surface-3); }
.onb-progress span.on { background: var(--primary); }

/* Welcome */
.welcome { min-height: 100vh; background: var(--sidebar); color: #DCE2F0; position: relative; overflow: hidden; }
.welcome::before { content: ""; position: absolute; left: 50%; top: 18%; width: 1400px; height: 1100px; transform: translateX(-30%); background: radial-gradient(closest-side, rgba(124, 58, 237, .26), rgba(124, 58, 237, .08) 55%, transparent); pointer-events: none; }
.welcome-nav { position: relative; display: flex; align-items: center; gap: 12px; padding: 20px clamp(20px, 5vw, 56px); max-width: 1280px; margin: 0 auto; }
.welcome-nav .links { margin-left: auto; display: flex; gap: 8px; }
.welcome-nav .btn.ghost { color: #C7CEDD; }
.welcome-nav .btn.ghost:hover { background: rgba(255,255,255,.06); color: #fff; }
.welcome-hero { position: relative; max-width: 1280px; margin: 0 auto; padding: clamp(36px, 7vw, 88px) clamp(20px, 5vw, 56px) 40px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.welcome-hero h1 { color: #fff; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -.035em; font-weight: 800; max-width: 14ch; }
.welcome-hero p.lead { font-size: 17px; line-height: 1.6; color: #A6B0C7; margin-top: 20px; max-width: 48ch; }
.welcome-hero .cta { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.welcome-hero .btn.ghost.outline { border-color: rgba(255,255,255,.18); color: #E6E9F2; background: rgba(255,255,255,.03); }
.welcome-hero .btn.ghost.outline:hover { background: rgba(255,255,255,.08); }
.welcome-hero .fine { margin-top: 16px; font-size: 13px; color: #7D8AA5; }
.welcome-steps { position: relative; max-width: 1280px; margin: 0 auto; padding: 24px clamp(20px, 5vw, 56px) 72px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; border-top: 1px solid rgba(255,255,255,.07); }
.welcome-steps h3 { color: #fff; font-size: 15px; margin: 6px 0 6px; }
.welcome-steps p { color: #8E99B3; font-size: 13.5px; line-height: 1.55; }
.welcome-steps .k { font: 700 13px var(--display); color: #C4B2FF; }

/* Agent constellation (illustration on the welcome screen) */
.constellation { position: relative; aspect-ratio: 1 / 1; max-width: 520px; width: 100%; margin: 0 auto; }
.constellation svg { width: 100%; height: 100%; overflow: visible; }
.constellation .orbit { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 1; }
.constellation .chain { fill: none; stroke: url(#huntGrad); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 6 9; animation: dash 18s linear infinite; opacity: .8; }
.constellation .node circle.bg { fill: #121A30; stroke: rgba(255,255,255,.14); }
.constellation .node text { fill: #DCE2F0; font: 600 11px var(--font); }
.constellation .node text.n { fill: #fff; font: 700 13px var(--display); }
.constellation .node.lit circle.bg { fill: url(#huntGrad); stroke: transparent; }
.constellation .packet { fill: #fff; filter: drop-shadow(0 0 6px #FE25CC); }
.constellation .core { fill: url(#coreGrad); }
.constellation .caption { position: absolute; left: 0; right: 0; bottom: -6px; text-align: center; font-size: 12px; color: #6D7894; }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes ring { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.98); } }
.menu { animation-name: menu-pop; }
@keyframes menu-pop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(8px); opacity: 0; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(var(--progress, 1)); } }
@keyframes flow { from { background-position: 0 0; } to { background-position: 200% 0; } }
@keyframes dash { to { stroke-dashoffset: -300; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   Premium layer — the logo's blue→violet→magenta light, used as glow,
   aurora and motion. Decorative only: every effect sits behind content,
   ignores pointer events and switches off under reduced motion.
   ========================================================================== */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

/* Ambient aurora + faint dot grid behind the workspace */
.main { position: relative; isolation: isolate; }
.main::before, .main::after { content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: var(--sidebar-w); z-index: -1; pointer-events: none; }
.main::before {
  background:
    radial-gradient(900px 520px at 88% -10%, var(--aurora-a), transparent 62%),
    radial-gradient(720px 460px at 6% 2%, var(--aurora-c), transparent 64%),
    radial-gradient(820px 620px at 72% 112%, var(--aurora-b), transparent 62%);
  animation: aurora 24s ease-in-out infinite alternate;
}
.main::after {
  background-image: radial-gradient(color-mix(in srgb, var(--primary) 16%, transparent) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(1100px 440px at 62% -4%, #000, transparent 72%);
  mask-image: radial-gradient(1100px 440px at 62% -4%, #000, transparent 72%);
  opacity: .5;
}

/* Glass top bar with a light seam */
.topbar { background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-bottom-color: color-mix(in srgb, var(--border) 70%, transparent); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(91, 20, 248, .35) 30%, rgba(254, 37, 204, .3) 70%, transparent); }
.searchbox { transition: border-color .2s, box-shadow .25s, background .2s; }
.searchbox:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 8%, transparent), 0 8px 24px -14px var(--glow); }
.icon-btn { transition: background .15s, color .15s, transform .15s; }
.icon-btn:hover { background: color-mix(in srgb, var(--primary-soft) 70%, transparent); color: var(--primary-ink); }
.avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px rgba(138, 24, 248, .45), 0 6px 18px -6px var(--glow-pink); transition: transform .2s var(--ease); }
.avatar:hover { transform: scale(1.06); }
.auto-pill { transition: border-color .2s, box-shadow .25s; }
.auto-pill.live { border-color: rgba(254, 37, 204, .35); background: var(--hunt-soft); box-shadow: 0 0 22px -6px var(--glow-pink); }
.icon-btn .badge-dot { background: linear-gradient(135deg, #8A18F8, #FE25CC); box-shadow: 0 0 10px -1px rgba(254, 37, 204, .8); }
.grad-text { background: linear-gradient(100deg, #8B7BFF 0%, #B565FF 40%, #FE25CC 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: flow 8s ease-in-out infinite alternate; }
.welcome > * { position: relative; z-index: 1; }
.welcome::after { z-index: 0; content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(196, 178, 255, .12) 1px, transparent 1.2px); background-size: 26px 26px; -webkit-mask-image: radial-gradient(900px 500px at 70% 30%, #000, transparent 70%); mask-image: radial-gradient(900px 500px at 70% 30%, #000, transparent 70%); }
.welcome-hero .btn.primary.lg { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px rgba(138, 24, 248, .4), 0 14px 34px -10px rgba(138, 24, 248, .9), 0 0 40px -8px rgba(254, 37, 204, .55); }

/* Sidebar: deep ink with the logo light pooling at the corners */
.sidebar {
  background:
    radial-gradient(130% 55% at 0% 0%, rgba(42, 27, 250, .26), transparent 58%),
    radial-gradient(120% 45% at 100% 100%, rgba(254, 37, 204, .18), transparent 62%),
    radial-gradient(90% 40% at 100% 45%, rgba(138, 24, 248, .12), transparent 70%),
    linear-gradient(180deg, #0E0A2A 0%, var(--sidebar) 52%, #100A2C 100%);
}
.sidebar::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(138, 24, 248, .55) 28%, rgba(254, 37, 204, .4) 72%, transparent); }
.brand img { filter: drop-shadow(0 0 10px rgba(138, 24, 248, .55)); animation: logo-glow 5s ease-in-out infinite; }
.ws-switch { background: rgba(255, 255, 255, .04); border-color: rgba(196, 178, 255, .12); transition: border-color .2s, background .2s, box-shadow .25s; }
.ws-switch:hover { background: rgba(255, 255, 255, .07); border-color: rgba(196, 178, 255, .28); box-shadow: 0 10px 30px -14px rgba(138, 24, 248, .8); }
.ws-avatar { background: linear-gradient(135deg, #2A1BFA, #8A18F8 55%, #FE25CC); box-shadow: 0 4px 14px -4px rgba(138, 24, 248, .8); }
.nav a { position: relative; transition: background .2s, color .2s, transform .25s var(--ease), box-shadow .25s; }
.nav a:hover { transform: translateX(2px); background: rgba(196, 178, 255, .07); }
.nav a[aria-current="page"] {
  background: linear-gradient(90deg, rgba(91, 20, 248, .5), rgba(138, 24, 248, .2) 62%, rgba(254, 37, 204, .06));
  box-shadow: inset 0 0 0 1px rgba(196, 178, 255, .18), 0 10px 26px -12px rgba(138, 24, 248, .9);
}
.nav a[aria-current="page"] svg { color: #fff; filter: drop-shadow(0 0 6px rgba(196, 178, 255, .9)); }
.nav a[aria-current="page"]::before { background: linear-gradient(180deg, #2A1BFA, #8A18F8, #FE25CC); box-shadow: 0 0 12px 1px rgba(254, 37, 204, .75); }
.nav .count.hot { background: linear-gradient(135deg, rgba(138, 24, 248, .55), rgba(254, 37, 204, .55)); box-shadow: 0 0 12px -2px rgba(254, 37, 204, .7); }
.plan-card { position: relative; overflow: hidden; background: linear-gradient(160deg, rgba(91, 20, 248, .24), rgba(22, 17, 48, .55) 48%, rgba(254, 37, 204, .14)); border-color: rgba(196, 178, 255, .16); transition: border-color .2s, box-shadow .25s, transform .25s var(--ease); }
.plan-card:hover { border-color: rgba(196, 178, 255, .34); box-shadow: 0 14px 34px -14px rgba(138, 24, 248, .9); transform: translateY(-1px); }
.meter > span { background: linear-gradient(90deg, #2A1BFA, #8A18F8, #FE25CC, #8A18F8, #2A1BFA); background-size: 200% 100%; animation: flow 3.5s linear infinite; box-shadow: 0 0 12px rgba(254, 37, 204, .65); }

/* Buttons: logo gradient, glow, and a light sweep on hover */
.btn { transition: background .2s, border-color .2s, box-shadow .25s, transform .15s var(--ease), color .2s; }
.btn:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border-strong)); }
.btn.primary { position: relative; overflow: hidden; border-color: transparent; background: linear-gradient(135deg, #3A1BFB 0%, #6614F8 48%, #A21AF6 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px rgba(91, 20, 248, .3), 0 8px 20px -8px rgba(91, 20, 248, .75); }
.btn.primary:hover { background: linear-gradient(135deg, #2F17EC 0%, #5B14F8 45%, #B01CF2 100%); border-color: transparent; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px rgba(138, 24, 248, .4), 0 12px 28px -10px rgba(138, 24, 248, .85), 0 0 26px -6px rgba(254, 37, 204, .5); }
.btn.primary:active { transform: translateY(0); }
.btn.primary::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, .38) 50%, transparent 68%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.danger.solid { box-shadow: 0 8px 20px -10px rgba(239, 68, 68, .8); }

/* Surfaces: cursor spotlight (fx.js sets --mx/--my), tinted borders, glow on hover */
.panel, .stats, .agent-card, .master, .wizard-card, .auth-card {
  background-image: radial-gradient(560px circle at var(--mx, -999px) var(--my, -999px), color-mix(in srgb, var(--primary) 8%, transparent), transparent 42%);
  transition: border-color .3s, box-shadow .35s, transform .35s var(--ease);
}
.panel:hover, .stats:hover, .master:hover { border-color: color-mix(in srgb, var(--primary) 20%, var(--border)); box-shadow: var(--shadow-2); }
.panel-head h2 { letter-spacing: -.01em; }

/* Hero panel holding the hunt line: rotating logo-light border + under-glow */
.panel:has(.huntline) { position: relative; border-color: transparent; }
.panel:has(.huntline)::before, .agent-card.running::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.2px; pointer-events: none; z-index: 2; height: auto;
  background: conic-gradient(from var(--angle), rgba(42, 27, 250, .15) 0deg, #2A1BFA 70deg, #8A18F8 130deg, #FE25CC 190deg, rgba(254, 37, 204, .15) 250deg, rgba(42, 27, 250, .15) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin-angle 7s linear infinite;
}
.agent-card.running::before { inset: 0; background-size: auto; }
.panel:has(.huntline)::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -14px; height: 60%; z-index: -1; pointer-events: none; background: var(--hunt); filter: blur(46px); opacity: .2; border-radius: 50%; }

/* Hunt line: glowing signal with a travelling spark */
.huntline .signal { background: linear-gradient(90deg, #2A1BFA, #8A18F8, #FE25CC, #8A18F8, #2A1BFA); background-size: 200% 100%; box-shadow: 0 0 10px rgba(138, 24, 248, .7), 0 0 22px rgba(254, 37, 204, .35); animation: flow 5s linear infinite; }
.huntline.animate .signal { animation: draw 1.4s .15s var(--ease) forwards, flow 5s linear infinite; }
.huntline .spark { position: absolute; top: 37px; left: calc(100% / 14); width: 10px; height: 10px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, #fff 0 30%, rgba(254, 37, 204, .9) 55%, transparent 72%); box-shadow: 0 0 14px 4px rgba(254, 37, 204, .55);
  offset-path: none; animation: spark 3.6s cubic-bezier(.45, 0, .55, 1) infinite; }
.hl-dot { transition: border-color .25s, transform .3s var(--ease), box-shadow .3s; }
.hl-node:hover .hl-dot { transform: translateY(-3px) scale(1.05); box-shadow: 0 10px 24px -8px var(--glow); }
.hl-node.done .hl-dot { color: var(--primary-ink); border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(135deg, #2A1BFA, #8A18F8, #FE25CC) border-box; box-shadow: 0 6px 18px -8px var(--glow); }
.hl-node.running .hl-dot { background: linear-gradient(135deg, #2A1BFA, #8A18F8 55%, #FE25CC); box-shadow: 0 0 0 4px rgba(254, 37, 204, .12), 0 8px 26px -6px rgba(254, 37, 204, .8); }
.hl-node.done .hl-value, .hl-node.running .hl-value { background: linear-gradient(180deg, var(--text) 35%, color-mix(in srgb, var(--primary) 70%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* KPI strip */
.stats { position: relative; }
.stats::before { content: ""; position: absolute; left: 24px; right: 24px; top: -1px; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(91, 20, 248, .7), rgba(254, 37, 204, .6), transparent); }
.stat { position: relative; transition: background .25s; }
.stat:hover { background: color-mix(in srgb, var(--primary-soft) 38%, transparent); }
.stat .k svg { color: var(--primary); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--primary) 45%, transparent)); }
.stat .v { background: linear-gradient(180deg, var(--text) 40%, color-mix(in srgb, var(--primary) 55%, var(--text))); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Agent cards */
.agent-card { transition: border-color .3s, box-shadow .35s, transform .35s var(--ease); }
.agent-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); box-shadow: var(--shadow-glow); }
.agent-card .idx { color: var(--primary-ink); border: 1px solid transparent; background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box, linear-gradient(135deg, rgba(42, 27, 250, .55), rgba(138, 24, 248, .45), rgba(254, 37, 204, .55)) border-box; transition: box-shadow .3s, transform .3s var(--ease); }
.agent-card:hover .idx { box-shadow: 0 6px 18px -6px var(--glow); transform: rotate(-4deg) scale(1.05); }
.agent-card.running { border-color: transparent; box-shadow: 0 18px 44px -18px rgba(138, 24, 248, .6); }
.agent-card.running .idx { background: linear-gradient(135deg, #2A1BFA, #8A18F8 55%, #FE25CC); color: #fff; box-shadow: 0 0 0 4px rgba(254, 37, 204, .12), 0 8px 22px -6px rgba(254, 37, 204, .75); animation: breathe 2.4s ease-in-out infinite; }
.agent-card .task { border: 1px solid transparent; }
.agent-card.running .task { background: var(--hunt-soft); border-color: rgba(138, 24, 248, .2); color: var(--text); }
.agent-card .metrics { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.master.on .orb { background: linear-gradient(135deg, #2A1BFA, #8A18F8 55%, #FE25CC); box-shadow: 0 0 0 6px rgba(138, 24, 248, .1), 0 10px 26px -8px rgba(254, 37, 204, .7); animation: breathe 3s ease-in-out infinite; }

/* Badges, tabs, segmented, tables */
.badge.live { background: var(--hunt-soft); color: #A21CAF; box-shadow: 0 0 16px -6px var(--glow-pink); }
:root[data-theme="dark"] .badge.live { color: #F0ABFC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.live { color: #F0ABFC; } }
.badge.live::before { box-shadow: 0 0 8px rgba(254, 37, 204, .9); }
.tabs [aria-selected="true"] { border-bottom-color: transparent; background: linear-gradient(90deg, #2A1BFA, #8A18F8, #FE25CC) bottom / 100% 2px no-repeat; }
.segmented button { transition: color .2s, background .2s, box-shadow .25s; }
.segmented button[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(18, 15, 36, .06), 0 6px 16px -8px var(--glow); color: var(--primary-ink); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface)); }
.table tbody tr.clickable:hover td:first-child { box-shadow: inset 2px 0 0 var(--primary); }

/* Overlays */
.overlay { background: rgba(9, 5, 28, .42); -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2); }
.drawer { box-shadow: -40px 0 90px -30px rgba(91, 20, 248, .45); }
.drawer::before, .modal::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none; background: linear-gradient(90deg, #2A1BFA, #8A18F8, #FE25CC); box-shadow: 0 0 16px rgba(138, 24, 248, .6); }
.modal { box-shadow: var(--shadow-3), 0 0 0 1px rgba(138, 24, 248, .12), 0 30px 80px -30px rgba(91, 20, 248, .55); overflow: hidden; }
.toast { background: color-mix(in srgb, var(--text) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow-3), 0 0 0 1px rgba(196, 178, 255, .12), 0 12px 36px -14px rgba(138, 24, 248, .6); }
.banner.demo { position: relative; overflow: hidden; background: var(--hunt-soft); border-color: rgba(138, 24, 248, .28); }
.banner.demo::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .22) 50%, transparent 65%); transform: translateX(-100%); animation: sweep 6s ease-in-out infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--primary-soft) 70%, var(--surface-3)) 37%, var(--surface-2) 63%); background-size: 400% 100%; }

/* First paint of each page: content rises in, in order (fx.js adds .enter once) */
#page-root.enter > * { animation: rise .6s var(--ease) both; }
#page-root.enter > *:nth-child(2) { animation-delay: .06s; }
#page-root.enter > *:nth-child(3) { animation-delay: .12s; }
#page-root.enter > *:nth-child(4) { animation-delay: .18s; }
#page-root.enter > *:nth-child(5) { animation-delay: .24s; }
#page-root.enter > *:nth-child(n+6) { animation-delay: .3s; }

/* Auth & welcome: same ink and light as the app */
.auth-side { background: radial-gradient(120% 60% at 0% 0%, rgba(42, 27, 250, .3), transparent 60%), radial-gradient(110% 50% at 100% 100%, rgba(254, 37, 204, .2), transparent 62%), linear-gradient(180deg, #0E0A2A, #0B0820 55%, #100A2C); }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 30%, var(--border-strong)) transparent; }

@keyframes aurora { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-2%, 1.5%, 0) scale(1.04); } 100% { transform: translate3d(1.5%, -1%, 0) scale(1.02); } }
@keyframes logo-glow { 0%, 100% { filter: drop-shadow(0 0 8px rgba(138, 24, 248, .45)); } 50% { filter: drop-shadow(0 0 14px rgba(254, 37, 204, .65)); } }
@keyframes spin-angle { to { --angle: 360deg; } }
@keyframes spark { 0% { left: calc(100% / 14 - 5px); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: calc(100% - 100% / 14 - 5px); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sweep { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@media (max-width: 980px) {
  .main::before, .main::after { left: 0; }
  .huntline .spark { display: none; }
}


/* Phone bottom navigation (Home | Campaigns | Inbox | Alerts | More) */
.bottom-nav { display: none; }
@media (max-width: 760px) {
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent); box-shadow: 0 -12px 34px -18px rgba(91, 20, 248, .45);
  }
  .bottom-nav::before { content: ""; position: absolute; left: 12%; right: 12%; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(138, 24, 248, .6), rgba(254, 37, 204, .5), transparent); }
  .bottom-nav a, .bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none; color: var(--text-2); font: 600 10.5px var(--font); text-decoration: none; border-radius: 12px; cursor: pointer; transition: color .2s, background .2s; }
  .bottom-nav svg { width: 20px; height: 20px; }
  .bottom-nav [aria-current="page"] { color: var(--primary-ink); background: var(--hunt-soft); }
  .bottom-nav [aria-current="page"] svg { filter: drop-shadow(0 0 6px var(--glow)); }
  .bottom-nav .dot-count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; font: 700 10px/16px var(--font); color: #fff; background: linear-gradient(135deg, #8A18F8, #FE25CC); box-shadow: 0 0 10px -1px rgba(254, 37, 204, .8); }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); right: 12px; left: 12px; max-width: none; }
  .drawer, .drawer.wide { width: 100vw; border-left: 0; }
}

/* Connection issues band (API or mailbox disconnected) */
.conn-issues { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.conn-issue { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); background: linear-gradient(100deg, var(--danger-soft), color-mix(in srgb, var(--danger-soft) 35%, var(--surface))); box-shadow: 0 10px 28px -18px rgba(239, 68, 68, .6); animation: rise .45s var(--ease) both; }
.conn-issue.warning { border-color: color-mix(in srgb, var(--warning) 40%, var(--border)); background: linear-gradient(100deg, var(--warning-soft), color-mix(in srgb, var(--warning-soft) 35%, var(--surface))); box-shadow: 0 10px 28px -18px rgba(245, 158, 11, .6); }
.conn-issue .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: var(--danger-ink); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.conn-issue.warning .ic { color: var(--warning-ink); background: color-mix(in srgb, var(--warning) 16%, transparent); }
.conn-issue .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.conn-issue .txt b { color: var(--text); }
.conn-issue .txt span { color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 760px) { .conn-issue { flex-wrap: wrap; } .conn-issue .btn { margin-left: 42px; } }
/* Toasts sit above open drawers and panels */
.toasts { z-index: 120; }
/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-3); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 25; }
  .menu-btn { display: grid; }
  .wizard { grid-template-columns: 1fr; }
  .stepper { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; }
  .stepper li { padding: 0; }
  .stepper li::before, .stepper .s { display: none; }
  .stepper .t { display: none; }
  .stepper li.current .t { display: block; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .welcome-hero { grid-template-columns: 1fr; }
  .constellation { max-width: 380px; }
  .huntline { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 18px; }
  .huntline::before, .huntline .signal { display: none; }
}
@media (max-width: 760px) {
  .content { padding: 18px 16px 56px; }
  .topbar { padding: 0 12px; }
  .searchbox span, .searchbox .kbd { display: none; }
  .searchbox { width: 34px; padding: 0; justify-content: center; border: 0; background: transparent; }
  .auto-pill .lbl { display: none; }
  .grid-2, .grid-3, .form-grid, .review { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--border); }
  .stat:nth-child(2n) { border-right: 0; }
  .huntline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-steps { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 8px; }
  .page-head .actions { margin-left: 0; }
  .panel-head { flex-wrap: wrap; row-gap: 4px; }
  .panel-head .sub { flex-basis: 100%; order: 3; }
  .panel-head .actions { margin-left: auto; }
  .shell.nav-open::after { background: rgba(2, 6, 23, .6); }
  .wizard-card .body { padding: 18px; }
  .wizard-card .foot { padding: 12px 18px; flex-wrap: wrap; }
}

/* Auth side: the agent chain as a quiet vertical list */
.field > label.check { font-weight: 400; color: var(--text-2); }
.side-chain { list-style: none; margin: 56px 0 40px; padding: 0; display: flex; flex-direction: column; gap: 0; max-width: 360px; }
.side-chain li { position: relative; display: flex; gap: 14px; padding: 0 0 18px; }
.side-chain li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: linear-gradient(180deg, rgba(138, 24, 248,.55), rgba(138, 24, 248,.12)); }
.side-chain li:last-child::before { display: none; }
.side-chain .k { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 700 12px var(--display); color: #fff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); flex-shrink: 0; }
.side-chain li:first-child .k { background: var(--hunt); border-color: transparent; }
.side-chain b { display: block; color: #fff; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.side-chain small { display: block; color: #7D8AA5; font-size: 12.5px; }
@media (max-height: 760px) { .side-chain { display: none; } }
.list.scroll { max-height: 420px; overflow-y: auto; }

/* Print / save as PDF */
@media print {
  .sidebar, .topbar, .page-head .actions, .banner, .toasts { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .panel, .stats { box-shadow: none; break-inside: avoid; }
}

/* Room for the phone bottom bar (kept last so it wins over the responsive padding above) */
@media (max-width: 760px) {
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* While a side drawer is open on wide screens, toasts move beside it instead of covering its footer */
@media (min-width: 761px) {
  body:has(.drawer) .toasts { right: calc(min(560px, 100vw) + 20px); }
  body:has(.drawer.wide) .toasts { right: calc(min(720px, 100vw) + 20px); }
}
