/* ─── Fonts ───────────────────────────────────────────────────────────── */
/* Loaded with <link rel=preconnect> + <link rel=stylesheet> in each page head,
   not with @import here. An @import is serial: the browser has to fetch and
   parse this file before it even discovers the font request, so text cannot
   paint until two round trips have completed. A link in the head is found in
   the first HTML parse and fetched in parallel. display=swap is on the URL. */

/* ─── Design tokens — Velona "Meridian Ember" (dark-first) ─────────────── */
:root {
  --bg:               #08090D;
  --bg-secondary:     #0D0F15;
  --bg-card:          #10131B;
  --text:             #F4F5F7;
  --text-secondary:   #9BA0AC;
  --text-tertiary:    #949AA8; /* was #5E6470 (3.35:1 — failed AA). 7.06:1 on --bg, 6.58:1 on --bg-card. */
  --border:           rgba(255,255,255,.08);
  --border-strong:    rgba(255,255,255,.16);
  --accent:           #FB923C;
  --accent-rgb:       251, 146, 60;
  --color-terracotta: var(--accent); /* legacy hover accent — repointed to the ember palette */
  --accent-hover:     #FDBA74;
  --accent-light:     rgba(251,146,60,.12);
  --accent-dark:      #FDBA74;
  --accent-darker:    #FED7AA;
  --accent-tint:      rgba(251,146,60,.18);
  --accent-grad:      linear-gradient(100deg,#FBBF24 0%,#FB923C 45%,#F43F5E 100%);
  --gold:             #D4AF70;
  --gold-dark:        #F5C97B;
  --gold-bg:          #241A00;
  --gold-bg-dark:     #241A00;
  --color-primary-teal: #FDBA74;
  --primary:          var(--accent);
  --success:          #34D399;
  --success-light:    rgba(52,211,153,.12);
  --danger:           #F87171;
  --danger-light:     rgba(248,113,113,.12);
  --warning:          #FBBF24;
  --warning-light:    rgba(251,191,36,.12);
  --info:             #FB923C;
  --btn-pri-bg:       #FFFFFF;
  --btn-pri-fg:       #0A0A0C;
  --nav-glass:        rgba(8,9,13,.8);
  --shadow-sm:        0 1px 2px rgba(0,0,0,.35);
  --shadow:           0 6px 24px -8px rgba(0,0,0,.5);
  --shadow-md:        var(--shadow); /* alias — kept for existing call sites, same value as --shadow */
  --shadow-lg:        0 24px 60px -16px rgba(0,0,0,.65);
  --radius:           8px;
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        14px;
  --radius-btn:       8px; /* buttons — boxy, distinct from --radius-pill (badges/chips/pills) */
  --radius-pill:      100px;
  --radius-xl:        var(--radius-lg); /* alias — kept for existing call sites, same value as --radius-lg */
  --font:             'Inter', system-ui, sans-serif;
  --font-display:     'Inter', system-ui, sans-serif;
  --mono:             'JetBrains Mono', monospace;
  --nav-h:            60px;
  --sidebar-w:        220px;
  --transition:       0.15s ease;

  /* Spacing scale — 4px base rhythm, matches existing ad-hoc usage */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;

  /* Typography scale */
  --text-xs:   0.75rem;
  --text-sm:   0.85rem;
  --text-base: 1rem;
  --text-lg:   1.15rem;
  --text-xl:   1.4rem;
  --text-2xl:  1.75rem;
  --text-3xl:  2.25rem;
}

/* Dark = same as :root (explicit, so the toggle attribute is a no-op change) */
[data-theme="dark"] {
  --bg:               #08090D;
  --bg-secondary:     #0D0F15;
  --bg-card:          #10131B;
}

/* Light variant — "Ember on paper" (reachable via the theme toggle) */
[data-theme="light"] {
  --bg:               #FAFAF9;
  --bg-secondary:     #F5F5F4;
  --bg-card:          #FFFFFF;
  --text:             #0C0A09;
  --text-secondary:   #57534E;
  --text-tertiary:    #6F6A66; /* was #A8A29E (2.41:1 — failed AA). 5.12:1 on --bg, 5.34:1 on --bg-card. */
  --border:           #E7E5E4;
  --border-strong:    #D6D3D1;
  /* was #EA580C (3.41:1 as text — failed AA). `a { color: var(--accent) }` at
     line 126 puts this on every link, so darkening the token here fixes all
     311 text usages at once. --accent-grad is separate, so the brand gradient
     and logo mark are unchanged; the focus ring improves to 5.57:1. */
  --accent:           #B23F0A;
  --accent-rgb:       178, 63, 10;
  --accent-hover:     #C2410C;
  --accent-light:     #FFF7ED;
  --accent-dark:      #9A3412;
  --accent-darker:    #7C2D12;
  --accent-tint:      #FFEDD5;
  --accent-grad:      linear-gradient(100deg,#F59E0B 0%,#EA580C 45%,#E11D48 100%);
  --gold:             #B7791F;
  --gold-bg:          #FDF3E0;
  --color-primary-teal: #9A3412;
  --color-terracotta: var(--accent);
  --success:          #0A7D52; /* was #0FA36B (3.24:1 — the token itself failed AA). 5.16:1 on white, 4.69:1 on --success-light. */
  --success-light:    #E7F8F0;
  --danger:           #DC2626;
  --danger-light:     #FEE2E2;
  --warning:          #B45309;
  --warning-light:    #FEF3C7;
  --info:             #EA580C;
  --btn-pri-bg:       #0C0A09;
  --btn-pri-fg:       #FFFFFF;
  --nav-glass:        rgba(250,250,249,.85);
  --shadow-sm:        0 1px 2px rgba(12,10,9,.05);
  --shadow:           0 6px 24px -8px rgba(12,10,9,.12);
  --shadow-md:        var(--shadow);
  --shadow-lg:        0 24px 60px -16px rgba(12,10,9,.2);
}

/* ─── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; transition: background var(--transition), color var(--transition); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
a.lp-btn:hover { text-decoration: none; }
a.lp-btn-primary, a.lp-btn-primary:hover { color: var(--btn-pri-fg); }
a.lp-btn-ghost:hover { color: var(--accent); text-decoration: none; }
input, select, textarea { font-family: var(--font); }
button { cursor: pointer; font-family: var(--font); }
code, pre { font-family: var(--mono); }

/* ─── Mobile safety nets ─────────────────────────────────────────────── */
/* Media never forces the page wider than the viewport. NOT height:auto on
   canvas — Chart.js sets explicit pixel heights and auto would break them. */
img, svg, video, iframe { max-width: 100%; height: auto; }
canvas { max-width: 100%; }
/* Long unbroken tokens (API keys, hashes, URLs) are the main overflow
   driver in tables and detail panes. */
pre, code { overflow-x: auto; }
td, .detail-value { overflow-wrap: anywhere; }
h1, h2, h3, .display, .page-title, .stat-value, .topnav-brand, .lp-logo, .auth-logo-text, .lp-hero h1, .lp-section-title { font-family: var(--font-display); }

/* ─── Focus rings ────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ─── Utility ────────────────────────────────────────────────────────── */
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.font-mono { font-family: var(--mono); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .9rem; border-radius: var(--radius-btn);
  font-size: .85rem; font-weight: 500; border: none;
  transition: background 150ms ease, transform 100ms ease, box-shadow 150ms ease; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--btn-pri-bg); color: var(--btn-pri-fg); box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 2px 12px rgba(0,0,0,.3); }
.btn-primary:hover { color: var(--btn-pri-fg); transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 6px 20px rgba(0,0,0,.4); }
.btn-secondary { background: transparent; color: var(--text); border: 1.5px solid var(--border-strong); border-radius: var(--radius-btn); }
.btn-secondary:hover { background: var(--bg-secondary); }
.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid transparent; border-radius: var(--radius-btn); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-radius: var(--radius-btn); }
.btn-ghost:hover { background: var(--bg-secondary); color: var(--text); }
.btn-sm { padding: .3rem .65rem; font-size: .78rem; }
.btn-lg { padding: .65rem 1.4rem; font-size: .95rem; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-icon { padding: .45rem; width: 34px; height: 34px; justify-content: center; }

/* ─── Cards ──────────────────────────────────────────────────────────── */
/* The `hidden` attribute maps to a user-agent rule, [hidden]{display:none},
   which ANY author rule setting display overrides -- so a flex or grid element
   marked hidden still paints. That bug shipped once on the landing page promo
   banner, which showed with an empty amount while its offer was disabled.
   !important here is deliberate and narrow: `hidden` should mean hidden. */
[hidden] { display: none !important; }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-strong); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-size: .9rem; font-weight: 600; }

/* ─── Form elements ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.form-label { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.form-input {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: .5rem .75rem;
  font-size: .9rem; color: var(--text); width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition), background-image var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.15); }
.form-input::placeholder { color: var(--text-tertiary); }
.form-hint { font-size: .75rem; color: var(--text-tertiary); }
.form-error { font-size: .78rem; color: var(--danger); margin-top: .25rem; }

/* Valid input state */
.form-input.valid {
  border-color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2316A34A' d='M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 11.94l6.72-6.72a.75.75 0 0 1 1.06 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

/* Error input state */
.form-input.error {
  border-color: var(--danger);
  border-left-width: 3px;
  box-shadow: none;
}
.form-input.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Input wrapper for password/key toggles */
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper .form-input { padding-right: 2.5rem; }
.toggle-password {
  position: absolute; right: 0.6rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); padding: 0.25rem;
  display: flex; align-items: center;
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--text-secondary); }
.toggle-password svg { width: 16px; height: 16px; }

/* ─── Badge ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: var(--radius-pill);
  font-size: .72rem; font-weight: 500;
}
.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-yellow { background: var(--warning-light); color: var(--warning); }
.badge-purple { background: var(--accent-light); color: var(--accent-dark); }
.badge-grey { background: var(--bg-secondary, #f1f5f9); color: var(--text-tertiary, #64748b); }
.badge-gray { background: var(--bg-secondary); color: var(--text-secondary); }

/* ─── Table ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead tr { background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
th { padding: .65rem 1rem; text-align: left; font-weight: 500; color: var(--text-secondary); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-secondary); }

/* ─── Stat cards ─────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.25rem; }
.stat-label { font-size: .75rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; }
.stat-value { font-size: 1.6rem; font-weight: 600; color: var(--text); line-height: 1; }
.stat-sub { font-size: .75rem; color: var(--text-tertiary); margin-top: .25rem; }

/* ─── Navigation ─────────────────────────────────────────────────────── */
.topnav {
  height: var(--nav-h);
  background: var(--nav-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  /* viewport-fit=cover is declared on every page, so clear the notch in
     landscape. max() keeps the original 1.5rem on non-notched devices. */
  padding: 0 max(1.5rem, env(safe-area-inset-right)) 0 max(1.5rem, env(safe-area-inset-left));
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  gap: 1rem;
}
[data-theme="dark"] .topnav { background: var(--nav-glass); }
.topnav-brand { font-weight: 700; font-size: 1rem; color: var(--text); letter-spacing: -.02em; display: flex; align-items: center; gap: .5rem; }
.topnav-brand .logo-dot { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #6B72E2, #3B3F9E 78%); animation: lp-dot-pulse 5s ease-in-out infinite; }
.topnav-spacer { flex: 1; }
.topnav-actions { display: flex; align-items: center; gap: .5rem; }

.sidebar {
  width: var(--sidebar-w); background: var(--bg-secondary); border-right: 1px solid var(--border);
  position: fixed; top: var(--nav-h); bottom: 0; left: 0;
  padding: 1rem .75rem max(1rem, env(safe-area-inset-bottom));
  padding-left: max(.75rem, env(safe-area-inset-left));
  overflow-y: auto; z-index: 90;
}
.sidebar-section { margin-bottom: 1.5rem; }
.sidebar-section-label { font-size: .68rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .1em; padding: 0 .5rem; margin-bottom: .35rem; }
.sidebar-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .6rem; border-radius: var(--radius-md);
  font-size: .85rem; color: var(--text-secondary); font-weight: 500;
  transition: all var(--transition); cursor: pointer; text-decoration: none;
}
.sidebar-link:hover { background: var(--border); color: var(--text); text-decoration: none; }
.sidebar-link.active { background: var(--accent-light); color: var(--accent); }
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }

/* A Beta pill inside a sidebar link. Pushed to the trailing edge with
   margin-inline-start:auto so it sits away from the label regardless of the
   label's length, and stays correct under RTL. Reuses .beta-badge for colour
   and shape -- only the placement is specific to the sidebar. */
.sidebar-link .sidebar-beta {
  margin-inline-start: auto;
  flex-shrink: 0;
  font-size: 9px;
  padding: 1px 5px;
}

.main-content {
  margin-left: var(--sidebar-w); margin-top: var(--nav-h);
  padding: 2rem;
  /* dvh tracks the mobile URL bar; the vh line is the fallback and must
     come first so unsupporting browsers keep it. */
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100dvh - var(--nav-h));
}
.page-header { margin-bottom: 1.5rem; }
.page-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.page-subtitle { font-size: .85rem; color: var(--text-secondary); margin-top: .2rem; }

/* ─── INR price ticker ──────────────────────────────────────────────── */
.price-ticker { overflow: hidden; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-card); white-space: nowrap; }
.price-ticker-track { display: inline-flex; animation: ticker-scroll 46s linear infinite; }
.price-ticker span.pt-item { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); padding: 9px 22px; border-right: 1px dashed var(--border); }
.price-ticker b { color: var(--text); }
.price-ticker .pt-up { color: var(--success); }
.price-ticker .pt-accent { color: var(--accent-dark); font-weight: 700; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .price-ticker-track { animation: none; } }

/* ─── Gateway Pulse ──────────────────────────────────────────────────── */
.pulse-wrap { padding: 22px 24px 18px; overflow: hidden; position: relative; }
.pulse-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
.pulse-title h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.pulse-line { position: relative; height: 40px; display: flex; align-items: center; }
.pulse-rail { position: absolute; left: 0; right: 0; top: 50%; height: 8px; transform: translateY(-50%); border-radius: 4px; background: linear-gradient(90deg, var(--accent-tint), var(--accent) 45%, var(--accent) 55%, var(--accent-tint)); }
.pkt { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2.5px solid var(--accent); transform: translateY(-50%); animation: pulse-flow var(--pkt-dur, 3.2s) linear infinite; z-index: 1; }
.pkt.p2 { animation-delay: .55s; } .pkt.p3 { animation-delay: 1.1s; } .pkt.p4 { animation-delay: 1.65s; } .pkt.p5 { animation-delay: 2.2s; } .pkt.p6 { animation-delay: 2.75s; }
.pulse-wrap[data-load="low"] .pkt.p2, .pulse-wrap[data-load="low"] .pkt.p3, .pulse-wrap[data-load="low"] .pkt.p4, .pulse-wrap[data-load="low"] .pkt.p5, .pulse-wrap[data-load="low"] .pkt.p6 { display: none; }
.pulse-wrap[data-load="normal"] .pkt.p4, .pulse-wrap[data-load="normal"] .pkt.p5, .pulse-wrap[data-load="normal"] .pkt.p6 { display: none; }
.pulse-wrap[data-load="high"] .pkt.p5, .pulse-wrap[data-load="high"] .pkt.p6 { display: none; }
.pulse-wrap[data-load="low"] { --pkt-dur: 4.6s; }
.pulse-wrap[data-load="normal"] { --pkt-dur: 3.2s; }
.pulse-wrap[data-load="high"] { --pkt-dur: 2.2s; }
.pulse-wrap[data-load="peak"] { --pkt-dur: 1.5s; }
@keyframes pulse-flow { 0% { left: -2%; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
.pulse-ends { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); margin-top: 12px; }
.pulse-feed { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; font-family: var(--mono); font-size: 12.5px; color: var(--text-secondary); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pulse-feed b { color: var(--accent-dark); }
.pulse-feed .pf-txt { transition: opacity .35s; }
.pulse-feed .pf-txt.fade { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  /* Reduced motion: keep the packets visible and spread along the rail, just frozen. */
  .pkt { animation: none; }
  .pkt   { left: 8%; }  .pkt.p2 { left: 24%; } .pkt.p3 { left: 40%; }
  .pkt.p4 { left: 56%; } .pkt.p5 { left: 72%; } .pkt.p6 { left: 88%; }
}

/* ─── Logo mark (bar – sphere – bar, from the Velona brand mark) ───────── */
/* Brand mark stays indigo (logo colors are fixed, independent of the accent) */
.logo-mark { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; vertical-align: middle; }
.logo-mark i { display: block; width: 10px; height: 5.5px; border-radius: 2px; background: #5F66D6; font-style: normal; }
.logo-mark b { display: block; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #6B72E2, #3B3F9E 78%); font-weight: normal; animation: logo-orb 3s ease-in-out infinite; }
@keyframes logo-orb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .logo-mark b { animation: none; } }

/* ─── Theme toggle ───────────────────────────────────────────────────── */
.theme-toggle {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: var(--bg-secondary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); font-size: 1rem;
  /* The sun/moon SVGs use stroke="currentColor", so this drives the icon.
     --accent re-resolves per theme, so no [data-theme] override is needed. */
  color: var(--accent);
}
.theme-toggle:hover { background: var(--border); }

/* ─── Code blocks (always dark) ─────────────────────────────────────── */
.code-block {
  background: #0D1117; border: 1px solid #1E2A40;
  border-radius: var(--radius-md); padding: 1rem; overflow-x: auto;
  font-family: var(--mono); font-size: .82rem; line-height: 1.6;
  color: #E6EDF3;
}
.code-copy-wrap { position: relative; }
.code-copy-btn {
  position: absolute; top: .5rem; right: .5rem;
  background: #21262d; border: 1px solid #30363d;
  border-radius: var(--radius-sm); padding: .2rem .5rem; font-size: .72rem;
  color: #8b949e; cursor: pointer; transition: all var(--transition);
}
.code-copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── Alert / Toast ──────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-md); font-size: .85rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.alert-danger { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }

#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem; pointer-events: none;
}
.toast-item {
  background: var(--text); color: var(--bg); padding: .7rem 1rem;
  border-radius: var(--radius-md); font-size: .85rem; max-width: 300px;
  animation: slideIn .2s ease; box-shadow: var(--shadow-lg);
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  /* The safe-area floors keep the dialog clear of the notch and the home bar
     on a phone; 1rem is the ordinary case everywhere else. */
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
  /* The last resort: if a dialog is somehow still taller than the screen, the
     overlay itself scrolls rather than clipping the buttons away. */
  overflow-y: auto;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 1.5rem; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); animation: scaleIn .15s ease;
  /* Nothing bounded the height before, so a long dialog -- Create API key,
     Close account, New memory session -- simply ran off a short phone and its
     buttons could not be reached at all. */
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  /* Stops a flick at the end of the dialog from scrolling the page behind it. */
  overscroll-behavior: contain;
}
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-tertiary); font-size: 1.2rem; cursor: pointer; padding: .2rem; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ─── Spinner ────────────────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .6s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Auth pages ─────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg-secondary); }
.auth-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; width: 100%; max-width: 400px; box-shadow: var(--shadow); }

/* Split layout: gradient brand panel + form card, used by login/register */
.auth-split { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-split-left { background: var(--accent-grad); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-split-left .logo-mark i { background: rgba(255,255,255,.85); }
.auth-split-left .logo-mark b { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.auth-split-left h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.02em; line-height: 1.25; max-width: 400px; font-family: var(--font-display); }
.auth-split-quote { font-size: 14px; color: rgba(255,255,255,.85); border-left: 2px solid rgba(255,255,255,.6); padding-left: 16px; max-width: 380px; }
.auth-split-quote b { color: #fff; }
.auth-split-right { display: flex; align-items: center; justify-content: center; padding: 36px 20px; }
/* 768 to match the rest of the ladder. The brand panel is decorative
   marketing chrome — hiding it on small screens is intended. */
@media (max-width: 768px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-split-left { display: none; }
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo-text { font-size: 1.3rem; font-weight: 700; letter-spacing: -.03em; }
.auth-logo-dot { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #6B72E2, #3B3F9E 78%); display: inline-block; flex-shrink: 0; animation: lp-dot-pulse 5s ease-in-out infinite; margin-right: 8px; vertical-align: middle; }
.auth-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .35rem; }
.auth-sub { font-size: .85rem; color: var(--text-secondary); margin-bottom: 1.5rem; }
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--text-tertiary); font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: .65rem; width: 100%; padding: .55rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); font-size: .88rem; font-weight: 500; color: var(--text); cursor: pointer; transition: all var(--transition); text-decoration: none; }
.google-btn:hover { background: var(--bg-secondary); text-decoration: none; }
.github-btn { display: flex; align-items: center; justify-content: center; gap: .65rem; width: 100%; padding: .55rem; border: 1px solid #30363d; border-radius: var(--radius-md); background: #24292e; font-size: .88rem; font-weight: 500; color: #ffffff !important; cursor: pointer; transition: all var(--transition); text-decoration: none !important; }
.github-btn:hover { background: #2f363d; text-decoration: none !important; color: #ffffff !important; }
.github-btn svg { color: #ffffff; fill: #ffffff; flex-shrink: 0; }

/* ─── Landing page (legacy classes kept for compatibility) ───────────── */
.landing-nav { height: 60px; display: flex; align-items: center; padding: 0 2rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--nav-glass); backdrop-filter: blur(12px); z-index: 50; gap: 1rem; }
[data-theme="dark"] .landing-nav { background: rgba(14,16,36,0.88); }
.landing-nav-links { display: flex; gap: 1.5rem; flex: 1; margin-left: 2rem; }
.landing-nav-links a { font-size: .88rem; color: var(--text-secondary); font-weight: 500; }
.landing-nav-links a:hover { color: var(--text); text-decoration: none; }
.hero { max-width: 700px; margin: 0 auto; text-align: center; padding: 5rem 1.5rem 3rem; }
.hero-badge { display: inline-flex; align-items: center; gap: .4rem; background: var(--accent-light); color: var(--accent); padding: .3rem .75rem; border-radius: var(--radius-pill); font-size: .78rem; font-weight: 600; margin-bottom: 1.5rem; border: 1px solid var(--border-strong); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -.04em; line-height: 1.1; margin-bottom: 1rem; }
.hero-sub { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 2rem; line-height: 1.6; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; max-width: 900px; margin: 0 auto 4rem; padding: 0 1.5rem; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.feature-icon { font-size: 1.4rem; margin-bottom: .6rem; }
.feature-title { font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
.feature-desc { font-size: .82rem; color: var(--text-secondary); line-height: 1.5; }
.section-label { text-align: center; font-size: .75rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: .75rem; }
.section-title { text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: -.03em; margin-bottom: .5rem; color: var(--color-primary-teal); }
.section-sub { text-align: center; font-size: .9rem; color: var(--text-secondary); margin-bottom: 2.5rem; }
.container { max-width: 960px; margin: 0 auto; padding: 4rem 1.5rem; }

/* ─── Pricing table ──────────────────────────────────────────────────── */
.pricing-table th, .pricing-table td { text-align: center; }
.pricing-table td:first-child, .pricing-table th:first-child { text-align: left; }

/* ─── Status indicators ──────────────────────────────────────────────── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.green { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.red { background: var(--danger); }
.status-dot.yellow { background: var(--warning); }

/* ─── Animations ─────────────────────────────────────────────────────── */
.fade-in { animation: fadeInUp .3s ease both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Hamburger button ───────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 6px;
  border-radius: var(--radius-md);
  flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
}
.hamburger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: all 0.2s ease; }

/* ─── Sidebar overlay (mobile) ───────────────────────────────────────── */
/* Opacity + pointer-events rather than display, so the overlay can actually
   fade. `display` is not animatable: the old rule set a transition that could
   never run, and the backdrop appeared and vanished in one frame. */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 89;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s cubic-bezier(.22,.9,.24,1);
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

/* ─── App shell grid classes (replaces inline styles in dashboard.html) */
.dash-grid   { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; margin-bottom: 1.5rem; }
.dash-grid-2 { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.wallet-grid { display: grid; grid-template-columns: minmax(280px,340px) 1fr; gap: 1.5rem; align-items: start; }
.tool-page-grid { display: grid; grid-template-columns: minmax(360px, 720px) 1fr; gap: 1.5rem; align-items: start; }
/* A grid item defaults to min-width:auto, so the 1fr track refuses to shrink
   below its widest content and the pair overflows the container -- the API
   sample panel ended 37px past its own parent at 1280. minmax(0, 1fr) lets
   the track shrink; the content inside wraps instead. */
.tool-page-grid > * { min-width: 0; }

/* ─── Filter bar wrapper ─────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filter-bar input, .filter-bar select { width: 100%; max-width: 200px; }

/* ─── Responsive utilities ───────────────────────────────────────────── */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .dash-grid   { grid-template-columns: 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
  .wallet-grid { grid-template-columns: 1fr; }
  .tool-page-grid { grid-template-columns: 1fr; }
}

/* ── Sidebar drawer, up to 1024 ──────────────────────────────
   A tablet at 820px used to keep a fixed 200px rail, which ate a quarter of
   the width for navigation the reader was not using. The drawer now covers
   the whole touch range. */
@media (max-width: 1024px) {
  .hamburger { display: flex; }
  .main-content { margin-left: 0; }

  .sidebar {
    width: min(86vw, 300px);
    /* translate3d, not translateX: it promotes the layer so the slide runs on
       the compositor instead of repainting the list every frame. */
    transform: translate3d(-102%, 0, 0);
    visibility: hidden;
    /* Visibility is delayed so the panel is not focusable while it slides
       away -- without it, a closed drawer still takes tab focus. */
    transition: transform .3s cubic-bezier(.22,.9,.24,1),
                visibility 0s linear .3s;
    /* Keeps a flick at the end of the list from scrolling the page behind. */
    overscroll-behavior: contain;
  }
  .sidebar.open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    transition: transform .3s cubic-bezier(.22,.9,.24,1),
                visibility 0s linear 0s;
  }

  /* Locking the body is what stops the page behind the drawer scrolling
     under a drag. Set from shell.js while the drawer is open. */
  body.sidebar-open { overflow: hidden; }
}

/* Set by the observer in app.js whenever any dialog is visible, at every
   width: a dialog scrolling the page behind it is not a phone-only problem. */
body.modal-open { overflow: hidden; }

/* A drawer that flies in is motion, not decoration: honour the OS setting. */
@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar.open,
  .sidebar-overlay { transition: none; }
}

@media (max-width: 768px) {
  :root { --nav-h: 56px; }

  /* iOS Safari force-zooms any focused field below 16px and never zooms
     back out. html is 15px, so .9rem = 13.5px — every field on the site
     triggers it. 16px here is a hard floor, not a preference. */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="number"], input[type="tel"],
  input[type="url"], input[type="date"], input:not([type]),
  select, textarea, .form-input {
    font-size: 16px;
  }

  /* Touch targets — 44px is the accepted minimum tap area. */
  .btn, .btn-sm, .sidebar-link, .theme-toggle, .toggle-password,
  .filter-bar select, .filter-bar input {
    min-height: 44px;
  }
  .btn, .btn-sm { display: inline-flex; align-items: center; }

  .public-nav-links { display: none !important; }
  .main-content { padding: 0.75rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 1.1rem; }
  .card { padding: 1rem; }
  .dash-grid, .dash-grid-2, .tool-page-grid { grid-template-columns: 1fr; }
  /* Evaluator mobile rules live AFTER Section E, not here -- see the note
     at the end of that section. */
  /* ── Running text floor ──────────────────────────────────
     Docs sets .85rem on its body copy, which lands at 12.75px on a phone --
     readable on a laptop, tiring on a handset held at arm's length. 13px is
     the floor for anything someone reads a paragraph of; captions and labels
     are left alone, since they are glanced at rather than read. */
  /* A floor on the elements themselves, not on a container: the paragraphs
     that needed it sit in unclassed divs, so no ancestor selector reaches
     them. max() keeps anything already larger at its own size and only lifts
     what falls below 13px. */
  /* !important because docs sets font-size:.85rem as an INLINE style on each
     paragraph, and inline beats any stylesheet rule. The alternative is
     editing ~46 inline styles across the page, which would drift the moment
     anyone adds a step. max() means this only ever lifts text that falls
     below 13px and leaves anything larger alone. */
  p, li, td, dd { font-size: max(13px, 1em) !important; }
  /* Captions and labels are glanced at rather than read, so they keep their
     smaller sizes. */
  .text-xs, .stat-sub, .text-tertiary, figcaption,
  .badge, .lp-stat-label { font-size: unset; }

  /* Docs — #doc-tabs is already a scrolling strip, which is the right
     mobile pattern; just tighten its gutters. */
  #doc-tabs { padding: 0 1rem !important; }
  #doc-content { padding: 1.5rem 1rem !important; }
  /* Reflow to two columns rather than dropping cols 3-4 — hiding them
     lost real data (pricing/context) on every phone. */
  /* .model-row and .err-code mobile rules live AFTER Section D -- their base
     rules are defined there, and would otherwise win on position. */
  /* Toast */
  #toast { bottom: max(1rem, env(safe-area-inset-bottom)); right: 1rem; left: 1rem; }
  .toast-item { max-width: 100%; }
  /* Notification panel */
  /* Fixed to the viewport rather than hung off the bell. The old rule was
     `width: calc(100vw - 2rem); right: -1rem`, which positions relative to
     the bell's container -- on a narrow screen that put the panel's left edge
     off screen, and a long list had no height bound so it ran past the
     bottom with no way to scroll it. */
  #notifPanel {
    /* !important throughout: shell.js writes position, top, right, width and
       max-height as inline styles on this element, and an inline style beats
       any stylesheet rule. The alternative is editing the markup string in
       shell.js, which would lose the desktop layout that those inline values
       are there to provide. */
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: calc(var(--nav-h) + 8px) !important;
    width: auto !important;
    max-height: 70dvh !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }

  /* Collapse any multi-column grid to a single column. !important is
     required to beat inline style="grid-template-columns:..." — a
     deliberate, documented exception on this one utility. */
  .stack-md { grid-template-columns: 1fr !important; }

  /* ── Card-stacked tables ──────────────────────────────────────────
     Opt-in via .stack-table. Labels come from the table's own <thead>
     at runtime (js/responsive-table.js), so no markup changes are
     needed in the ~28 JS-rendered tbodies. */
  .stack-table thead {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .stack-table, .stack-table tbody { display: block; width: 100%; }
  .stack-table tbody tr {
    display: block; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: .35rem .85rem; margin-bottom: .75rem;
  }
  .stack-table tbody tr:hover { background: var(--bg-card); }
  .stack-table td {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 1rem; border: none; padding: .4rem 0; text-align: right;
    font-size: .85rem;
  }
  .stack-table td + td { border-top: 1px solid var(--border); }
  .stack-table td::before {
    content: attr(data-label);
    font-size: .72rem; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-secondary);
    text-align: left; flex-shrink: 0;
  }
  /* Rows with no data-label (loading spinners, "no results" states) keep
     their natural full-width rendering. */
  .stack-table td:not([data-label]) { display: block; text-align: center; }
  .stack-table td:not([data-label])::before { content: none; }
}

/* Opt-in for space-between flex rows holding a .btn. .btn is globally
   white-space: nowrap (style.css:187), so such a row cannot give way and a
   label that grows at runtime spills past the viewport, scrolling the whole
   document sideways. Same !important rationale as .stack-md: every row using
   this sets display:flex in an inline style attribute. */
@media (max-width: 560px) {
  .stack-flex { flex-direction: column !important; align-items: stretch !important; gap: .85rem; }
  /* Direct child only. A .btn nested inside a value group (settings' "Copy"
     beside a <code>) must keep its intrinsic width — stretching it strands a
     24px affordance across the full row, detached from what it acts on. */
  .stack-flex > .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .stat-value { font-size: 1.3rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 1rem; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; justify-content: center; }
  /* Keep the safe-area floor from the base rule while tightening padding. */
  .topnav {
    padding: 0 max(0.75rem, env(safe-area-inset-right)) 0 max(0.75rem, env(safe-area-inset-left));
    gap: 0.5rem;
  }
  .main-content { padding: 0.6rem; }
  .page-header { margin-bottom: 1rem; }
  .hide-mobile { display: none !important; }
  /* Filter bar full-width on small phones */
  .filter-bar input, .filter-bar select { max-width: 100%; }
  /* Density fallback for tables that can't card-stack (no <thead>). */
  .table-wrap table { font-size: .78rem; }
  .table-wrap :where(th, td) { padding: .5rem .6rem; }
}

/* ── Top bar, small screens ──────────────────────────────────
   The email and the Sign out button are what overflow a 360px bar: a real
   address renders ~190px wide, which pushes .topnav-actions to ~462px and
   takes Sign out off screen entirely. Both move into the sidebar's Account
   section below 1024 (see shell.js), so nothing is lost -- and the bell and
   theme toggle, which are one tap each, stay where they are. */
/* Desktop keeps the top bar, so the sidebar copies stay hidden and nothing is
   duplicated. */
.sidebar-only { display: none; }

@media (max-width: 768px) {
  #nav-user,
  #navSignOut { display: none; }

  /* ── Sign-in screens ─────────────────────────────────────
     The brand panel is hidden on phones, so these are the whole page. */

  /* 40px, just under the floor, on the one control a new visitor is most
     likely to reach for. */
  .google-btn,
  .github-btn { min-height: 44px; }

  /* Seven 44px boxes plus six 8px gaps need 356px, and the card's content box
     is 338 at a 360px viewport -- so the last digit sat outside it. Letting
     the boxes shrink keeps all seven on one line, which is the point of the
     layout: a wrapped code is much harder to check against the email. */
  #otp-boxes { gap: 6px !important; }
  #otp-boxes input {
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
    max-width: 44px;
  }

  /* The hamburger and the brand are on every signed-in page, so each counted
     once per page in the audit. Both were under 40px. */
  .hamburger {
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
  }
  .topnav-brand { min-height: 40px; }
}

/* 1024, not 768: this is where the drawer takes over, so this is where the
   sidebar has to carry what the top bar drops. */
@media (max-width: 1024px) {
  .sidebar-only {
    display: flex;
    width: 100%;
    background: none;
    border: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
}

@media (max-width: 360px) {
  /* `html { font-size: 14px }` used to live here. It shrank every rem on the
     page to buy width in the top bar, and the cost was body copy: docs ran at
     11.2px with 57 of its 58 paragraphs under 13px. The bar is handled
     properly now -- the email and Sign out moved into the sidebar in Task 2 --
     so the text does not have to pay for it. */
  .topnav-actions .btn-ghost { padding: .25rem .4rem; font-size: .75rem; }
  .stat-grid { grid-template-columns: 1fr; }
}

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION A: Shared background utilities & page-specific overrides
   ═══════════════════════════════════════════════════════════════════════════ */
body.page-landing::before,
body.page-about::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
[data-theme="dark"] body.page-landing::before,
[data-theme="dark"] body.page-about::before { opacity: 0.25; }

body.page-landing main, body.page-landing nav, body.page-landing footer,
body.page-landing section, body.page-landing .lp-container,
body.page-about main, body.page-about nav { position: relative; z-index: 1; }

body.page-evaluator { overflow: hidden; }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION B: Landing page — all lp-* classes and landing-specific keyframes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Navbar ─────────────────────────────────────────────── */
.lp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

[data-theme="dark"] .lp-nav {
  background: rgba(10, 10, 10, 0.85);
}

.lp-nav-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.lp-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.lp-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: inline-block;
  flex-shrink: 0;
  animation: lp-dot-pulse 5s ease-in-out infinite;
}

.lp-nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.lp-nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.lp-nav-links a:hover {
  color: var(--text);
}

.lp-nav-links a.active,
.public-nav-link.active {
  color: var(--accent);
  font-weight: 600;
}

.lp-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lp-theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s ease, border-color 0.15s ease;
  line-height: 1;
  color: var(--accent);   /* icon SVGs use stroke="currentColor" */
}

.lp-theme-btn:hover {
  background: var(--border);
}

/* ── Marketing buttons ─────────────────────────────────── */
.lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-btn);
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.lp-btn-primary {
  background: var(--btn-pri-bg);
  color: var(--btn-pri-fg);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 2px 12px rgba(0,0,0,.3);
}

.lp-btn-primary:hover {
  color: var(--btn-pri-fg);
  transform: translateY(-0.5px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 6px 20px rgba(0,0,0,.4);
}

.lp-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
}

.lp-btn-ghost:hover {
  border-color: var(--color-terracotta);
  color: var(--color-terracotta);
}

.lp-btn-lg {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
}

.lp-btn-cta {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
}

/* ── Hero ───────────────────────────────────────────────── */
.lp-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 120px 1.5rem 80px;
  background: radial-gradient(ellipse 50% 40% at 50% 45%, rgba(11, 60, 66, 0.05) 0%, transparent 70%);
  background-size: 200% 200%;
  animation: lp-ambient 18s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.lp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 14px;
  margin-bottom: 28px;
  opacity: 0;
  animation: lp-badge-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) 0s both paused;
}

[data-theme="dark"] .lp-hero-badge {
  color: var(--accent-dark);
}

.lp-hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
  opacity: 0;
  animation: lp-h1-reveal 0.45s ease 0.18s both paused;
}

.lp-hero-sub {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  opacity: 0;
  animation: lp-fade-up 0.4s ease 0.40s both paused;
}

.lp-hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: lp-fade-up 0.4s ease 0.55s both paused;
}

.lp-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 48px;
  flex-wrap: wrap;
  opacity: 0;
  animation: lp-fade-up 0.4s ease 0.68s both paused;
}

.lp-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 32px;
}

.lp-stat-num {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.lp-stat-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.lp-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── ₹ shimmer ──────────────────────────────────────────── */
.accent-inr {
  color: var(--gold);
  font-size: 1.05em;
}

.accent-inr.shimmer-active {
  background: linear-gradient(90deg, var(--gold) 0%, #FDE68A 40%, var(--gold) 60%, var(--gold) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: lp-shimmer 1.2s linear 0s 1 both;
}

/* ── CTA arrow ──────────────────────────────────────────── */
.lp-cta-arrow {
  display: inline-block;
}

.lp-cta-arrow.nudge-active {
  animation: lp-arrow-nudge 0.7s ease 0s 1 both;
}

/* ── Code demo block ────────────────────────────────────── */
.lp-code-wrap {
  max-width: 660px;
  margin: 56px auto 0;
  padding: 0 1.5rem;
  opacity: 0;
  animation: lp-code-rise 0.45s ease 0.85s both paused;
}

.lp-code-block {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.lp-code-chrome {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #21262d;
  background: #161b22;
}

.lp-code-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.lp-code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.lp-code-dot-red {
  background: #ff5f57;
}

.lp-code-dot-yellow {
  background: #febc2e;
}

.lp-code-dot-green {
  background: #28c840;
}

.lp-code-filename {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: #8b949e;
  font-family: var(--mono);
}

.lp-code-body {
  padding: 20px;
  overflow-x: auto;
  animation: lp-code-reveal 0.55s cubic-bezier(0.4, 0, 0.2, 1) 1.05s both paused;
}

.lp-code-body pre {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: #e6edf3;
  margin: 0;
  white-space: pre;
}

.lp-copy-btn {
  position: absolute;
  top: 52px;
  right: 14px;
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: var(--radius-sm);
  color: #8b949e;
  font-size: 12px;
  font-family: var(--font);
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lp-copy-btn:hover {
  background: #30363d;
  color: #e6edf3;
}

/* Blinking caret */
.lp-caret::after {
  content: '▋';
  color: #e6edf3;
  animation: lp-caret-blink 1s step-end infinite;
  margin-left: 1px;
}

/* Syntax colors */
.syn-kw {
  color: #ff7b72;
}

.syn-str {
  color: #a5d6ff;
}

.syn-fn {
  color: #d2a8ff;
}

.syn-cm {
  color: #8b949e;
}

.syn-plain {
  color: #e6edf3;
}

/* ── Section layout ─────────────────────────────────────── */
.lp-section {
  padding: 40px 1.5rem;
}

.lp-container {
  max-width: 1100px;
  margin: 0 auto;
}

.lp-section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-terracotta);
  font-weight: 600;
  text-align: center;
}

.lp-section-title {
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  text-align: center;
  margin-top: 10px;
}

.lp-section-sub {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 10px;
  line-height: 1.6;
}

/* scroll-reveal base state */
.sr-item {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.sr-item.sr-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Feature cards ──────────────────────────────────────── */
.lp-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 56px;
  position: relative;
}

.lp-features-grid::before {
  content: '';
  position: absolute;
  /* THE SIDE BLEED IS ZERO ON PURPOSE.
     This was `inset: -40px -60px`, so the hex pattern ran 60px past each edge
     and made the landing page scroll 38px sideways at every width -- 398
     against a 360 viewport, 1137 against 1024. A pseudo-element cannot be
     found by querySelectorAll, which is why the page looked clean to an
     element sweep while still scrolling.
     It keeps its vertical bleed, where there is nothing to overflow. */
  inset: -40px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='69.28' viewBox='0 0 60 69.28'%3E%3Cpolygon points='30%2C2 58%2C17.64 58%2C51.64 30%2C67.28 2%2C51.64 2%2C17.64' fill='none' stroke='%230B3C42' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 60px 69.28px;
  background-repeat: repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* clip, not hidden: `hidden` would create a scroll container and break any
   position:sticky inside this section. `clip` contains the decoration
   without that side effect. */
.lp-features-grid { overflow-x: clip; }

.lp-features-grid > * {
  position: relative;
  z-index: 1;
}

.lp-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.45s ease;
}

.lp-feature-card:hover {
  border-color: var(--border-strong);
}

.lp-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.lp-feature-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 16px;
}

.lp-feature-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ── Testimonials ───────────────────────────────────────── */
.lp-testimonials {
  background: var(--bg);
}

.lp-testi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

@media (max-width: 640px) {
  .lp-testi-grid {
    grid-template-columns: 1fr;
  }
}

.lp-testi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.lp-testi-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.lp-testi-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.lp-testi-mark {
  font-size: 2.5rem;
  color: var(--accent-tint);
  line-height: 0.5;
  margin-bottom: 8px;
}

.lp-testi-quote {
  font-size: 15px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
}

.lp-testi-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 14px;
}

.lp-testi-role {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ── FAQ ────────────────────────────────────────────────── */
.lp-faq {
  background: var(--bg);
}

.lp-faq-item {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.lp-faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  gap: 12px;
}

.lp-faq-toggle {
  font-size: 1.25rem;
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
}

.lp-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.lp-faq-item.open .lp-faq-answer {
  max-height: 200px;
}

.lp-faq-answer-inner {
  padding-bottom: 16px;
}

/* ── Pricing preview ────────────────────────────────────── */
.lp-pricing-band {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lp-pricing-table-wrap {
  max-width: 600px;
  margin: 32px auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.lp-pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lp-pricing-table thead tr {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.lp-pricing-table th {
  padding: 11px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lp-pricing-table th:not(:first-child),
.lp-pricing-table td:not(:first-child) {
  text-align: right;
}

.lp-pricing-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.lp-pricing-table td:first-child {
  color: var(--text-secondary);
  font-weight: 400;
}

.lp-pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.lp-pricing-table tbody tr:hover {
  background: var(--bg-secondary);
}

/* ── CTA section ────────────────────────────────────────── */
.lp-cta-section {
  padding: 60px 1.5rem;
  text-align: center;
  background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(11, 60, 66, 0.05) 0%, transparent 70%);
}

/* ── Footer ─────────────────────────────────────────────── */
.lp-footer {
  border-top: 1px solid var(--border);
  padding: 32px 1.5rem;
}

.lp-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.lp-footer-copy {
  font-size: 13px;
  color: var(--text-tertiary);
}

.lp-footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.lp-footer-links a {
  font-size: 13px;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}

.lp-footer-links a:hover {
  color: var(--text);
}

.footer-social { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.footer-social-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; color: #fff; text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.footer-social-icon:hover { transform: translateY(-1px); opacity: 0.9; }
.footer-social-icon svg { width: 16px; height: 16px; }

/* ── Footer, small screens ───────────────────────────────────
   Thirteen links at 21px tall, wrapped into a dense block, is the single
   biggest cluster of mis-taps on every public page -- 16 of the 23 sub-40px
   controls on /privacy are here. Two columns with real tap height turns the
   block into a list people can actually hit. */
@media (max-width: 768px) {
  .lp-footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
  }
  .lp-footer-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
  /* 32px is under the 44px floor but the icons are square and spaced; padding
     grows the hit area without changing how they look. */
  .footer-social-icon {
    width: 44px;
    height: 44px;
  }
  .footer-social-icon svg { width: 18px; height: 18px; }
}

/* Company info row — sits below the copy/links/social row, separated by a
   hairline. :not(:empty) keeps the divider from showing before the JS fills
   the wrapper in, and when no COMPANY_* env vars are configured at all. */
.footer-info-wrap:not(:empty) {
  max-width: 1100px;
  margin: 20px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.6;
}
.footer-info-item { display: inline-flex; align-items: center; gap: 6px; }
.footer-info-icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.85; }
.footer-info-item a { color: var(--text-tertiary); transition: color 0.15s ease; }
.footer-info-item a:hover { color: var(--text); }

/* ── Landing-specific beta badge ────────────────────────── */
.beta-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--color-primary-teal);
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════
   KEYFRAMES — Landing page
══════════════════════════════════════════════════════════ */

/* Badge pop — overshoot */
@keyframes lp-badge-pop {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }

  70% {
    opacity: 1;
    transform: scale(1.05);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* H1 blur-clear rise */
@keyframes lp-h1-reveal {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Generic fade-up */
@keyframes lp-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Code card rise */
@keyframes lp-code-rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Code body L→R clip reveal */
@keyframes lp-code-reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0% 0 0);
  }
}

/* Caret blink */
@keyframes lp-caret-blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* ₹ shimmer sweep */
@keyframes lp-shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* Logo dot pulse */
@keyframes lp-dot-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.45);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0);
  }
}

/* Hero ambient gradient drift */
@keyframes lp-ambient {

  0%,
  100% {
    background-position: 45% 45%;
  }

  33% {
    background-position: 55% 40%;
  }

  66% {
    background-position: 50% 55%;
  }
}

/* CTA arrow double-nudge */
@keyframes lp-arrow-nudge {
  0% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(4px);
  }

  40% {
    transform: translateX(0);
  }

  60% {
    transform: translateX(4px);
  }

  80%,
  100% {
    transform: translateX(0);
  }
}

/* ── Landing page mobile menu ───────────────────────────── */
.lp-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 6px;
  border-radius: var(--radius-md);
  flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
  width: 36px; height: 36px; flex-shrink: 0;
}
.lp-hamburger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: all 0.2s ease; }

/* display is not animatable, so the menu used to snap open in one frame. It
   is always `display: flex` now and hidden with opacity + visibility, which
   can transition -- the same approach as the app sidebar drawer. */
.lp-mobile-menu {
  display: flex; position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--bg-card); z-index: 99; flex-direction: column;
  padding: 1rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  border-top: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  /* Visibility is delayed on the way out so the panel is not focusable while
     it fades -- otherwise a closed menu still takes tab focus. */
  transition: opacity .22s var(--ease-out),
              transform .22s var(--ease-out),
              visibility 0s linear .22s;
}
.lp-mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .22s var(--ease-out),
              transform .22s var(--ease-out),
              visibility 0s linear 0s;
}

/* The three bars become an X while the menu is open, so the control says what
   tapping it will do. */
.lp-hamburger span { transition: transform .22s var(--ease-out), opacity .22s var(--ease-out); }
.lp-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.lp-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.lp-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

@media (prefers-reduced-motion: reduce) {
  .lp-mobile-menu,
  .lp-mobile-menu.open,
  .lp-hamburger span { transition: none; }
}
/* :not(.lp-btn) is load-bearing. Without it this rule ties on specificity with
   a.lp-btn-primary (style.css:129) and wins on source order, painting the CTA's
   text in --text over its own --btn-pri-bg background: invisible in both themes.
   It also overrode .lp-btn's inline-flex, side padding, and added a divider. */
.lp-mobile-menu a:not(.lp-btn) {
  padding: 0.85rem 0; font-size: 1rem; font-weight: 500;
  color: var(--text); border-bottom: 1px solid var(--border);
  text-decoration: none; display: block;
}
.lp-mobile-menu a:not(.lp-btn):hover { color: var(--accent); text-decoration: none; }
.lp-mobile-menu .lp-mobile-cta { margin-top: 1rem; }

/* ── Public nav, tablet band ─────────────────────────────────
   The full nav needs 1054px and the row is 979 at a 1024 viewport, so the
   links pushed the Sign in / Dashboard actions 113px past the edge and the
   page scrolled sideways. The links are shrinkable but their text is not, so
   no amount of flex-shrink saves it -- the menu has to take over, and 1024 is
   where the app sidebar becomes a drawer too. */
@media (min-width: 769px) and (max-width: 1024px) {
  .lp-hamburger { display: flex; }
  .public-nav-links,
  .lp-nav-links { display: none !important; }
}

/* ── Landing page responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .lp-hamburger { display: flex; }
  .lp-nav-links {
    display: none;
  }

  .lp-hero {
    padding: 80px 1.5rem 60px;
  }

  .lp-hero h1 {
    font-size: 36px !important;
  }

  .lp-hero-sub {
    font-size: 15px;
  }

  .lp-features-grid {
    grid-template-columns: 1fr;
  }

  .lp-stat-divider {
    display: none;
  }

  .lp-stats {
    gap: 16px;
  }


  .lp-stat {
    padding: 0 16px;
  }

  .lp-code-body pre {
    font-size: 12px;
  }

  .lp-code-wrap {
    overflow-x: auto;
  }
  /* Hide secondary nav actions, keep primary CTA only.
     .seo-nav covers the generated model pages and the blog/custom renderers,
     whose action wrappers are not .lp-nav-actions. */
  .lp-nav-actions .lp-btn-ghost,
  .seo-nav .lp-btn-ghost,
  .seo-nav-actions .lp-btn-ghost { display: none; }

  /* The nav row is flex-shrink:0, so anything that doesn't fit becomes page
     width rather than wrapping. Reclaim ~50px of padding and gap. */
  .lp-nav       { padding: 0 1rem; }
  .lp-nav-inner { gap: 0.75rem; }

  /* Touch targets — bump below-44px tap heights on small screens */
  .lp-btn { padding: 11px 20px; min-height: 44px; }
  .lp-hamburger { width: 44px; height: 44px; }
  .theme-toggle, .lp-theme-btn, .about-theme-btn { min-width: 40px; min-height: 40px; }
}

/* CTA label swap. Both labels ship in the markup and CSS picks one, so no
   resize listener is needed and the generated static pages work identically. */
.cta-short { display: none; }

@media (max-width: 450px) {
  /* ~40px still overflows at 360-390px after the 768px reclaim. Drop the Beta
     badge and shorten the CTA rather than hiding it — it's why the nav exists.
     450px, not 430px: measured on the real page, the long "Get started free"
     label still spilled .public-nav-actions by 5px across 431-440px. */
  .beta-badge { display: none; }
  .cta-long   { display: none; }
  .cta-short  { display: inline; }
  #public-nav-guest .lp-btn-primary,
  .seo-nav .lp-btn-primary { font-size: 12.5px; padding: 10px 12px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .lp-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Landing page prefers-reduced-motion ────────────────── */
@media (prefers-reduced-motion: reduce) {

  .lp-hero-badge,
  .lp-hero h1,
  .lp-hero-sub,
  .lp-hero-cta,
  .lp-stats,
  .lp-code-wrap,
  .lp-code-body {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
    animation: none !important;
  }

  .lp-logo-dot {
    animation: none !important;
  }

  .lp-hero {
    animation: none !important;
  }

  .sr-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION C: About page — all about-* classes
   ═══════════════════════════════════════════════════════════════════════════ */

.main-content { background: var(--bg) !important; }

/* ── Nav ────────────────────────────────────────────────────── */
.about-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}
[data-theme="dark"] .about-nav { background: rgba(10, 10, 10, 0.85); }

.about-nav-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.about-nav-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font);
}

.about-nav-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.about-theme-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease;
  color: var(--accent);   /* icon SVGs use stroke="currentColor" */
}
.about-theme-btn:hover { background: var(--border); }

/* ── Shell ──────────────────────────────────────────────────── */
.about-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Hero ───────────────────────────────────────────────────── */
.about-hero {
  padding: 3rem 0 2rem;
}

.about-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.about-hero h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.about-lead {
  max-width: 760px;
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

/* ── Grid ───────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

/* ── Cards ──────────────────────────────────────────────────── */
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.about-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

/* ── Section ────────────────────────────────────────────────── */
.about-section {
  margin: 3rem 0;
}

.about-overline {
  display: block;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 18px;
}

.about-section h2 {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  font-size: 1.6rem;
  color: var(--text);
}

.about-section p {
  line-height: 1.9;
  color: var(--text-secondary);
}

/* ── Divider ────────────────────────────────────────────────── */
.about-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Contact ────────────────────────────────────────────────── */
.about-contact {
  text-align: center;
  padding: 1rem 0;
  color: var(--text-secondary);
}
.about-contact p + p { margin-top: 0.85em; }
.about-contact a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: opacity 0.15s;
}
.about-contact a:hover { opacity: 0.75; }

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION D: Docs page — all doc-*, ep-*, field-*, req-badge, etc. classes
   ═══════════════════════════════════════════════════════════════════════════ */

/* Doc tabs */
.doc-tab {
  display: inline-block;
  padding: 10px 16px;
  font-size: .82rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  cursor: pointer;
  margin-bottom: -1px;
}
.doc-tab:hover { color: var(--accent); text-decoration: none; }
.doc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Doc sections */
.doc-section { padding-top: 56px; padding-bottom: 8px; }
.doc-h2 { font-size: 1.25rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; margin-bottom: .45rem; }
.doc-h3 { font-size: .92rem; font-weight: 600; color: var(--text); margin: 1.25rem 0 .5rem; }
.doc-sub { font-size: .88rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 1.5rem; }

/* Step cards — connected stack */
.step-card {
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  background: var(--bg);
}

/* Info note box */
.info-note {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
  padding: .75rem 1rem;
  font-size: .84rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 1rem;
}
[data-theme="dark"] .info-note { background: var(--accent-light); color: var(--text-secondary); }

/* Language switcher pills */
.lang-switcher-wrap { display: flex; flex-direction: column; gap: .4rem; }
.lang-pills { display: flex; gap: .35rem; }
.lang-pill {
  padding: .2rem .65rem;
  font-size: .75rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all .12s;
}
.lang-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.lang-pill:not(.active):hover { color: var(--accent); border-color: var(--accent); }

/* Endpoint cards */
.ep-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.ep-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.1rem;
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.ep-header:hover { background: var(--bg-secondary); }
.ep-body {
  padding: 1.1rem 1.1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.ep-path {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text);
  flex-shrink: 0;
}
.ep-desc {
  font-size: .82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.ep-arrow {
  font-size: .8rem;
  color: var(--text-tertiary);
  transition: transform .2s;
  flex-shrink: 0;
}
.ep-card.open .ep-arrow { transform: rotate(180deg); }

/* Method badges */
.method-badge {
  display: inline-flex;
  align-items: center;
  padding: .18rem .55rem;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.method-post { background: var(--accent-light); color: var(--accent); }
.method-get  { background: var(--bg-secondary); color: var(--text-secondary); }

/* Field table */
.field-table {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: .8rem;
}
.field-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr .85fr 2fr;
  gap: .5rem;
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.field-header {
  background: var(--bg-secondary);
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.field-row code { font-size: .76rem; }
.req-badge {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
}
.req-badge.req { background: #fef2f2; color: #991b1b; }
.req-badge.opt { background: var(--bg-secondary); color: var(--text-secondary); }
[data-theme="dark"] .req-badge.opt { background: var(--bg-secondary); color: var(--text-secondary); }

/* Model table rows */
.model-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: .5rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  align-items: center;
}
.model-row code { font-size: .78rem; }

/* Error code rows */
.err-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.err-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .15rem .5rem;
  border-radius: 5px;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 36px;
}
.err-code { font-family: var(--mono); font-size: .78rem; flex-shrink: 0; color: var(--text); min-width: 180px; }
.err-desc { color: var(--text-secondary); font-size: .82rem; }

/* ── Error table and model rows, small screens ───────────────
   MUST STAY AFTER THE BASE RULES ABOVE. These were in the shared Responsive
   block near the top of the file, where the later base rules outranked them:
   .model-row kept four columns on a phone and .err-code kept its 180px floor,
   so the error table pushed the page sideways. */
@media (max-width: 768px) {
  /* Two columns, not one: dropping to a single column would lose the pricing
     and context values, which are the reason to look at this table. */
  .model-row { grid-template-columns: 1fr 1fr; }
  .err-code  { min-width: 100px; font-size: .72rem; }

  /* Docs carries ~35 of these per page -- the language pills above each
     sample and the copy button on every block. They are 21px tall, which is
     half a fingertip. Padding grows the tap area; the pills keep their size
     because the text inside them does not change. */
  .lang-pill {
    /* 40px rather than 36: the brief's floor is 36, but anything under 40 is
       still a miss-prone target and the audit counts it as one. The pills sit
       on their own row, so the extra height costs no layout. */
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  .lang-pills { flex-wrap: wrap; gap: .4rem; }

  /* The copy button is absolutely positioned in the corner of the block, so
     giving it real height does not reflow the sample -- and a real box is
     better than a ::after hit area, which a finger can use but no
     measurement can see. */
  .code-copy-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: .2rem .7rem;
  }
}

/* ── Docs parameter/reference rows ────────────────────────────────────
   The docs page builds its reference tables as grids on otherwise
   classless divs. These three classes replace the inline
   grid-template-columns so the columns can reflow on narrow screens
   instead of crushing to ~90px each. */
.doc-row-2 { display: grid; grid-template-columns: 1fr 2fr; }
.doc-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; }
.doc-row-3-alt { display: grid; grid-template-columns: 1fr 1fr 2fr; }
.doc-row-4 { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr; }
.doc-row-4-alt { display: grid; grid-template-columns: 1.3fr 1fr 1.6fr 1.3fr; }
.doc-row-4-wide { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; }

@media (max-width: 768px) {
  .doc-row-3, .doc-row-3-alt,
  .doc-row-4, .doc-row-4-alt, .doc-row-4-wide {
    grid-template-columns: 1fr 1fr;
    gap: .15rem 1rem;
  }
}
@media (max-width: 480px) {
  .doc-row-2, .doc-row-3, .doc-row-3-alt,
  .doc-row-4, .doc-row-4-alt, .doc-row-4-wide {
    grid-template-columns: 1fr;
    gap: .1rem;
  }
}

/* Code block override for doc page — always dark */
.code-block {
  background: #0D1117;
  border: 1px solid #1E2A40;
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--mono);
  font-size: .79rem;
  line-height: 1.7;
  color: #E6EDF3;
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}
[data-theme="dark"] .code-block { background: #0D1117; border-color: #1E2A40; color: #E6EDF3; }

@media (max-width: 768px) {
  .ep-desc { display: none; }
  /* Reflow rather than hiding cols 3-4 — the dropped columns were the
     parameter's type and description, i.e. the useful part. */
  .field-row { grid-template-columns: 1fr 1fr; }
  /* .field-header is itself a .field-row, so it reflows with the data
     rows above — hiding its cols 3-4 here would leave the wrapped data
     columns without headings. */
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION E: Evaluator page — all ev-* classes and keyframes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────── */
.ev-page {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-h));
  height: calc(100dvh - var(--nav-h));
  margin-left: var(--sidebar-w); margin-top: var(--nav-h);
  overflow: hidden;
}
.ev-top    { flex-shrink: 0; padding: 12px 16px 8px; }
.ev-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Slot selector ───────────────────────────────────────── */
.ev-slots { display: flex; gap: 10px; margin-bottom: 0; }
.ev-slot {
  flex: 1; border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md); padding: 10px 12px;
  cursor: pointer; transition: all 0.15s ease;
  border-top: 3px solid var(--slot-color, var(--border-strong));
  background: var(--bg-card); min-height: 60px;
  display: flex; align-items: center; gap: 8px;
  user-select: none;
}
.ev-slot:hover  { border-color: var(--accent); border-top-color: var(--slot-color, var(--accent)); }
.ev-slot.filled { border-style: solid; }
.ev-slot-empty  { display: flex; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 13px; }
.ev-slot-plus   { width: 20px; height: 20px; border-radius: 50%; border: 1.5px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; }
.ev-slot-info   { flex: 1; min-width: 0; }
.ev-slot-name   { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-slot-prov   { font-size: 11px; color: var(--text-tertiary); }
.ev-slot-dot    { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ev-slot-x      { margin-left: auto; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-tertiary); background: var(--bg-secondary); cursor: pointer; transition: all 0.1s; }
.ev-slot-x:hover { background: var(--danger-light); color: var(--danger); }

/* ── Response grid ───────────────────────────────────────── */
.ev-grid {
  display: grid; gap: 1px; background: var(--border);
  flex: 1; overflow: hidden; min-height: 0;
}
.ev-grid[data-count="2"] { grid-template-columns: repeat(2,1fr); }
.ev-grid[data-count="3"] { grid-template-columns: repeat(3,1fr); }
.ev-grid[data-count="4"] { grid-template-columns: repeat(4,1fr); }

/* ── Response panel ──────────────────────────────────────── */
.ev-panel {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-card);
  border-top: 3px solid var(--slot-color, var(--border));
}
.ev-panel-hdr {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
  background: var(--bg-secondary); min-height: 38px;
}
.ev-panel-hdr-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.ev-panel-hdr-prov { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
.ev-panel-body {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.7; color: var(--text);
}
.ev-panel-body::-webkit-scrollbar { width: 4px; }
.ev-panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.ev-panel-body pre { background: #0d1117; border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: .5rem 0; }
.ev-panel-body code { font-family: var(--mono); font-size: 12px; color: #e6edf3; }
.ev-panel-body p { margin: .4rem 0; }

/* ── Metrics bar ─────────────────────────────────────────── */
.ev-metrics {
  display: flex; align-items: center; padding: 0 10px; height: 32px;
  border-top: 1px solid var(--border); flex-shrink: 0;
  background: var(--bg); font-size: 11px; overflow-x: auto; gap: 0;
  white-space: nowrap;
}
.ev-metric { display: flex; align-items: center; gap: 3px; }
.ev-metric-val { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ev-metric-lbl { color: var(--text-tertiary); font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.ev-msep { width: 1px; height: 10px; background: var(--border); margin: 0 7px; flex-shrink: 0; }

/* ── Loading dots ────────────────────────────────────────── */
.ev-dots { display: flex; gap: 5px; align-items: center; justify-content: center; height: 100%; flex-direction: column; }
.ev-dots-row { display: flex; gap: 5px; }
.ev-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--slot-color, var(--accent));
  animation: ev-bounce 1.1s ease-in-out infinite;
}
.ev-dot:nth-child(2) { animation-delay: 0.18s; }
.ev-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes ev-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-8px)} }
.ev-dots-lbl { font-size: 11.5px; color: var(--text-tertiary); margin-top: 6px; }

/* ── Idle empty state ────────────────────────────────────── */
.ev-idle { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-tertiary); gap: 6px; }
.ev-idle-icon { font-size: 28px; opacity: .35; }
.ev-idle-txt { font-size: 12px; }

/* ── Streaming cursor ────────────────────────────────────── */
.ev-cursor {
  display: inline-block; width: 2px; height: 14px;
  background: var(--slot-color, var(--accent));
  margin-left: 1px; vertical-align: middle;
  animation: ev-blink 0.85s step-end infinite;
}
@keyframes ev-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Comparison footer ───────────────────────────────────── */
.ev-footer {
  display: flex; border-top: 2px solid var(--border);
  background: var(--bg-secondary); flex-shrink: 0;
  animation: ev-slide-up 0.22s ease;
}
@keyframes ev-slide-up { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:none} }
.ev-footer-col {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-right: 1px solid var(--border);
}
.ev-footer-col:last-child { border-right: none; }
.ev-footer-icon { font-size: 18px; flex-shrink: 0; }
.ev-footer-label { font-size: 10px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .06em; }
.ev-footer-winner { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-footer-val { font-size: 11px; color: var(--text-secondary); }

/* ── Prompt bar ──────────────────────────────────────────── */
.ev-prompt-bar { border-top: 1px solid var(--border); background: var(--bg-card); flex-shrink: 0; padding: 10px 16px 12px; }
.ev-prompt-inp {
  width: 100%; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); outline: none; color: var(--text);
  font-family: inherit; font-size: 14px; padding: 10px 12px;
  resize: none; line-height: 1.55; transition: border-color 0.15s;
  display: block;
}
.ev-prompt-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.12); }
.ev-prompt-inp::placeholder { color: var(--text-tertiary); }
.ev-sys-inp {
  width: 100%; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); outline: none; color: var(--text);
  font-family: inherit; font-size: 13px; padding: 8px 12px;
  resize: none; line-height: 1.5; transition: border-color 0.15s;
  margin-bottom: 6px; display: block;
}
.ev-sys-inp:focus { border-color: var(--accent); }
.ev-adv-row { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.ev-adv-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.ev-adv-row input[type=range] { accent-color: var(--accent); cursor: pointer; }
.ev-prompt-bottom { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ev-prompt-left  { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.ev-prompt-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ev-tok-est { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
.ev-toggle-btn {
  padding: 4px 10px; border-radius: var(--radius-btn); border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); font-family: inherit;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.12s;
}
.ev-toggle-btn.on { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.ev-run-btn {
  padding: 8px 20px; border-radius: var(--radius-btn); border: none;
  background: var(--accent); color: #fff; font-family: inherit;
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.ev-run-btn:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); }
.ev-run-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ev-clear-btn {
  padding: 8px 14px; border-radius: var(--radius-btn); border: 1.5px solid var(--border-strong);
  background: transparent; color: var(--text-secondary); font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.12s;
}
.ev-clear-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Count toggle ────────────────────────────────────────── */
.ev-count-tog { display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-md); background: var(--bg-secondary); border: 1px solid var(--border); }
.ev-count-btn {
  padding: 3px 11px; border-radius: 5px; border: none;
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all 0.1s;
}
.ev-count-btn.active { background: var(--accent); color: #fff; }

/* ── Status pill ─────────────────────────────────────────── */
.ev-status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 20px; font-size: 10.5px; font-weight: 500;
  border: 1px solid transparent;
}
.ev-status-dot { width: 5px; height: 5px; border-radius: 50%; }
.ev-status-dot.pulse { animation: ev-pulse 1.2s ease-in-out infinite; }
@keyframes ev-pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.75)} }

/* ── Key banner ──────────────────────────────────────────── */
.ev-key-banner {
  background: var(--gold-bg,#FFFBEB); border: 1px solid var(--border);
  border-left: 3px solid var(--gold,#FBCA57); border-radius: var(--radius-md);
  padding: 10px 14px; margin-bottom: 8px; font-size: 12.5px;
  color: var(--text-secondary); display: flex; align-items: flex-start; gap: 10px;
}
.ev-key-banner-body { flex: 1; }
.ev-key-row { display: flex; gap: 6px; margin-top: 6px; }
.ev-key-input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text);
  font-family: var(--mono); font-size: 12px; outline: none; min-width: 0;
}
.ev-key-input:focus { border-color: var(--accent); }
.ev-key-submit {
  padding: 6px 12px; border-radius: var(--radius-sm); border: none;
  background: var(--accent); color: #fff; font-family: inherit;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}

/* ── Model picker modal ──────────────────────────────────── */
.ev-picker-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,28,56,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px;
}
.ev-picker-panel {
  width: min(500px, calc(100vw - 2rem)); max-height: 68vh; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: ev-picker-in 0.14s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes ev-picker-in { from{opacity:0;transform:scale(.95) translateY(-6px)} to{opacity:1;transform:none} }
.ev-picker-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.ev-picker-si {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.ev-picker-si::placeholder { color: var(--text-tertiary); }
.ev-picker-close { background: none; border: none; color: var(--text-tertiary); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px; }
.ev-picker-close:hover { color: var(--text); }
.ev-picker-list { overflow-y: auto; flex: 1; padding: 4px 0; }
.ev-picker-list::-webkit-scrollbar { width: 4px; }
.ev-picker-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.ev-picker-grp { padding: 8px 14px 3px; font-size: 10px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .08em; }
.ev-picker-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px;
  cursor: pointer; transition: background 0.08s; border: none;
  background: transparent; width: 100%; text-align: left; font-family: inherit;
}
.ev-picker-item:hover { background: var(--bg-secondary); }
.ev-picker-item.selected { background: var(--accent-light); }
.ev-picker-name { font-size: 13px; color: var(--text); font-weight: 500; flex: 1; min-width: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-picker-ctx { font-size: 10.5px; color: var(--text-tertiary); white-space: nowrap; }
.ev-picker-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Divider between top and grid ────────────────────────── */
.ev-divider { height: 1px; background: var(--border); flex-shrink: 0; }

/* ── Error state ─────────────────────────────────────────── */
.ev-error { padding: 16px; color: var(--danger); font-size: 13px; line-height: 1.6; }

/* ── Header row ──────────────────────────────────────────── */
.ev-hdr-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ev-hdr-right { display: flex; align-items: center; gap: 10px; }
.ev-hdr-stat { font-size: 12px; color: var(--text-tertiary); }

/* ── Evaluator, small screens ────────────────────────────────
   THESE RULES MUST STAY AFTER THE BASE RULES ABOVE.
   They used to sit in the shared Responsive block near the top of this file.
   Same specificity, earlier position, so the base rules in this section won
   and the page kept margin-left: var(--sidebar-w) with four squeezed columns
   on a phone -- the mobile layout never applied at all. */

/* Tablet band: a 4-way comparison would otherwise be ~250px columns. */
@media (min-width: 769px) and (max-width: 1024px) {
  .ev-grid[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  /* The drawer takes over below 1024, so the page must not reserve rail width. */
  .ev-page { margin-left: 0; }
}

@media (max-width: 768px) {
  /* height:100% + overflow:hidden traps the page inside the viewport on a
     phone, where the composer and footer need to push it taller. Let it grow
     and let the document scroll instead. */
  .ev-page {
    height: auto;
    min-height: calc(100dvh - var(--nav-h));
    overflow: visible;
    margin-left: 0;
  }
  .ev-content,
  .ev-grid { overflow: visible; }

  /* One column at every count: two 190px panels side by side are unreadable. */
  .ev-grid[data-count="1"],
  .ev-grid[data-count="2"],
  .ev-grid[data-count="3"],
  .ev-grid[data-count="4"] { grid-template-columns: 1fr; }

  /* Tall enough to show a real answer without scrolling the panel itself. */
  .ev-panel { min-height: 45dvh; }

  .ev-slots { flex-wrap: wrap; }
  .ev-slot  { flex: 1 1 calc(50% - 5px); min-width: 0; }

  .ev-hdr-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ev-hdr-right { flex-wrap: wrap; }

  .ev-footer { flex-direction: column; }
  .ev-footer-col { border-right: none; border-bottom: 1px solid var(--border); }

  /* 16px floor: anything smaller makes iOS zoom the page on focus, and it
     never zooms back out. These sit here, after the base rules in Section E,
     for the same reason as everything else in this block. */
  .ev-prompt-inp,
  .ev-sys-inp { font-size: 16px; }

  /* ── Tap targets ──────────────────────────────────────────
     Every control here was 21-30px tall. 40px is the floor a fingertip
     reliably hits. The Evaluator is the densest page in the app, so these
     are the bulk of its mis-taps. */
  .ev-count-btn,
  .ev-toggle-btn,
  .ev-clear-btn,
  .ev-run-btn,
  .ev-key-submit {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* The X on a model slot has to stay visually small -- it sits inside a
     compact chip and a 40px circle would dominate it. The ::after grows what
     the finger hits while the circle keeps its 18px. */
  .ev-slot-x { position: relative; }
  .ev-slot-x::after {
    content: "";
    position: absolute;
    inset: -11px;
  }
}

/* The referral field on the wallet page sets .78rem inline, which beats any
   stylesheet rule -- hence the !important, used here rather than editing the
   markup because the inline style is what the page generates.
   It is readonly, but readonly fields still take focus, and iOS zooms on
   focus regardless of whether the field can be edited. */
@media (max-width: 768px) {
  #referral-link { font-size: 16px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION F: Global polish layer — micro-interactions & motion
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Smooth theme switch ─────────────────────────────────── */
body,
.card, .stat-card, .topnav, .sidebar, .modal, .auth-card,
.lp-feature-card, .lp-testi-card, .about-card, .form-input,
table, thead tr, td, th {
  /* opacity IS IN THIS LIST ON PURPOSE. Without it this rule overrides the
     scroll-reveal transition on .lp-feature-card and .lp-testi-card -- they
     set opacity 0 -> 1 and then had no transition for it, so the cards
     snapped in instead of fading. */
  transition-property: background-color, background, border-color, color, box-shadow, transform, opacity;
  transition-duration: 0.22s;
  transition-timing-function: var(--ease-out);
}

/* ── Theme toggle icon pair (CSS-driven sun/moon) ────────── */
.ticon-sun, .ticon-moon { width: 16px; height: 16px; display: none; pointer-events: none; }
:root:not([data-theme="dark"]) .ticon-moon { display: block; }
[data-theme="dark"] .ticon-sun { display: block; }
.theme-toggle, .lp-theme-btn, .about-theme-btn { position: relative; overflow: hidden; }
.theme-toggle:active, .lp-theme-btn:active, .about-theme-btn:active { transform: scale(0.9); }
.theme-toggle, .lp-theme-btn, .about-theme-btn { transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out), transform 0.12s var(--ease-out); }
.ticon-sun { animation: ticon-in 0.35s var(--ease-spring); }
[data-theme="dark"] .ticon-sun, :root:not([data-theme="dark"]) .ticon-moon { animation: ticon-in 0.35s var(--ease-spring); }
@keyframes ticon-in { from { transform: rotate(-90deg) scale(0.5); opacity: 0; } to { transform: rotate(0) scale(1); opacity: 1; } }

/* ── Buttons: tactile press + sheen ──────────────────────── */
.btn, .lp-btn, .ev-run-btn, .ev-clear-btn, .google-btn, .github-btn {
  transition: background 0.18s var(--ease-out), color 0.18s var(--ease-out),
              border-color 0.18s var(--ease-out), transform 0.12s var(--ease-out),
              box-shadow 0.18s var(--ease-out);
  will-change: transform;
}
.btn:active, .lp-btn:active, .ev-run-btn:active, .google-btn:active, .github-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.06s;
}
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-out);
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-icon:hover { transform: translateY(-1px); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost:active { transform: scale(0.95); }

/* ── Cards: lift on hover ────────────────────────────────── */
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card {
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.stat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:hover::before { transform: scaleX(1); }
.stat-value { font-variant-numeric: tabular-nums; }

/* ── Sidebar links: indicator + slide ────────────────────── */
.sidebar-link { position: relative; }
.sidebar-link::before {
  content: '';
  position: absolute; left: -2px; top: 50%; translate: 0 -50%;
  width: 3px; height: 0; border-radius: 3px;
  background: var(--accent);
  transition: height 0.22s var(--ease-out);
}
.sidebar-link:hover { transform: translateX(2px); }
.sidebar-link.active::before { height: 60%; }
.sidebar-link.active { box-shadow: inset 0 0 0 1px var(--border); }
.sidebar-link svg { transition: transform 0.2s var(--ease-out); }
.sidebar-link:hover svg { transform: scale(1.12); }

/* ── Tables: row transitions ─────────────────────────────── */
tbody tr { transition: background 0.14s var(--ease-out); }

/* ── Inputs: focus glow ──────────────────────────────────── */
.form-input { transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), background 0.22s var(--ease-out); }
.form-input:hover:not(:focus) { border-color: var(--border-strong); }

/* ── Modal: springier entrance ───────────────────────────── */
.modal { animation: modal-spring 0.28s var(--ease-spring); }
@keyframes modal-spring {
  from { transform: scale(0.92) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-overlay { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal-close { transition: color 0.15s var(--ease-out), transform 0.15s var(--ease-out); border-radius: var(--radius-sm); }
.modal-close:hover { transform: rotate(90deg); }

/* ── Toast: slide + settle ───────────────────────────────── */
.toast-item {
  animation: toast-in 0.32s var(--ease-spring);
  pointer-events: auto;
  display: flex; align-items: center; gap: .5rem;
  border-radius: var(--radius-md);
}
@keyframes toast-in {
  from { transform: translateX(60%) scale(0.9); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}

/* ── Page entrance ───────────────────────────────────────── */
.main-content > * { animation: page-in 0.35s var(--ease-out) both; }
.main-content > *:nth-child(2) { animation-delay: 0.04s; }
.main-content > *:nth-child(3) { animation-delay: 0.08s; }
.main-content > *:nth-child(4) { animation-delay: 0.12s; }
.main-content > *:nth-child(5) { animation-delay: 0.16s; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Skeleton shimmer (loading placeholders) ─────────────── */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none; pointer-events: none;
}
.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: translateX(-100%);
  animation: skeleton-sweep 1.4s ease infinite;
}
[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
@keyframes skeleton-sweep { to { transform: translateX(100%); } }

/* ─── Loading states ──────────────────────────────────────────────────────
   The catalog fetches 870KB and lays out ~540 cards, so there is a real
   1-2s gap. A bare 18px .spinner centred in an empty grid reads as a blank
   page -- the eye has nothing to hold. These give the wait a shape.

   Honour reduced-motion: every animation here is decorative, and a user who
   asked the OS to stop moving things means it. The elements stay visible,
   they just stop pulsing. */

/* A skeleton shaped like the thing that is coming. Reusing .card means it
   inherits the real border, radius and padding, so the swap to real content
   does not shift the layout. */
.skel-line {
  height: .7rem; border-radius: 4px;
  background: var(--bg-secondary);
  position: relative; overflow: hidden;
}
.skel-line::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-100%);
  animation: skeleton-sweep 1.4s ease infinite;
}
[data-theme="dark"] .skel-line::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
}

/* Staggered so the grid ripples rather than strobing as one block -- 540
   elements pulsing in lockstep is genuinely unpleasant. */
.skel-card:nth-child(3n+2) .skel-line::after { animation-delay: .15s; }
.skel-card:nth-child(3n+3) .skel-line::after { animation-delay: .3s; }

/* Inline "still working" label, for waits with no card shape to imitate. */
.loading-inline {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: 3rem 1rem; color: var(--text-secondary); font-size: .875rem;
}
.loading-dots::after {
  content: ''; animation: loading-dots 1.4s steps(4, end) infinite;
}
@keyframes loading-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

@media (prefers-reduced-motion: reduce) {
  .skel-line::after { animation: none; }
  .loading-dots::after { animation: none; content: '...'; }
  .spinner { animation-duration: 1.6s; }
}

/* ── Badges: subtle pop on hover ─────────────────────────── */
.badge { transition: transform 0.15s var(--ease-out); }
.badge:hover { transform: scale(1.05); }

/* ── Inline icon utility ─────────────────────────────────── */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; vertical-align: -0.15em;
}
.ico svg { width: 1em; height: 1em; }

/* ── Notification bell: swing on hover ───────────────────── */
#notifBellBtn:hover svg { animation: bell-swing 0.55s var(--ease-out); transform-origin: top center; }
@keyframes bell-swing {
  0% { transform: rotate(0); } 25% { transform: rotate(12deg); }
  50% { transform: rotate(-9deg); } 75% { transform: rotate(5deg); } 100% { transform: rotate(0); }
}

/* ── Copy buttons: success flash ─────────────────────────── */
.code-copy-btn:active, .lp-copy-btn:active { transform: scale(0.94); }

/* ── FAQ toggle: rotate ──────────────────────────────────── */
.lp-faq-toggle { transition: transform 0.25s var(--ease-out); }
.lp-faq-item.open .lp-faq-toggle { transform: rotate(45deg); }
.lp-faq-item .lp-faq-q { transition: color 0.15s var(--ease-out); }
.lp-faq-item:hover .lp-faq-q { color: var(--accent); }

/* ── Scrollbar refinement ────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 8px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); background-clip: content-box; }

/* ── Reduced motion: switch it all off ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ── SEO pages (generated tool + model pricing pages) ───────────────────── */
.seo-breadcrumb { font-size: .8rem; color: var(--text-tertiary); margin-bottom: 1rem; }
.seo-breadcrumb a { color: var(--text-tertiary); text-decoration: none; }
.seo-breadcrumb a:hover { color: var(--accent); }
.seo-section { margin-top: 2rem; }
.seo-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: .75rem; }
.seo-section p { color: var(--text-secondary); font-size: .92rem; line-height: 1.7; margin-bottom: .75rem; }
.seo-muted { color: var(--text-tertiary); font-size: .85rem; }
.seo-howto { padding-left: 1.25rem; color: var(--text-secondary); font-size: .92rem; line-height: 1.9; }
.seo-code { background: #1E1E1E; color: #E0E0E0; border-radius: var(--radius, 8px); padding: 1rem; overflow-x: auto; font-size: 12.5px; line-height: 1.55; font-family: var(--mono); white-space: pre-wrap; word-break: break-word; }
.seo-example { margin-bottom: 1rem; }
.seo-example-label { font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--text-secondary); }
.seo-faq-item { border: 1px solid var(--border); border-radius: var(--radius, 8px); padding: .8rem 1rem; margin-bottom: .6rem; background: var(--bg-card); }
.seo-faq-item summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.seo-faq-item p { margin: .6rem 0 0; color: var(--text-secondary); font-size: .88rem; line-height: 1.65; }
.seo-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.seo-related-card { text-decoration: none; color: inherit; padding: 1rem; }
.seo-related-title { font-size: .9rem; font-weight: 600; }
.seo-cta { border: 1px solid var(--border-strong); background: var(--bg-secondary); border-radius: var(--radius, 8px); padding: 1.5rem; margin-top: 2.5rem; }
.seo-cta-title { font-weight: 700; font-size: 1.05rem; margin-bottom: .4rem; }
.seo-cta p { color: var(--text-secondary); font-size: .9rem; line-height: 1.65; margin-bottom: 1rem; }
.seo-cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.seo-cta-actions .btn { text-decoration: none; }
.seo-table-wrap { overflow-x: auto; }
.seo-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.seo-table th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--text-tertiary); padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.seo-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.seo-table a { color: var(--accent); text-decoration: none; }
.seo-num { font-family: var(--mono); font-size: .85rem; white-space: nowrap; }
.seo-chip { display: inline-block; background: var(--accent-light, #EBF0FF); color: var(--accent); font-size: .78rem; font-weight: 500; border-radius: 100px; padding: .2rem .7rem; margin: 0 .4rem .4rem 0; }
.seo-bench-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.seo-bench-label { flex: 0 0 160px; font-size: .82rem; color: var(--text-secondary); }
.seo-bench-track { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: 100px; overflow: hidden; }
.seo-bench-fill { height: 100%; background: var(--accent); border-radius: 100px; }
.seo-bench-val { flex: 0 0 48px; text-align: right; font-family: var(--mono); font-size: .8rem; }
.seo-price-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.seo-price-item { padding: .75rem 0; }
.seo-price-label { font-size: .75rem; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: .3rem; }
.seo-price-value { font-size: 1.3rem; font-weight: 700; font-family: var(--mono); }
.seo-model-card { text-decoration: none; color: inherit; padding: 1rem; display: block; }
.seo-model-card-name { font-weight: 600; font-size: .95rem; }
.seo-model-card-provider { font-size: .78rem; color: var(--text-tertiary); margin: .15rem 0 .4rem; }
.seo-model-card-price { font-size: .82rem; font-family: var(--mono); color: var(--text-secondary); }
.seo-calc { display: grid; gap: 1rem; }
.seo-calc label { font-size: .82rem; color: var(--text-secondary); display: block; margin-bottom: .3rem; }
.seo-calc-result { font-size: 1.4rem; font-weight: 700; font-family: var(--mono); }
.seo-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .seo-compare-grid { grid-template-columns: 1fr; } .seo-bench-label { flex-basis: 110px; } }

/* ── Foldable sections and capped scroll areas ────────────────────────────────
   Shared because more than one admin page needs them. They began as page-local
   rules in admin/deploy.html; a second page wanting the same fold is the point
   at which two copies start drifting, so they live here instead. */

/* The marker is drawn by us so it can sit on the left and rotate; the native
   one cannot be positioned consistently across browsers. */
.fold > summary{list-style:none;cursor:pointer;display:flex;align-items:baseline;
  justify-content:space-between;gap:1rem}
.fold > summary::-webkit-details-marker{display:none}
.fold > summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;
  border-radius:4px}
.fold-t{display:flex;align-items:center;gap:.5rem;font-weight:600}
.fold-t::before{content:'';width:0;height:0;flex:none;
  border-left:5px solid currentColor;border-top:4px solid transparent;
  border-bottom:4px solid transparent;transition:transform .15s}
.fold[open] > summary .fold-t::before{transform:rotate(90deg)}
@media (prefers-reduced-motion: reduce){.fold-t::before{transition:none}}

/* A cap, not a fixed height: a short list stays short rather than sitting in a
   mostly empty box. */
.scroll-y{max-height:26rem;overflow-y:auto}
/* The header must stay readable while the body scrolls under it. */
.scroll-y thead th{position:sticky;top:0;background:var(--bg);z-index:1}

/* A filter bar above a folded table. Shared for the same reason .fold is:
   user_detail.html needs the same bar deploy.html has, and two copies of a
   rule drift. */
.filters{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;margin:.85rem 0}
.filters .form-input{max-width:230px}
.filters select.form-input{max-width:170px}

/* ── Long-page rendering cost ────────────────────────────────
   Docs, the legal pages and a blog post are long enough that laying out every
   section on load costs noticeable time on a low-end phone. content-visibility
   lets the browser skip layout and paint for anything off screen, and
   contain-intrinsic-size gives it a height to assume so the scrollbar does not
   lurch as sections are realised.

   Applied to SECTIONS, never to the page container: putting it on an ancestor
   would skip the whole document. Anchor links still work -- the browser
   realises a skipped section before scrolling to it. */
#doc-content > section,
.doc-section,
.legal-body > section,
.post-body > section {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTION G: Touch polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hover transforms are for pointers only ──────────────────
   A touch screen has no hover, so :hover latches after a tap and stays until
   something else is tapped -- a card sits lifted, a sidebar link sits nudged
   2px right, a badge stays scaled. Neutralising the TRANSFORM only, rather
   than the whole rule, keeps the colour and shadow feedback that reads as
   "this is pressed" on touch.

   Written as `not (hover: hover)` rather than wrapping eight scattered rules
   in a positive query: this is one block to read and one to delete if the
   decision ever changes. */
@media (not (hover: hover)), (pointer: coarse) {
  .btn-primary:hover,
  .btn-icon:hover,
  .card:hover,
  .stat-card:hover,
  .sidebar-link:hover,
  .badge:hover,
  .footer-social-icon:hover,
  .modal-close:hover { transform: none; }
}

/* ── Tap feedback ────────────────────────────────────────────
   The grey flash iOS and Android paint over a tapped control is the OS
   guessing at feedback the design already provides. */
body { -webkit-tap-highlight-color: transparent; }

/* A real press state, so a tap still feels answered once the hover lift above
   is gone. */
.btn:active { transform: scale(.98); }

/* ── Anchored sections clear the fixed top bar ───────────────
   Without this, jumping to #section puts the heading underneath the bar and
   the reader lands mid-paragraph. */
html { scroll-padding-top: calc(var(--nav-h) + 8px); }

/* The drawer, the dialogs and the press state are all motion. */
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
  .modal { animation: none; }
  .modal-overlay { animation: none; }
}
