/* Keyvane — one stylesheet for the marketing site, docs and dashboard.
   Design rationale and tokens: DESIGN.md at the repository root. */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/assets/fonts/bricolage-grotesque-latin-opsz-normal.woff2) format('woff2-variations'); 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: 'Bricolage Grotesque'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/assets/fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2) format('woff2-variations'); 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: 'IBM Plex Sans'; font-style: normal; font-display: swap; font-weight: 100 700; src: url(/assets/fonts/ibm-plex-sans-latin-wght-normal.woff2) format('woff2-variations'); 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: 'IBM Plex Sans'; font-style: normal; font-display: swap; font-weight: 100 700; src: url(/assets/fonts/ibm-plex-sans-latin-ext-wght-normal.woff2) format('woff2-variations'); 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: 'IBM Plex Sans'; font-style: italic; font-display: swap; font-weight: 100 700; src: url(/assets/fonts/ibm-plex-sans-latin-wght-italic.woff2) format('woff2-variations'); 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: 'IBM Plex Sans'; font-style: italic; font-display: swap; font-weight: 100 700; src: url(/assets/fonts/ibm-plex-sans-latin-ext-wght-italic.woff2) format('woff2-variations'); 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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); 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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 400; src: url(/assets/fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format('woff2'); 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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url(/assets/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); 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: 'IBM Plex Mono'; font-style: normal; font-display: swap; font-weight: 500; src: url(/assets/fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2'); 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; }

/* ---------- Tokens ---------- */
:root {
  --ink: oklch(0.22 0.03 265);
  --bg: oklch(0.985 0.004 265);
  --bg-subtle: oklch(0.97 0.006 265);
  --muted-bg: oklch(0.95 0.007 265);
  --surface: oklch(0.997 0.002 265);
  --border: oklch(0.905 0.01 265);
  --border-strong: oklch(0.82 0.015 265);
  --text: var(--ink);
  --text-muted: oklch(0.44 0.025 265);
  --text-subtle: oklch(0.52 0.02 265);
  --accent: oklch(0.553 0.195 38.4);
  --accent-strong: oklch(0.47 0.157 37.3);
  --accent-bright: oklch(0.705 0.19 47);
  --accent-soft: oklch(0.955 0.03 50);
  --accent-text: oklch(0.5 0.17 38);
  --on-accent: oklch(0.99 0.006 60);
  --success: oklch(0.5 0.12 155);
  --success-soft: oklch(0.955 0.035 155);
  --warning: oklch(0.52 0.11 70);
  --warning-soft: oklch(0.96 0.05 85);
  --danger: oklch(0.505 0.19 27.5);
  --danger-soft: oklch(0.96 0.025 25);
  --info: oklch(0.49 0.13 255);
  --info-soft: oklch(0.955 0.025 255);
  --code-bg: oklch(0.2 0.03 265);
  --code-border: oklch(0.3 0.03 265);
  --code-text: oklch(0.93 0.01 265);
  --font-display: 'Bricolage Grotesque', 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-text: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius-sm: 6px;
  --radius: 10px;
  --shadow-float: 0 12px 32px -8px oklch(0.22 0.03 265 / 0.22);
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --focus: 0 0 0 3px oklch(0.705 0.19 47 / 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.18 0.02 265);
    --bg-subtle: oklch(0.2 0.022 265);
    --muted-bg: oklch(0.25 0.024 265);
    --surface: oklch(0.215 0.022 265);
    --border: oklch(0.3 0.025 265);
    --border-strong: oklch(0.38 0.028 265);
    --text: oklch(0.95 0.008 265);
    --text-muted: oklch(0.79 0.018 265);
    --text-subtle: oklch(0.69 0.02 265);
    --accent: oklch(0.72 0.17 50);
    --accent-strong: oklch(0.79 0.14 55);
    --accent-bright: oklch(0.75 0.17 52);
    --accent-soft: oklch(0.28 0.05 45);
    --accent-text: oklch(0.8 0.13 55);
    --on-accent: oklch(0.2 0.03 265);
    --success: oklch(0.78 0.13 155);
    --success-soft: oklch(0.27 0.045 155);
    --warning: oklch(0.83 0.12 80);
    --warning-soft: oklch(0.29 0.05 80);
    --danger: oklch(0.75 0.15 25);
    --danger-soft: oklch(0.28 0.06 25);
    --info: oklch(0.78 0.11 255);
    --info-soft: oklch(0.28 0.05 255);
    --code-bg: oklch(0.15 0.02 265);
    --code-border: oklch(0.3 0.025 265);
    --shadow-float: 0 12px 32px -8px oklch(0 0 0 / 0.5);
    color-scheme: dark;
  }
  .section-ink { background: oklch(0.14 0.02 265); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'kern';
}
a { color: var(--accent-text); text-decoration: none; text-underline-offset: 0.18em; }
a:hover { text-decoration: underline; }
/* Links inside running text are underlined so they never rely on color alone. */
p a:not(.btn), li a:not(.btn), dd a, td a:not(.row-link):not(.btn), .hint a, .auth-foot a, .pricing-note a, .lede a { text-decoration: underline; text-decoration-color: color-mix(in oklch, currentColor 45%, transparent); text-decoration-thickness: 1px; }
.footer-grid a, .docs-nav a, .switcher-menu a, .nav a, .site-nav a, .eyebrow a, .timeline a { text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-display); font-optical-sizing: auto; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.012em; text-wrap: balance; color: var(--text); }
h1 { font-size: 1.95rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; text-wrap: pretty; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.875em; }
:not(pre) > code { background: var(--muted-bg); border-radius: 5px; padding: 0.12em 0.38em; word-break: break-word; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
strong { font-weight: 600; }
::selection { background: oklch(0.705 0.19 47 / 0.25); }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--font-mono); font-size: 0.875em; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-sm { width: 16px; height: 16px; }
.skip-link { position: absolute; left: 1rem; top: -100px; background: var(--ink); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 1rem; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: var(--focus); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: 0.5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 1rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 40px; padding: 0.5rem 1rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: 1.2;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--muted-bg); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--muted-bg); color: var(--text); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in oklch, var(--danger) 45%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ink { background: var(--ink); color: oklch(0.97 0.006 265); }
.btn-ink:hover { background: oklch(0.3 0.035 265); }
.btn-sm { min-height: 32px; padding: 0.3rem 0.7rem; font-size: 0.875rem; }
.btn-lg { min-height: 48px; padding: 0.7rem 1.35rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; }
.inline-form { display: inline; margin: 0; }
@media (pointer: coarse) { .btn { min-height: 44px; } .btn-sm { min-height: 40px; } }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-3 { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field > label, .label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.hint { font-size: 0.8125rem; color: var(--text-subtle); line-height: 1.45; }
.optional { font-weight: 400; color: var(--text-subtle); }
input:not([type]), input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], input[type='search'], input[type='url'], select, textarea {
  width: 100%; min-height: 40px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem; line-height: 1.4;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input::placeholder, textarea::placeholder { color: var(--text-subtle); opacity: 0.85; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
textarea { min-height: 88px; resize: vertical; }
input.mono, textarea.mono { font-family: var(--font-mono); font-size: 0.9375rem; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--accent); }
.checkbox { display: inline-flex; align-items: flex-start; gap: 0.55rem; font-size: 0.9375rem; cursor: pointer; line-height: 1.45; }
.checkbox input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.form-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.search { display: flex; gap: 0.5rem; }
.search input { max-width: 340px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- Panels ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1.05rem; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.card .table-wrap { border: 0; border-radius: 0; background: transparent; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.panel { background: var(--bg-subtle); border-radius: var(--radius); padding: 1rem 1.15rem; }
.callout { border-radius: var(--radius); padding: 0.9rem 1.1rem; background: var(--bg-subtle); font-size: 0.9375rem; }
.callout-info { background: var(--info-soft); }
.callout-warning { background: var(--warning-soft); }
.callout-success { background: var(--success-soft); }
.callout-danger { background: var(--danger-soft); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg-subtle); white-space: nowrap; }
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.12s var(--ease); }
.table tbody tr:hover td { background: color-mix(in oklch, var(--muted-bg) 55%, transparent); }
.table .row-link { color: var(--text); font-weight: 600; }
.table-sm td, .table-sm th { padding: 0.55rem 0.85rem; }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 0.6rem 1.5rem; margin: 0; font-size: 0.9375rem; }
dl.kv dt { color: var(--text-muted); }
dl.kv dd { margin: 0; min-width: 0; word-break: break-word; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.12rem 0.6rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; line-height: 1.55; white-space: nowrap; background: var(--muted-bg); color: var(--text-muted); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-yellow { background: var(--warning-soft); color: var(--warning); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.pill { display: inline-block; padding: 0.08rem 0.5rem; border-radius: 6px; background: var(--muted-bg); font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); }

/* ---------- Flash ---------- */
.flash { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: 0.9375rem; }
.flash-success { background: var(--success-soft); color: var(--success); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--info-soft); color: var(--info); }
.flash .icon { margin-top: 3px; }

/* ---------- Code ---------- */
pre.code, .prose pre {
  margin: 0; background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--code-border); border-radius: var(--radius);
  padding: 1rem 1.15rem; overflow-x: auto; font-size: 0.875rem; line-height: 1.65; tab-size: 2;
}
pre.code code, .prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.tok-k { color: oklch(0.8 0.1 300); }
.tok-s { color: oklch(0.85 0.12 140); }
.tok-c { color: oklch(0.66 0.03 265); font-style: italic; }
.tok-f { color: oklch(0.82 0.1 230); }
.tok-n { color: oklch(0.8 0.13 55); }
.tok-p { color: oklch(0.86 0.11 85); }
.copy-field { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-subtle); overflow: hidden; }
.copy-field code { flex: 1; min-width: 0; background: transparent !important; padding: 0.55rem 0.75rem !important; font-family: var(--font-mono); font-size: 0.875rem; overflow-x: auto; white-space: nowrap; border-radius: 0 !important; }
.copy-field .btn { border-radius: 0; border: 0; border-left: 1px solid var(--border-strong); min-height: 0; }
[data-copy] .when-copied { display: none; }
[data-copy].copied .when-copied { display: inline; }
[data-copy].copied .when-idle { display: none; }

/* ---------- Dashboard shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--bg-subtle) 0 247px, var(--border) 247px 248px, var(--bg) 248px); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1.1rem; padding: 1.1rem 0.85rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text) !important; text-decoration: none !important; }
.brand img { width: 28px; height: 28px; }
.sidebar .brand { padding: 0.2rem 0.5rem; }
.switcher { position: relative; }
.switcher summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 0.9375rem; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary .proj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-float); padding: 0.35rem; }
.switcher-menu a { display: block; padding: 0.5rem 0.65rem; border-radius: 6px; color: var(--text); font-size: 0.9375rem; }
.switcher-menu a:hover { background: var(--muted-bg); text-decoration: none; }
.switcher-menu a.current { font-weight: 650; color: var(--accent-text); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 0.8125rem; color: var(--text-subtle); font-weight: 600; padding: 0.9rem 0.65rem 0.3rem; }
.nav a { display: flex; align-items: center; gap: 0.65rem; padding: 0.45rem 0.65rem; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.9375rem; font-weight: 500; text-decoration: none; transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.nav a:hover { background: var(--muted-bg); color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); font-weight: 650; box-shadow: inset 0 0 0 1px var(--border); }
.nav a.active .icon { color: var(--accent); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: 0.8rem; display: flex; flex-direction: column; gap: 2px; }
.user-chip { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.65rem; font-size: 0.875rem; color: var(--text-muted); overflow: hidden; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex: none; }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 2.25rem 2.75rem 5rem; max-width: 1220px; width: 100%; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-header .lead { margin: 0.4rem 0 0; color: var(--text-muted); max-width: 66ch; }
.eyebrow { font-size: 0.875rem; color: var(--text-subtle); margin: 0 0 0.4rem; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.eyebrow a { color: var(--text-muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.75rem 0 0.9rem; }
.section-title h2 { margin: 0; font-size: 1.15rem; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: 0.6rem 0.85rem; color: var(--text-muted); font-weight: 600; font-size: 0.9375rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------- Stats & charts ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stats .stat + .stat { border-left: 1px solid var(--border); }
.stat { padding: 1.1rem 1.25rem; }
.stat-label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; letter-spacing: -0.015em; margin-top: 0.15rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: 0.8125rem; color: var(--text-subtle); margin-top: 0.2rem; }
.chart { width: 100%; height: 160px; }
.chart .bar { fill: var(--accent); }
.chart .bar-alt { fill: var(--text); opacity: 0.5; }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--text-subtle); font-size: 11px; font-family: var(--font-text); }
.legend { display: flex; gap: 1rem; font-size: 0.8125rem; color: var(--text-muted); }
.chart-axis { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--text-subtle); margin-top: 0.35rem; font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.35rem; vertical-align: -1px; }
.meter { height: 8px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; min-width: 120px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--text); }
.meter.warn > span { background: var(--warning); }
.meter.full > span { background: var(--danger); }

/* ---------- Empty states & checklists ---------- */
.empty { padding: 2.5rem 1.5rem; max-width: 560px; }
.empty h3 { margin-bottom: 0.35rem; font-size: 1.1rem; }
.empty p { color: var(--text-muted); margin: 0 0 1.1rem; }
.checklist { list-style: none; margin: 0; padding: 0; counter-reset: check; }
.checklist li { display: flex; gap: 0.9rem; align-items: flex-start; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); counter-increment: check; }
.checklist li:last-child { border-bottom: 0; }
.check-dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; font-size: 0.8125rem; font-weight: 650; color: var(--text-muted); }
.check-dot:empty::before { content: counter(check); }
.checklist li.done .check-dot { background: var(--success); border-color: var(--success); color: var(--surface); }
.checklist li.done .check-title { color: var(--text-muted); }
.check-title { font-weight: 600; }
.check-body { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.1rem; }
.progress-label { font-size: 0.875rem; color: var(--text-muted); }

/* ---------- Entitlement matrix ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix td:first-child { min-width: 220px; }
.matrix .cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.matrix .cell input[type='number'] { width: 96px; min-height: 34px; padding: 0.3rem 0.5rem; font-size: 0.9375rem; }
.matrix .plan-head { display: flex; flex-direction: column; gap: 0.1rem; align-items: center; font-size: 0.9375rem; color: var(--text); }
.matrix .plan-head .subtle { font-size: 0.8125rem; font-weight: 500; }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
details.disclosure > summary { cursor: pointer; padding: 0.75rem 1rem; font-weight: 600; font-size: 0.9375rem; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: '+'; color: var(--text-subtle); font-weight: 400; font-size: 1.25rem; line-height: 1; transition: transform 0.2s var(--ease); }
details.disclosure[open] > summary::after { transform: rotate(45deg); }
details.disclosure > .disclosure-body { padding: 0.25rem 1rem 1.1rem; }
.card-footer details.disclosure { border: 0; background: transparent; }
.card-footer details.disclosure > summary { padding: 0.25rem 0; color: var(--accent-text); }
.card-footer details.disclosure > .disclosure-body { padding: 0.75rem 0 0.5rem; }
.danger-zone { border-top: 1px solid var(--border); padding-top: 1.25rem; }
.danger-zone h2 { font-size: 1.05rem; color: var(--danger); margin-bottom: 0.35rem; }
.card.danger-zone { border-top: 1px solid color-mix(in oklch, var(--danger) 35%, var(--border)); padding-top: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 10px 1fr auto; gap: 0.85rem; padding: 0.7rem 1.25rem; border-bottom: 1px solid var(--border); align-items: baseline; font-size: 0.9375rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.timeline .dot.stripe { background: var(--accent); }
.timeline .dot.api_key { background: var(--success); }
.timeline .dot.user { background: var(--info); }
.timeline .row { margin-top: 0.25rem; gap: 0.35rem; }
.json { max-height: 460px; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--bg-subtle); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 1.75rem; }
.auth-head { margin-bottom: 1.5rem; }
.auth-head .brand { margin-bottom: 1.5rem; }
.auth-head h1 { font-size: 1.6rem; margin-bottom: 0.35rem; }
.auth-head p { margin: 0; }
.auth-foot { font-size: 0.9375rem; color: var(--text-muted); margin-top: 1.25rem; }

/* ---------- Marketing site ---------- */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in oklch, var(--bg) 92%, transparent); backdrop-filter: saturate(150%) blur(10px); -webkit-backdrop-filter: saturate(150%) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; gap: 2rem; height: 64px; }
.site-nav { display: flex; gap: 1.6rem; }
.site-nav a { color: var(--text-muted); font-size: 0.9375rem; font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-header .actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }

.hero { padding: 5.5rem 0 5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.35rem, 4.4vw, 3.6rem); line-height: 1.04; letter-spacing: -0.025em; font-weight: 760; margin-bottom: 1.25rem; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero .lede { font-size: 1.1875rem; color: var(--text-muted); max-width: 52ch; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-facts { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; gap: 0.6rem 1.5rem; flex-wrap: wrap; font-size: 0.9375rem; color: var(--text-muted); }
.hero-facts li { display: inline-flex; gap: 0.4rem; align-items: center; }
.hero-facts .icon { color: var(--success); }

/* The product proof next to the hero: a real entitlement response, rendered */
.proof { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px -36px oklch(0.22 0.03 265 / 0.45); }
.proof-request { display: flex; gap: 0.6rem; align-items: center; padding: 0.75rem 1.1rem; background: var(--code-bg); color: var(--code-text); font-family: var(--font-mono); font-size: 0.8125rem; overflow-x: auto; white-space: nowrap; }
.proof-request .method { color: var(--accent-bright); font-weight: 500; }
.proof-body { padding: 1.25rem 1.35rem 1.35rem; }
.proof-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.proof-head .who { font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 500; }
.proof-row { display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; align-items: center; padding: 0.7rem 0; border-top: 1px solid var(--border); font-size: 0.9375rem; }
.proof-row .meter { grid-column: 1 / -1; }
.proof-row .val { font-variant-numeric: tabular-nums; color: var(--text-muted); }
.proof-row .val.on { color: var(--success); font-weight: 600; }
.proof-row .val.off { color: var(--text-subtle); }
.proof-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 0.85rem; border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--text-muted); }
.proof-foot .mono { font-size: 0.8125rem; }

.section { padding: 6rem 0; }
.section-tight { padding: 4rem 0; }
.section-alt { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-ink { background: var(--ink); color: oklch(0.94 0.008 265); }
.section-ink h2, .section-ink h3 { color: oklch(0.98 0.004 265); }
.section-ink .muted, .section-ink p, .section-ink .section-head p { color: oklch(0.8 0.015 265); }
.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: -0.022em; font-weight: 720; line-height: 1.1; margin-bottom: 0.9rem; }
.section-head p { color: var(--text-muted); font-size: 1.125rem; margin: 0; max-width: 60ch; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center p { margin: 0 auto; }

.compare { width: 100%; border-collapse: collapse; font-size: 1rem; }
.compare th { text-align: left; font-family: var(--font-display); font-size: 1.05rem; font-weight: 650; padding: 0 1.25rem 0.9rem 0; vertical-align: bottom; }
.compare td { padding: 0.9rem 1.25rem 0.9rem 0; border-top: 1px solid var(--border); vertical-align: top; }
.compare td:first-child { color: var(--text-muted); width: 46%; }
.compare .ic-row { display: grid; grid-template-columns: 18px 1fr; gap: 0.55rem; align-items: start; }
.compare .icon { margin-top: 4px; }
.compare td:first-child .icon { color: var(--text-subtle); }
.compare td:last-child .icon { color: var(--success); }

.steps-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; counter-reset: step; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 2.25rem 1fr; gap: 0 1rem; }
.steps-list li::before { content: counter(step); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--accent-text); grid-row: span 2; }
.steps-list h3 { margin: 0.35rem 0 0.25rem; font-size: 1.1rem; }
.steps-list p { margin: 0; color: var(--text-muted); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 4rem; align-items: center; }
.split h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); letter-spacing: -0.02em; font-weight: 720; line-height: 1.12; }
.split p { color: var(--text-muted); font-size: 1.0625rem; max-width: 58ch; }

.capabilities { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; }
.capability h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.capability > p { color: var(--text-muted); margin-bottom: 1.1rem; }
.capability ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.capability li { display: grid; grid-template-columns: 20px 1fr; gap: 0.6rem; align-items: start; }
.capability li .icon { color: var(--accent); margin-top: 3px; }
.capability li strong { display: block; }
.capability li span { color: var(--text-muted); font-size: 0.9375rem; }

.guarantees { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem 2.5rem; margin: 0; }
.guarantees div { border-top: 2px solid oklch(0.705 0.19 47 / 0.8); padding-top: 1rem; }
.guarantees dt { font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; margin-bottom: 0.35rem; color: oklch(0.98 0.004 265); }
.guarantees dd { margin: 0; color: oklch(0.8 0.015 265); font-size: 0.9375rem; }

.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0.75rem; align-items: stretch; }
.flow-node { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.2rem; }
.flow-node.focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.flow-node h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.flow-node p { margin: 0; color: var(--text-muted); font-size: 0.9375rem; }
.flow-arrow { display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--text-subtle); font-size: 0.8125rem; text-align: center; gap: 0.2rem; }
.flow-arrow .icon { color: var(--text-subtle); }

.example-table td:nth-child(n+2), .example-table th:nth-child(n+2) { text-align: right; }

.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.price-card { padding: 1.5rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; position: relative; }
.price-card + .price-card { border-left: 1px solid var(--border); }
.price-card.featured { background: var(--accent-soft); }
.price-card .tag { align-self: flex-start; font-size: 0.8125rem; font-weight: 650; color: var(--accent-text); }
.price-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.price { font-family: var(--font-display); font-size: 2.25rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.price small { font-family: var(--font-text); font-size: 0.9375rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.price-desc { font-size: 0.9375rem; color: var(--text-muted); margin: 0; }
.price-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9375rem; flex: 1; }
.price-features li { display: grid; grid-template-columns: 18px 1fr; gap: 0.5rem; }
.price-features .icon { color: var(--success); margin-top: 3px; }
.pricing-note { color: var(--text-muted); font-size: 0.9375rem; margin-top: 1.25rem; }

.faq { max-width: 780px; display: flex; flex-direction: column; }
.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-child { border-top: 1px solid var(--border); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 0; font-family: var(--font-display); font-weight: 650; font-size: 1.1rem; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--text-subtle); font-family: var(--font-text); font-weight: 400; font-size: 1.4rem; line-height: 1; transition: transform 0.2s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-muted); margin: 0 0 1.25rem; max-width: 68ch; }

.cta-band { padding: 4.5rem 0; }
.cta-band h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.022em; font-weight: 740; max-width: 20ch; }
.cta-band .row { margin-top: 1.75rem; }
.cta-band .btn-secondary { background: transparent; color: oklch(0.97 0.006 265); border-color: oklch(0.5 0.03 265); }
.cta-band .btn-secondary:hover { background: oklch(0.3 0.035 265); }

.site-footer { border-top: 1px solid var(--border); padding: 3rem 0 3.5rem; color: var(--text-muted); font-size: 0.9375rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 2rem; }
.footer-grid h3 { font-family: var(--font-text); font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.75rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--text); }
.footer-grid p { max-width: 34ch; margin-top: 0.75rem; }

.page-hero { padding: 4.5rem 0 3rem; }
.page-hero h1 { font-size: clamp(2.1rem, 4vw, 3rem); letter-spacing: -0.024em; font-weight: 750; line-height: 1.08; max-width: 22ch; }
.page-hero p.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 60ch; }
.changelog { max-width: 760px; }
.changelog article { display: grid; grid-template-columns: 140px 1fr; gap: 1.5rem; padding: 2rem 0; border-top: 1px solid var(--border); }
.changelog time { color: var(--text-muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.changelog h2 { font-size: 1.3rem; }
.changelog ul { padding-left: 1.2rem; color: var(--text-muted); margin: 0; }
.changelog li { margin: 0.3rem 0; }

/* ---------- Docs ---------- */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4rem; padding: 3rem 0 5rem; }
.docs-nav { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 1px; max-height: calc(100vh - 110px); overflow-y: auto; }
.docs-nav .nav-label { padding-left: 0.6rem; }
.docs-nav a { padding: 0.35rem 0.6rem; border-radius: 6px; color: var(--text-muted); font-size: 0.9375rem; }
.docs-nav a:hover { background: var(--muted-bg); color: var(--text); text-decoration: none; }
.docs-nav a.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.doc-meta { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; font-size: 0.875rem; color: var(--text-subtle); margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.doc-meta a { color: var(--text-muted); }
.prose { max-width: 70ch; min-width: 0; font-size: 1.0625rem; line-height: 1.7; }
.prose h1 { font-size: clamp(2rem, 3.6vw, 2.6rem); letter-spacing: -0.024em; font-weight: 740; margin-bottom: 0.75rem; }
.prose h2 { font-size: 1.5rem; margin: 2.75rem 0 0.8rem; letter-spacing: -0.016em; }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 0.6rem; }
.prose h2 a.anchor, .prose h3 a.anchor { color: inherit; text-decoration: none; }
.prose p, .prose li { color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--accent-text) 40%, transparent); }
.prose ul, .prose ol { padding-left: 1.35rem; margin: 0 0 1.1em; }
.prose li { margin: 0.35rem 0; }
.prose pre { margin: 0 0 1.4rem; font-size: 0.875rem; }
.prose :not(pre) > code { font-size: 0.85em; color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: 0.9375rem; display: block; overflow-x: auto; line-height: 1.5; }
.prose th, .prose td { border-bottom: 1px solid var(--border); padding: 0.55rem 0.9rem 0.55rem 0; text-align: left; vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--border-strong); }
.prose td { color: var(--text-muted); }
.prose blockquote { margin: 0 0 1.4rem; padding: 0.9rem 1.1rem; background: var(--bg-subtle); border-radius: var(--radius); }
.prose blockquote p { color: var(--text); margin: 0; }
.prose img { border-radius: var(--radius); border: 1px solid var(--border); }
.prose hr { margin: 2.5rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 3rem; }
  .capabilities, .guarantees { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-grid .price-card:nth-child(3) { border-left: 0; }
  .pricing-grid .price-card:nth-child(n+3) { border-top: 1px solid var(--border); }
  .grid-4, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:nth-child(3) { border-left: 0; }
  .stats .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .site-nav { display: none; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { flex-direction: row; padding: 0.25rem 0; }
  .flow-arrow .icon { transform: rotate(90deg); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .sidebar, .main { min-width: 0; }
  .sidebar { position: static; height: auto; padding: 0.8rem; gap: 0.6rem; background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
  .sidebar .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .sidebar .nav-label { display: none; }
  .sidebar .nav a { white-space: nowrap; }
  .sidebar-footer { flex-direction: row; flex-wrap: wrap; border-top: 0; padding-top: 0; margin-top: 0; }
  .sidebar-footer .user-chip { display: none; }
  .sidebar-footer { gap: 0 0.25rem; }
  .sidebar-footer a, .sidebar-footer .btn { min-height: 36px; padding: 0.3rem 0.55rem; font-size: 0.875rem; }
  .main { padding: 1.5rem 1rem 3rem; }
  .docs { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.5rem; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
  .docs-nav .nav-label { width: 100%; padding-top: 0.5rem; }
  .steps-list { grid-template-columns: 1fr; }
  .changelog article { grid-template-columns: 1fr; gap: 0.5rem; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3, .form-row, .form-row-3, .capabilities, .guarantees, .pricing-grid, .footer-grid { grid-template-columns: 1fr; }
  .pricing-grid .price-card + .price-card { border-left: 0; border-top: 1px solid var(--border); }
  .span-2 { grid-column: auto; }
  .hero { padding: 3rem 0 3rem; }
  .hero .lede { font-size: 1.0625rem; }
  .section { padding: 4rem 0; }
  .site-header .actions .btn-ghost { display: none; }
  dl.kv { grid-template-columns: 1fr; gap: 0.1rem; }
  dl.kv dd { margin-bottom: 0.65rem; }
  .compare td:first-child { width: auto; }
  .prose { font-size: 1rem; }
}
