/* ==========================================================================
   Nexfer Inference — styles.css
   Dark only. 1px hairlines. Mono micro-labels. No shadows, no gradients on text.
   Sections: 01 tokens · 02 base · 03 layout · 04 chrome · 05 buttons · 06 cards
   07 labels · 08 tables · 09 badges · 10 forms · 11 chips/tabs · 12 overlays
   13 states · 14 charts · 15 landing · 16 dashboard · 17 admin · 18 docs
   19 responsive · 20 print/motion
   ========================================================================== */

/* == 01 tokens ========================================================== */
:root {
  color-scheme: dark;
  --bg: #080b0a;
  --fg: #f1f5ef;
  --muted: #9aa69e;
  --accent: #ccff8b;
  --line: #273029;
  --card: #0d130f;
  --card-strong: #141f12;
  --ok: #ccff8b;
  --warn: #ffd479;
  --bad: #ff9d8b;
  --info: #9ad0ff;
  --accent-dim: #9dc46b;
  --line-soft: #1b231d;
  --line-strong: #3a4a3a;
  --font: Arial, Helvetica, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  --r: 4px;
  --r-lg: 10px;
  --pad: clamp(16px, 4vw, 56px);
  --gap: clamp(12px, 2vw, 24px);
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t: 200ms;
  --header-h: 56px;
}

/* == 02 base ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
/* Dot-grid page field, matching the parent site's diagram pattern. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(#344038 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  opacity: .35;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }
h1, h2, h3, h4, h5, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); }
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
::selection { background: var(--accent); color: #08110a; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--accent); color: #08110a;
  padding: 8px 14px; border-radius: var(--r);
  font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  z-index: 100;
}
.skip-link:focus { top: 12px; color: #08110a; }

/* == 03 layout ========================================================== */
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }
.wrap--narrow { max-width: 780px; }
.wrap--doc { max-width: 1180px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack--sm { gap: 10px; }
.stack--xs { gap: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--top { align-items: flex-start; }
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--metrics { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 56px); align-items: start; }
.split--aside { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
.section { padding: clamp(36px, 6vw, 88px) 0; border-top: 1px solid var(--line); }
.section--flush { border-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: clamp(20px, 3vw, 36px); }
.section-head h2 { font-size: clamp(20px, 2.4vw, 28px); font-weight: 700; letter-spacing: -.4px; }
.rule { height: 1px; background: var(--line); border: 0; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.info { color: var(--info); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.tnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }

/* == 04 chrome ========================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(8, 11, 10, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.topbar__in {
  max-width: 1440px; margin: 0 auto; padding: 0 var(--pad);
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -.5px; color: var(--fg); }
.brand:hover { color: var(--fg); }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand__sub { font: 400 10px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line); align-self: center; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a, .nav button.navlink {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r);
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); background: none; border: 1px solid transparent;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.nav a:hover, .nav a[aria-current="page"], .nav button.navlink:hover { color: var(--fg); background: var(--card); border-color: var(--line); }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line); border-radius: var(--r);
  padding: 8px; color: var(--fg); line-height: 0;
}
.nav-toggle svg { width: 20px; height: 20px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; background: var(--card);
  font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.status-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.status-chip[data-state="ok"] { color: var(--ok); border-color: #33471f; }
.status-chip[data-state="ok"] .dot { background: var(--ok); animation: pulse 2.4s var(--ease) infinite; }
.status-chip[data-state="warn"] { color: var(--warn); border-color: #4a3c1c; }
.status-chip[data-state="warn"] .dot { background: var(--warn); }
.status-chip[data-state="bad"] { color: var(--bad); border-color: #4a2a24; }
.status-chip[data-state="bad"] .dot { background: var(--bad); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 34px; }
.site-footer__in { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; color: var(--muted); font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.wordplay { display: inline-flex; gap: 4px; align-items: center; letter-spacing: .06em; }
.wordplay strong { color: var(--fg); font-weight: 600; }
.wordplay .slash { color: var(--accent); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* app shell */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.sidenav { border-right: 1px solid var(--line); padding: 22px 14px; position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow: auto; }
.sidenav__group { margin-bottom: 22px; }
.sidenav__label { padding: 0 10px 8px; }
.sidenav a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r); border-left: 2px solid transparent;
  font-size: 13px; color: var(--muted);
  transition: color var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.sidenav a svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.sidenav a:hover { color: var(--fg); background: var(--card); }
.sidenav a[aria-current="page"] { color: var(--accent); background: var(--card); border-left-color: var(--accent); }
.main { padding: clamp(20px, 3.4vw, 44px) var(--pad) 64px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(22px, 2.6vw, 32px); font-weight: 700; letter-spacing: -.5px; }
.crumb { font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }

/* == 05 buttons ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); color: var(--fg);
  font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; white-space: nowrap;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease), transform 120ms var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { border-color: var(--line-strong); background: var(--card-strong); color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #08110a; }
.btn--primary:hover { background: #dbffab; border-color: #dbffab; color: #08110a; }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--bad); border-color: #4a2a24; background: transparent; }
.btn--danger:hover { background: rgba(255, 157, 139, .08); border-color: var(--bad); color: var(--bad); }
.btn--sm { padding: 7px 11px; font-size: 10px; }
.btn--block { width: 100%; }
.btn--link { border: 0; background: none; padding: 4px 2px; color: var(--accent); text-transform: none; letter-spacing: 0; font: 500 13px/1.4 var(--mono); }
.btn--link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--fg); border-color: var(--line-strong); background: var(--card-strong); }
.icon-btn--bare { border-color: transparent; background: none; width: 28px; height: 28px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r) 0 0 var(--r); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.btn-group .btn[aria-pressed="true"] { background: var(--card-strong); border-color: var(--line-strong); color: var(--accent); }

/* == 06 cards =========================================================== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(16px, 2.2vw, 24px); min-width: 0;
}
.card--strong { background: var(--card-strong); }
.card--flat { background: transparent; }
.card--pad-sm { padding: 14px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card__head h2, .card__head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }
.card__foot { border-top: 1px solid var(--line); padding: 12px 16px; background: rgba(255, 255, 255, .01); }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; }
.metric__label { margin-bottom: 10px; }
.metric__value { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric__value small { font-size: .55em; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.metric__foot { margin-top: 8px; font: 400 11px/1.4 var(--mono); color: var(--muted); display: flex; gap: 8px; align-items: center; }
.metric--accent { border-color: #33471f; background: linear-gradient(180deg, rgba(204, 255, 139, .045), transparent 70%), var(--card); }
.inset { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }

/* == 07 labels ========================================================== */
.label {
  font: 500 10px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow .num { font: 500 10px/1 var(--mono); letter-spacing: .12em; color: var(--accent); }
.eyebrow .dash { width: 26px; height: 1px; background: var(--line-strong); flex: none; }
.eyebrow .txt { font: 500 10px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.section-head .eyebrow { margin-bottom: 8px; }
.lede { color: var(--muted); font-size: clamp(14px, 1.35vw, 17px); line-height: 1.6; max-width: 62ch; }

/* == 08 tables ========================================================== */
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line);
  font: 500 10px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  background: var(--card-strong); white-space: nowrap;
}
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(204, 255, 139, .025); }
.table tbody tr[data-selected="true"] { background: rgba(204, 255, 139, .06); }
.table .cell-main { color: var(--fg); font-weight: 600; }
.table .cell-sub { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.table--compact tbody td { padding: 8px 12px; }
.table--compact thead th { padding: 8px 12px; }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-wrap__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* == 09 badges ========================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line);
  font: 500 10px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: rgba(255, 255, 255, .015); white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge--ok { color: var(--ok); border-color: #33471f; background: rgba(204, 255, 139, .06); }
.badge--warn { color: var(--warn); border-color: #4a3c1c; background: rgba(255, 212, 121, .06); }
.badge--bad { color: var(--bad); border-color: #4a2a24; background: rgba(255, 157, 139, .06); }
.badge--info { color: var(--info); border-color: #24404f; background: rgba(154, 208, 255, .06); }
.badge--accent { color: var(--accent); border-color: #33471f; }
.badge--plain { border-color: transparent; padding-left: 0; background: none; }
.tag { font: 400 11px/1.4 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; }
.kind { font: 400 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* == 10 forms =========================================================== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field__label { font: 500 10px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; font-size: 14px; line-height: 1.4;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.input::placeholder, .textarea::placeholder { color: #5f6b62; }
.textarea { min-height: 88px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input--mono { font-family: var(--mono); font-size: 13px; }
.input--sm { padding: 7px 10px; font-size: 13px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--bad); }
.field__hint { font: 400 11px/1.45 var(--mono); color: var(--muted); }
.field__error { font: 500 11px/1.45 var(--mono); color: var(--bad); }
.field__error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--r) 0 0 var(--r); }
.input-group .btn { border-radius: 0 var(--r) var(--r) 0; border-left: 0; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--fg); cursor: pointer; }
.check input[type="checkbox"], .check input[type="radio"] { appearance: none; width: 15px; height: 15px; flex: none; margin: 3px 0 0; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--bg); display: inline-grid; place-content: center; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input[type="checkbox"]:checked::after { content: ""; width: 7px; height: 4px; border-left: 2px solid #08110a; border-bottom: 2px solid #08110a; transform: rotate(-45deg) translate(0, -1px); }
.check input[type="radio"]:checked::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #08110a; }
.check small { display: block; color: var(--muted); font: 400 11px/1.4 var(--mono); margin-top: 2px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--line); border: 1px solid var(--line-strong); position: relative; transition: background var(--t) var(--ease); flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); transition: transform var(--t) var(--ease), background var(--t) var(--ease); }
.switch input:checked { background: rgba(204, 255, 139, .25); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(14px); background: var(--accent); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength span { height: 3px; background: var(--line); border-radius: 2px; transition: background var(--t) var(--ease); }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--bad); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] span:nth-child(-n+3) { background: var(--accent-dim); }
.strength[data-level="4"] span { background: var(--accent); }
.otp { display: flex; gap: 8px; }
.otp input {
  width: 46px; height: 56px; text-align: center;
  font: 600 22px/1 var(--mono); color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r);
}
.otp input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.otp[aria-invalid="true"] input { border-color: var(--bad); }
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 34px; }
.copyfield { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.copyfield code { flex: 1; padding: 10px 12px; font: 400 12px/1.5 var(--mono); color: var(--fg); overflow-x: auto; white-space: pre; }
.copyfield .icon-btn { border: 0; border-left: 1px solid var(--line); border-radius: 0; height: auto; width: 38px; background: var(--card); }
.range { width: 100%; accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); cursor: pointer; }
.help-text { font: 400 11px/1.45 var(--mono); color: var(--muted); }
.form-error {
  border: 1px solid #4a2a24; background: rgba(255, 157, 139, .06); color: var(--bad);
  border-radius: var(--r); padding: 10px 12px; font: 500 12px/1.45 var(--mono);
}
.form-error:empty { display: none; }

/* == 11 chips / tabs ==================================================== */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  padding: 4px 10px; font: 400 11px/1.4 var(--mono); color: var(--muted);
}
.chip button { background: none; border: 0; padding: 0; color: var(--muted); line-height: 0; }
.chip button:hover { color: var(--bad); }
.chip svg { width: 12px; height: 12px; }
.chip--on { border-color: #33471f; color: var(--accent); background: rgba(204, 255, 139, .06); }
.chip--pick { cursor: pointer; }
.chip--pick:hover { border-color: var(--line-strong); color: var(--fg); }
.chip--pick[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: rgba(204, 255, 139, .08); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs [role="tab"] {
  border: 0; border-bottom: 2px solid transparent; background: none;
  padding: 9px 14px; margin-bottom: -1px;
  font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.tabs [role="tab"]:hover { color: var(--fg); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { padding-top: 16px; }
.tab-panel:focus { outline: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 12px; font: 500 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--card-strong); color: var(--accent); }

/* == 12 overlays ======================================================== */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 7, 5, .72);
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.scrim[data-open="true"] { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(520px, 100vw); max-width: 100%;
  background: var(--bg); border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform 240ms var(--ease);
  visibility: hidden;
}
.drawer[data-open="true"] { transform: none; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 16px; font-weight: 700; }
.drawer__body { padding: 20px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.drawer__foot { border-top: 1px solid var(--line); padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; background: var(--card); }
.modal {
  position: fixed; z-index: 61; left: 50%; top: 50%;
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  transform: translate(-50%, -46%) scale(.98); opacity: 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
  visibility: hidden;
}
.modal[data-open="true"] { transform: translate(-50%, -50%); opacity: 1; visibility: visible; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal__head h2 { font-size: 17px; font-weight: 700; }
.modal__body { padding: 4px 20px 20px; overflow-y: auto; }
.modal__foot { border-top: 1px solid var(--line); padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; background: var(--card); }
.modal--wide { width: min(680px, calc(100vw - 32px)); }
body[data-overlay="true"] { overflow: hidden; }
.toasts {
  position: fixed; z-index: 70; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-left: 2px solid var(--accent);
  background: var(--card-strong); border-radius: var(--r);
  padding: 11px 12px; font-size: 13px; color: var(--fg);
  animation: toast-in 220ms var(--ease);
}
.toast svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }
.toast--bad { border-left-color: var(--bad); }
.toast--bad svg { color: var(--bad); }
.toast--warn { border-left-color: var(--warn); }
.toast--warn svg { color: var(--warn); }
.toast__msg { flex: 1; min-width: 0; }
.toast__msg b { display: block; font-size: 12px; }
.toast__msg span { color: var(--muted); font: 400 11px/1.4 var(--mono); overflow-wrap: anywhere; }
.toast button { background: none; border: 0; color: var(--muted); line-height: 0; padding: 2px; }
.toast button:hover { color: var(--fg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.help-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(4, 7, 5, .82); padding: 20px; }
.help-card { width: min(460px, 100%); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); padding: 22px; }
.help-card h2 { font-size: 15px; margin-bottom: 14px; }
.kbd-list { display: grid; gap: 8px; }
.kbd-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
kbd {
  font: 500 11px/1 var(--mono); color: var(--fg);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px;
  padding: 3px 6px; background: var(--card); white-space: nowrap;
}
.tooltip { position: relative; }
.tooltip:hover::after, .tooltip:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--card-strong); border: 1px solid var(--line); color: var(--fg);
  font: 400 11px/1.4 var(--mono); padding: 5px 8px; border-radius: 3px; white-space: nowrap; z-index: 30;
}

/* == 13 states ========================================================== */
.skeleton { background: var(--line-soft); border-radius: 3px; position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .05), transparent); animation: shimmer 1.4s var(--ease) infinite; }
.skeleton--text { height: 12px; margin: 6px 0; }
.skeleton--line { height: 14px; width: 60%; }
.skeleton--cell { height: 12px; width: 80%; }
.skeleton--card { height: 92px; border-radius: var(--r-lg); }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.empty { padding: clamp(26px, 4vw, 48px) 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); }
.empty svg { width: 28px; height: 28px; color: var(--line-strong); margin-bottom: 10px; }
.empty h3 { color: var(--fg); font-size: 14px; margin-bottom: 6px; }
.empty p { font: 400 12px/1.5 var(--mono); max-width: 42ch; margin: 0 auto 14px; }
.error-state {
  border: 1px solid #4a2a24; background: rgba(255, 157, 139, .04); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start;
}
.error-state svg { width: 18px; height: 18px; color: var(--bad); flex: none; margin-top: 2px; }
.error-state__body { flex: 1; min-width: 200px; }
.error-state h3 { font-size: 14px; margin-bottom: 4px; }
.error-state p { font: 400 12px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.inline-note { font: 400 11px/1.5 var(--mono); color: var(--muted); display: flex; gap: 7px; align-items: flex-start; }
.inline-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.banner { border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: var(--r); padding: 11px 13px; background: var(--card); font-size: 13px; }
.banner--warn { border-left-color: var(--warn); }
.banner--bad { border-left-color: var(--bad); }
.loading-line { height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.loading-line::after { content: ""; display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }

/* == 14 landing ========================================================= */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero__inner { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(40px, 7vw, 88px) 0 clamp(34px, 6vw, 72px); }
.hero h1 { font-size: clamp(38px, 6.4vw, 80px); line-height: .98; letter-spacing: -2.5px; font-weight: 700; margin: 20px 0 20px; }
.hero h1 .accent { color: var(--accent); display: block; }
.hero__lede { color: var(--muted); font-size: clamp(14px, 1.4vw, 17px); line-height: 1.65; max-width: 46ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font: 400 11px/1.4 var(--mono); color: var(--muted); }
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta b { color: var(--fg); font-weight: 600; }
.hero__meta .sep { color: var(--line-strong); }
.hero__art { position: relative; min-height: 340px; display: grid; place-items: center; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__art .diagram { width: 100%; max-width: 560px; height: auto; }
.hero__frame { position: absolute; inset: 0; pointer-events: none; border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.hero__frame::before, .hero__frame::after { content: ""; position: absolute; width: 7px; height: 7px; border-color: var(--accent); border-style: solid; opacity: .7; }
.hero__frame::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.hero__frame::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.hero__hint { position: absolute; bottom: 10px; right: 12px; font: 400 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); opacity: .6; }
.hero__glyphs { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 400 11px/1 var(--mono); color: var(--accent); letter-spacing: 2px; opacity: .25; pointer-events: none; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--card); }
.status-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.status-chip[data-state="ok"] .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(204, 255, 139, .12); }
.status-chip[data-state="bad"] .dot { background: var(--bad); }
.status-chip[data-state="warn"] .dot { background: var(--warn); }
.status-chip[data-state="loading"] .dot { background: var(--muted); animation: pulse 1.2s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.diagram text { font-family: var(--mono); }
.diagram .d-line { stroke: #2f3d2c; stroke-width: 1; fill: none; }
.diagram .d-line--live { stroke: var(--accent); stroke-dasharray: 3 5; animation: dashflow 3.2s linear infinite; }
@keyframes dashflow { to { stroke-dashoffset: -64; } }
.diagram .d-box { fill: #0b120d; stroke: #2a362b; }
.diagram .d-core { fill: #101b0d; stroke: var(--accent); }
.diagram .d-label { fill: #9aa69e; font-size: 9px; letter-spacing: 1.4px; }
.diagram .d-label--accent { fill: var(--accent); }
.diagram .d-node { fill: var(--accent); }
.diagram .d-wave { stroke: var(--accent); stroke-width: 1.5; fill: none; stroke-linecap: round; }

.grid-section { padding: clamp(34px, 5.5vw, 64px) 0; border-bottom: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: clamp(18px, 2.4vw, 28px); }
.section-head h2 { font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -.7px; font-weight: 700; }
.section-head p { color: var(--muted); font-size: 13px; max-width: 46ch; }
.section-head .side { font: 400 11px/1.5 var(--mono); color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.feature { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; background: var(--card); display: flex; flex-direction: column; gap: 8px; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.feature:hover { border-color: var(--line-strong); background: var(--card-strong); }
.feature__ico { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #2f3d2c; border-radius: var(--r); color: var(--accent); background: rgba(204, 255, 139, .04); }
.feature__ico svg { width: 16px; height: 16px; }
.feature h3 { font-size: 13px; font-weight: 700; }
.feature p { font-size: 12px; line-height: 1.55; color: var(--muted); }

.model-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.model-tools .search { flex: 1 1 260px; max-width: 340px; }
.model-tools .count { font: 400 11px/1.4 var(--mono); color: var(--muted); }
.price { font: 500 12px/1.4 var(--mono); color: var(--fg); font-variant-numeric: tabular-nums; }
.price small { color: var(--muted); font-weight: 400; }
.model-id { font: 500 12px/1.4 var(--mono); color: var(--fg); }
.price--accent { color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 20px; }
.step { border-top: 1px solid var(--line); padding-top: 14px; }
.step__n { font: 500 10px/1 var(--mono); color: var(--accent); letter-spacing: .14em; margin-bottom: 8px; }
.step h3 { font-size: 14px; margin-bottom: 4px; }
.step p { font-size: 12px; color: var(--muted); line-height: 1.55; }
.code-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: #060907; overflow: hidden; }
.code-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 8px 12px; background: var(--card); }
.code-card__body { position: relative; }
.code-card pre { margin: 0; padding: 16px; overflow-x: auto; font: 400 12.5px/1.75 var(--mono); color: #d8e4d4; tab-size: 2; }
.code-card .copy-btn { position: absolute; top: 8px; right: 8px; }
.code-card--inset { border-radius: var(--r); }
pre.code { margin: 0; padding: 14px; background: #060907; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; font: 400 12.5px/1.7 var(--mono); color: #d8e4d4; white-space: pre; }
code { font-family: var(--mono); font-size: .92em; }
.tok-k { color: var(--accent); }
.tok-s { color: #d9c78a; }
.tok-c { color: #64715f; }
.tok-f { color: #9ad0ff; }
.tok-p { color: #c9b7e6; }
.agent-block { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.agent-links { display: grid; gap: 8px; align-content: start; }
.agent-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 12px 14px; text-decoration: none; color: var(--fg); transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.agent-link:hover { border-color: var(--line-strong); background: var(--card-strong); }
.agent-link .l { font: 500 12px/1.3 var(--mono); color: var(--accent); }
.agent-link .s { display: block; font: 400 11px/1.4 var(--mono); color: var(--muted); margin-top: 2px; }
.agent-link svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.wordplay { border-top: 1px solid var(--line); margin-top: clamp(28px, 4vw, 48px); padding-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: baseline; font: 500 clamp(13px, 1.6vw, 18px)/1.3 var(--mono); letter-spacing: .02em; }
.wordplay .w1 { color: var(--muted); }
.wordplay .w2 { color: var(--fg); }
.wordplay .w3 { color: var(--accent); }
.wordplay .w3 b { font-weight: 700; }

/* == 15 auth ============================================================ */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, .82fr); }
.auth-aside { position: relative; border-right: 1px solid var(--line); padding: clamp(22px, 4vw, 52px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; background: radial-gradient(120% 90% at 80% 10%, rgba(204, 255, 139, .06), transparent 55%); }
.auth-aside::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--line) .7px, transparent .7px); background-size: 22px 22px; opacity: .35; pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -.8px; line-height: 1.15; margin-bottom: 12px; }
.auth-aside p { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 40ch; }
.auth-points { display: grid; gap: 10px; margin-top: 20px; }
.auth-points li { display: flex; gap: 9px; font: 400 12px/1.5 var(--mono); color: var(--muted); }
.auth-points svg { width: 14px; height: 14px; color: var(--accent); flex: none; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: clamp(22px, 5vw, 56px) clamp(16px, 4vw, 40px); }
.auth-card { width: min(430px, 100%); }
.auth-card h1 { font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -.6px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-form { display: grid; gap: 14px; }
.auth-form .btn--primary { margin-top: 4px; }
.auth-switch { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.auth-switch a { color: var(--accent); }
.auth-alt { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.auth-card .divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font: 400 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; }
.auth-card .divider::before, .auth-card .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.auth-foot { margin-top: 22px; font: 400 11px/1.5 var(--mono); color: var(--muted); }
.auth-foot a { color: var(--accent); }
.auth-note { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font: 400 11px/1.55 var(--mono); color: var(--muted); background: var(--card); }
.auth-note b { color: var(--fg); font-weight: 600; }
.auth-view[hidden] { display: none; }
.otp-hint { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.resend { font: 400 11px/1.4 var(--mono); color: var(--muted); }
.resend b { color: var(--accent); font-weight: 600; }

/* == 16 app shell ======================================================= */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidenav { border-right: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; z-index: 40; }
.sidenav__brand { display: flex; align-items: center; gap: 9px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.sidenav__brand svg { width: 22px; height: 22px; }
.sidenav__brand .name { font-size: 13px; font-weight: 700; letter-spacing: -.2px; }
.sidenav__brand .sub { display: block; font: 400 9px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.sidenav__nav { padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidenav__label { font: 500 9.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 7px; }
.nav-link { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-size: 13px; border: 1px solid transparent; transition: color var(--t) var(--ease), background var(--t) var(--ease); }
.nav-link svg { width: 15px; height: 15px; flex: none; }
.nav-link:hover { color: var(--fg); background: var(--card); }
.nav-link[aria-current="page"] { color: var(--accent); background: var(--card-strong); border-color: var(--line); }
.nav-link .n { margin-left: auto; font: 400 10px/1 var(--mono); color: var(--muted); }
.sidenav__foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.sidenav__user { display: flex; align-items: center; gap: 9px; font-size: 12px; min-width: 0; }
.sidenav__user .avatar { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: var(--r); display: grid; place-items: center; font: 600 10px/1 var(--mono); color: var(--accent); background: var(--card); flex: none; }
.sidenav__user .u { min-width: 0; }
.sidenav__user .u b { display: block; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidenav__user .u span { display: block; font: 400 10px/1.3 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { border-bottom: 1px solid var(--line); padding: 12px clamp(16px, 2.4vw, 32px); display: flex; align-items: center; gap: 12px; background: rgba(8, 11, 10, .92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 30; }
.topbar__crumb { display: flex; align-items: center; gap: 8px; font: 400 11px/1.4 var(--mono); color: var(--muted); min-width: 0; }
.topbar__crumb b { color: var(--fg); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.burger { display: none; }
.page { padding: clamp(20px, 3vw, 36px) clamp(16px, 2.6vw, 34px) 56px; }
.page__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: clamp(16px, 2.2vw, 26px); }
.page__head h1 { font-size: clamp(21px, 2.4vw, 27px); letter-spacing: -.7px; font-weight: 700; }
.page__head .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page__head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.view[hidden] { display: none; }
.metric-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 20px; }
.metric { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); padding: 14px 15px; min-width: 0; }
.metric .label { font: 500 9.5px/1.3 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.metric .value { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; letter-spacing: -.8px; margin-top: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric .value small { font: 500 11px/1 var(--mono); color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.metric .foot { font: 400 10.5px/1.4 var(--mono); color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.metric--accent { border-color: #37472f; background: linear-gradient(180deg, rgba(204, 255, 139, .05), transparent 70%), var(--card); }
.metric--accent .value { color: var(--accent); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.stack { display: grid; gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); min-width: 0; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.panel__head h2 { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-family: var(--mono); color: var(--fg); }
.panel__head .meta { font: 400 10.5px/1.4 var(--mono); color: var(--muted); }
.panel__body { padding: 15px; min-width: 0; }
.panel__body--flush { padding: 0; }
.panel__body--tight { padding: 10px 15px; }
.spark-wrap { position: relative; }
.spark { width: 100%; height: 88px; display: block; }
.spark .axis { stroke: var(--line); stroke-width: 1; }
.spark .area { fill: url(#spark-fill); }
.spark .line { stroke: var(--accent); stroke-width: 1.5; fill: none; stroke-linejoin: round; }
.spark .dot { fill: var(--accent); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--accent); opacity: .82; }
.chart .bar--alt { fill: var(--info); opacity: .7; }
.chart .bar:hover { opacity: 1; }
.chart .axis-label { fill: var(--muted); font: 400 9px var(--mono); }
.chart .value-label { fill: var(--fg); font: 500 9.5px var(--mono); }
.chart .legend { display: flex; gap: 12px; font: 400 10px var(--mono); color: var(--muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font: 400 10.5px/1.4 var(--mono); color: var(--muted); margin-top: 8px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); display: inline-block; }
.chart-legend i.info { background: var(--info); }
.chart-legend i.warn { background: var(--warn); }
.chart-legend i.bad { background: var(--bad); }
.chart-empty { height: 130px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); font: 400 11px/1.4 var(--mono); text-align: center; padding: 12px; }
.quick-start-snippet { position: relative; }
.quick-start-snippet .copy-btn { position: absolute; top: 6px; right: 6px; }
.quick-start-snippet pre { padding-right: 46px; }
.key-prefix { font: 500 12px/1 var(--mono); color: var(--accent); background: rgba(204, 255, 139, .06); border: 1px solid #37472f; border-radius: 3px; padding: 4px 7px; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.list-simple { display: grid; }
.list-simple > * { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 15px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; min-width: 0; }
.list-simple > *:last-child { border-bottom: 0; }
.list-simple .l { min-width: 0; }
.list-simple .l b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-simple .l span { display: block; font: 400 10.5px/1.4 var(--mono); color: var(--muted); margin-top: 2px; }
.list-simple .r { font: 500 11px/1.4 var(--mono); color: var(--muted); text-align: right; flex: none; }
.usage-bars { display: grid; gap: 9px; }
.usage-bar { display: grid; grid-template-columns: minmax(80px, 130px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font: 400 11px/1.3 var(--mono); }
.usage-bar .track { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.usage-bar .fill { height: 100%; background: var(--accent); opacity: .8; border-radius: 3px; }
.usage-bar .name { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-bar .v { color: var(--fg); text-align: right; white-space: nowrap; }

/* == 17 drawer / modal ================================================== */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(3, 5, 4, .66); backdrop-filter: blur(2px); opacity: 0; transition: opacity var(--t) var(--ease); z-index: 100; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--bg); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform 200ms var(--ease); display: flex; flex-direction: column; z-index: 101; }
.drawer.is-open { transform: none; }
.drawer--wide { width: min(640px, 100%); }
.drawer__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 14px; font-weight: 600; letter-spacing: -.2px; }
.drawer__head .sub { font: 400 10.5px/1.4 var(--mono); color: var(--muted); margin-top: 2px; }
.drawer__body { padding: 16px; overflow-y: auto; flex: 1; }
.drawer__foot { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; background: var(--bg); }
.drawer form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section h3 { font: 500 10px/1.4 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.check { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; cursor: pointer; font-size: 12px; transition: border-color var(--t) var(--ease), background var(--t) var(--ease); }
.check:hover { border-color: var(--line-strong); }
.check input { margin: 2px 0 0; flex: none; }
.check span b { display: block; font-weight: 500; }
.check span small { display: block; font: 400 10.5px/1.35 var(--mono); color: var(--muted); }
.check:has(input:checked) { border-color: #37472f; background: rgba(204, 255, 139, .045); }
.secret-box { border: 1px solid #37472f; border-radius: var(--r); background: rgba(204, 255, 139, .045); padding: 12px; }
.secret-box .warn { display: flex; gap: 8px; font: 400 11px/1.5 var(--mono); color: var(--warn); margin-bottom: 9px; }
.secret-box .warn svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.secret-val { display: flex; gap: 6px; }
.secret-val input { font: 500 11.5px/1.4 var(--mono); color: var(--accent); background: #060907; }
.confirm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.confirm-row .input { flex: 1 1 180px; }
.inline-note { font: 400 11px/1.5 var(--mono); color: var(--muted); }
.inline-note b { color: var(--fg); font-weight: 600; }
.danger-zone { border: 1px solid rgba(255, 157, 139, .35); border-radius: var(--r-lg); background: rgba(255, 157, 139, .035); }
.danger-zone .panel__head { border-color: rgba(255, 157, 139, .25); }
.danger-zone .panel__head h2 { color: var(--bad); }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.range-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-val { font: 500 12px/1 var(--mono); color: var(--accent); min-width: 34px; text-align: right; }
.search-select { position: relative; }
.search-select__list { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); max-height: 190px; overflow-y: auto; margin-top: 6px; }
.search-select__list[hidden] { display: none; }
.search-select__list label { display: flex; gap: 9px; align-items: center; padding: 7px 10px; font: 400 11.5px/1.4 var(--mono); color: var(--muted); cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.search-select__list label:last-child { border-bottom: 0; }
.search-select__list label:hover { background: var(--card-strong); color: var(--fg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--card); padding: 3px 7px; font: 400 10.5px/1.4 var(--mono); color: var(--muted); }
.chip--accent { border-color: #37472f; color: var(--accent); background: rgba(204, 255, 139, .05); }
.chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; display: inline-flex; }
.chip button svg { width: 11px; height: 11px; }

/* == 18 play ============================================================ */
.play-grid { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); gap: 12px; align-items: start; }
.play-settings { position: sticky; top: 68px; }
.play-settings .panel__body { display: grid; gap: 13px; }
.chat-panel { display: flex; flex-direction: column; min-height: min(72vh, 700px); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 300px; max-height: 62vh; scroll-behavior: smooth; }
.msg { display: grid; gap: 6px; max-width: min(680px, 94%); }
.msg--user { align-self: flex-end; }
.msg__role { font: 500 9.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.msg__body { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px 13px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.msg--user .msg__body { background: var(--card-strong); border-color: #37472f; }
.msg--assistant .msg__body { background: var(--card); }
.msg--error .msg__body { border-color: rgba(255, 157, 139, .4); color: var(--bad); background: rgba(255, 157, 139, .04); }
.msg__meta { font: 400 10px/1.4 var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.msg__body p { margin: 0 0 9px; }
.msg__body p:last-child { margin-bottom: 0; }
.msg__body ul, .msg__body ol { margin: 0 0 9px; padding-left: 20px; }
.msg__body li { margin-bottom: 4px; }
.msg__body h4 { font-size: 13px; margin: 12px 0 6px; }
.msg__body pre { border: 1px solid var(--line); border-radius: var(--r); background: #060907; padding: 10px 12px; overflow-x: auto; margin: 9px 0; position: relative; }
.msg__body pre code { font-size: 11.5px; line-height: 1.65; color: #d8e4d4; }
.msg__body :not(pre) > code { background: var(--card-strong); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; font-size: 11.5px; color: var(--accent); }
.msg__body a { color: var(--accent); }
.msg__body table { width: 100%; border-collapse: collapse; margin: 9px 0; font-size: 12px; }
.msg__body th, .msg__body td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.chat-compose { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 8px; background: var(--card); }
.chat-compose__row { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { flex: 1; min-height: 44px; max-height: 180px; resize: vertical; }
.chat-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font: 400 10.5px/1.4 var(--mono); color: var(--muted); }
.chat-meta .cost { color: var(--accent); font-weight: 500; }
.caret { display: inline-block; width: 6px; height: 13px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.msg__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.msg__actions .btn { min-height: 24px; padding: 2px 7px; font-size: 10px; }

/* == 19 admin =========================================================== */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.health-list { display: grid; gap: 8px; }
.health-row { display: flex; align-items: center; gap: 9px; font: 400 11.5px/1.4 var(--mono); color: var(--muted); }
.health-row b { color: var(--fg); font-weight: 500; margin-left: auto; }
.health-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.health-row .dot--ok { background: var(--ok); }
.health-row .dot--warn { background: var(--warn); }
.health-row .dot--bad { background: var(--bad); }
.audit { max-height: 430px; overflow-y: auto; }
.audit__item { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 9px 15px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.audit__item:last-child { border-bottom: 0; }
.audit__item time { font: 400 10px/1.5 var(--mono); color: var(--muted); }
.audit__item .a { min-width: 0; }
.audit__item .a b { font-weight: 500; }
.audit__item .a span { display: block; font: 400 10.5px/1.4 var(--mono); color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.row-actions .btn { min-height: 26px; padding: 2px 7px; font-size: 10.5px; }
.credit-form { display: grid; gap: 10px; }
.credit-form .row { display: flex; gap: 8px; }
.credit-form .row .input { flex: 1; }

/* == 20 docs ============================================================ */
.docs-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr) 190px; gap: clamp(20px, 3vw, 44px); max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
.docs-side { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto; padding: 26px 0; }
.docs-side h4 { font: 500 9.5px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }
.docs-side nav { display: grid; gap: 1px; border-left: 1px solid var(--line); }
.docs-side a { color: var(--muted); text-decoration: none; font-size: 12px; line-height: 1.45; padding: 5px 0 5px 11px; border-left: 1px solid transparent; margin-left: -1px; transition: color var(--t) var(--ease), border-color var(--t) var(--ease); }
.docs-side a:hover { color: var(--fg); }
.docs-side a.is-active { color: var(--accent); border-left-color: var(--accent); }
.docs-side a.lvl3 { padding-left: 22px; font-size: 11.5px; }
.docs-main { padding: 30px 0 80px; min-width: 0; }
.docs-main h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -1px; margin: 8px 0 14px; }
.docs-main h2 { font-size: clamp(17px, 2vw, 21px); letter-spacing: -.4px; margin: 40px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.docs-main h3 { font-size: 14px; font-weight: 600; margin: 24px 0 9px; scroll-margin-top: 80px; }
.docs-main h4 { font-size: 13px; font-weight: 600; margin: 18px 0 7px; }
.docs-main p { color: #cdd8cb; font-size: 13.5px; line-height: 1.75; margin-bottom: 12px; }
.docs-main a { color: var(--accent); }
.docs-main ul, .docs-main ol { margin: 0 0 14px; padding-left: 22px; color: #cdd8cb; font-size: 13.5px; line-height: 1.75; }
.docs-main li { margin-bottom: 5px; }
.docs-main li > ul { margin-top: 5px; }
.docs-main blockquote { border-left: 2px solid var(--accent); background: var(--card); padding: 10px 14px; margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.docs-main hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.docs-main table { margin: 0 0 18px; }
.docs-main code { font-size: .92em; }
.docs-main :not(pre) > code { background: var(--card-strong); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; color: var(--accent); }
.code-wrap { position: relative; margin: 0 0 16px; }
.code-wrap pre { margin: 0; }
.code-wrap .copy-btn { position: absolute; top: 7px; right: 7px; }
.code-lang { position: absolute; top: 9px; left: 12px; font: 500 9px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.code-wrap pre { padding-top: 28px; }
.docs-toc { position: sticky; top: 72px; align-self: start; padding: 26px 0; font: 400 11px/1.6 var(--mono); color: var(--muted); }
.docs-toc h4 { font: 500 9.5px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; margin-bottom: 9px; }
.docs-toc a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; }
.docs-toc a:hover { color: var(--accent); }
.docs-hero { border-bottom: 1px solid var(--line); padding: 34px 0 8px; }
.docs-hero .links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.docs-status { display: flex; align-items: center; gap: 8px; font: 400 11px/1.4 var(--mono); color: var(--muted); margin-bottom: 12px; }

/* == 21 legacy class bridge ============================================= */
/* The pages and the shared scripts in src/web use terse class names. These
   rules map them onto the tokens above so every surface renders the same
   way: 1px hairlines, mono micro-labels, no shadows. */
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mb0 { margin-bottom: 0 !important; }
.mt2 { margin-top: 16px !important; }
.mt3 { margin-top: 24px !important; }
.tiny { font: 400 11px/1.5 var(--mono); letter-spacing: .04em; }
.block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #08110a; }
.btn-primary:hover { background: #dbffab; border-color: #dbffab; color: #08110a; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: #4a2a24; background: transparent; }
.btn-danger:hover { background: rgba(255, 157, 139, .08); border-color: var(--bad); color: var(--bad); }
.btn-sm { padding: 7px 11px; font-size: 10px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; flex: none; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.inline { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.inline:hover { color: #dbffab; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.link:hover { color: var(--accent); }
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hint { font: 400 11px/1.45 var(--mono); color: var(--muted); }
.ferr { display: none; font: 500 11px/1.45 var(--mono); color: var(--bad); }
[data-invalid] .ferr { display: block; }
[data-invalid] input, [data-invalid] textarea, [data-invalid] select { border-color: var(--bad); }
.tbl-search { position: relative; flex: 1 1 220px; max-width: 340px; }
.tbl-search input { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--fg); font-size: 13px; }
.tbl-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.copy-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: 7px 9px; font: 400 12px/1.5 var(--mono); overflow: hidden; }
.copy-row > span, .copy-row > code { white-space: nowrap; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.copy-row > button { flex: none; }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--accent); font: 500 12px/1.5 var(--mono); cursor: pointer; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.copy { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; }

header.site { display: flex; align-items: center; gap: 16px; padding: 18px clamp(16px, 3vw, 34px); border-bottom: 1px solid var(--line); }
header.site .mark { width: 30px; height: 30px; flex: none; }
header.site .brand { font-size: 22px; }
footer.site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 22px; padding: 26px clamp(16px, 3vw, 34px); border-top: 1px solid var(--line); font: 400 11px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
footer.site .fnav { display: flex; flex-wrap: wrap; gap: 14px; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }
.page { max-width: 1600px; margin: 0 auto; padding: 0; min-height: 100svh; display: flex; flex-direction: column; }
.page > main { flex: 1 1 auto; min-width: 0; }
.nav-scrim { position: fixed; inset: 0; background: rgba(3, 5, 4, .66); opacity: 0; pointer-events: none; transition: opacity .18s var(--ease); z-index: 44; }
.nav-scrim.open { opacity: 1; pointer-events: auto; }

.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(34px, 6vw, 72px) clamp(16px, 3vw, 34px); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero > div:first-child { position: relative; z-index: 2; }
.hero h1 { font-size: clamp(38px, 6vw, 72px); line-height: .98; letter-spacing: -2.5px; margin: 18px 0; }
.hero h1 span { color: var(--accent); }
.intro { color: var(--muted); font-size: clamp(14px, 1.4vw, 17px); line-height: 1.65; max-width: 54ch; }
.hero-art { position: relative; min-height: 380px; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--card); display: grid; place-items: center; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-art .diagram-static { width: 100%; max-width: 560px; height: auto; }
.no-webgl .hero-canvas { display: none; }
.fig { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: space-between; font: 400 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); opacity: .7; }
.diagram .flow { stroke-dasharray: 3 5; animation: dashflow 3.2s linear infinite; }
.diagram .flow.two { animation-delay: -.9s; }
.diagram .flow.three { animation-delay: -1.8s; }

.sec { padding: clamp(34px, 5.5vw, 64px) clamp(16px, 3vw, 34px); border-bottom: 1px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: clamp(18px, 2.4vw, 28px); }
.sec-head .n { font: 500 11px/1 var(--mono); color: var(--accent); letter-spacing: .14em; }
.sec-head h2 { font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -.7px; font-weight: 700; }
.sec-head p { color: var(--muted); font-size: 13px; max-width: 54ch; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.feature svg { width: 20px; height: 20px; color: var(--accent); }
.endpoint { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.step .n { display: block; font: 500 10px/1 var(--mono); color: var(--accent); letter-spacing: .14em; margin-bottom: 8px; }
.g2-1 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.g4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }

.appbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px clamp(16px, 3vw, 34px); border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.appnav { display: flex; flex-wrap: wrap; gap: 4px; }
.appnav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid transparent; border-radius: var(--r); color: var(--muted); font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.appnav a:hover { color: var(--fg); background: var(--card); border-color: var(--line); }
.appnav a[aria-current="page"] { color: var(--accent); background: var(--card); border-color: var(--line); }
.pageview { padding: clamp(18px, 2.6vw, 30px) clamp(16px, 3vw, 34px) 56px; min-height: 60vh; }
#pageHead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
#pageHead h1 { font-size: clamp(21px, 2.4vw, 28px); letter-spacing: -.6px; font-weight: 700; }
#pageHead p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 14px; font-weight: 600; }
.m-label { font: 500 9.5px/1.3 var(--mono); letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.m-value { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; letter-spacing: -.8px; margin-top: 7px; font-variant-numeric: tabular-nums; }
.m-sub { font: 400 10.5px/1.4 var(--mono); color: var(--muted); margin-top: 6px; }
.kv { display: grid; grid-template-columns: minmax(92px, auto) minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 12.5px; }
.kv dt { font: 500 9.5px/1.5 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.form-sheet { display: grid; gap: 14px; }
.inline-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.badge.ok { color: var(--ok); border-color: #33471f; background: rgba(204, 255, 139, .06); }
.badge.warn { color: var(--warn); border-color: #4a3c1c; background: rgba(255, 212, 121, .06); }
.badge.bad { color: var(--bad); border-color: #4a2a24; background: rgba(255, 157, 139, .06); }
.badge.info { color: var(--info); border-color: #24404f; background: rgba(154, 208, 255, .06); }
.badge.plain { border-color: transparent; padding-left: 0; background: none; }
.alert { display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); padding: 11px 13px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.55; }
.alert svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.alert.ok { border-color: #33471f; background: rgba(204, 255, 139, .05); }
.alert.warn { border-color: #4a3c1c; background: rgba(255, 212, 121, .05); }
.alert.bad { border-color: #4a2a24; background: rgba(255, 157, 139, .05); }
.alert strong { font-weight: 600; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 130px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font: 400 11px/1.3 var(--mono); }
.bar-row .track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 3px; background: var(--accent); opacity: .8; }
.bar-row .v { text-align: right; white-space: nowrap; }
.skel.line { height: 12px; border-radius: 3px; margin: 9px 0; background: linear-gradient(90deg, var(--line-soft), var(--line), var(--line-soft)); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.strength i { height: 3px; border-radius: 2px; background: var(--line); }
.strength i[style] { transition: width .2s var(--ease), background .2s var(--ease); }
.auth-view { padding: 20px; }
.auth-view.hide { display: none; }
.auth-view > .label { display: block; margin-bottom: 16px; }
.auth-view .field + .field { margin-top: 14px; }
.form-sheet .field { margin-bottom: 0; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select, textarea {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 11px; font: 400 14px/1.45 var(--font);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input::placeholder, textarea::placeholder { color: #65716a; }
.field > label, .field .label { display: block; }
.field input, .field select, .field textarea { margin-top: 2px; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.otp { display: flex; gap: 8px; }
.field .otp input { width: 42px; text-align: center; font: 600 18px/1 var(--mono); color: var(--accent); }
#verifyForm .otp input, #resetConfirm .otp input { width: 42px; padding: 8px 0; text-align: center; font: 600 18px/1 var(--mono); color: var(--accent); }

.doc-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); align-items: start; }
.doc-head { max-width: 1180px; margin: 0 auto; padding: 26px clamp(16px, 3vw, 32px) 0; }
.doc-side { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 90px); overflow-y: auto; padding: 26px 0; }
.doc-side .label { display: block; margin-bottom: 9px; }
.doc-side nav { display: grid; gap: 1px; border-left: 1px solid var(--line); }
.doc-side a { color: var(--muted); font-size: 12px; line-height: 1.45; padding: 5px 0 5px 11px; border-left: 1px solid transparent; margin-left: -1px; }
.doc-side a:hover, .doc-side a.on { color: var(--accent); border-left-color: var(--accent); }
.doc-side li.lvl3 a { padding-left: 22px; font-size: 11.5px; }
.doc-body { min-width: 0; padding: 30px 0 80px; }
.doc-body h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -1px; margin: 8px 0 14px; }
.doc-body h2 { font-size: clamp(17px, 2vw, 21px); margin: 40px 0 12px; padding-top: 16px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.doc-body h3 { font-size: 14px; font-weight: 600; margin: 24px 0 9px; scroll-margin-top: 80px; }
.doc-body p, .doc-body li { color: #cdd8cb; font-size: 13.5px; line-height: 1.75; }
.doc-body ul, .doc-body ol { padding-left: 22px; margin: 0 0 14px; }
.doc-body blockquote { border-left: 2px solid var(--accent); background: var(--card); padding: 10px 14px; margin: 0 0 14px; color: var(--muted); }
.doc-body table { width: 100%; margin: 0 0 18px; }
.doc-body :not(pre) > code { background: var(--card-strong); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; font-size: .92em; color: var(--accent); }
.doc-body pre { margin: 0 0 16px; padding: 16px; background: #060907; border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; font: 400 12.5px/1.7 var(--mono); color: #d8e4d4; white-space: pre; }
.code-wrap { position: relative; margin: 0 0 16px; }
.code-wrap pre { margin: 0; }
.code-wrap .copy { position: absolute; top: 7px; right: 7px; }

.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(3, 5, 4, .66); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s var(--ease); display: flex; padding: 20px; }
.overlay.show { opacity: 1; }
.overlay.center { align-items: center; justify-content: center; text-align: left; }
.overlay.right { justify-content: flex-end; padding: 0; }
.overlay .drawer, .overlay .modal { position: relative; top: auto; right: auto; bottom: auto; left: auto; transform: none; visibility: visible; background: var(--bg); border: 1px solid var(--line); max-height: min(88vh, 900px); display: flex; flex-direction: column; }
.overlay .drawer { width: min(520px, 100%); height: 100%; max-height: none; border-top: 0; border-right: 0; border-bottom: 0; border-radius: 0; }
.overlay .modal { width: min(560px, 100%); border-radius: var(--r-lg); opacity: 1; }
.overlay .modal.wide { width: min(760px, 100%); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-h h3 { font-size: 14px; font-weight: 600; }
.sheet-b { padding: 16px; overflow-y: auto; flex: 1; }
.sheet-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.modal .sheet-b { padding-top: 6px; }

.play-grid { display: grid; grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); gap: 12px; align-items: start; }
.play-side { position: sticky; top: 68px; display: grid; gap: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); padding: 14px; }
.chat { display: flex; flex-direction: column; min-height: min(72vh, 700px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 300px; max-height: 62vh; }
.msg { max-width: min(680px, 94%); }
.msg.user { align-self: flex-end; }
.msg .who { display: block; margin-bottom: 5px; font: 500 9.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.msg > div:last-child { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); padding: 11px 13px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.msg.user > div:last-child { background: var(--card-strong); border-color: #37472f; }
.msg > div:last-child pre { border: 1px solid var(--line); border-radius: var(--r); background: #060907; padding: 10px 12px; overflow-x: auto; margin: 9px 0; }
.msg > div:last-child :not(pre) > code { background: var(--card-strong); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; font-size: 11.5px; color: var(--accent); }
.chat-in { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: flex-end; background: var(--bg); }
.chat-in textarea { flex: 1; min-height: 44px; max-height: 180px; }

.chart { width: 100%; height: auto; display: block; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--accent); opacity: .82; }
.chart .bar.hi { opacity: 1; }
.chart .area { fill: rgba(204, 255, 139, .12); stroke: none; }
.chart .line { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.chart text { fill: var(--muted); font: 400 9px var(--mono); }

/* Responsive: the pages are laid out for 320px through 4K. */
.nav-toggle { display: none; }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 300px; }
  .g2-1, .g2 { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; max-height: none; padding-bottom: 0; }
  .play-grid { grid-template-columns: minmax(0, 1fr); }
  .play-side { position: static; }
}
@media (max-width: 480px) {
  header.site { flex-wrap: wrap; gap: 10px; padding-inline: 14px; }
  header.site .brand { font-size: 17px; gap: 8px; }
  header.site .mark { width: 24px; height: 24px; }
  header.site .nav-toggle { order: 2; margin-left: auto; }
  header.site .status-chip { order: 3; flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  header.site .nav { position: fixed; top: 0; right: 0; bottom: 0; width: min(80vw, 320px); margin: 0; padding: 70px 18px 18px; background: var(--bg); border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; gap: 4px; transform: translateX(100%); transition: transform .2s var(--ease); z-index: 45; }
  header.site .nav.open { transform: none; }
  header.site .nav a { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .table--cards thead { display: none; }
  .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: auto; }
  .table--cards tr { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 8px 10px; margin-bottom: 8px; }
  .table--cards td { border: 0; padding: 4px 0; text-align: right; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: 12px; }
  .table--cards td::before { content: attr(data-label); text-align: left; font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .table--cards td:first-child { border-bottom: 1px solid var(--line-soft); padding-bottom: 7px; margin-bottom: 5px; }
  .table--cards td:first-child::before { display: none; }
  .inline-fields, .form-grid, .inline-fields .field { grid-template-columns: minmax(0, 1fr); }
  .play-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 12px; }
  .play-side .field:first-child, .play-side .hint, .play-side p { grid-column: 1 / -1; }
  .play-grid .chat { min-height: 0; }
  .play-grid .chat-log { min-height: 150px; max-height: 46vh; }
}

/* == 22 docs v2 / auth story ============================================= */
.docs-main { padding: 0; }
.doc-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr) 200px; gap: clamp(24px, 3vw, 44px); max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 34px); align-items: start; }
.doc-side { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; padding: 32px 0 40px; display: flex; flex-direction: column; gap: 22px; }
.docs-home { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-decoration: none; color: var(--fg); font-size: 13px; font-weight: 600; letter-spacing: -.2px; }
.docs-home .badge { font-size: 8.5px; padding: 3px 6px; }
.docs-search { position: relative; display: block; margin: 0; }
.docs-search input { width: 100%; padding: 9px 34px 9px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); color: var(--fg); font-size: 12px; }
.docs-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.docs-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--muted); font: 500 9px/1 var(--mono); padding: 3px 5px; pointer-events: none; }
.docs-results { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 5px; max-height: 46vh; overflow-y: auto; }
.docs-results a { display: flex; align-items: baseline; gap: 8px; padding: 7px 8px; border-radius: 4px; text-decoration: none; color: var(--fg); font-size: 12px; line-height: 1.35; }
.docs-results a:hover { background: var(--card-strong); }
.docs-results .tag { font: 500 8.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px; flex: none; }
.docs-results .none { padding: 8px; font-size: 11px; color: var(--muted); }
.docs-menu { border-top: 1px solid var(--line); padding-top: 16px; }
.docs-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font: 500 9.5px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.docs-menu summary::-webkit-details-marker { display: none; }
.docs-menu summary::after { content: '−'; color: var(--muted); font-size: 14px; line-height: 1; }
.docs-menu:not([open]) summary::after { content: '+'; }
.docs-menu nav { display: grid; gap: 1px; border-left: 1px solid var(--line); }
.docs-menu a { display: flex; align-items: baseline; gap: 8px; color: var(--muted); text-decoration: none; font-size: 12px; line-height: 1.4; padding: 6px 0 6px 12px; border-left: 1px solid transparent; margin-left: -1px; }
.docs-menu a:hover { color: var(--fg); }
.docs-menu a.on { color: var(--accent); border-left-color: var(--accent); }
.docs-menu a .num { font: 400 9px/1 var(--mono); color: var(--muted); flex: none; }
.docs-resources { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 3px; }
.docs-resources .label { margin-bottom: 5px; }
.docs-resources a { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); text-decoration: none; font-size: 11.5px; padding: 4px 0; }
.docs-resources a:hover { color: var(--accent); }
.docs-resources a span { color: var(--line-strong); }
.doc-content { min-width: 0; padding: 38px 0 80px; }
.doc-intro { border-bottom: 1px solid var(--line); padding-bottom: clamp(24px, 3vw, 38px); }
.doc-intro .eyebrow { display: block; font: 500 10px/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.doc-intro h1 { font-size: clamp(34px, 4.8vw, 56px); line-height: .98; letter-spacing: -2.2px; margin: 14px 0 16px; font-weight: 700; }
.doc-lead { color: var(--muted); font-size: clamp(14px, 1.35vw, 16px); line-height: 1.6; max-width: 58ch; margin: 0; }
.docs-start { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 24px 0 16px; }
.docs-start-card { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); padding: 14px 16px; text-decoration: none; color: var(--fg); transition: border-color .18s var(--ease), background .18s var(--ease); }
.docs-start-card:hover { border-color: var(--line-strong); background: var(--card-strong); }
.docs-start-card .label { font: 500 9px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.docs-start-card strong { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.docs-start-card strong span { color: var(--muted); font-weight: 400; }
.docs-start-card > span:last-child { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.docs-base { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: 8px 8px 8px 12px; }
.docs-base .label { flex: none; }
.docs-main .docs-base code { flex: 1 1 220px; min-width: 0; font: 400 11.5px/1.5 var(--mono); color: var(--fg); overflow-x: auto; white-space: nowrap; scrollbar-width: thin; background: transparent; border: 0; padding: 0; }
.docs-base .btn { flex: none; }
.doc-body { padding: 4px 0 70px; }
.doc-body > h1:first-child { display: none; }
.doc-body h2, .doc-body h3 { scroll-margin-top: 92px; }
.doc-body table { display: block; overflow-x: auto; }
.doc-body table thead, .doc-body table tbody { width: 100%; }
.doc-body table th:first-child, .doc-body table td:first-child { white-space: nowrap; }
.doc-outline { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; padding: 38px 0; }
.doc-outline .label { display: block; margin-bottom: 9px; }
.doc-outline nav { border-left: 1px solid var(--line); display: grid; gap: 1px; }
.doc-outline a { display: block; color: var(--muted); text-decoration: none; font: 400 10.5px/1.5 var(--mono); padding: 4px 0 4px 12px; border-left: 1px solid transparent; margin-left: -1px; }
.doc-outline a.lvl3 { padding-left: 23px; font-size: 10px; }
.doc-outline a:hover { color: var(--fg); }
.doc-outline a.on { color: var(--accent); border-left-color: var(--accent); }
.docs-raw { display: block; margin-top: 16px; font: 400 10px/1.4 var(--mono); color: var(--muted); text-decoration: none; }
.docs-raw:hover { color: var(--accent); }
.docs-back { display: inline-flex; margin-top: 26px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.docs-back:hover { color: var(--accent); }

.auth-main { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .78fr); gap: clamp(32px, 5vw, 90px); align-items: center; max-width: 1280px; width: 100%; margin: 0 auto; min-height: calc(100svh - 73px); padding: clamp(28px, 4.5vw, 60px) clamp(16px, 4vw, 40px); }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 20px 0; min-width: 0; }
.auth-story::before { content: ""; position: absolute; inset: -20% -10% -20% -18%; background: radial-gradient(60% 60% at 35% 40%, rgba(204, 255, 139, .07), transparent 70%); pointer-events: none; }
.auth-story .eyebrow { display: block; position: relative; font: 500 10px/1.4 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.auth-story h2 { position: relative; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.02; letter-spacing: -2px; font-weight: 700; }
.auth-story > p:not(.eyebrow) { position: relative; color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 44ch; margin: 0; }
.auth-benefits { position: relative; display: grid; gap: 14px; max-width: 440px; margin: 8px 0 2px; }
.auth-benefits > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 12px; align-items: start; }
.auth-benefits span { grid-row: span 2; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; font: 500 9px/1 var(--mono); color: var(--accent); }
.auth-benefits strong { font-size: 13px; font-weight: 600; }
.auth-benefits p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.auth-story .inline { position: relative; align-self: flex-start; font-size: 12px; }
.auth-form-wrap { justify-self: end; align-self: center; width: 100%; max-width: 460px; min-width: 0; }
.auth-form-wrap > .eyebrow { color: var(--muted); }
.auth-form-wrap > h1 { margin-top: 8px; }

@media (max-width: 1100px) {
  .doc-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .doc-outline { display: none; }
}
@media (max-width: 980px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; max-height: none; padding: 22px 0 0; }
  .doc-content { padding-top: 24px; }
  .docs-start { grid-template-columns: 1fr; }
  .auth-main { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .auth-story { display: none; }
  .auth-form-wrap { justify-self: center; }
}
@media (max-width: 720px) {
  .doc-content { padding-top: 18px; }
  .doc-intro h1 { font-size: clamp(30px, 9vw, 40px); }
  .docs-start { margin: 18px 0 14px; }
  .docs-base { align-items: flex-start; }
  .docs-main .docs-base code { flex-basis: 100%; order: 2; }
  .docs-base .btn { margin-left: auto; }
  .doc-body table { font-size: 12px; }
  .docs-resources { display: none; }
  .auth-main { padding-top: 22px; padding-bottom: 34px; }
  .auth-form-wrap { max-width: none; }
}

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

/* Print: the console and the marketing page both stay legible. */
@media print {
  body { background: #fff; color: #000; }
  body::before, .nav-toggle, .toasts, .overlay, .nav-scrim { display: none !important; }
  .card, .metric, .table-wrap, .panel, .feature { border-color: #999; background: #fff; }
  a { color: #000; }
}







