@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ============================================================
   SWURL DESIGN TOKENS
   ------------------------------------------------------------
   BRAND SWAP POINT — replace the values in --brand-* and the
   two logo slots (see .logo-mark in markup) with client assets.
   Everything else derives from these.
   ============================================================ */

:root {
  color-scheme: light;

  /* ---- BRAND (taken from the Swurl mark) ---- */
  --brand-violet: #A63BEF;
  --brand-indigo: #6054F1;
  --brand-blue:   #2A8FF5;
  --brand-cyan:   #1AE7FB;
  --brand-pink:   #EF62A1;

  --brand:      #6054F1;                       /* solid brand: borders, rings, marks */
  --on-brand:   #FFFFFF;                       /* text that sits on the gradient */
  --accent-ink: #6D28D9;                       /* brand that passes as body text (7.1:1) */

  /* Gradient for controls — stops short of cyan so white text stays legible */
  --brand-grad: linear-gradient(103deg, #A63BEF 0%, #7B4BF3 48%, #5B4FEF 100%);
  /* Full ramp — decorative surfaces only, never behind text */
  --brand-grad-full: linear-gradient(103deg, #A63BEF 0%, #6054F1 32%, #2A8FF5 66%, #1AE7FB 100%);

  --brand-wash:   rgba(96, 84, 241, 0.09);
  --brand-wash-2: rgba(96, 84, 241, 0.20);

  /* Hero field — the seven currents, in the mark's own ramp */
  --f1:#A63BEF; --f2:#9450F4; --f3:#7B4BF3; --f4:#6054F1; --f5:#3D74F4; --f6:#2A8FF5; --f7:#1AE7FB; --f8:#EF62A1;

  /* Logo swap (custom properties reach where class selectors cannot) */
  --logo-light-on: block;
  --logo-dark-on:  none;

  /* Neutrals — cool, faint indigo bias to sit under the brand */
  --bg:         #F6F7FB;
  --surface:    #FFFFFF;
  --surface-2:  #EEF1F8;
  --surface-3:  #E2E7F3;
  --line:       #E1E5F0;
  --line-soft:  rgba(11, 15, 28, 0.08);
  --line-hard:  #C4CBDD;

  --ink:    #0B0F1C;
  --ink-2:  #4A5268;
  --ink-3:  #7B839A;

  /* Status — fixed, never themed */
  --good:    #0ca30c;
  --warn:    #fab219;
  --serious: #ec835a;
  --crit:    #d03b3b;
  --good-ink: #0A6B0A;
  --crit-ink: #B0242E;

  /* Categorical series — fixed slot order, never cycled */
  --s1: #2a78d6;  /* OpenAI      */
  --s2: #eb6834;  /* Anthropic   */
  --s3: #1baf7a;  /* Google      */
  --s4: #eda100;  /* Meta Llama  */
  --s5: #e87ba4;  /* Mistral     */
  --s6: #008300;  /* xAI         */
  --s7: #4a3aa7;  /* DeepSeek    */
  --s8: #e34948;  /* Perplexity  */

  --grid:     #EAEDF5;
  --baseline: #C4CBDD;
  --serp-link: #1a0dab;

  /* Form */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 26px;
  --shadow-1: 0 1px 2px rgba(11,15,28,.06), 0 1px 1px rgba(11,15,28,.04);
  --shadow-2: 0 12px 32px -12px rgba(11,15,28,.22), 0 2px 6px rgba(11,15,28,.06);
  --shadow-3: 0 32px 64px -24px rgba(11,15,28,.30);
  --ring: 0 0 0 3px var(--brand-wash-2);

  --font-display: 'Syne', 'Trebuchet MS', sans-serif;
  --font-body: 'Public Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --rail: 236px;
  --list: 274px;
}

/* Dark tokens — OS preference (loses to an explicit light stamp) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --brand-violet: #B667F5;
    --brand-indigo: #7C6BF6;
    --brand-blue:   #4FA2F7;
    --brand-cyan:   #4FEBFC;
    --brand-pink:   #F27DB2;

    --brand:      #7C6BF6;
    --on-brand:   #FFFFFF;
    --accent-ink: #A98CFF;

    --brand-grad: linear-gradient(103deg, #B057F2 0%, #8A63F5 48%, #6A78F5 100%);
    --brand-grad-full: linear-gradient(103deg, #B057F2 0%, #7C6BF6 32%, #3E97F6 66%, #4FEBFC 100%);

    --brand-wash:   rgba(124, 107, 246, 0.16);
    --brand-wash-2: rgba(124, 107, 246, 0.30);

    --f1:#B667F5; --f2:#A85EF5; --f3:#9B5BF4; --f4:#7C6BF6; --f5:#5686F5; --f6:#3E97F6; --f7:#4FEBFC; --f8:#F27DB2;

    --logo-light-on: none;
    --logo-dark-on:  block;

    --bg:        #080B16;
    --surface:   #0F1424;
    --surface-2: #161C30;
    --surface-3: #1F2740;
    --line:      #212940;
    --line-soft: rgba(238, 241, 248, 0.09);
    --line-hard: #38425F;

    --ink:   #EEF1F8;
    --ink-2: #A2ABC4;
    --ink-3: #6F7898;

    --good-ink: #3ECF3E;
    --crit-ink: #F07070;

    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --s4: #c98500;
    --s5: #d55181;
    --s6: #008300;
    --s7: #9085e9;
  --s8: #e66767;

    --grid:     #1A2135;
    --baseline: #38425F;
    --serp-link: #99c3ff;

    --shadow-1: 0 1px 2px rgba(0,0,0,.5);
    --shadow-2: 0 12px 32px -12px rgba(0,0,0,.75), 0 2px 6px rgba(0,0,0,.45);
    --shadow-3: 0 32px 64px -24px rgba(0,0,0,.85);
  }
}

/* Dark tokens — explicit toggle (wins both ways) */
:root[data-theme="dark"] {
  color-scheme: dark;

  --brand-violet: #B667F5;
  --brand-indigo: #7C6BF6;
  --brand-blue:   #4FA2F7;
  --brand-cyan:   #4FEBFC;
  --brand-pink:   #F27DB2;

  --brand:      #7C6BF6;
  --on-brand:   #FFFFFF;
  --accent-ink: #A98CFF;

  --brand-grad: linear-gradient(103deg, #B057F2 0%, #8A63F5 48%, #6A78F5 100%);
  --brand-grad-full: linear-gradient(103deg, #B057F2 0%, #7C6BF6 32%, #3E97F6 66%, #4FEBFC 100%);

  --brand-wash:   rgba(124, 107, 246, 0.16);
  --brand-wash-2: rgba(124, 107, 246, 0.30);

  --f1:#B667F5; --f2:#A85EF5; --f3:#9B5BF4; --f4:#7C6BF6; --f5:#5686F5; --f6:#3E97F6; --f7:#4FEBFC; --f8:#F27DB2;

  --logo-light-on: none;
  --logo-dark-on:  block;

  --bg:        #080B16;
  --surface:   #0F1424;
  --surface-2: #161C30;
  --surface-3: #1F2740;
  --line:      #212940;
  --line-soft: rgba(238, 241, 248, 0.09);
  --line-hard: #38425F;

  --ink:   #EEF1F8;
  --ink-2: #A2ABC4;
  --ink-3: #6F7898;

  --good-ink: #3ECF3E;
  --crit-ink: #F07070;

  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --s4: #c98500;
  --s5: #d55181;
  --s6: #008300;
  --s7: #9085e9;
  --s8: #e66767;

  --grid:     #1A2135;
  --baseline: #38425F;
  --serp-link: #99c3ff;

  --shadow-1: 0 1px 2px rgba(0,0,0,.5);
  --shadow-2: 0 12px 32px -12px rgba(0,0,0,.75), 0 2px 6px rgba(0,0,0,.45);
  --shadow-3: 0 32px 64px -24px rgba(0,0,0,.85);
}

/* ============================================================ BASE */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; text-wrap: balance; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-hard); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num  { font-variant-numeric: tabular-nums; }
.sr   { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ============================================================ LOGO
   Client artwork. Swap the two data URIs to replace the wordmark,
   and .logo-mark's to replace the mark. Nothing else references them. */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: auto; flex: none; }
.logo-word { height: 19px; width: auto; }
.logo-word.on-light { display: var(--logo-light-on); }
.logo-word.on-dark  { display: var(--logo-dark-on); }
.footer .logo-mark { width: 34px; }
.footer .logo-word { height: 22px; }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r);
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid transparent; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-grad); color: var(--on-brand); }
.btn-primary:hover { filter: brightness(1.12) saturate(1.05); }
.btn-ghost { border-color: var(--line-hard); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger { border-color: var(--crit); color: var(--crit-ink); background: transparent; }
.btn-danger:hover { background: rgba(208,59,59,.1); }
.btn-lg { padding: 13px 24px; font-size: 15px; border-radius: var(--r); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: var(--r-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============================================================ CHIPS / PILLS */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.dot-swatch { width: 8px; height: 8px; border-radius: 99px; flex: none; box-shadow: 0 0 0 2px var(--surface); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status svg { width: 13px; height: 13px; flex: none; }
.status.is-good    { color: var(--good-ink); }
.status.is-warn    { color: var(--ink-2); }
.status.is-crit    { color: var(--crit-ink); }
.status.is-warn svg { color: var(--warn); }

/* ============================================================ CARD */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; letter-spacing: -0.01em; }
.card-head .sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

/* ============================================================ SITE SHELL */
.site { display: none; }
.site.is-on { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a {
  padding: 7px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: color .15s, background .15s;
}
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.section { padding: 96px 0; }
.section-head { max-width: 620px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 44px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 700; }
.section-head p { color: var(--ink-2); font-size: 17px; }

/* ---------- HERO ---------- */
.hero { position: relative; overflow: hidden; padding: 76px 0 88px; }
#confluence { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, transparent 55%, var(--bg) 97%);
}
.hero .wrap { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(40px, 6.2vw, 74px); line-height: .96; letter-spacing: -0.045em;
  margin-bottom: 22px;
}
.hero h1 em { font-style: normal; color: var(--accent-ink); }
.hero-sub { font-size: 19px; color: var(--ink-2); max-width: 46ch; margin-bottom: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 30px; }
.hero-fine { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px 5px 6px; border-radius: 99px; margin-bottom: 26px;
  background: var(--brand-wash); border: 1px solid var(--brand-wash-2);
  font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.hero-badge b { color: var(--ink); font-weight: 600; }
.hero-badge .tag {
  background: var(--brand-grad); color: var(--on-brand); font-weight: 700;
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px;
}

/* Hero product preview */
.preview {
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-3); overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.preview-bar .lights { display: flex; gap: 5px; }
.preview-bar .lights i { width: 9px; height: 9px; border-radius: 99px; background: var(--line-hard); }
.preview-bar .addr {
  flex: 1; text-align: center; font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-3);
}
.preview-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.preview-row { display: flex; gap: 10px; align-items: flex-start; }
.preview-row .who {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  background: var(--surface-3); color: var(--ink-2);
}
.preview-row .msg { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.preview-row .msg b { color: var(--ink); font-weight: 600; }
.preview-swap {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px dashed var(--line-hard); border-radius: var(--r-sm);
  font-size: 12px; color: var(--ink-3);
}

/* ---------- LOGO STRIP ---------- */
.strip { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 22px 0; }
.strip-inner { display: flex; align-items: center; gap: 14px 30px; flex-wrap: wrap; justify-content: center; }
.strip-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.strip-item { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--ink-2); }

/* ---------- COST COMPARISON ---------- */
.cost { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
.cost-stack { display: flex; flex-direction: column; gap: 2px; }
.cost-row { display: grid; grid-template-columns: 122px minmax(0,1fr) 62px; align-items: center; gap: 12px; }
.cost-row .nm { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.cost-row .bar-track { height: 22px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.cost-row .bar-fill { height: 100%; border-radius: 0 4px 4px 0; }
.cost-row .val { font-family: var(--font-mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.cost-total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.cost-total .lbl { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.cost-total .amt { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.cost-win { border-color: var(--brand); box-shadow: var(--ring); }
.cost-win .amt { color: var(--accent-ink); }
.save-note { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.save-note b { color: var(--accent-ink); }

/* ---------- MODEL CATALOG ---------- */
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.model-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.model-card:hover { border-color: var(--line-hard); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.model-card .prov { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.model-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.model-card li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.model-card li .mn { color: var(--ink); font-weight: 500; }
.model-card li .mm { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.model-card .best { font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 11px; }
.model-card .best b { color: var(--ink); font-weight: 600; }

/* ---------- FEATURES ---------- */
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.feat { background: var(--surface); padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.feat .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-wash); color: var(--accent-ink); display: grid; place-items: center; }
.feat .ic svg { width: 17px; height: 17px; }
.feat h3 { font-size: 15px; }
.feat p { font-size: 14px; color: var(--ink-2); }

/* ---------- PRICING ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.tier { padding: 24px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.tier.is-featured { border-color: var(--brand); box-shadow: var(--shadow-2); }
.tier-flag {
  position: absolute; top: -11px; left: 24px;
  background: var(--brand-grad); color: var(--on-brand);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 99px;
}
.tier h3 { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.03em; }
.tier .price { display: flex; align-items: baseline; gap: 4px; }
.tier .price .amt { font-family: var(--font-display); font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.tier .price .per { font-size: 14px; color: var(--ink-3); }
.tier .desc { font-size: 14px; color: var(--ink-2); }
.tier ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.tier li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.tier li svg { width: 15px; height: 15px; flex: none; margin-top: 4px; color: var(--accent-ink); }
.tier li b { color: var(--ink); font-weight: 600; }

.billing-toggle { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; gap: 2px; }
.billing-toggle button { padding: 6px 15px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.billing-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .pm { color: var(--ink-3); transition: transform .2s; flex: none; }
.faq details[open] summary .pm { transform: rotate(45deg); color: var(--accent-ink); }
.faq .ans { padding: 0 0 20px; color: var(--ink-2); font-size: 15px; max-width: 68ch; }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: 56px 0 30px; background: var(--surface); }
/* brand block + five link columns — keep them on one row on desktop */
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) repeat(5, minmax(0, 1fr)); gap: 34px 26px; align-items: start; }
.footer h4, .footer .foot-h { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-family: var(--font-mono); font-weight: 500; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer li a { font-size: 14px; color: var(--ink-2); }
.footer li a:hover { color: var(--accent-ink); }
.footer-base { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }

/* ============================================================ APP SHELL */
.app { display: none; height: 100vh; }
.app.is-on { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }

.rail { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.rail-head { padding: 16px 16px 12px; }
.ws-switch {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2);
  text-align: left; margin-top: 14px;
}
.ws-switch:hover { border-color: var(--line-hard); }
.ws-switch .av { width: 26px; height: 26px; border-radius: 7px; background: var(--brand-grad); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.ws-switch .nm { font-size: 13px; font-weight: 600; line-height: 1.2; }
.ws-switch .pl { font-size: 11px; color: var(--ink-3); }

.rail-nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 0; }
.rail-group { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 14px 8px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: left;
  transition: background .12s, color .12s;
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active { background: var(--brand-wash); color: var(--accent-ink); font-weight: 600; }
.nav-item.is-active svg { opacity: 1; }
.nav-item .badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); }

.rail-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.credit-meter { display: flex; flex-direction: column; gap: 7px; }
.credit-meter .top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; }
.credit-meter .top b { font-family: var(--font-mono); font-weight: 500; }
.meter-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; background: var(--brand-grad-full); border-radius: 99px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
.main-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px;
  border-bottom: 1px solid var(--line); background: var(--surface); flex: none;
}
.main-head h1 { font-size: 16px; letter-spacing: -0.015em; }
.main-head .sub { font-size: 12px; color: var(--ink-3); }
.main-head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.main-body { flex: 1; min-height: 0; overflow: auto; }
/* Each pane owns its own scroll: the head is pinned, the body scrolls. */
.pane { display: none; min-height: 0; }
.pane.is-on { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pane.is-on > .main-head { flex: none; }
.pane.is-on > .pane-pad { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#pane-chat.is-on { display: block; }
.pane-pad { padding: 24px 24px 76px; display: flex; flex-direction: column; gap: 20px; max-width: 1180px; }

/* ---------- CHAT ---------- */
.chat-layout { display: grid; grid-template-columns: var(--list) minmax(0, 1fr); height: 100%; min-height: 0; }
.thread-list { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.thread-search { padding: 12px; border-bottom: 1px solid var(--line); }
.input {
  width: 100%; padding: 8px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input::placeholder { color: var(--ink-3); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; font-family: inherit; }

.threads { overflow-y: auto; flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.thread {
  width: 100%; text-align: left; padding: 10px 11px; border-radius: var(--r-sm);
  display: flex; flex-direction: column; gap: 4px; transition: background .12s;
  border-left: 2px solid transparent;
}
.thread:hover { background: var(--surface-2); }
.thread.is-active { background: var(--brand-wash); border-left-color: var(--brand); }
.thread .t { font-size: 13px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread .m { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }

.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 18px 8px; min-height: 0; }
.chat-inner { max-width: 760px; margin-inline: auto; display: flex; flex-direction: column; gap: 22px; }

.msg { display: flex; flex-direction: column; gap: 8px; }
.msg-head { display: flex; align-items: center; gap: 8px; }
.msg-avatar { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; color: #fff; }
.msg-who { font-size: 13px; font-weight: 700; }
.msg-model { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.msg-body { font-size: 15px; line-height: 1.68; color: var(--ink); padding-left: 32px; }
.msg-body p + p { margin-top: 12px; }
.msg-body ul { margin: 12px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.msg-body code { font-family: var(--font-mono); font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.msg.is-user .msg-body { color: var(--ink-2); }
.msg-foot { padding-left: 32px; display: flex; align-items: center; gap: 12px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-foot, .msg-foot:focus-within { opacity: 1; }
.msg-foot button { font-size: 12px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; }
.msg-foot button:hover { color: var(--accent-ink); }
.msg-cost { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.caret { display: inline-block; width: 7px; height: 16px; background: var(--brand); vertical-align: -3px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.composer { flex: none; padding: 14px 18px 18px; }
.composer-inner { max-width: 760px; margin-inline: auto; }
.composer-box {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-2); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.composer-box:focus-within { border-color: var(--brand); box-shadow: var(--ring), var(--shadow-2); }
.composer-box textarea {
  width: 100%; border: 0; background: none; padding: 14px 16px 6px; resize: none;
  font-size: 15px; line-height: 1.55; max-height: 200px;
}
.composer-box textarea:focus { outline: none; }
.composer-tools { display: flex; align-items: center; gap: 6px; padding: 8px 10px 10px 12px; }
.tool-btn { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; color: var(--ink-3); }
.tool-btn:hover { background: var(--surface-2); color: var(--ink); }
.tool-btn svg { width: 16px; height: 16px; }
.tool-btn[aria-pressed="true"] { background: var(--brand-wash); color: var(--accent-ink); }
.send-btn { margin-left: auto; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--brand-grad); color: var(--on-brand); display: grid; place-items: center; }
.send-btn:hover { filter: brightness(1.12); }
.composer-note { font-size: 11px; color: var(--ink-3); text-align: left; margin-top: 9px; }

/* Model picker */
.picker { position: relative; }
.picker-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
  font-size: 13px; font-weight: 600;
}
.picker-btn:hover { border-color: var(--line-hard); }
.picker-menu {
  position: absolute; z-index: 80; top: calc(100% + 6px); left: 0;
  width: 330px; max-height: 400px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-hard);
  border-radius: var(--r); box-shadow: var(--shadow-3); padding: 6px; display: none;
}
.picker-menu.is-open { display: block; }
.picker-menu.to-right { left: auto; right: 0; }
.picker-group { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 4px; display: flex; align-items: center; gap: 7px; }
.picker-opt { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); }
.picker-opt:hover { background: var(--surface-2); }
.picker-opt.is-sel { background: var(--brand-wash); }
.picker-opt .pm-name { font-size: 13px; font-weight: 600; }
.picker-opt .pm-meta { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.picker-opt .pm-right { margin-left: auto; text-align: right; }
.picker-opt .pm-price { font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); }

/* ---------- COMPARE ---------- */
.compare-cols { display: grid; gap: 14px; align-items: stretch; }
.compare-col { display: flex; flex-direction: column; min-width: 0; }
.compare-col .cc-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.compare-col .cc-body { padding: 14px; font-size: 14px; line-height: 1.62; color: var(--ink); flex: 1; min-height: 150px; }
.compare-col .cc-foot { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.compare-col .cc-foot .pick { margin-left: auto; font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.compare-col.is-best { border-color: var(--brand); }
.compare-col.is-best .cc-foot .pick { color: var(--accent-ink); }

/* ---------- LIBRARY ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.lib-card { padding: 16px; display: flex; flex-direction: column; gap: 9px; text-align: left; transition: border-color .15s, transform .15s; }
.lib-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.lib-card h4 { font-size: 14px; }
.lib-card p { font-size: 13px; color: var(--ink-2); }
.lib-card .meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }

/* ============================================================ DATA DISPLAY */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; }
.stat .lbl { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.stat .val { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.stat .delta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.stat .delta svg { width: 12px; height: 12px; }
.delta.up   { color: var(--good-ink); }
.delta.down { color: var(--crit-ink); }
.delta.flat { color: var(--ink-3); }
.stat .spark { margin-top: 6px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); padding: 10px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.legend-item .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.tt {
  position: absolute; z-index: 40; pointer-events: none; opacity: 0;
  background: var(--surface); border: 1px solid var(--line-hard); border-radius: var(--r-sm);
  box-shadow: var(--shadow-2); padding: 8px 10px; font-size: 12px;
  transition: opacity .1s; min-width: 130px;
}
.tt.is-on { opacity: 1; }
.tt .tt-t { font-weight: 700; margin-bottom: 5px; font-size: 12px; }
.tt .tt-r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tt .tt-r .l { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tt .tt-r .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }

/* ============================================================ FORMS / ADMIN */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--ink-3); }
.field .counter { font-family: var(--font-mono); font-size: 11px; }
.counter.ok { color: var(--good-ink); }
.counter.over { color: var(--crit-ink); }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.serp {
  padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--bg); font-family: Arial, sans-serif; max-width: 600px;
}
.serp .crumb { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.serp .crumb .fav { width: 18px; height: 18px; flex: none; border-radius: 99px; overflow: hidden; }
.serp .crumb .fav img { width: 100%; height: 100%; object-fit: contain; }
.serp .ttl { color: var(--serp-link); font-size: 19px; line-height: 1.3; margin: 5px 0 3px; }
.serp .desc { font-size: 13px; color: var(--ink-2); line-height: 1.55; }

.code-block {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.65;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; overflow-x: auto; white-space: pre; color: var(--ink-2);
}
.code-block .k { color: var(--accent-ink); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-hard); position: relative; transition: background .18s, border-color .18s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-1); transition: transform .18s; }
.switch input:checked + .track { background: var(--brand-grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.switch .sl { font-size: 13px; font-weight: 500; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  padding: 9px 14px; font-size: 13px; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--brand); }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag.plan-pro { background: var(--brand-wash); color: var(--accent-ink); border-color: var(--brand-wash-2); }
.tag.plan-team { background: rgba(42,120,214,.12); color: var(--s1); border-color: rgba(42,120,214,.25); }

.avatar-sm { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--ink-2); flex: none; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell .nm { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user-cell .em { font-size: 11px; color: var(--ink-3); }

.audit { display: flex; flex-direction: column; }
.audit-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; align-items: flex-start; }
.audit-row:last-child { border-bottom: 0; }
.audit-row .ts { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); width: 108px; flex: none; padding-top: 2px; }
.audit-row .txt { color: var(--ink-2); }
.audit-row .txt b { color: var(--ink); font-weight: 600; }

.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* Invoice / plan */
.plan-card { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.plan-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.plan-top .amt { font-family: var(--font-display); font-size: 38px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.plan-top .per { font-size: 13px; color: var(--ink-3); }

/* Toast */
.toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 10px 15px;
  background: var(--ink); color: var(--bg); border-radius: 99px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-3);
  animation: rise .25s cubic-bezier(.2,.9,.3,1);
}
.toast svg { width: 15px; height: 15px; color: var(--brand-cyan); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Demo switcher */
.demo-switch {
  position: fixed; right: 16px; bottom: 16px; z-index: 150;
  display: flex; align-items: center; gap: 3px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line-hard);
  border-radius: 99px; box-shadow: var(--shadow-3);
}
.demo-switch .lb { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 0 8px 0 10px; }
.demo-switch button { padding: 6px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.demo-switch button:hover { background: var(--surface-2); color: var(--ink); }
.demo-switch button[aria-pressed="true"] { background: var(--brand-grad); color: var(--on-brand); }

/* ============================================================ RESPONSIVE */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .cost { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topnav { display: none; }
  .section { padding: 64px 0; }
  .app.is-on { grid-template-columns: 1fr; }
  .rail { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .thread-list { display: none; }
  .wrap { width: calc(100% - 32px); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 20px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .demo-switch, .composer, .rail { display: none !important; }
}
