/* ============================================================================
   StartupAPI — "Obsidian" design system
   One token-driven stylesheet shared by the customer portal (/) and the
   superadmin console (/console). Subject: a precision metering instrument for
   resold API capacity. The signature is the meter itself.
   ========================================================================== */

/* ---------- Fonts (self-hosted, no external CDN) ---------- */
@font-face { font-family: "Geist"; src: url("/fonts/geist-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/geist-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --bg:        #08090B;
  --bg-2:      #0B0D11;
  --surface:   #101216;
  --surface-2: #15181E;
  --surface-3: #1A1E25;
  --line:      #1E2127;
  --line-2:    #282C34;

  --ink:       #EDEEF0;
  --ink-dim:   #9AA0AA;
  --ink-faint: #686E78;

  /* Emerald-teal signature (matches the premium reference dashboard). */
  --accent:        #2DD4BF;
  --accent-dim:    #14B8A6;
  --accent-deep:   #06231F;
  --accent-glow:   rgba(45, 212, 191, 0.22);
  --on-accent:     #04231E;

  --ok:     #46D39A;
  --ok-bg:  rgba(70, 211, 154, 0.12);
  --warn:   #F5B544;
  --warn-bg:rgba(245, 181, 68, 0.12);
  --tip:    #A78BFA;
  --tip-bg: rgba(167, 139, 250, 0.12);
  --danger: #F2645A;
  --danger-bg: rgba(242, 100, 90, 0.12);

  --display: "Geist", system-ui, -apple-system, sans-serif;
  --sans:    "Geist", system-ui, -apple-system, sans-serif;
  --mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow:    0 12px 32px -14px rgba(0, 0, 0, 0.75);
  --shadow-lg: 0 40px 90px -28px rgba(0, 0, 0, 0.85);
  --hairline:  inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --ease: cubic-bezier(0.22, 0.7, 0.25, 1);
  --sidebar-w: 252px;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* instrument-panel atmosphere: faint engraved grid + one cool pool of light */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 540px at 78% -8%, rgba(45,212,191, 0.05), transparent 60%),
    radial-gradient(800px 600px at -6% 108%, rgba(80, 120, 200, 0.04), transparent 55%),
    linear-gradient(transparent 0, transparent calc(100% - 1px), rgba(255,255,255,0.015) 100%),
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255,255,255,0.015) 100%);
  background-size: 100% 100%, 100% 100%, 100% 44px, 44px 100%;
}
::selection { background: var(--accent); color: var(--on-accent); }
a { color: inherit; text-decoration: none; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.num  { font-variant-numeric: tabular-nums; }
.key-cell { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.key-cell .muted { color: var(--ink-dim); font-size: 0.82em; }

/* keyboard focus, everywhere */
:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Icons ---------- */
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -3px; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 10px 15px; font-family: inherit; font-size: 14px; font-weight: 500;
  letter-spacing: -0.01em; cursor: pointer; white-space: nowrap;
  transition: transform 0.08s var(--ease), background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn .ico { width: 16px; height: 16px; vertical-align: middle; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: var(--on-accent);
  border-color: transparent; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(45,212,191,0.14), 0 8px 24px -12px var(--accent-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, #3fe3cd, #17c3af); box-shadow: 0 0 0 1px rgba(45,212,191,0.28), 0 12px 30px -10px var(--accent-glow); }
.btn-outline { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); box-shadow: var(--hairline); }
.btn-outline:hover { border-color: var(--ink-faint); background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--ink-dim); }
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- Inputs ---------- */
.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); color: var(--ink); padding: 11px 13px;
  font-family: inherit; font-size: 14px; letter-spacing: -0.01em;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.input:hover { border-color: var(--ink-faint); }
.input:focus { outline: none; border-color: var(--accent); background: var(--bg); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--ink-faint); }
.input.mono { font-family: var(--mono); }
.field { display: grid; gap: 7px; }
.field-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 11px; user-select: none; }
.wordmark .mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-2); box-shadow: var(--hairline);
  position: relative;
}
.wordmark .mark::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent), 0 0 0 3px var(--accent-glow);
  animation: live 2.6s var(--ease) infinite;
}
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.wordmark .name { font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.02em; }
.wordmark .name .tick { color: var(--accent); }
.wordmark.lg .mark { width: 38px; height: 38px; border-radius: 10px; }
.wordmark.lg .mark::after { width: 11px; height: 11px; }
.wordmark.lg .name { font-size: 19px; }

/* ---------- Auth ---------- */
.auth { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 392px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 34px 32px; box-shadow: var(--shadow-lg), var(--hairline);
}
.auth-sub { color: var(--ink-dim); margin: 20px 0 22px; font-size: 14px; }
.auth-links { margin: 16px 0 0; text-align: center; font-size: 14px; }
.auth-links a { color: var(--accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-tabs {
  display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1; background: transparent; border: none; color: var(--ink-dim);
  padding: 9px; border-radius: 7px; font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: color 0.16s, background 0.16s;
}
.auth-tabs button:hover { color: var(--ink); }
.auth-tabs button.is-active { background: var(--surface-3); color: var(--ink); box-shadow: var(--hairline); }
.form { display: grid; gap: 16px; }
.form-hint { color: var(--ink-dim); font-size: 12.5px; margin: -4px 0 0; }
.form-error { margin: 14px 0 0; color: var(--danger); font-size: 13px; }
.auth-foot { margin: 22px 0 0; color: var(--ink-faint); font-size: 12px; letter-spacing: 0.04em; }

/* ============================================================================
   APP SHELL  — shared by both portals
   ========================================================================== */
.shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: grid; grid-template-rows: auto 1fr auto;
  gap: 20px; padding: 22px 16px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,18,22,0.6), rgba(8,9,11,0.6));
  backdrop-filter: blur(10px);
}
.sidebar-brand { padding: 6px 8px 2px; }
.nav { display: grid; align-content: start; gap: 3px; }
.nav-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); padding: 8px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; color: var(--ink-dim);
  font-family: inherit; font-size: 14px; font-weight: 500; padding: 9px 11px; border-radius: 9px; cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.nav-item .ico { color: var(--ink-faint); transition: color 0.15s; }
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item:hover .ico { color: var(--ink-dim); }
.nav-item.is-active { color: var(--ink); background: var(--surface-2); border-color: var(--line-2); box-shadow: var(--hairline); }
.nav-item.is-active .ico { color: var(--accent); }

.sidebar-foot { display: grid; gap: 10px; }
.acct {
  display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface);
}
.acct-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.acct-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--accent-deep); color: var(--accent); font-family: var(--mono); font-size: 13px; font-weight: 600; text-transform: uppercase;
}
.acct-meta { min-width: 0; display: grid; }
.acct-label { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase; }
.acct-email { font-size: 12.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; max-width: 1200px; width: 100%; margin: 0 auto; padding: 30px 36px 90px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
.page-title { font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: -0.02em; margin: 9px 0 0; }
.page-note { color: var(--ink-dim); font-size: 14px; margin: 7px 0 0; max-width: 60ch; }
.page-note code, .table-foot code { font-family: var(--mono); color: var(--ink); font-size: 0.92em; }

.view { animation: rise 0.4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 22px; }

/* status dot in sidebar / headers */
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ok); }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 9px var(--ok); }
.status-dot.is-down { color: var(--danger); }
.status-dot.is-down i { background: var(--danger); box-shadow: 0 0 9px var(--danger); }

/* ============================================================================
   SIGNATURE — the meter
   ========================================================================== */
.instrument {
  position: relative; border-radius: var(--r-lg); padding: 24px 26px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(45,212,191,0.06), transparent 55%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2); box-shadow: var(--shadow), var(--hairline);
  overflow: hidden;
}
.instrument::after { /* faint scanline texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0,0,0,0.06) 3px 4px);
}
.instrument > * { position: relative; }
.inst-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); }
.inst-readout { font-family: var(--mono); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.inst-readout.xl { font-size: 46px; }
.inst-readout.lg { font-size: 30px; }
.inst-readout.is-zero { color: var(--danger); }

.meter {
  position: relative; height: 16px; border-radius: var(--r-pill);
  background: var(--bg); border: 1px solid var(--line-2);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6); overflow: hidden; display: flex;
}
.meter.tall { height: 22px; }
.meter-fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 18px var(--accent-glow); position: relative;
  transition: width 0.9s var(--ease);
}
.meter-fill.is-low  { background: linear-gradient(90deg, #c9921f, var(--warn)); box-shadow: 0 0 16px var(--warn-bg); }
.meter-fill.is-empty{ background: linear-gradient(90deg, #b23a33, var(--danger)); box-shadow: none; }
/* two-segment (admin: cost vs margin) */
.meter-seg { height: 100%; transition: width 0.9s var(--ease); }
.meter-seg.cost   { background: linear-gradient(180deg, #f0b54a, #c98a1e); }
.meter-seg.margin { background: linear-gradient(180deg, var(--accent), var(--accent-dim)); box-shadow: 0 0 18px var(--accent-glow); }
.meter-ticks {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(8,9,11,0.7) calc(10% - 1px) 10%);
}
.meter-foot { margin-top: 12px; color: var(--ink-dim); font-size: 12px; font-family: var(--mono); letter-spacing: 0.02em; }

.meter-legend { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.leg { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-dim); }
.leg i { width: 10px; height: 10px; border-radius: 3px; }
.leg i.cost { background: var(--warn); }
.leg i.margin { background: var(--accent); }
.leg-total { margin-left: auto; font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--ink); }

.inst-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; }
.inst-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.live-stamp { margin-left: 8px; color: var(--ink-faint); font-family: var(--mono); font-size: 11px; letter-spacing: 0; text-transform: none; }
.inst-facts { display: flex; gap: 28px; }
.inst-fact { display: grid; gap: 5px; }
.inst-fact .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.inst-fact .v { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.inst-fact .v.ok { color: var(--ok); }
@media (max-width: 720px) { .inst-grid { grid-template-columns: 1fr; gap: 20px; } .inst-facts { flex-wrap: wrap; gap: 16px 28px; } }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; box-shadow: var(--hairline);
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3, .card h3 { font-family: var(--display); font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.card-head .note, .note { color: var(--ink-dim); font-size: 13px; margin: 4px 0 0; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 17px 18px; display: grid; gap: 9px; box-shadow: var(--hairline);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-dim); border: 1px solid var(--line-2); }
.stat-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); }
.stat-value { font-family: var(--mono); font-size: 25px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--ink-faint); }
.stat.is-accent { border-color: rgba(45,212,191,0.3); background: linear-gradient(180deg, rgba(45,212,191,0.07), var(--surface)); }
.stat.is-accent .stat-value { color: var(--accent); }
.stat.is-accent .stat-ico { color: var(--accent); background: var(--accent-deep); border-color: rgba(45,212,191,0.25); }

/* ---------- Layout grids ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr); gap: 14px; }
.grid-equal { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: grid; gap: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--hairline); }
.table-wrap.bare { background: transparent; border-color: var(--line); }
.usage-table-wrap { max-height: min(430px, 52vh); overflow: auto; }
.usage-table-wrap .table thead th { position: sticky; top: 0; z-index: 1; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; padding: 13px 18px; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; transition: background 0.12s; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table .num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.table-foot { padding: 12px 18px; color: var(--ink-faint); font-size: 12px; border-top: 1px solid var(--line); background: var(--bg-2); }
.cell-main { display: flex; flex-direction: column; gap: 2px; }
.cell-main b { font-weight: 600; }
.cell-sub { color: var(--ink-faint); font-size: 12px; font-family: var(--mono); }

/* ---------- Empty / skeleton ---------- */
.empty { padding: 40px 18px; color: var(--ink-dim); text-align: center; font-size: 14px; display: grid; gap: 10px; justify-items: center; }
.empty .ico { width: 26px; height: 26px; color: var(--ink-faint); }
.empty.compact { padding: 22px 14px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 12px; margin: 9px 0; }
.sk-row { height: 44px; margin: 0; border-radius: 0; border-bottom: 1px solid var(--line); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: var(--r-pill); letter-spacing: 0.02em; }
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-ok   { background: var(--ok-bg);     color: var(--ok); }
.pill-off  { background: var(--danger-bg); color: var(--danger); }
.pill-warn { background: var(--warn-bg);   color: var(--warn); }
.pill-mute { background: var(--surface-3); color: var(--ink-dim); }

/* ---------- Segmented control ---------- */
.seg { display: inline-flex; gap: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-dim); border-radius: 6px; padding: 7px 11px; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: color 0.15s, background 0.15s; }
.seg button:hover { color: var(--ink); }
.seg button.is-active { background: var(--surface-3); color: var(--ink); box-shadow: var(--hairline); }
.seg-count { display: inline-block; margin-left: 5px; padding: 0 6px; border-radius: 999px; background: var(--bg-2); color: var(--ink-dim); font-size: 11px; font-weight: 600; line-height: 17px; vertical-align: middle; }
.seg button.is-active .seg-count { background: var(--surface-2, var(--bg-2)); color: var(--ink); }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pager-info { color: var(--ink-dim); font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.row-form { display: flex; gap: 10px; }
.row-form .input { flex: 1; min-width: 200px; }
.spacer { flex: 1; }

/* ---------- Redeem code form ---------- */
.redeem-card { max-width: 520px; margin: 0 auto; }
.redeem-form {
  display: flex; flex-direction: column; align-items: stretch;
  gap: 12px; margin-top: 16px;
}
.redeem-label {
  font-size: 13px; font-weight: 500; color: var(--ink-dim);
  letter-spacing: -0.01em; text-align: center;
}
.redeem-input {
  text-align: center; font-size: 16px; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 14px 16px;
}
.redeem-input.is-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.redeem-input.is-success { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.redeem-btn { width: 100%; }
.redeem-feedback {
  margin: 4px auto 0; text-align: center; font-size: 13px; font-weight: 500;
  color: var(--ink-dim); letter-spacing: -0.01em;
}
.redeem-feedback.is-error { color: var(--danger); }
.redeem-feedback.is-success { color: var(--accent); }

/* ---------- Redeem confirmation modal ---------- */
.redeem-confirm-card { max-width: 420px; text-align: center; }
.redeem-confirm-card .modal-head { text-align: left; }
/* THE HERO: the amount about to be credited, large and obvious. */
.rc-amount {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 1px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  color: var(--ink); margin: 10px auto 6px; white-space: nowrap;
  text-shadow: 0 0 34px var(--accent-glow);
}
.rc-amount .rc-cur { color: var(--ink-dim); font-size: 0.5em; font-weight: 600; }
.rc-breakdown {
  display: grid; gap: 2px; margin: 14px 0 4px; padding: 12px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  text-align: left;
}
.rc-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.rc-row dt { color: var(--ink-dim); font-size: 13px; margin: 0; }
.rc-row dd { margin: 0; font-size: 14px; color: var(--ink); }
.rc-row-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.rc-row-total dt { color: var(--ink); font-weight: 600; }
.rc-row-total dd { color: var(--accent); font-weight: 600; }
.redeem-confirm-card .modal-actions { margin-top: 6px; }
@media (max-width: 480px) {
  .rc-amount { font-size: 42px; }
  .redeem-confirm-card .modal-actions { flex-direction: column-reverse; }
  .redeem-confirm-card .modal-actions .btn { width: 100%; }
}

/* ---------- Balance gauge (compact, in tables) ---------- */
.gauge { height: 6px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-pill); overflow: hidden; }
.gauge > i { display: block; height: 100%; background: var(--ok); transition: width 0.6s var(--ease); }
.gauge > i.is-low { background: var(--warn); }
.gauge > i.is-empty { background: var(--danger); }
.balance-cell { min-width: 150px; display: grid; gap: 6px; }
.balance-amt { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.balance-amt.is-zero { color: var(--danger); }

/* ---------- Recent / mini list ---------- */
.mini-list { display: grid; gap: 8px; }
.mini-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); padding: 11px 13px;
}
.mini-item .m-l { display: grid; gap: 2px; min-width: 0; }
.mini-item b { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item span { color: var(--ink-faint); font-size: 12px; }
.mini-item strong { font-family: var(--mono); font-size: 13px; }

/* ---------- Endpoint / code ---------- */
.endpoint { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--r-sm); padding: 11px 13px; margin-bottom: 12px; }
.endpoint .e-k { color: var(--ink-dim); font-size: 13px; }
.endpoint code { color: var(--accent); font-family: var(--mono); font-size: 13px; word-break: break-all; }
.codeblock { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 15px 16px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-dim); overflow-x: auto; white-space: pre; line-height: 1.75; }
.codeblock .tok-cmd { color: var(--accent); }
.codeblock .tok-var { color: var(--ink); }

/* ---------- Banner ---------- */
.banner { display: flex; align-items: center; gap: 11px; border: 1px solid rgba(245,181,68,0.35); background: var(--warn-bg); color: var(--warn); border-radius: var(--r-sm); padding: 12px 15px; font-size: 13.5px; margin-bottom: 16px; }
.banner .ico { flex: none; }

/* ---------- Key cards ---------- */
.keys { display: grid; gap: 10px; }
.key-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); padding: 16px; display: grid; gap: 14px; }
.key-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.key-card .k-prefix { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
.key-card h3 { margin: 4px 0 0; font-size: 15px; }
.key-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key-stats span { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; display: grid; gap: 3px; background: var(--surface); }
.key-stats b { font-family: var(--mono); font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-stats small { color: var(--ink-faint); font-size: 11px; }
.key-policy code { display: block; color: var(--ink-dim); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.key-card-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- Pricing cards ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 16px; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 14px; box-shadow: var(--hairline); }
.price-card .p-name { font-family: var(--mono); font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-card .p-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-card .p-rows span { display: grid; gap: 3px; }
.price-card .p-rows b { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.price-card .p-rows small { color: var(--ink-faint); font-size: 11px; }

/* ---------- SVG chart ---------- */
.chart { width: 100%; height: 190px; display: block; }
.chart .area { fill: url(#meter-grad); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot { fill: var(--accent); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .glabel { fill: var(--ink-faint); font-family: var(--mono); font-size: 9px; }
.chart-empty { height: 190px; display: grid; place-items: center; color: var(--ink-faint); font-size: 13px; }

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(4,5,7,0.66); backdrop-filter: blur(3px); animation: fade 0.2s ease; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 95vw); background: var(--surface); border-left: 1px solid var(--line-2); padding: 26px 28px 48px; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideIn 0.32s var(--ease); }
@keyframes slideIn { from { transform: translateX(46px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.drawer-balance { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; margin-bottom: 18px; }
.drawer-balance .balance-big { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.billing-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; color: var(--ink-faint); font-size: 12px; }
.billing-mini b { display: block; margin-top: 2px; color: var(--ink); font-family: var(--mono); font-weight: 600; }
.drawer-title { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 7px 0 0; word-break: break-all; letter-spacing: -0.01em; }
.drawer-section { margin-bottom: 26px; }
.drawer-section h3 { font-family: var(--display); font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.drawer-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drawer-section-head h3 { margin: 0; }
.topup { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 9px; margin-bottom: 26px; }
.stacked-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.keyrow { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; }
.keyrow .kp { font-family: var(--mono); font-size: 13px; }
.keyrow .kn { color: var(--ink-faint); font-size: 12px; }
.keyrow .ks { margin-left: auto; }
.audit-list { display: grid; gap: 8px; }
.audit-item { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; display: grid; gap: 3px; }
.audit-item b { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.audit-item span { color: var(--ink-faint); font-size: 12px; word-break: break-word; }
.small-code { margin-top: 10px; white-space: pre-wrap; word-break: break-all; }

/* ---------- Request transcripts ---------- */
.transcript-filter-grid { display: grid; grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(150px, 0.8fr)) repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.transcript-filter-actions { display: flex; gap: 8px; grid-column: 1 / -1; }
.transcript-customer-picker { position: relative; }
.transcript-customer-results { position: absolute; z-index: 12; top: calc(100% + 6px); left: 0; right: 0; max-height: 240px; overflow-y: auto; padding: 5px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.transcript-customer-results button { display: block; width: 100%; border: 0; border-radius: 6px; padding: 10px 11px; background: transparent; color: var(--ink); font: 13px var(--sans); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.transcript-customer-results button:hover, .transcript-customer-results button:focus-visible { background: var(--surface-3); }
.transcript-table { min-width: 980px; }
.logs-subhead { margin: 26px 0 10px; font-size: 15px; font-weight: 600; }
.modal .transcript-modal-card { max-width: min(1100px, 96vw); width: 100%; height: min(820px, 92vh); padding: 24px; grid-template-rows: auto auto minmax(0, 1fr); gap: 14px; }
.transcript-modal-head, .transcript-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.transcript-controls { align-items: center; }
.transcript-controls .doc-tabs { flex: 1; }
.transcript-content { min-height: 0; margin: 0; padding: 20px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #07090d; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); font: 13px/1.65 var(--mono); letter-spacing: 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(4,5,7,0.74); backdrop-filter: blur(3px); animation: fade 0.2s ease; }
.modal-card { position: relative; width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow-lg), var(--hairline); display: grid; gap: 9px; animation: pop 0.26s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-title { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 7px 0 0; letter-spacing: -0.01em; }
.modal-sub { color: var(--ink-dim); font-size: 13px; margin: 0 0 6px; }
.modal-form { gap: 14px; }
.modal-fields { display: grid; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.modal-danger .modal-card, .modal-card.is-danger { border-color: rgba(242,100,90,0.45); }
.modal-card.is-danger .modal-title { color: var(--danger); }
.key-reveal { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid rgba(45,212,191,0.4); border-radius: var(--r-sm); padding: 12px 14px; margin: 4px 0 8px; box-shadow: 0 0 0 3px var(--accent-glow); }
.key-reveal code { flex: 1; font-family: var(--mono); font-size: 13px; color: var(--accent); word-break: break-all; }
.use-key-reveal { align-items: center; justify-content: space-between; margin: 0; }
.use-key-reveal > div { min-width: 0; display: grid; gap: 5px; }
.use-key-reveal code { display: block; max-width: 100%; }
.use-key-card { max-width: min(960px, 96vw); max-height: min(860px, 92vh); overflow: auto; gap: 16px; padding: 30px 36px 34px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-faint); font-size: 32px; line-height: 1; cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.doc-tabs { display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.doc-tabs button { position: relative; appearance: none; border: 0; background: transparent; color: var(--ink-dim); font: 600 15px var(--sans); padding: 12px 2px 13px; cursor: pointer; white-space: nowrap; }
.doc-tabs button:hover { color: var(--ink); }
.doc-tabs button.is-active { color: var(--accent); }
.doc-tabs button.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: var(--r-pill); }
.doc-tabs-sub { gap: 24px; }
.use-key-input { margin-top: -4px; }
.snippet-stack { display: grid; gap: 16px; }
.snippet-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.snippet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); color: var(--ink-dim); font-family: var(--mono); font-size: 13px; }
.snippet-hint { color: var(--ink-faint); font-weight: 400; font-size: 0.85em; }
.snippet-card pre { margin: 0; padding: 22px 24px; overflow-x: auto; background: #070B15; }
.snippet-card code { font-family: var(--mono); font-size: 14px; line-height: 1.7; color: var(--ink); white-space: pre; letter-spacing: 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: max-content; max-width: 92vw; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-left: 3px solid var(--ok); border-radius: var(--r-sm); padding: 11px 16px; font-size: 14px; box-shadow: var(--shadow); animation: toastin 0.24s var(--ease) both; }
.toast.err { border-left-color: var(--danger); }
.toast .ico { width: 16px; color: var(--ok); }
.toast.err .ico { color: var(--danger); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

[hidden] { display: none !important; }

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .shell { display: block; }
  .sidebar {
    position: sticky; top: 0; height: auto; z-index: 20;
    grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 10px 14px;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px;
  }
  .sidebar-brand { grid-column: 1; grid-row: 1; padding: 0; }
  .sidebar-foot { grid-column: 2; grid-row: 1; justify-self: end; }
  .nav { grid-column: 1 / -1; grid-row: 2; grid-auto-flow: column; justify-content: start; overflow-x: auto; gap: 2px; }
  .nav-item { white-space: nowrap; padding: 8px 12px; }
  .nav-item .ico { display: none; }
  .nav-label { display: none; }
  .acct { padding: 6px 10px; }
  .acct-label, .acct-email { display: none; }
  .main { padding: 22px 18px 70px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-equal { grid-template-columns: 1fr; }
  .table-wrap { overflow-x: auto; }
  .table { min-width: 560px; }
  .transcript-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .page-title { font-size: 25px; }
  .stats { grid-template-columns: 1fr; }
  .inst-readout.xl { font-size: 38px; }
  .key-stats { grid-template-columns: 1fr; }
  .topup { grid-template-columns: 1fr; }
  .row-form { flex-direction: column; }
  .leg-total { margin-left: 0; }
  .transcript-filter-grid { grid-template-columns: 1fr; }
  .transcript-filter-actions { flex-direction: column; }
  .transcript-controls { align-items: stretch; flex-direction: column; }
  .transcript-modal-card { height: 96vh; padding: 16px; }
}

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

/* ============================================================================
   ANALYTICS DASHBOARD  (additive — reuses Obsidian tokens)
   ========================================================================== */

/* ---- Top bar ---- */
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.topbar-titles .page-title { margin: 0; }
.topbar-sub { color: var(--ink-dim); font-size: 13.5px; margin: 6px 0 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-dim); font-size: 13.5px; background: transparent; border: none; cursor: pointer; padding: 6px 4px; }
.topbar-link:hover { color: var(--ink); }
.balance-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(70,211,154,0.28); border-radius: var(--r-pill); padding: 6px 13px; font-size: 13px; font-weight: 600; }
.acct-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 12px 4px 4px; }
.acct-avatar.sm { width: 26px; height: 26px; font-size: 11px; border-radius: 7px; }
.acct-chip-name { font-size: 13px; color: var(--ink-dim); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Panels ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--hairline); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-title { font-family: var(--display); font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.panel-note { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.04em; }
.poll-status { color: var(--ink-faint); font-size: 12px; white-space: nowrap; }

/* ---- Main stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--hairline);
  transition: border-color 0.16s, transform 0.08s var(--ease);
}
.stat-card:hover { border-color: var(--line-2); }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--card-accent, var(--accent)); opacity: 0.9; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.stat-label { font-size: 12.5px; color: var(--ink-dim); }
.stat-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--card-accent, var(--accent)); background: color-mix(in srgb, var(--card-accent, var(--accent)) 14%, transparent); }
.stat-ico .ico { width: 18px; height: 18px; }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.stat-sub { margin-top: 6px; font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }

/* ---- Billing meter cards ---- */
.meter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.meter-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 8px; }
.meter-card-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.meter-card-value { font-size: 19px; font-weight: 600; }
.meter.mini { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; position: relative; }
.meter.mini .meter-fill { height: 100%; border-radius: var(--r-pill); transition: width 0.9s var(--ease); }

/* ---- Per-platform breakdown ---- */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.provider-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.provider-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.provider-name { font-family: var(--display); font-size: 15px; font-weight: 600; }
.provider-total { font-size: 15px; font-weight: 600; color: var(--accent); }
.provider-rows { display: grid; gap: 7px; }
.prow { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-dim); }
.prow .mono { color: var(--ink); }

/* ---- Filters ---- */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 20px; margin-top: 22px; box-shadow: var(--hairline); }
.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-group label { font-size: 13px; color: var(--ink-dim); }
.select { appearance: none; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 30px 8px 12px; font-family: inherit; font-size: 13.5px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA0AA' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
.select:hover { border-color: var(--ink-faint); }

/* ---- Charts ---- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.chart-frame { min-height: 210px; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-dim); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; flex: none; }
.donut-total { fill: var(--ink); font-family: var(--mono); font-size: 22px; font-weight: 600; }
.donut-cap { fill: var(--ink-faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; }
.donut-legend { display: grid; gap: 8px; flex: 1; min-width: 160px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-name { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.legend-val { color: var(--ink); }

/* ---- Sidebar tools (theme / collapse) ---- */
.sidebar-tools { display: grid; gap: 3px; }
.nav-tool { color: var(--ink-dim); }
.nav-tool .ico { color: var(--ink-faint); }

/* ---- Settings + usage helpers ---- */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; }
.empty-cell { text-align: center; color: var(--ink-dim); padding: 30px 18px; }

/* ---- Collapsed sidebar ---- */
.shell.is-collapsed { grid-template-columns: 74px minmax(0, 1fr); }
.shell.is-collapsed .wordmark .name,
.shell.is-collapsed .nav-item span,
.shell.is-collapsed .nav-label,
.shell.is-collapsed .acct-meta,
.shell.is-collapsed #signout { display: none; }
.shell.is-collapsed .nav-item { justify-content: center; padding: 10px 0; }
.shell.is-collapsed .acct { justify-items: center; }

/* ---- Light theme ---- */
:root[data-theme="light"] {
  --bg: #F4F6F9; --bg-2: #FFFFFF; --surface: #FFFFFF; --surface-2: #F3F5F8; --surface-3: #E9ECF1;
  --line: #E3E7ED; --line-2: #D3D8E0;
  --ink: #161A20; --ink-dim: #515866; --ink-faint: #8B93A1;
  --accent-deep: #EEF6D6; --on-accent: #1A2103;
  --shadow: 0 12px 32px -18px rgba(20, 30, 50, 0.28);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
:root[data-theme="light"] body { background: var(--bg); }
:root[data-theme="light"] body::before {
  background:
    radial-gradient(900px 540px at 78% -8%, rgba(45,212,191, 0.10), transparent 60%),
    radial-gradient(800px 600px at -6% 108%, rgba(80, 120, 200, 0.06), transparent 55%);
}
:root[data-theme="light"] .sidebar { background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(244,246,249,0.9)); }
:root[data-theme="light"] .donut-total { fill: var(--ink); }

/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .topbar-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
}

/* ============================================================================
   PREMIUM DASHBOARD v2 — reference-matched chrome + live metering
   ========================================================================== */

/* ---- Reference-style active nav: emerald text, tinted fill, left accent ---- */
.nav-item.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-item.is-active .ico { color: var(--accent); }

/* ---- Top bar: notification bell + language selector ---- */
.topbar-icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-dim); cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.topbar-icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); }
.topbar-icon-btn .ico { width: 18px; height: 18px; }
.topbar-icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.lang-select {
  appearance: none; background: var(--surface); color: var(--ink-dim); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 28px 8px 12px; font-family: inherit; font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA0AA' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
.lang-select:hover { color: var(--ink); border-color: var(--line-2); }
.balance-pill .ico { width: 15px; height: 15px; }
.acct-chip { cursor: pointer; }
.acct-chip .chip-role { font-size: 10.5px; color: var(--ink-faint); }
.acct-chip-meta { display: grid; line-height: 1.15; min-width: 0; }

/* ---- Live streaming strip ---- */
.live-strip {
  display: grid; gap: 14px; margin-top: 22px; padding: 18px 20px;
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background:
    radial-gradient(140% 160% at 0% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 55%),
    var(--surface);
  box-shadow: var(--hairline);
}
.live-strip.is-active { border-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-title { display: inline-flex; align-items: center; gap: 9px; font-family: var(--display); font-size: 15px; font-weight: 600; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); }
.live-strip.is-active .live-dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: live 1.4s var(--ease) infinite; }
.live-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.live-metric { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: 12px 14px; display: grid; gap: 6px; }
.live-metric .lm-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.live-metric .lm-v { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.live-metric.accent .lm-v { color: var(--accent); }
.live-streams { display: grid; gap: 8px; }
.live-stream-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); padding: 10px 13px; font-size: 13px;
}
.live-stream-row .lsr-model { font-family: var(--mono); color: var(--ink); }
.live-stream-row .lsr-meta { color: var(--ink-faint); font-family: var(--mono); font-size: 12px; }
.live-stream-row .lsr-spacer { flex: 1; }

/* stream / lifecycle status badges */
.sbadge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; padding: 3px 9px; border-radius: var(--r-pill); text-transform: none; }
.sbadge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sbadge.active   { background: var(--accent-glow); color: var(--accent); }
.sbadge.settling { background: var(--warn-bg); color: var(--warn); }
.sbadge.settled  { background: var(--ok-bg); color: var(--ok); }
.sbadge.stopped, .sbadge.debt { background: var(--danger-bg); color: var(--danger); }
.sbadge.mute { background: var(--surface-3); color: var(--ink-dim); }

/* ---- Provider card: avg-response footer + colored dot ---- */
.provider-head .provider-name { display: inline-flex; align-items: center; gap: 8px; }
.provider-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.provider-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-faint); }
.provider-foot .mono { color: var(--ink-dim); }

/* ---- Model distribution: donut + table side by side ---- */
.model-split { display: grid; grid-template-columns: minmax(220px, 320px) minmax(0,1fr); gap: 20px; align-items: start; }
.model-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.model-table th { text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.model-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.model-table tbody tr:last-child td { border-bottom: none; }
.model-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.model-table .m-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); color: var(--ink); }
.model-table .m-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.share-bar { position: relative; height: 5px; margin-top: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.share-bar > i { display: block; height: 100%; border-radius: var(--r-pill); }
@media (max-width: 820px) { .model-split { grid-template-columns: 1fr; } }

/* ---- Dashboard recent-usage table ---- */
.dash-usage-wrap { max-height: 460px; overflow: auto; }
.dash-usage-wrap .table { min-width: 860px; }
.dash-usage-wrap .table thead th { position: sticky; top: 0; z-index: 1; }
.stream-tag { font-family: var(--mono); font-size: 10.5px; padding: 2px 7px; border-radius: var(--r-pill); }
.stream-tag.on { background: var(--accent-glow); color: var(--accent); }
.stream-tag.off { background: var(--surface-3); color: var(--ink-dim); }

/* ---- Loading / error states for panels ---- */
.dash-error { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 40px 18px; color: var(--ink-dim); }
.dash-error .ico { width: 26px; height: 26px; color: var(--danger); }

@media (max-width: 1080px) { .live-metrics { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .live-metrics { grid-template-columns: 1fr; } }

/* ============================================================
   PUBLIC PRICING PAGE (/pricing)
   ============================================================ */
.pricing-page { display: block; background: var(--bg); color: var(--ink); overflow-x: hidden; }
.pricing-page #main { max-width: 1120px; margin: 0 auto; padding: 0 max(22px, env(safe-area-inset-left)) 80px max(22px, env(safe-area-inset-left)); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: var(--r-sm); z-index: 50; }
.skip-link:focus { left: 12px; top: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.pp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; max-width: 1120px; margin: 0 auto; padding: 18px max(22px, env(safe-area-inset-left)); }
.pp-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pp-nav a { color: var(--ink-dim); text-decoration: none; font-size: 14px; }
.pp-nav a:hover { color: var(--ink); }
.pp-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.pp-cta-group { display: flex; gap: 8px; }

.pp-hero { text-align: center; padding: 56px 0 40px; }
.pp-hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.08; letter-spacing: -0.02em; margin: 14px 0 12px; }
.pp-lede { color: var(--ink-dim); font-size: 17px; max-width: 620px; margin: 0 auto 26px; line-height: 1.55; }
.pp-hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pp-hero-note { color: var(--accent); font-weight: 600; margin-top: 18px; }
.pp-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-deep); color: var(--accent); border: 1px solid rgba(45,212,191,0.3); padding: 6px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; }
.pp-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.pp-section { padding: 34px 0; border-top: 1px solid var(--line); }
.pp-section > h2 { font-size: 24px; letter-spacing: -0.01em; margin: 0 0 6px; }
.pp-muted { color: var(--ink-dim); font-size: 14px; }

/* offer */
.pp-offer-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; margin-top: 18px; }
.pp-offer-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.pp-offer-card h3 { margin: 0 0 10px; font-size: 18px; }
.pp-offer-card p { color: var(--ink-dim); line-height: 1.55; margin: 0 0 10px; }
.pp-offer-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; align-content: start; }
.pp-offer-points li { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--ink-dim); }
.pp-offer-points strong { color: var(--ink); }

/* calculator */
.pp-calc { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; }
.pp-calc-controls { display: grid; gap: 16px; align-content: start; }
.pp-field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; }
.pp-field > span, .pp-field legend { font-size: 13px; color: var(--ink-dim); font-weight: 600; }
.pp-help { font-size: 12px; color: var(--ink-faint); }
.pp-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px; width: max-content; }
.pp-seg-btn { border: 0; background: transparent; color: var(--ink-dim); padding: 6px 18px; border-radius: var(--r-pill); cursor: pointer; font: inherit; font-weight: 600; }
.pp-seg-btn.is-active { background: var(--accent); color: var(--on-accent); }
.pp-seg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pp-fx-note { font-size: 12px; color: var(--warn); margin: 4px 0 0; }
.pp-amount { display: flex; align-items: center; gap: 6px; }
.pp-amount-sym { color: var(--ink-dim); font-weight: 600; }
.pp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pp-preset { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim); border-radius: var(--r-pill); padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.pp-preset:hover { border-color: var(--accent-dim); color: var(--ink); }
.pp-ratio input[type=range] { width: 100%; accent-color: var(--accent); }
.pp-calc-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.pp-res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pp-res { display: grid; gap: 2px; }
.pp-res-k { font-size: 12px; color: var(--ink-faint); }
.pp-res-v { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.pp-assumptions { margin-top: 14px; }

/* model table */
.pp-model-controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.pp-search { flex: 1 1 200px; }
.pp-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }
.pp-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 780px; }
.pp-table th, .pp-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pp-table thead th { background: var(--surface-2); color: var(--ink-dim); font-size: 12px; font-weight: 600; position: sticky; top: 0; }
.pp-table tbody tr:hover, .pp-table tr:hover { background: var(--surface-2); }
.pp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pp-mname { font-weight: 600; }
.pp-mid { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }
.pp-ref { color: var(--ink-faint); text-decoration: line-through; }
.pp-save { color: var(--accent); font-weight: 600; font-size: 13px; }
.pp-copy { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-dim); border-radius: var(--r-sm); padding: 4px 9px; cursor: pointer; font: inherit; font-size: 12px; margin-right: 4px; }
.pp-copy:hover { border-color: var(--accent-dim); color: var(--ink); }

/* mobile cards (hidden on desktop) */
.pp-cards { display: none; gap: 12px; margin-top: 4px; }
.pp-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.pp-card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.pp-card-rows { display: grid; gap: 6px; margin: 12px 0 0; }
.pp-card-rows > div { display: flex; justify-content: space-between; }
.pp-card-rows dt { color: var(--ink-faint); font-size: 13px; margin: 0; }
.pp-card-rows dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pp-card-copy { margin-top: 12px; }

/* features */
.pp-features { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.pp-features li { position: relative; padding-left: 26px; color: var(--ink-dim); line-height: 1.5; }
.pp-features li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-deep); border: 1px solid var(--accent-dim); }

/* faq */
.pp-faq { display: grid; gap: 8px; margin-top: 16px; }
.pp-faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px; }
.pp-faq-item summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style-position: inside; }
.pp-faq-item summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.pp-faq-item p { color: var(--ink-dim); margin: 0 0 12px; line-height: 1.55; }

.pp-foot { padding-top: 30px; border-top: 1px solid var(--line); display: grid; gap: 8px; }

.pp-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--line-2); color: var(--ink); padding: 10px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow); z-index: 60; font-size: 14px; }

/* focus visibility everywhere on the page */
.pricing-page a:focus-visible, .pricing-page button:focus-visible, .pricing-page select:focus-visible, .pricing-page input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* responsive */
@media (max-width: 860px) {
  .pp-offer-grid, .pp-calc, .pp-res-grid { grid-template-columns: 1fr; }
  .pp-features { grid-template-columns: 1fr; }
  .pp-table-wrap { display: none; }
  .pp-cards { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  .pricing-page * { transition: none !important; animation: none !important; }
}

/* admin pricing presentation editor */
.pp-admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.pp-admin-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: grid; gap: 12px; align-content: start; }
.pp-admin-card h3 { margin: 0; font-size: 16px; }
.pp-admin-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.pp-admin-card .check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-dim); font-size: 14px; }
@media (max-width: 860px) { .pp-admin-grid { grid-template-columns: 1fr; } }

/* ============================================================
   BUY CREDITS PAGE (/credits)
   ============================================================ */
.cr-accent { color: var(--accent); }
.btn-lg { padding: 14px 26px; font-size: 15px; }

/* Center every section's heading/intro block on this conversion page. */
.pricing-page .pp-section { text-align: center; }
.pricing-page .pp-section > h2 { font-size: clamp(24px, 3.2vw, 32px); }
.pricing-page .pp-section > .pp-muted { max-width: 560px; margin-left: auto; margin-right: auto; }

.cr-hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.02; }
.cr-hero .cr-accent {
  background: linear-gradient(120deg, #5eead4, var(--accent) 55%, var(--accent-dim));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---- Package grid: centered, balanced, capped width ---- */
.cr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 244px));
  gap: 18px;
  margin: 30px auto 0;
  max-width: 1000px;
  justify-content: center;
  align-items: stretch;
}

/* ---- Package card: a metering readout. The PAYABLE price is the hero. ---- */
.cr-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 3px;
  padding: 30px 22px 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(45,212,191,0.06), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow), var(--hairline);
  transition: transform 0.14s var(--ease), border-color 0.16s, box-shadow 0.16s;
}
.cr-card:hover { transform: translateY(-4px); border-color: var(--accent-dim); box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-glow); }

/* Featured card (JS adds .is-featured to the middle package). */
.cr-card.is-featured { border-color: rgba(45,212,191,0.45); box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-glow), 0 24px 60px -30px var(--accent-glow); }
.cr-flag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: var(--on-accent);
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 12px; border-radius: var(--r-pill); white-space: nowrap; box-shadow: 0 6px 18px -8px var(--accent-glow);
}

/* Discount ribbon — a solid, confident chip (not a faint outline). */
.cr-off {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim)); color: var(--on-accent);
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 5px 11px; border-radius: var(--r-pill); margin-bottom: 12px;
}

.cr-eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
/* What you receive. */
.cr-face { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.cr-face b { color: var(--accent); font-weight: 700; }

.cr-rule { width: 34px; height: 1px; background: var(--line-2); margin: 13px 0 11px; }

.cr-pay-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); }
.cr-orig { color: var(--ink-faint); font-size: 15px; text-decoration: line-through; text-decoration-color: var(--danger); margin-top: 3px; }
/* THE HERO: what you actually pay. */
.cr-pay-hero {
  display: inline-flex; align-items: baseline; justify-content: center; gap: 2px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  color: var(--ink); margin-top: 1px; white-space: nowrap;
  text-shadow: 0 0 34px var(--accent-glow);
}
.cr-pay-hero .cur { color: var(--ink-dim); font-size: 0.5em; font-weight: 600; letter-spacing: 0; }

.cr-save { display: inline-block; color: var(--accent); background: var(--accent-deep); border: 1px solid rgba(45,212,191,0.25); font-weight: 600; font-size: 12.5px; padding: 4px 12px; border-radius: var(--r-pill); margin: 14px 0 0; white-space: nowrap; }
/* The save chip begins the bottom cluster; margin-top:auto pushes the chip+button
   pair to the card floor so buttons align across cards even if one runs taller. */
.cr-card .cr-save { margin-top: auto; }
.cr-card .cr-buy { width: 100%; margin-top: 18px; }

/* ---- Custom calculator ---- */
.cr-calc { display: grid; grid-template-columns: 1fr 1.05fr; gap: 20px; margin: 28px auto 0; max-width: 760px; text-align: left; align-items: stretch; }
.cr-calc-input { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; align-content: center; }
.cr-calc-out { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 11px; align-content: center; box-shadow: var(--hairline); }
.cr-res { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cr-res-k { color: var(--ink-dim); font-size: 13.5px; }
.cr-res-v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; }
.cr-res.is-hero .cr-res-k { color: var(--ink); font-weight: 600; }
.cr-res.is-hero .cr-res-v { font-size: 30px; color: var(--accent); text-shadow: 0 0 28px var(--accent-glow); }
.cr-calc-out .cr-buy { margin-top: 6px; }

/* ---- How it works: an ordered, numbered sequence (order carries meaning) ---- */
.cr-steps { list-style: none; padding: 0; margin: 26px auto 0; max-width: 860px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: left; }
.cr-steps li { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 16px; }
.cr-step-n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-deep); color: var(--accent); border: 1px solid rgba(45,212,191,0.3); font-family: var(--mono); font-weight: 700; }
.cr-steps strong { display: block; margin-bottom: 2px; }
.cr-steps p { margin: 0; color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; }

/* Center the remaining shared sections on this page. */
.pricing-page .pp-features { max-width: 720px; margin-left: auto; margin-right: auto; text-align: left; }
.pricing-page .pp-faq { max-width: 720px; margin-left: auto; margin-right: auto; text-align: left; }
.pricing-page .pp-hero-cta { justify-content: center; }

@media (max-width: 860px) {
  .cr-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .cr-calc { grid-template-columns: 1fr; }
}
/* Mobile: keep TWO package columns (never collapse to one); scale the card
   internals so a full readout fits a ~360px phone. Extra row-gap gives the
   'Most popular' flag clearance so it never overlaps the card above. */
@media (max-width: 560px) {
  .pricing-page #main { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  /* minmax(0,1fr) lets columns shrink below content width — prevents overflow. */
  .cr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 12px; max-width: 100%; }
  .cr-card { padding: 20px 12px 18px; gap: 2px; }
  .cr-off { margin-bottom: 8px; font-size: 10px; padding: 4px 9px; }
  .cr-eyebrow, .cr-pay-label { font-size: 9.5px; letter-spacing: 0.1em; }
  .cr-face { font-size: 17px; }
  .cr-rule { margin: 9px 0 7px; }
  .cr-orig { font-size: 12.5px; }
  .cr-pay-hero { font-size: 34px; }
  .cr-save { font-size: 11px; padding: 3px 9px; }
  .cr-card .cr-buy { margin-top: 13px; padding: 11px 6px; font-size: 12.5px; }
  .cr-flag { font-size: 9px; padding: 3px 9px; top: -10px; }
  .cr-steps { grid-template-columns: 1fr; }
}
/* Very narrow phones (<=330px): two columns would genuinely overflow, so fall
   back to a single column. The payable hero can breathe at full size again. */
@media (max-width: 330px) {
  .cr-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 320px; }
}

/* ============================================================================
   PUBLIC HOMEPAGE (/) — approved marketing design (hp-*). Scoped under .hp.
   ============================================================================ */
.home-page { background: var(--bg); color: var(--ink); }
.hp { position: relative; z-index: 1; min-height: 100vh; width: 100%; overflow-x: hidden; }
.hp-main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px 72px; }
/* grid/flex children must be allowed to shrink below content width, else the
   terminal's nowrap lines blow the track out past the viewport on mobile. */
.hp-hero-copy, .hp-term-wrap { min-width: 0; }

/* ---- Nav ---- */
.hp-nav {
  width: 100%; max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; gap: 16px; flex-wrap: wrap;
}
.hp-brand { display: inline-flex; align-items: center; gap: 11px; }
.hp-logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none; position: relative;
  background: linear-gradient(150deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-2); box-shadow: var(--hairline);
}
.hp-logo::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent), 0 0 0 3px var(--accent-glow);
}
.hp-wordmark { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: 0.01em; }
.hp-wordmark .tick { color: var(--accent); }
.hp-nav-links { display: flex; align-items: center; gap: 26px; }
.hp-nav-links a:not(.btn) { color: var(--ink-dim); font-size: 14px; font-weight: 500; transition: color 0.16s; }
.hp-nav-links a:not(.btn):hover { color: var(--ink); }
.hp-nav-cta { padding: 8px 15px; font-size: 14px; }

/* ---- Hero ---- */
.hp-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px; align-items: center; padding: 48px 0 40px;
}
.hp-hero-copy { min-width: 0; }
.hp-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--ink-dim); font-size: 12.5px; font-weight: 500; letter-spacing: 0.01em;
  box-shadow: var(--hairline);
}
.hp-badge-glyph { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.hp-title {
  margin: 22px 0 0; font-family: var(--display); font-weight: 700;
  font-size: clamp(34px, 4.4vw, 54px); line-height: 1.06; letter-spacing: -0.02em;
}
.hp-title-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--accent);
}
.hp-sub { margin: 20px 0 0; color: var(--ink-dim); font-size: 17px; line-height: 1.6; max-width: 33em; }
.hp-checks { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 24px; }
.hp-checks li { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14.5px; font-weight: 500; }
.hp-checks li::before {
  content: "✓"; flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: var(--on-accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}

.hp-cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 0; }
.hp-btn-lg { padding: 13px 22px; font-size: 15px; border-radius: var(--r); }
.btn-primary.hp-btn-lg { box-shadow: 0 10px 30px -12px var(--accent-glow), var(--hairline); }
.hp-arrow { transition: transform 0.16s var(--ease); }
.hp-btn-lg:hover .hp-arrow { transform: translateX(3px); }
.hp-trustline { margin: 26px 0 0; color: var(--ink-dim); font-size: 13px; letter-spacing: 0.01em; }

/* ---- Hero terminal (static illustration) ---- */
.hp-term-wrap { position: relative; min-width: 0; }
.hp-term-glow {
  position: absolute; inset: -12% -8% -16% -8%; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 60% 45%, var(--accent-glow), transparent 70%);
  filter: blur(24px);
}
.hp-term-ghost {
  position: absolute; z-index: 1; inset: 0; transform: translate(18px, 20px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.hp-term {
  position: relative; z-index: 2;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), var(--hairline); overflow: hidden;
}
.hp-term-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.015);
}
.hp-term-dots { display: inline-flex; gap: 7px; }
.hp-term-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); display: block; }
.hp-term-dots i:first-child { background: #F2645A; }
.hp-term-dots i:nth-child(2) { background: #F5B544; }
.hp-term-dots i:nth-child(3) { background: #46D39A; }
.hp-term-tab { color: var(--ink-dim); font-size: 13px; font-family: var(--mono); }

.hp-term-body { padding: 22px 20px 26px; font-family: var(--mono); font-size: 14px; line-height: 1.9; }
.hp-term-line { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-term-cmd { color: var(--ink); }
.hp-term-prompt { color: var(--accent); margin-right: 8px; font-weight: 600; }
.hp-term-user { color: var(--ink); }
.hp-term-caret { color: var(--accent); margin-right: 8px; }
.hp-term-ok { color: var(--ok); }
.hp-term-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 9px; vertical-align: middle; box-shadow: 0 0 8px var(--ok); }
.hp-term-check { margin-right: 8px; }
.hp-term-muted { color: var(--ink); opacity: 0.5; }

/* ---- Feature strip ---- */
.hp-features {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin: 40px 0 0; border: 1px solid var(--line);
  border-radius: var(--r-lg); background: var(--surface); overflow: hidden;
  box-shadow: var(--hairline);
}
.hp-feature { padding: 30px 26px; border-left: 1px solid var(--line); }
.hp-feature:first-child { border-left: 0; }
.hp-feature-ic {
  width: 42px; height: 42px; border-radius: var(--r); display: grid; place-items: center;
  background: var(--accent-deep); border: 1px solid var(--line-2); color: var(--accent);
}
.hp-feature-ic .ico { width: 21px; height: 21px; }
.hp-feature h2 { margin: 18px 0 7px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.hp-feature p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.55; }

/* ---- Trust band ---- */
.hp-trust { margin: 56px 0 0; text-align: center; }
.hp-trust-head { margin: 0; color: var(--ink-dim); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; }
.hp-trust-row {
  display: grid; grid-template-columns: repeat(4, auto); justify-content: center;
  gap: 20px 56px; margin: 26px 0 0; flex-wrap: wrap;
}
.hp-trust-item { display: inline-flex; align-items: center; gap: 11px; }
.hp-trust-ic {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--accent);
}
.hp-trust-ic .ico { width: 19px; height: 19px; }
.hp-trust-label { color: var(--ink); font-size: 14.5px; font-weight: 500; }

/* ---- Homepage responsive ---- */
@media (max-width: 1024px) {
  .hp-hero { grid-template-columns: 1fr; gap: 44px; padding: 32px 0; }
  .hp-term-wrap { max-width: 560px; }
  .hp-features { grid-template-columns: repeat(2, 1fr); }
  .hp-feature:nth-child(3) { border-left: 0; }
  .hp-feature:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .hp-nav { padding: 16px 20px; }
  .hp-main { padding: 0 20px 56px; }
  .hp-nav-links { gap: 14px; }
  .hp-nav-links a[data-hp="docs"], .hp-nav-links a[data-hp="credits"] { display: none; }
  .hp-trust-row { grid-template-columns: repeat(2, auto); gap: 22px 40px; }
}
@media (max-width: 560px) {
  .hp-features { grid-template-columns: 1fr; }
  .hp-feature { border-left: 0; border-top: 1px solid var(--line); }
  .hp-feature:first-child { border-top: 0; }
  .hp-cta-row .hp-btn-lg { flex: 1 1 auto; }
  .hp-term-body { font-size: 12.5px; }
  .hp-trust-row { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 380px) {
  .hp-nav-links { gap: 10px; }
  .hp-nav-cta { padding: 7px 11px; font-size: 13px; }
  .hp-term-body { font-size: 11.5px; padding: 18px 14px 20px; }
 }
@media (prefers-reduced-motion: reduce) {
  .home-page * { transition: none !important; animation: none !important; }
}

/* ============================================================================
   STARTUPAPI WELCOME - server-driven homepage onboarding and customer home
   ========================================================================== */
.welcome-page {
  min-height: 100vh;
  letter-spacing: 0;
  background: var(--bg);
}
.welcome-page .btn,
.welcome-page h1,
.welcome-page h2,
.welcome-page h3,
.welcome-page p,
.welcome-page a,
.welcome-page button,
.welcome-page span,
.welcome-page small { letter-spacing: 0; }

.welcome-nav {
  position: relative;
  z-index: 5;
  width: min(1260px, calc(100% - 48px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.welcome-nav-links { display: flex; align-items: center; gap: 24px; color: var(--ink-dim); }
.welcome-nav-links > a,
.welcome-nav-links > span > a { min-height: 44px; display: inline-flex; align-items: center; }
.welcome-nav-links > a:hover,
.welcome-nav-links > span > a:not(.btn):hover { color: var(--ink); }
#homeAccountLink { display: inline-flex; align-items: center; gap: 12px; }
.welcome-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.welcome-nav-toggle span { width: 18px; height: 1px; background: var(--ink); }

.welcome-page #main {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 88px;
}
.welcome-hero { max-width: 850px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; }
.welcome-eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.welcome-hero h1 { margin: 0; font-size: 56px; line-height: 1.05; font-weight: 600; }
.welcome-lede { margin: 16px 0 0; color: var(--ink-dim); font-size: 20px; }
.welcome-motivation { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; color: var(--accent); }
.welcome-motivation strong { font-size: 14px; font-weight: 500; }
.welcome-motivation span { color: var(--ink-dim); font-size: 13px; }
.welcome-loading {
  width: min(560px, 100%);
  height: 120px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  animation: welcome-pulse 1.4s var(--ease) infinite;
}
@keyframes welcome-pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.8; } }

.welcome-status {
  display: grid;
  grid-template-rows: 0fr;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--ok);
  background: var(--ok-bg);
  border: 0 solid transparent;
  border-radius: var(--r-sm);
  transition: grid-template-rows 180ms var(--ease), opacity 180ms var(--ease), margin 180ms var(--ease), padding 180ms var(--ease);
}
.welcome-status.is-visible {
  grid-template-rows: 1fr;
  margin: 22px 0 0;
  padding: 12px 14px;
  opacity: 1;
  border-width: 1px;
  border-color: rgba(70, 211, 154, 0.35);
}

.welcome-region { margin-top: 34px; }
.welcome-card,
.welcome-success {
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow), var(--hairline);
  padding: 28px;
}
.welcome-card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.welcome-card-head h2 { margin: 0; font-size: 18px; }
.welcome-card-head > span { color: var(--ink-dim); font-size: 12px; }
.welcome-progress { height: 6px; margin-top: 18px; overflow: hidden; background: var(--line-2); border-radius: var(--r-pill); }
.welcome-progress > span { display: block; height: 100%; background: var(--accent); transition: width 360ms var(--ease); }

.welcome-step-summary {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}
.welcome-step-summary li {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  color: var(--ink-dim);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.welcome-step-summary li.is-complete span:first-child { color: var(--ok); }
.welcome-step-summary li.is-current { color: var(--ink); border-color: rgba(45, 212, 191, 0.45); }

.welcome-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  gap: 18px;
  margin-top: 18px;
}
.welcome-current {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px;
  background: var(--bg-2);
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: var(--r-sm);
  animation: welcome-rise 220ms var(--ease) both;
}
@keyframes welcome-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.welcome-current h2 { margin: 0; font-size: 32px; line-height: 1.15; }
.welcome-why-label { margin: 22px 0 0; color: var(--ink-dim); font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.welcome-why { margin: 7px 0 0; color: var(--ink-dim); font-size: 16px; }
.welcome-eta { margin: 14px 0 0; color: var(--accent); font-size: 13px; }
.welcome-primary { min-height: 46px; margin-top: auto; }
.welcome-tip { width: 100%; display: grid; gap: 3px; margin-top: 14px; padding: 11px 12px; border: 1px solid rgba(245, 181, 68, 0.28); border-radius: var(--r-sm); color: var(--ink-dim); background: var(--warn-bg); font-size: 12px; }
.welcome-tip strong { color: var(--warn); font-size: 11px; }

.welcome-visual {
  margin: 0;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.browser-frame { height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.browser-frame span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.welcome-visual img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; object-position: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.welcome-visual figcaption { margin: 10px 2px 0; color: var(--ink-dim); font-size: 11px; }
.welcome-terminal { min-height: 316px; display: flex; flex-direction: column; gap: 6px; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); font-family: var(--mono); font-size: 13px; }
.terminal-command::before { content: "$ "; color: var(--ink-faint); }
.terminal-success { margin-top: 16px; color: var(--ok); font-weight: 600; }
.terminal-detail { color: var(--ink-dim); }
.terminal-prompt { margin-top: 18px; color: var(--ink); }
.terminal-prompt::before { content: "> "; color: var(--accent); }

.welcome-support-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; margin-top: 18px; }
.welcome-unlocked,
.welcome-help {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.welcome-unlocked h3,
.welcome-help h3 { margin: 0 0 12px; font-size: 14px; }
.welcome-unlocked ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; padding: 0; }
.welcome-unlocked li { min-height: 36px; display: flex; align-items: center; gap: 7px; padding: 7px 9px; background: var(--surface); color: var(--ink-dim); font-size: 12px; border-left: 2px solid var(--ok); }
.welcome-unlocked li span { color: var(--ok); }
.welcome-help-link { min-height: 38px; display: flex; align-items: center; color: var(--ink-dim); border-top: 1px solid var(--line); font-size: 12px; }
.welcome-help-link:first-of-type { border-top: 0; }
.welcome-help-link:hover { color: var(--accent); }

.welcome-success { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 18px; animation: welcome-rise 220ms var(--ease) both; }
.welcome-success-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: var(--accent-deep); font-size: 25px; font-weight: 700; }
.welcome-success-copy h2 { margin: 0; font-size: 30px; }
.welcome-success-copy > p:last-child { margin: 8px 0 0; color: var(--ink-dim); }
.welcome-quick-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.welcome-quick-action { min-height: 46px; display: flex; align-items: center; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); }
.welcome-quick-action:hover { border-color: var(--accent); }
.welcome-complete-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.welcome-complete-summary p { margin: 3px 0 0; color: var(--ink-dim); font-size: 12px; }
.welcome-review { margin-top: 14px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.welcome-review[hidden] { display: none; }
.welcome-review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.welcome-review-head h2 { margin: 0; font-size: 22px; }
.welcome-review-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.welcome-review-step { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.welcome-review-check { color: var(--ok); }
.welcome-review-step h3 { margin: 0; font-size: 14px; }
.welcome-review-step p { margin: 5px 0; color: var(--ink-dim); font-size: 12px; }
.welcome-review-step small { color: var(--accent); font-size: 11px; }

.customer-home { margin-top: 14px; }
.customer-home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 14px; }
.customer-snapshot,
.home-update,
.home-feed-error { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.customer-snapshot > h2,
.home-update h2,
.home-feed-error h2 { margin: 0; font-size: 17px; }
.customer-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.customer-metrics > div { min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.customer-metrics span { display: block; color: var(--ink-dim); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.customer-metrics strong { display: block; margin-top: 8px; overflow-wrap: anywhere; font-size: 17px; }
.customer-snapshot > h3 { margin: 20px 0 10px; font-size: 14px; }
.customer-activity { list-style: none; display: grid; gap: 7px; margin: 0; padding: 0; }
.customer-activity li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.customer-activity li > span { display: grid; gap: 2px; }
.customer-activity small,
.customer-activity time { color: var(--ink-dim); font-size: 11px; }
.customer-activity .is-empty { color: var(--ink-dim); }
.customer-updates { display: grid; align-content: start; gap: 10px; }
.home-update { position: relative; }
.home-update > div { padding-right: 36px; }
.home-update > p { margin: 12px 0 0; color: var(--ink-dim); font-size: 13px; }
.home-update > a { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-size: 13px; }
.home-update-dismiss { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink-dim); cursor: pointer; font-size: 20px; }

.welcome-footer {
  position: relative;
  z-index: 1;
  width: min(1260px, calc(100% - 48px));
  min-height: 90px;
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
}
.welcome-footer nav { display: flex; flex-wrap: wrap; gap: 20px; color: var(--ink-dim); }
.welcome-footer a { min-height: 44px; display: inline-flex; align-items: center; }

@media (max-width: 940px) {
  .welcome-focus-grid { grid-template-columns: 1fr; }
  .welcome-current { min-height: 320px; }
  .welcome-support-grid { grid-template-columns: 1fr; }
  .customer-home-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .welcome-nav { width: min(100% - 32px, 1260px); }
  .welcome-nav-toggle { display: flex; }
  .welcome-nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .welcome-nav-links.is-open { display: flex; }
  .welcome-nav-links > a,
  .welcome-nav-links > span > a { padding: 0 10px; }
  #homeAccountLink { display: flex; flex-direction: column; align-items: stretch; }
  .welcome-page #main { width: min(100% - 32px, 1120px); padding: 46px 0 64px; }
  .welcome-hero { min-height: 190px; }
  .welcome-hero h1 { font-size: 40px; }
  .welcome-lede { font-size: 17px; }
  .welcome-region { margin-top: 24px; }
  .welcome-card,
  .welcome-success { padding: 18px; }
  .welcome-step-summary { display: grid; padding-left: 12px; border-left: 1px solid var(--line-2); }
  .welcome-step-summary li { border: 0; background: transparent; padding: 4px 0; }
  .welcome-current { min-height: 0; padding: 22px; }
  .welcome-current h2 { font-size: 28px; }
  .welcome-primary { width: 100%; margin-top: 24px; }
  .welcome-visual img { aspect-ratio: 4 / 3; }
  .welcome-terminal { min-height: 260px; padding: 18px; font-size: 12px; }
  .welcome-unlocked ul { grid-template-columns: 1fr; }
  .welcome-success { grid-template-columns: 1fr; }
  .welcome-quick-actions { grid-column: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-complete-summary { align-items: flex-start; }
  .welcome-review-steps { grid-template-columns: 1fr; }
  .customer-metrics { grid-template-columns: 1fr; }
  .customer-activity li { flex-direction: column; }
  .welcome-footer { width: min(100% - 32px, 1260px); align-items: flex-start; flex-direction: column; }
}

@media (max-width: 360px) {
  .welcome-hero h1 { font-size: 34px; }
  .welcome-card,
  .welcome-success,
  .welcome-review,
  .customer-snapshot,
  .home-update { padding: 15px; }
  .welcome-quick-actions { grid-template-columns: 1fr; }
  .welcome-complete-summary { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-page *,
  .welcome-page *::before,
  .welcome-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================================
   CLAUDE CODE GUIDES - shared StartupAPI product language
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.docs-page { min-height: 100vh; background: var(--bg); }
.docs-page h1,
.docs-page h2,
.docs-page h3,
.docs-page p,
.docs-page a,
.docs-page button,
.docs-page span { letter-spacing: 0; }
.docs-topbar {
  position: sticky; top: 0; z-index: 10;
  min-height: 72px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: rgba(8, 9, 11, 0.92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.docs-top-actions { display: flex; align-items: center; gap: 18px; color: var(--ink-dim); }
.docs-top-actions > a { min-height: 44px; display: inline-flex; align-items: center; }
.docs-menu-button {
  display: none; min-width: 44px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer;
}
.docs-layout { position: relative; z-index: 1; width: min(1240px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: 230px minmax(0, 760px); gap: 72px; justify-content: center; }
.docs-sidebar { position: sticky; top: 104px; align-self: start; padding: 46px 0; }
.docs-sidebar-label { margin: 0 0 22px; color: var(--ink); font-size: 20px; font-weight: 600; }
.docs-sidebar nav { display: grid; gap: 3px; }
.docs-nav-group { margin: 26px 0 8px; padding: 20px 10px 0; border-top: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: 0; }
.docs-nav-group:first-child { margin-top: 0; }
.docs-sidebar a { min-height: 40px; display: flex; align-items: center; padding: 8px 10px; border-left: 2px solid transparent; color: var(--ink-dim); font-size: 14px; }
.docs-sidebar .docs-mobile-dashboard { display: none; }
.docs-sidebar a:hover { color: var(--ink); background: var(--surface); }
.docs-sidebar a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); background: var(--surface); }
.docs-page #docsContent { min-width: 0; padding: 72px 0 120px; outline: none; }
.docs-loading { width: 100%; height: 210px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); animation: welcome-pulse 1.4s var(--ease) infinite; }
.docs-hero { padding-bottom: 42px; border-bottom: 1px solid var(--line); }
.docs-hero h1 { max-width: 700px; margin: 0; font-size: 48px; line-height: 1.08; font-weight: 600; }
.docs-lede { max-width: 680px; margin: 18px 0 0; color: var(--ink-dim); font-size: 18px; }
.docs-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.docs-meta span { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-dim); font-size: 12px; }
.docs-step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; padding: 42px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 94px; }
.docs-step-number { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); color: var(--accent); font-family: var(--mono); font-size: 12px; }
.docs-step-body { min-width: 0; }
.docs-step-body > h2 { margin: 3px 0 0; font-size: 24px; }
.docs-step-body > p { margin: 10px 0 0; color: var(--ink-dim); }
.docs-step-body > .docs-action { margin-top: 20px; }
.docs-action { min-height: 46px; }
.docs-command { margin-top: 18px; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); box-shadow: var(--hairline); }
.docs-command-head { min-height: 44px; padding: 0 8px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); color: var(--ink-dim); font-family: var(--mono); font-size: 11px; }
.docs-command-head button { min-width: 62px; min-height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; }
.docs-command-head button:hover { border-color: var(--accent); }
.docs-command pre,
.docs-expected pre { margin: 0; padding: 20px; overflow-x: auto; color: var(--ink); font: 13px/1.75 var(--mono); white-space: pre; }
.docs-expected { border-top: 1px solid var(--line); background: var(--surface); }
.docs-expected > span { display: block; padding: 14px 20px 0; color: var(--ok); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.docs-expected pre { color: var(--ink-dim); padding-top: 8px; }
.docs-callout { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line-2); border-left-width: 3px; border-radius: var(--r-sm); background: var(--surface); }
.docs-callout strong { display: block; font-size: 13px; }
.docs-callout p { margin: 5px 0 0; color: var(--ink-dim); font-size: 13px; line-height: 1.6; }
.docs-callout-success { border-left-color: var(--ok); background: var(--ok-bg); }
.docs-callout-warning { border-left-color: var(--warn); background: var(--warn-bg); }
.docs-callout-info { border-left-color: var(--accent); background: var(--accent-deep); }
.docs-callout-tip { border-left-color: var(--tip); background: var(--tip-bg); }
.docs-product-shot { margin: 22px 0 0; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); }
.docs-product-shot img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.docs-product-shot figcaption { margin: 10px 3px 2px; color: var(--ink-dim); font-size: 11px; }
.docs-platform,
.docs-return,
.docs-contact,
.docs-legacy { margin-top: 42px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.docs-platform h2,
.docs-return h2,
.docs-contact h2,
.docs-legacy h2 { margin: 0; font-size: 24px; }
.docs-platform > p,
.docs-return > p,
.docs-contact > p,
.docs-legacy > p { color: var(--ink-dim); }
.docs-platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.docs-platform-grid a { min-height: 108px; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 18px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); }
.docs-platform-grid a:hover { border-color: var(--accent); }
.docs-platform-grid span { color: var(--ink-dim); font-size: 13px; }
.docs-return { border-color: rgba(45, 212, 191, 0.3); }
.docs-return ol { color: var(--ink-dim); }
.docs-prompt { margin-top: 18px; padding: 18px; border-left: 3px solid var(--accent); background: var(--surface); color: var(--ink); }
.docs-model { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.docs-troubleshooting,
.docs-faq { display: grid; gap: 10px; margin-top: 32px; }
.docs-troubleshooting section,
.docs-faq section { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); scroll-margin-top: 94px; }
.docs-troubleshooting h2,
.docs-faq h2 { margin: 0; font-size: 18px; }
.docs-troubleshooting p,
.docs-faq p { margin: 8px 0 0; color: var(--ink-dim); }
.docs-faq a { color: var(--accent); }
.docs-copy-status { position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translateX(-50%); min-height: 24px; padding: 8px 12px; color: var(--ok); background: var(--surface); border-radius: var(--r-sm); pointer-events: none; }
.docs-copy-status:empty { display: none; }

/* ---- Index (Overview) page ---- */
.docs-product-hero { padding: 28px 0 52px; border-bottom: 1px solid var(--line); }
.docs-product-hero h1 { max-width: 720px; margin: 10px 0 0; font-size: 50px; line-height: 1.08; font-weight: 600; }
.docs-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.docs-product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 34px; }
.docs-product-grid .docs-navcard { min-height: 160px; justify-content: space-between; }
.docs-prose-section { padding: 38px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 94px; }
.docs-prose-section h2 { margin: 0; font-size: 24px; }
.docs-prose-section > p { max-width: 690px; margin: 12px 0 0; color: var(--ink-dim); font-size: 16px; line-height: 1.7; }
.docs-flow-list { margin: 22px 0 0; padding: 0; display: grid; gap: 10px; list-style: none; }
.docs-flow-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.docs-flow-list strong { color: var(--ink); }
.docs-flow-list span { color: var(--ink-dim); line-height: 1.6; }
.docs-model-family { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.docs-model-family article { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.docs-model-family h3 { margin: 0; font-size: 17px; }
.docs-model-family p { margin: 8px 0 0; color: var(--ink-dim); font-size: 14px; line-height: 1.6; }
.docs-index-hero { padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.docs-index-hero h1 { max-width: 760px; margin: 10px 0 0; font-size: 46px; line-height: 1.08; font-weight: 600; }
.docs-search { margin-top: 26px; max-width: 520px; }
.docs-search input { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--bg-2); color: var(--ink); font: 15px/1.4 var(--sans, inherit); }
.docs-search input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.docs-search input::placeholder { color: var(--ink-faint); }
.docs-search-empty { margin: 12px 2px 0; color: var(--ink-dim); font-size: 13px; }
.docs-index-section { margin-top: 48px; }
.docs-index-section > h2 { margin: 0; font-size: 22px; font-weight: 600; }
.docs-section-note { margin: 8px 0 0; color: var(--ink-dim); font-size: 14px; }
.docs-quickgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.docs-quickcard { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); scroll-margin-top: 94px; outline: none; }
.docs-quickcard-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--bg-2); color: var(--accent); font-family: var(--mono); font-size: 12px; }
.docs-quickcard h3 { margin: 16px 0 0; font-size: 17px; }
.docs-quickcard p { margin: 7px 0 0; color: var(--ink-dim); font-size: 14px; }
.docs-quickcard-link { display: inline-flex; align-items: center; margin-top: 16px; color: var(--accent); font-size: 13px; font-weight: 500; }
.docs-quickcard-link::after { content: "→"; margin-left: 6px; }
.docs-cardgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.docs-navcard { display: flex; flex-direction: column; gap: 7px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color 0.18s var(--ease, ease); }
.docs-navcard:hover { border-color: var(--accent); }
.docs-navcard[hidden] { display: none; }
.docs-navcard-head { display: flex; align-items: center; gap: 10px; }
.docs-navcard-head strong { font-size: 16px; }
.docs-navcard span { color: var(--ink-dim); font-size: 14px; }
.docs-navcard-tag { padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg-2); color: var(--ink-dim); font-family: var(--mono); font-size: 10px; text-transform: uppercase; }
.docs-prereq { margin-top: 32px; padding: 20px 22px; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--r-sm); background: var(--surface); }
.docs-prereq-label { margin: 0; color: var(--ink-dim); font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.docs-prereq p { margin: 8px 0 0; color: var(--ink); font-size: 14px; }
.docs-prereq ul { margin: 12px 0 0; padding-left: 18px; color: var(--ink-dim); font-size: 13px; }
.docs-prereq a { display: inline-block; margin-top: 12px; color: var(--accent); font-size: 13px; font-weight: 500; }

/* ---- Premium template: explained commands, mistakes, help, next steps ---- */
.docs-cmd-intro { margin: 16px 0 0; color: var(--ink-dim); font-size: 14px; }
.docs-cmd-intro + .docs-command { margin-top: 10px; }
.docs-list { margin: 16px 0 0; padding-left: 18px; display: grid; gap: 8px; color: var(--ink-dim); font-size: 15px; }
.docs-mistakes { margin-top: 42px; padding: 26px 28px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r); background: var(--surface); }
.docs-mistakes h2 { margin: 0 0 14px; font-size: 18px; }
.docs-mistakes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.docs-mistakes li { display: grid; gap: 3px; }
.docs-mistakes strong { font-size: 14px; }
.docs-mistakes span { color: var(--ink-dim); font-size: 14px; }
.docs-help { margin-top: 20px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.docs-help h2 { margin: 0; font-size: 18px; }
.docs-help p { margin: 8px 0 14px; color: var(--ink-dim); font-size: 14px; }
.docs-help a { color: var(--accent); font-size: 14px; font-weight: 500; }
.docs-next-label { margin: 0 0 16px; color: var(--ink-dim); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
/* Prev/next pager — consistent on every content page. */
.docs-pager { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.docs-pager-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.docs-pager-card { display: flex; flex-direction: column; gap: 5px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color 0.18s var(--ease, ease), background 0.18s var(--ease, ease); }
.docs-pager-card:hover { border-color: var(--accent); background: var(--surface-2); }
.docs-pager-next { text-align: right; }
.docs-pager-dir { color: var(--ink-dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; }
.docs-pager-card strong { color: var(--ink); font-size: 15px; }

/* Breadcrumbs — complement the sidebar, never replace it. */
.docs-breadcrumbs { margin-bottom: 22px; }
.docs-breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.docs-breadcrumbs li { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); }
.docs-breadcrumbs li:not(:first-child)::before { content: "›"; color: var(--ink-dim); }
.docs-breadcrumbs a { color: var(--ink-dim); }
.docs-breadcrumbs a:hover { color: var(--accent); }
.docs-breadcrumbs [aria-current="page"] { color: var(--ink); }

/* Header "last updated" — tasteful secondary style. */
.docs-meta-updated { border-style: dashed !important; color: var(--ink-dim) !important; }

/* Search: shortcut hint + suggestion chips. */
.docs-search-field { position: relative; }
.docs-search-kbd { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink-faint); font-family: var(--mono); font-size: 12px; pointer-events: none; }
.docs-search-hint { margin: 12px 2px 8px; color: var(--ink-dim); font-size: 12px; }
.docs-search-hint kbd { padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--surface); color: var(--ink-dim); font-family: var(--mono); font-size: 11px; }
.docs-search-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.docs-search-chip { padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink-dim); font-size: 13px; cursor: pointer; transition: border-color 0.18s var(--ease, ease), color 0.18s var(--ease, ease); }
.docs-search-chip:hover { border-color: var(--accent); color: var(--ink); }

/* Documentation footer — consistent close on every page. */
.docs-footer { margin-top: 64px; padding: 28px 0 8px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.docs-footer .wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-dim); }
.docs-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.docs-footer a { color: var(--ink-dim); font-size: 13px; }
.docs-footer a:hover { color: var(--accent); }

@media (max-width: 940px) {
  .docs-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 760px) {
  .docs-topbar { padding: 0 16px; }
  .docs-top-actions > a:first-child { display: none; }
  .docs-menu-button { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
  .docs-layout { width: min(100% - 32px, 760px); display: block; }
  .docs-sidebar { display: none; position: fixed; z-index: 9; top: 72px; left: 16px; right: 16px; max-height: calc(100vh - 88px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); }
  .docs-sidebar.is-open { display: block; }
  .docs-page #docsContent { padding: 46px 0 72px; }
  .docs-hero h1 { font-size: 38px; }
  .docs-lede { font-size: 16px; }
  .docs-step { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 34px 0; }
  .docs-step-number { width: 30px; height: 30px; }
  .docs-step-body > h2 { font-size: 21px; }
  .docs-command pre,
  .docs-expected pre { padding: 15px; font-size: 12px; }
  .docs-platform,
  .docs-return,
  .docs-contact,
  .docs-legacy { padding: 20px; }
  .docs-platform-grid { grid-template-columns: 1fr; }
  .docs-index-hero h1 { font-size: 34px; }
  .docs-product-hero h1 { font-size: 38px; }
  .docs-product-grid,
  .docs-model-family { grid-template-columns: 1fr; }
  .docs-product-grid .docs-navcard { min-height: 124px; }
  .docs-flow-list li { grid-template-columns: 1fr; gap: 6px; }
  .docs-quickgrid,
  .docs-cardgrid,
  .docs-pager-grid { grid-template-columns: 1fr; }
  .docs-mistakes,
  .docs-help { padding: 20px; }
  .docs-footer { flex-direction: column; align-items: flex-start; gap: 18px; }
  .docs-product-shot img { aspect-ratio: 4 / 3; }
  .docs-copy-status { left: 16px; right: 16px; bottom: 12px; transform: none; text-align: center; }
}

@media (max-width: 360px) {
  .docs-top-actions { display: none; }
  .docs-sidebar .docs-mobile-dashboard { display: flex; margin-top: 10px; border-top: 1px solid var(--line); color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  .docs-page *,
  .docs-page *::before,
  .docs-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
