/* Cartroute design system ------------------------------------------------ */

:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --surface-3: #e9e9e4;
  --ink: #0d0e11;
  --ink-2: #464950;
  --muted: #7c7f87;
  --line: #e4e3de;
  --line-2: #d3d2cb;
  --brand: #2f45ff;
  --brand-ink: #1f33e0;
  --brand-soft: #edefff;
  --brand-contrast: #ffffff;
  --price: #d4380d;
  --good: #0b7a35;
  --good-soft: #e6f5ec;
  --warn: #8a5a00;
  --warn-soft: #fdf3dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --code-bg: #0f1117;
  --code-ink: #e5e7ee;
  --code-muted: #8b90a0;
  --code-key: #9cb4ff;
  --code-str: #9fe0b0;
  --code-num: #ffc27a;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(13, 14, 17, 0.04), 0 4px 16px rgba(13, 14, 17, 0.05);
  --shadow-lg: 0 2px 4px rgba(13, 14, 17, 0.04), 0 18px 48px rgba(13, 14, 17, 0.10);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* chart roles (validated palette, light) */
  --viz-surface: #ffffff;
  --viz-grid: #ecebe6;
  --viz-axis: #c3c2b7;
  --viz-ink: #0b0b0b;
  --viz-ink-2: #52514e;
  --viz-muted: #898781;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0d10;
    --surface: #15171c;
    --surface-2: #1b1e24;
    --surface-3: #23272f;
    --ink: #f3f4f6;
    --ink-2: #b9bcc4;
    --muted: #868a94;
    --line: #262a32;
    --line-2: #323741;
    --brand: #6b7cff;
    --brand-ink: #8f9bff;
    --brand-soft: #1c2140;
    --brand-contrast: #0c0d10;
    --price: #ff8a5c;
    --good: #3fcf7a;
    --good-soft: #10261a;
    --warn: #f0b429;
    --warn-soft: #2a2110;
    --bad: #ff7a70;
    --bad-soft: #2c1413;
    --code-bg: #0a0b0e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45);
    --viz-surface: #15171c;
    --viz-grid: #262a32;
    --viz-axis: #3a3f49;
    --viz-ink: #ffffff;
    --viz-ink-2: #c3c2b7;
    --viz-muted: #898781;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d10;
  --surface: #15171c;
  --surface-2: #1b1e24;
  --surface-3: #23272f;
  --ink: #f3f4f6;
  --ink-2: #b9bcc4;
  --muted: #868a94;
  --line: #262a32;
  --line-2: #323741;
  --brand: #6b7cff;
  --brand-ink: #8f9bff;
  --brand-soft: #1c2140;
  --brand-contrast: #0c0d10;
  --price: #ff8a5c;
  --good: #3fcf7a;
  --good-soft: #10261a;
  --warn: #f0b429;
  --warn-soft: #2a2110;
  --bad: #ff7a70;
  --bad-soft: #2c1413;
  --code-bg: #0a0b0e;
  --viz-surface: #15171c;
  --viz-grid: #262a32;
  --viz-axis: #3a3f49;
  --viz-ink: #ffffff;
  --viz-ink-2: #c3c2b7;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 650; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sandbox strip ----------------------------------------------------------- */
.env-strip {
  background: var(--ink); color: var(--bg); font-size: 12.5px; text-align: center; padding: 6px 16px;
}
.env-strip a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.env-strip code { background: transparent; border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent); color: inherit; }
.env-strip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f5b82e; margin-right: 8px; vertical-align: 1px; }

/* Header ----------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 28px; height: 62px; }
.logo { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo img { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: var(--ink-2); padding: 6px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.credit-pill { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.header-actions .menu-toggle { display: none; }
@media (max-width: 960px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 62px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .header-actions .menu-toggle { display: inline-flex; }
  .header-actions .hide-sm { display: none; }
}

/* Buttons & forms --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 9px; font: 600 14px/1 var(--font); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field .error { font-size: 12.5px; color: var(--bad); margin-top: 5px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface);
  color: var(--ink); font: 14.5px var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.has-error input, .has-error select { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; }
.check input { margin-top: 4px; accent-color: var(--brand); }
.hp { position: absolute; left: -9999px; }

/* Cards, badges, tables --------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.card-tight { padding: 16px; }
.card h3 { margin-bottom: 6px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 16px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.status-icon { font-weight: 700; }

.retailer { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.retailer .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--rt, var(--muted)); color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; letter-spacing: -0.02em; flex: none; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr.best td { background: var(--good-soft); }
.table-compact td, .table-compact th { padding: 7px 10px; font-size: 13px; }

.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.price-lg { font-size: 30px; font-weight: 750; letter-spacing: -0.03em; color: var(--ink); }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.code-chip { font-family: var(--mono); font-size: 12.5px; font-weight: 600; background: var(--surface-2); border: 1px dashed var(--line-2); padding: 2px 8px; border-radius: 6px; }

/* Code blocks ------------------------------------------------------------- */
pre.code {
  background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 18px 20px; overflow-x: auto;
  font-size: 13px; line-height: 1.65; margin: 0 0 16px; border: 1px solid #1d212b;
}
pre.code .c { color: var(--code-muted); }
pre.code .k { color: var(--code-key); }
pre.code .s { color: var(--code-str); }
pre.code .n { color: var(--code-num); }
.code-tabs { display: flex; gap: 2px; background: var(--code-bg); border-radius: 12px 12px 0 0; padding: 6px 8px 0; border: 1px solid #1d212b; border-bottom: 0; }
.code-tabs button { background: none; border: 0; color: var(--code-muted); font: 500 12.5px var(--font); padding: 7px 12px; border-radius: 7px 7px 0 0; cursor: pointer; }
.code-tabs button[aria-selected="true"] { color: #fff; background: #1a1d26; }
.code-tabs + pre.code { border-radius: 0 0 12px 12px; }
.code-panel[hidden] { display: none; }

/* Hero -------------------------------------------------------------------- */
.hero { padding: 72px 0 48px; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 50% at 70% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%),
              radial-gradient(40% 40% at 10% 20%, color-mix(in srgb, var(--series-2) 8%, transparent), transparent 70%);
}
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 4px 12px 4px 6px; margin-bottom: 20px; }
.eyebrow .tag { background: var(--brand); color: var(--brand-contrast); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.hero .lede { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 640px; margin-bottom: 28px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: start; }
.hero-grid pre.code { max-height: 460px; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; } }

.searchbar { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg); max-width: 620px; }
.searchbar input { border: 0; height: 44px; font-size: 16px; box-shadow: none !important; background: transparent; }
.searchbar .btn { height: 44px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 13px; }
.suggestions a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; color: var(--ink-2); }
.suggestions a:hover { border-color: var(--line-2); color: var(--ink); text-decoration: none; }

.stats-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); margin-top: 48px; }
.stats-strip > div { padding: 18px 20px; border-right: 1px solid var(--line); }
.stats-strip > div:last-child { border-right: 0; }
.stats-strip .v { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.stats-strip .l { font-size: 12.5px; color: var(--muted); }
@media (max-width: 800px) { .stats-strip { grid-template-columns: repeat(2, 1fr); } .stats-strip > div { border-bottom: 1px solid var(--line); } }

.logo-wall { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; color: var(--ink-2); font-weight: 650; font-size: 15px; }
.logo-wall span { opacity: .8; }

section.band { padding: 64px 0; }
section.band.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head p { color: var(--ink-2); font-size: 16.5px; }

.feature { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.feature .icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; font-weight: 800; }
.feature p { color: var(--ink-2); font-size: 14.5px; margin: 0; }

.step-list { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.step-list li { counter-increment: s; padding-left: 44px; position: relative; }
.step-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* Product cards / results ------------------------------------------------- */
.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.result-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.result-head h3 { margin: 0 0 4px; font-size: 18px; }
.result-head h3 a { color: var(--ink); }
.best-box { text-align: right; }
.best-box .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.verdict { font-size: 13px; }
.offer-row .eff { font-weight: 700; }
.pcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.pcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pcard .cat { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.pcard .title { font-weight: 600; margin: 4px 0 12px; line-height: 1.35; min-height: 2.7em; }

.layout-search { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }
.filters { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.filters h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.filters h4:first-child { margin-top: 0; }
.filters .check { font-size: 13.5px; margin-bottom: 4px; }
@media (max-width: 900px) { .layout-search { grid-template-columns: 1fr; } .filters { position: static; } }

.callout { border-radius: var(--radius); padding: 14px 16px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.callout-brand { background: var(--brand-soft); border-color: transparent; color: var(--ink); }
.callout-good { background: var(--good-soft); border-color: transparent; }
.callout-warn { background: var(--warn-soft); border-color: transparent; }
.callout-bad { background: var(--bad-soft); border-color: transparent; }
.callout strong { font-weight: 650; }

.answer { font-size: 17.5px; line-height: 1.6; color: var(--ink); max-width: 820px; }
.byline { font-size: 13.5px; color: var(--muted); margin-bottom: 26px; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 40px; font-size: 24px; }
.prose p, .prose li { color: var(--ink-2); font-size: 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 22px 0 14px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }

.spec-table th { text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink-2); width: 32%; background: var(--surface-2); }

/* Pricing ------------------------------------------------------------------ */
.plan { display: flex; flex-direction: column; }
.plan .amount { font-size: 38px; font-weight: 750; letter-spacing: -0.04em; }
.plan .amount small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 16px 0 22px; flex: 1; }
.plan li { padding: 5px 0 5px 24px; position: relative; font-size: 14px; color: var(--ink-2); }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.plan.featured { border: 2px solid var(--brand); position: relative; }
.plan.featured .ribbon { position: absolute; top: -12px; left: 22px; background: var(--brand); color: var(--brand-contrast); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }

/* Auth --------------------------------------------------------------------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 62px); }
.auth-side { background: var(--ink); color: var(--bg); padding: 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-side h2 { color: var(--bg); }
.auth-side p, .auth-side li { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.auth-side .big { font-size: 64px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.auth-main { padding: 48px 56px; display: flex; justify-content: center; }
.auth-main form { width: 100%; max-width: 460px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { padding: 32px 20px; } .auth-main { padding: 32px 20px; } }

/* Dashboard ------------------------------------------------------------- */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin-top: 2px; }
.kpi .d { font-size: 12.5px; margin-top: 2px; }
.d-up { color: var(--good); }
.d-down { color: var(--bad); }
.d-flat { color: var(--muted); }
.hero-number { font-size: 56px; font-weight: 750; letter-spacing: -0.045em; line-height: 1; }
.key-reveal { font-family: var(--mono); font-size: 14px; background: var(--code-bg); color: #b9f5c7; padding: 14px 16px; border-radius: 10px; word-break: break-all; }

/* Charts ------------------------------------------------------------------- */
.viz { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font); }
.viz .viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz .viz-axis { stroke: var(--viz-axis); stroke-width: 1; }
.viz .viz-ref { stroke: var(--viz-axis); stroke-width: 1; }
.viz .viz-ref-label { fill: var(--viz-muted); font-size: 11px; }
.viz .viz-tick { fill: var(--viz-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .viz-label { fill: var(--viz-ink-2); font-size: 12.5px; }
.viz .viz-label.link { fill: var(--brand-ink); }
.viz .viz-value { fill: var(--viz-ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz .viz-end { fill: var(--viz-ink); font-size: 12px; font-weight: 600; }
.viz .viz-hit { fill: transparent; cursor: crosshair; }
.viz-hbars .viz-hit { cursor: default; }
.viz .s1 { fill: var(--series-1); }
.viz .s2 { fill: var(--series-2); }
.viz .s3 { fill: var(--series-3); }
.viz .s4 { fill: var(--series-4); }
.viz .viz-stroke { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .viz-stroke.s1 { stroke: var(--series-1); }
.viz .viz-stroke.s2 { stroke: var(--series-2); }
.viz .viz-stroke.s3 { stroke: var(--series-3); }
.viz .viz-area { opacity: 0.10; }
.viz .viz-dot, .viz .viz-hover-dot { stroke: var(--viz-surface); stroke-width: 2; }
.viz .viz-crosshair { stroke: var(--viz-axis); stroke-width: 1; }
.viz-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0 0 10px; font-size: 13px; color: var(--ink-2); }
.viz-legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.swatch.s1 { background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
.swatch.s3 { background: var(--series-3); }
.swatch.s4 { background: var(--series-4); }
.viz-tooltip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 8px; box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; line-height: 1.5; white-space: pre-line; max-width: 280px;
  font-variant-numeric: tabular-nums;
}
.viz-tooltip b { font-weight: 650; }
.viz-toggle { font-size: 12.5px; }
.viz-table[hidden] { display: none; }
@media (forced-colors: active) { .viz .s1, .viz .s2, .viz .s3, .viz .s4 { fill: CanvasText; } }

/* Footer ------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 48px 0 32px; margin-top: 72px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 28px; }
.footer-grid h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-grid a { color: var(--ink-2); }
.footer-legal { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* Admin -------------------------------------------------------------------- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 62px); }
.admin-nav { border-right: 1px solid var(--line); background: var(--surface); padding: 20px 12px; position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.admin-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); }
.admin-nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 16px 12px 6px; }
.admin-main { padding: 28px 32px 60px; min-width: 0; }
.admin-main h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0; }
.range-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.range-tabs a { padding: 4px 11px; border-radius: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.range-tabs a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.range-tabs a:hover { text-decoration: none; color: var(--ink); }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-row .field { margin: 0; min-width: 140px; }
.filter-row select, .filter-row input { height: 34px; font-size: 13.5px; }
.live-feed { font-family: var(--mono); font-size: 12px; max-height: 360px; overflow-y: auto; }
.live-feed .ev { display: grid; grid-template-columns: 70px 70px 150px 1fr 50px; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.live-feed .ev.new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--brand-soft); } to { background: transparent; } }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; }
.ua { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } .admin-nav { position: static; height: auto; display: flex; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); } .admin-nav .sep { display: none; } .admin-main { padding: 20px 16px; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Spacing utilities (the CSP forbids inline style attributes) ------------ */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }
.w-full { width: 100%; }
.gap-lg { gap: 28px; }
.flex-1 { flex: 1; }
.h-results { font-size: 22px; letter-spacing: -0.02em; }

/* Grid items default to min-width:auto, which lets <pre> and tables push the
   page wider than the viewport on phones. Let them shrink and scroll instead. */
.hero-grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > *, .layout-search > *, .admin-shell > *, .footer-grid > * { min-width: 0; }
pre.code { max-width: 100%; }

/* Docs --------------------------------------------------------------------- */
.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 24px; }
.docs-nav { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 8px; }
.docs-nav h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 6px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--ink-2); font-size: 14px; }
.docs-nav li a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.docs-nav li a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.docs-body { max-width: 820px; }
.docs-body h1 { font-size: clamp(26px, 3.4vw, 38px); }
.docs-body h2 { scroll-margin-top: 80px; }
.docs-body h3 { margin-top: 28px; }
.docs-body [id] { scroll-margin-top: 80px; }
.docs-body .table-wrap { margin: 12px 0 20px; }
.docs-body pre.code { margin: 12px 0 20px; }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.docs-pager .pcard .title { min-height: 0; display: block; }
.docs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0 24px; }
.docs-cards .pcard .title { min-height: 0; }
.method { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--good-soft); color: var(--good); margin-right: 6px; }
.method.post { background: var(--brand-soft); color: var(--brand-ink); }
.endpoint { font-family: var(--mono); font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0 18px; overflow-x: auto; white-space: nowrap; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } .docs-nav { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; } .docs-cards { grid-template-columns: 1fr; } }

/* Request inspector -------------------------------------------------------- */
.req-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
.req-dialog[open] { display: flex; flex-direction: column; }
.req-dialog::backdrop { background: rgba(8, 9, 12, 0.55); backdrop-filter: blur(2px); }
.req-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.req-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.req-title { font-family: var(--mono); font-size: 14px; font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; }
.req-body { padding: 16px 18px 22px; overflow-y: auto; }
.req-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
.req-body h3:first-child { margin-top: 0; }
.req-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 18px; }
.req-grid div { min-width: 0; }
.req-grid dt { font-size: 11.5px; color: var(--muted); }
.req-grid dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.req-kv { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.req-kv td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.req-kv td:first-child { color: var(--brand-ink); white-space: nowrap; width: 1%; }
.req-kv tr.redacted td:last-child { color: var(--warn); }
.req-raw { font-family: var(--mono); font-size: 12.5px; background: var(--code-bg); color: var(--code-ink); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow-y: auto; margin: 0; }
@media (max-width: 700px) { .req-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Clickable rows that open the inspector */
[data-event-id] { cursor: pointer; }
tr[data-event-id]:hover td { background: var(--brand-soft); }
.live-feed button.ev { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 70px 70px 190px 1fr 50px 60px; gap: 10px; padding: 5px 6px; width: 100%; border-bottom: 1px dashed var(--line); cursor: pointer; border-radius: 4px; }
.live-feed button.ev:hover, .live-feed button.ev:focus-visible { background: var(--brand-soft); }
.live-feed button.ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-head { display: grid; grid-template-columns: 70px 70px 190px 1fr 50px 60px; gap: 10px; padding: 0 6px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); font-family: var(--font); }
.st-2 { color: var(--good); } .st-3 { color: var(--muted); } .st-4 { color: var(--warn); } .st-5 { color: var(--bad); }
@media (max-width: 800px) { .live-feed button.ev, .ev-head { grid-template-columns: 64px 1fr 44px; } .live-feed .hide-sm, .ev-head .hide-sm { display: none; } }
