/* ================================================================
   asAi gateway — customer UI
   Design system: NeedMCP "revolut" (light mode tokens)
   Wireframe: NeedMCP "finance-dashboard"
   Palette: wireframe chart scheme — indigo #6366f1 (primary),
   orange #fb923c (secondary), light indigo #c7d2fe (subtle fills)
   ================================================================ */

@font-face {
  font-family: "DM Sans";
  src: url("/static/fonts/dmsans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* neutrals (revolut light) */
  --bg: #f6f7fb;               /* page background, cool light gray */
  --bg-deep: #ffffff;          /* topnav / inputs / table surface */
  --surface: #ffffff;          /* cards */
  --surface-hover: #f1f2f7;
  --surface-active: #e9ebf3;
  --line: #e4e6ec;             /* border.subtle */
  --line-bright: #c9cdd6;      /* border */
  --text: #191c1f;             /* on-background.light */
  --text-secondary: #4b5563;
  --text-muted: #5d6773;
  --placeholder: #9aa1ac;
  --inverse: #ffffff;

  /* wireframe palette */
  --accent: #6366f1;           /* indigo — fills, chart, links */
  --accent-strong: #4f46e5;    /* indigo-600 — buttons & AA text */
  --accent-deep: #4338ca;      /* indigo-700 — active text on tint */
  --accent-soft: #c7d2fe;      /* light indigo — subtle borders */
  --accent-tint: rgba(99, 102, 241, 0.10);
  --accent-tint-strong: rgba(99, 102, 241, 0.16);
  --orange: #fb923c;           /* wireframe secondary */
  --orange-text: #c2410c;      /* readable orange for text */

  /* semantic (light) */
  --success: #047857;
  --success-bg: rgba(4, 120, 87, 0.10);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --danger-bright: #b91c1c;
  --warning: #ec7e00;
  --warning-bg: rgba(236, 126, 0, 0.12);

  /* shape (revolut) */
  --r-sm: 0.25rem;
  --r-md: 0.5rem;
  --r-lg: 0.75rem;
  --r-xl: 1.25rem;
  --r-full: 9999px;

  /* motion (revolut) */
  --t-fast: 150ms ease;
  --t-normal: 200ms ease;
  --t-slow: 300ms ease;

  --font-display: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", monospace;

  --nav-h: 64px;
  --container: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }

::selection { background: var(--accent); color: #fff; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

input:focus { outline: none; }

/* skip link */
.skip-link {
  position: absolute; left: 16px; top: -48px;
  background: var(--accent-strong); color: #fff;
  padding: 10px 18px; border-radius: var(--r-md);
  z-index: 700; font-weight: 600; text-decoration: none;
  transition: top var(--t-normal);
}
.skip-link:focus { top: 12px; }

/* ================================================================
   Layout shell
   ================================================================ */

.shell { max-width: var(--container); margin: 0 auto; padding: 0 28px 96px; }

/* Sticky top navbar (wireframe: top-navbar) */
.topnav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 max(28px, calc((100vw - var(--container)) / 2 + 28px));
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.brand-logo {
  display: block;
  height: auto;
  object-fit: contain;
}
.brand-logo-full { width: 128px; }
.brand-logo-mark { display: none; width: 32px; height: 32px; }

/* Main nav tabs (wireframe: main-nav) */
.main-nav {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface-hover);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 4px;
}
.nav-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.nav-tab svg { width: 15px; height: 15px; opacity: 0.75; }
.nav-tab:hover { color: var(--text); background: #ffffff; }
.nav-tab.active {
  color: var(--accent-deep);
  background: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(25, 28, 31, 0.08);
}

.nav-right { display: flex; align-items: center; gap: 12px; }

/* Language Switcher (EN | BM) - NeedMCP revolut pill */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--surface-hover);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 2px;
  gap: 2px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--r-full);
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), transform 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.lang-btn:hover {
  color: var(--text);
}
.lang-btn[aria-current="true"] {
  background: var(--surface);
  color: var(--accent-deep);
  box-shadow: 0 1px 2px rgba(25, 28, 31, 0.08);
}
.lang-btn:active {
  transform: scale(0.97);
}

/* Balance pill in navbar (wireframe: profile-menu) */
.verification-badge{display:inline-flex;align-items:center;white-space:nowrap;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:700;border:1px solid var(--line)}
.verification-badge.verified{color:#166534;background:#dcfce7;border-color:#86efac}
.verification-badge.unverified{color:#9a3412;background:#ffedd5;border-color:#fdba74}

.balance-pill {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 7px 16px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-full);
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.balance-pill:hover { border-color: var(--accent); background: var(--accent-tint-strong); }
.balance-pill .pill-label {
  color: var(--text-muted);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.balance-pill .pill-value {
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.credit-expiry-banner {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 18px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-md, 10px);
}
.credit-expiry-banner strong { font-size: 14px; color: var(--text); }
.credit-expiry-banner span { font-size: 13px; color: var(--text-muted); }
.credit-expiry-banner.hidden { display: none; }

/* ================================================================
   Buttons (revolut button component: pill, 2px border, 44px)
   ================================================================ */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  border: 2px solid transparent;
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  font-size: 15px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.button.primary {
  background: var(--accent-strong);
  color: #ffffff;
  border-color: var(--accent-strong);
}
.button.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line-bright);
}
.button.secondary:hover { border-color: var(--accent); color: var(--accent-strong); }

.button.ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.button.ghost:hover { background: var(--surface-hover); color: var(--text); }
.button.danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}
.button.danger:hover { background: var(--danger-bright); border-color: var(--danger-bright); }

.button.sm { min-height: 34px; padding: 6px 14px; font-size: 13px; }
#sign-out { white-space: nowrap; }

/* ================================================================
   Cards & panels (revolut card component: r-xl, 1px border)
   ================================================================ */

.panel, .stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
.panel { padding: 26px; }

.panel-heading {
  display: flex; justify-content: space-between; gap: 20px;
  align-items: end; margin-bottom: 20px;
  flex-wrap: wrap;
}
.panel-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.03em;
}
.panel small, .muted-small { color: var(--text-muted); font-size: 13px; }

.eyebrow, .kicker {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: 0.09em; text-transform: uppercase;
}

/* ================================================================
   Home page (marketing)
   ================================================================ */

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 72px; align-items: center;
  padding: 88px 0 72px;
}
.home-hero h1, .login-context h1, .dashboard-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.02;
}
.home-hero h1 { font-size: clamp(46px, 6vw, 76px); }
.home-hero .hero-sub {
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 18px; line-height: 1.6;
  margin: 26px 0 0;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }

.home-proof {
  display: grid; gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  overflow: hidden;
}
.home-proof > div {
  padding: 26px 28px;
  display: grid; gap: 6px;
  border-bottom: 1px solid var(--line);
}
.home-proof > div:last-child { border-bottom: 0; }
.home-proof span { color: var(--text-muted); font-size: 13px; }
.home-proof strong {
  font-family: var(--font-mono);
  font-size: 30px; font-weight: 700;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}
.home-proof small { color: var(--text-muted); }

.home-models { margin-top: 28px; }

/* ================================================================
   Login page
   ================================================================ */

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.65fr);
  gap: 84px; align-items: center;
  padding: 72px 0;
}
.login-context { max-width: 620px; }
.login-context h1 { font-size: clamp(44px, 5.5vw, 68px); }
.login-context p:not(.kicker) {
  max-width: 520px;
  color: var(--text-secondary);
  font-size: 17px; line-height: 1.6;
  margin: 24px 0 0;
}

.auth-panel {
  padding: 0 30px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
}
.tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin: 0 -30px 28px;
}
.tab {
  border: 0; border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  padding: 18px;
  font-weight: 600; font-size: 14px;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent-deep); border-color: var(--accent); }

.auth-form { display: grid; gap: 18px; }
.auth-form h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700; letter-spacing: -0.03em;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 6px;
  font-weight: 600; font-size: 15px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.google-button:hover { background: #f8f9fa; box-shadow: 0 1px 2px rgba(60,64,67,0.2); }
.google-button svg { flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.auth-legal {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px; line-height: 1.5;
}
.auth-legal a { color: var(--accent-deep); text-decoration: none; }
.auth-legal a:hover { text-decoration: underline; }

.verify-nudge {
  margin-top: 18px;
  padding: 16px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: var(--r-md);
  display: grid; gap: 12px;
}
.verify-nudge p { margin: 0; color: #4338ca; font-size: 14px; line-height: 1.5; }
.verify-nudge .button { justify-self: start; }

label { display: grid; gap: 8px; color: var(--text-secondary); font-size: 14px; font-weight: 500; }

input {
  width: 100%;
  border: 1px solid var(--line-bright);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 46px; padding: 10px 14px;
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:hover { border-color: var(--placeholder); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
input::placeholder { color: var(--placeholder); }

.back-link {
  color: var(--text-muted); text-decoration: none; font-size: 14px;
  transition: color var(--t-fast);
}
.back-link:hover { color: var(--text); }

/* ================================================================
   Dashboard — finance-dashboard wireframe layout
   ================================================================ */

.topup-bonus-announcement {
  margin-top: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--accent-soft);
  border-left: 4px solid var(--accent-strong);
  border-radius: var(--r-xl);
  box-shadow: 0 8px 24px rgba(67, 56, 202, 0.06);
}
.announcement-track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.announcement-track::-webkit-scrollbar { display: none; }
.announcement-slide {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 102px;
  padding: 14px 20px 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.topup-bonus-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topup-bonus-label {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: var(--accent-deep);
  background: var(--accent-tint);
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topup-bonus-announcement h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.topup-bonus-announcement p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.topup-bonus-announcement .button { flex: 0 0 auto; }
.announcement-controls {
  min-height: 34px;
  padding: 0 18px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.announcement-arrow {
  min-height: 30px;
  padding: 4px 10px;
  color: var(--accent-deep);
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.announcement-arrow:hover, .announcement-arrow:focus-visible { background: var(--accent-tint); }
.announcement-dots { display: flex; align-items: center; gap: 8px; }
.announcement-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  cursor: pointer;
}
.announcement-dot[aria-current="true"] { background: var(--accent-strong); }
.topup-bonus-announcement + .page-head { padding-top: 28px; }
@media (prefers-reduced-motion: reduce) {
  .announcement-track { scroll-behavior: auto; }
}

.page-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 44px 0 28px;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 700; letter-spacing: -0.045em;
}

/* Stat grid (wireframe: stats-grid, 4 columns) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  padding: 22px 24px;
  display: grid; gap: 10px;
  align-content: start;
  transition: border-color var(--t-normal), box-shadow var(--t-normal);
}
.stat-card:hover { border-color: var(--accent-soft); box-shadow: 0 2px 10px rgba(25, 28, 31, 0.05); }
.stat-card > span {
  color: var(--text-muted);
  font-size: 13px; font-weight: 500;
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat-card .stat-sub {
  color: var(--text-muted); font-size: 12.5px;
  display: flex; align-items: center; gap: 6px;
}
.stat-card.hero-stat {
  background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.03));
  border-color: var(--accent-soft);
}
.stat-card.hero-stat .stat-value { color: var(--accent-deep); }

.trend { font-size: 12px; font-weight: 600; }
.trend.up { color: var(--success); }
.trend.down { color: var(--orange-text); }

/* Secondary metrics strip */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.metric-cell {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: grid; gap: 5px;
}
.metric-cell span { color: var(--text-muted); font-size: 11.5px; font-weight: 500; }
.metric-cell strong {
  font-family: var(--font-mono);
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ================================================================
   Chart (wireframe: financial-trends — indigo #6366f1)
   ================================================================ */

.chart-panel { margin-bottom: 22px; }
.range-tabs {
  display: flex; gap: 2px;
  border: 1px solid var(--line-bright);
  border-radius: var(--r-lg);
  padding: 3px;
  background: var(--surface);
}
.range-tab {
  border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text-muted);
  padding: 6px 11px;
  font-size: 11.5px; font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.range-tab:hover { color: var(--text); background: var(--surface-hover); }
.range-tab.active { background: var(--accent-strong); color: #ffffff; }

.usage-chart { position: relative; min-height: 240px; padding: 12px 0 20px; overflow: visible; }
.usage-chart svg { width: 100%; height: 230px; display: block; }
.chart-grid { stroke: var(--line-bright); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-zero { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 3; }
.chart-tick { fill: var(--text-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart-area { transition: opacity var(--t-fast); }
.chart-line {
  fill: none; stroke: var(--accent); stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  transition: d 300ms cubic-bezier(0.77, 0, 0.175, 1);
}
.chart-dot {
  fill: var(--accent); stroke: var(--surface); stroke-width: 2;
  opacity: 0; transition: opacity var(--t-fast), r var(--t-fast);
}
.chart-dot.active { opacity: 1; r: 4.5; }
.chart-hit { cursor: crosshair; }
.chart-cursor {
  stroke: var(--line-bright); stroke-width: 1;
  transition: opacity 120ms ease-out;
  pointer-events: none;
}
.chart-axis-title {
  position: absolute; left: 2px; top: 8px;
  color: var(--text-muted); font-size: 11px; font-weight: 600;
}
.chart-tooltip {
  position: absolute; transform: translate(-50%, -100%);
  background: var(--text); color: var(--inverse);
  border-radius: var(--r-md); padding: 6px 9px;
  font-size: 11.5px; line-height: 1.3; white-space: nowrap;
  pointer-events: none; z-index: 2; transition: opacity 120ms ease-out;
  display: flex; flex-direction: column; gap: 1px;
}
.chart-tooltip strong { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chart-tooltip span { color: var(--text-muted); font-size: 10.5px; }
@media (prefers-reduced-motion: reduce) {
  .chart-line, .chart-dot, .chart-cursor, .chart-tooltip, .chart-area { transition: none; }
}

/* ================================================================
   Tables (recent activity)
   ================================================================ */

.requests-panel { margin-bottom: 22px; }
.request-list { border-top: 1px solid var(--line); }

.model-choice-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}
.model-choice-panel { min-width: 0; }
.model-choice-heading { min-height: 72px; align-items: start; }
.model-choice-heading h2 { margin: 0; }
.model-choice-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 12.5px; }
.model-choice-content {
  display: grid;
  grid-template-columns: minmax(142px, .65fr) minmax(0, 1.35fr);
  gap: 16px;
  align-items: start;
}
.model-choice-chart {
  display: grid;
  min-width: 0;
  min-height: 166px;
  place-items: center;
}
.model-choice-chart svg { display: block; width: min(100%, 166px); height: auto; }
.model-choice-slice { stroke: var(--accent); stroke-linecap: butt; }
.model-choice-slice-0, .model-choice-swatch-0 { color: #4f46e5; stroke: currentColor; background: currentColor; }
.model-choice-slice-1, .model-choice-swatch-1 { color: #0f766e; stroke: currentColor; background: currentColor; }
.model-choice-slice-2, .model-choice-swatch-2 { color: #c2410c; stroke: currentColor; background: currentColor; }
.model-choice-slice-3, .model-choice-swatch-3 { color: #be185d; stroke: currentColor; background: currentColor; }
.model-choice-slice-4, .model-choice-swatch-4 { color: #2563eb; stroke: currentColor; background: currentColor; }
.model-choice-slice-5, .model-choice-swatch-5 { color: #7c3aed; stroke: currentColor; background: currentColor; }
.model-choice-slice-6, .model-choice-swatch-6 { color: #a16207; stroke: currentColor; background: currentColor; }
.model-choice-slice-7, .model-choice-swatch-7 { color: #475569; stroke: currentColor; background: currentColor; }
.model-choice-slice-8, .model-choice-swatch-8 { color: #4d7c0f; stroke: currentColor; background: currentColor; }
.model-choice-slice-9, .model-choice-swatch-9 { color: #b45309; stroke: currentColor; background: currentColor; }
.model-choice-slice-10, .model-choice-swatch-10 { color: #0369a1; stroke: currentColor; background: currentColor; }
.model-choice-slice-11, .model-choice-swatch-11 { color: #9d174d; stroke: currentColor; background: currentColor; }
.model-choice-donut-label { fill: var(--text-muted); font: 600 10px var(--font-sans); }
.model-choice-donut-value { fill: var(--text); font: 700 19px var(--font-mono); font-variant-numeric: tabular-nums; }
.model-choice-ranking-wrap { min-width: 0; }
.model-choice-total { margin: 0 0 8px; color: var(--text); font: 700 12px var(--font-mono); font-variant-numeric: tabular-nums; }
.model-choice-ranking {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.model-choice-rank-row {
  display: grid;
  grid-template-columns: 18px 9px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
}
.model-choice-rank, .model-choice-count, .model-choice-percentage {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.model-choice-rank, .model-choice-percentage { color: var(--text-muted); }
.model-choice-count { color: var(--text-secondary); }
.model-choice-swatch { width: 9px; height: 9px; border-radius: var(--r-sm); }
.model-choice-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-weight: 600;
}
.model-choice-empty { margin: 0; color: var(--text-muted); font-size: 13px; text-align: center; }
@media (max-width: 768px) {
  .model-choice-panels { grid-template-columns: 1fr; }
  .model-choice-content { grid-template-columns: 166px minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .model-choice-content { grid-template-columns: 1fr; gap: 10px; }
  .model-choice-chart { min-height: 142px; }
  .model-choice-chart svg { width: 142px; }
  .model-choice-rank-row { grid-template-columns: 18px 9px minmax(0, 1fr) auto auto; gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .model-choice-slice { transition: none; }
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.requests-table {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 13.5px;
}
.requests-table th, .requests-table td {
  padding: 11px 16px; text-align: left; white-space: nowrap;
}
.requests-table thead th {
  color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 1px solid var(--line);
  background: var(--surface-hover);
}
.requests-table tbody td { border-bottom: 1px solid var(--line); }
.requests-table tbody tr:last-child td { border-bottom: 0; }
.requests-table tbody tr { transition: background var(--t-fast); }
.requests-table tbody tr:hover { background: var(--accent-tint); }
.requests-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.requests-table .req-model { color: var(--accent-deep); font-weight: 600; font-family: var(--font-mono); font-size: 12.5px; }
.requests-table .req-credits { color: var(--accent-deep); font-weight: 600; }
.requests-table td:not(.req-model) { font-variant-numeric: tabular-nums; }

/* ================================================================
   Workspace: keys + coupon
   ================================================================ */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.72fr);
  gap: 20px;
  align-items: start;
}
.account-tools { display: grid; gap: 20px; }
.compact-form { margin-top: 20px; display: grid; gap: 14px; }

.key-list { border-top: 1px solid var(--line); }
.key-row {
  padding: 16px 0;
  display: grid; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.key-row:last-child { border-bottom: 0; }
.key-row.revoked .key-identity strong { color: var(--text-muted); text-decoration: line-through; }
.key-identity { display: grid; gap: 5px; min-width: 0; }
.key-identity strong { font-size: 15px; font-weight: 600; }
.key-identity small { color: var(--text-muted); font-size: 12.5px; }
.key-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.key-value {
  color: var(--accent-deep);
  overflow-wrap: anywhere;
  font: 600 12px var(--font-mono);
  max-width: 100%;
}
.key-badge {
  color: var(--danger);
  font: 600 10.5px var(--font-sans);
  text-transform: uppercase; letter-spacing: 0.07em;
  background: var(--danger-bg);
  border: 0;
  padding: 4px 10px;
  border-radius: var(--r-full);
}
.key-revoke { margin-left: auto; }
#key-revoke-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(34, 39, 54, 0.20);
}
#key-revoke-dialog::backdrop { background: rgba(25, 28, 31, 0.38); }
.key-revoke-card { display: grid; gap: 16px; padding: 24px; }
.key-revoke-card h2, .key-revoke-card p { margin: 0; }
.key-revoke-card p { color: var(--text-secondary); }
.key-revoke-card strong { color: var(--text); overflow-wrap: anywhere; }
.key-revoke-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.secret-result {
  margin-top: 16px; display: grid; gap: 10px;
  padding: 16px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-tint);
  border-radius: var(--r-lg);
}
.secret-result code {
  color: var(--accent-deep);
  overflow-wrap: anywhere;
  font: 500 12px var(--font-mono);
  line-height: 1.5;
}
.secret-result.error { color: var(--danger-bright); border-color: rgba(220, 38, 38, 0.35); background: var(--danger-bg); }

/* ================================================================
   Models directory
   ================================================================ */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.compact-page-head { padding-bottom: 14px; }
.page-intro { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.models-directory {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.model-toolbar {
  display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.model-search-label { width: min(320px, 36vw); }
.model-search-label input { min-height: 40px; }
.model-filter {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-hover);
}
.filter-chip {
  min-height: 32px; padding: 5px 12px;
  border: 0; border-radius: 6px;
  color: var(--text-muted); background: transparent;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.filter-chip:hover { color: var(--text); }
.filter-chip.active { color: var(--accent-deep); background: var(--surface); box-shadow: 0 1px 2px rgba(25, 28, 31, 0.08); }
.model-result-count { margin-left: auto; color: var(--text-muted); font-size: 12.5px; }
@media (max-width: 900px) {
  .model-toolbar { flex-wrap: wrap; }
  .model-result-count { margin-left: 0; }
}
.model-table-head,
.compact-model-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(130px, .8fr) repeat(2, minmax(90px, .62fr)) repeat(3, minmax(68px, .45fr)) minmax(96px, .4fr);
  gap: 14px; align-items: center;
}
.model-table-head {
  min-height: 38px; padding: 8px 16px;
  color: var(--text-muted); background: var(--surface-hover);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .055em;
}
.model-list { border-top: 1px solid var(--line); }
.model-directory-list { border-top: 0; }
.model-row {
  padding: 20px 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px; border-bottom: 1px solid var(--line); align-items: center;
}
.model-row > div:first-child { display: grid; gap: 8px; }
.model-row.compact-model-row {
  grid-template-columns: minmax(220px, 1.6fr) minmax(130px, .8fr) repeat(2, minmax(90px, .62fr)) repeat(3, minmax(68px, .45fr)) minmax(96px, .4fr);
  gap: 14px;
  min-height: 66px; padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  transition: background var(--t-fast);
}
.status-cell { display: flex; align-items: center; gap: 6px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.status-chip.status-fast { color: #15803d; background: #dcfce7; }
.status-chip.status-running { color: #4338ca; background: #e0e7ff; }
.status-chip.status-unstable { color: #92400e; background: #fef3c7; }
.status-chip.status-stale { color: #475569; background: #e2e8f0; }
.status-chip.status-unavailable { color: #b91c1c; background: #fee2e2; }
.status-latency { color: var(--muted, #5d6773); font-size: 11px; }
.model-status-legend {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 22px;
  margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid var(--line, #e2e8f0); border-radius: 10px;
  background: var(--panel-bg, #fff);
}
.model-status-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.model-status-legend .legend-text { font-size: 12px; color: var(--muted, #5d6773); }
@media (max-width: 640px) {
  .model-status-legend { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; }
}
/* Real-request latency sits below the existing model directory. */
.customer-latency-panel { margin-top: 22px; padding: 20px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.customer-latency-heading, .customer-latency-comparison { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.customer-latency-heading { margin-bottom: 18px; }
.customer-latency-heading h2 { margin: 0 0 4px; font-size: 18px; }
.customer-latency-heading p, .customer-latency-comparison p, #customer-latency-note { margin: 0; color: var(--text-muted); font-size: 12px; }
#customer-latency-latest { text-align: right; }
.customer-latency-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.customer-latency-summary article { display: grid; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-hover); }
.customer-latency-summary article > span, .customer-latency-summary article > small { color: var(--text-muted); font-size: 12px; }
.customer-latency-summary article > strong { font: 650 30px/1.2 var(--font-mono); font-variant-numeric: tabular-nums; }
.customer-latency-comparison { align-items: center; margin-bottom: 12px; }
.customer-latency-comparison h3 { margin: 0 0 3px; font-size: 14px; }
.customer-latency-comparison label { display: flex; align-items: center; flex-shrink: 0; gap: 8px; color: var(--text-muted); font-size: 12px; }
.customer-latency-comparison select { width: auto; min-height: 36px; }
.customer-latency-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.customer-latency-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.customer-latency-table th, .customer-latency-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.customer-latency-table th { color: var(--text-muted); font-size: 11px; }
.customer-latency-table th:first-child, .customer-latency-table td:first-child { width: 36%; padding-left: 0; }
.customer-latency-table th:last-child, .customer-latency-table td:last-child { width: 120px; padding-right: 0; text-align: right; }
.customer-latency-name { overflow-wrap: anywhere; font-weight: 600; }
.customer-latency-reading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.customer-latency-bar { flex: 1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-hover); }
.customer-latency-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.customer-latency-value, .customer-latency-coverage { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.customer-latency-value { min-width: 72px; text-align: right; }
.customer-latency-coverage { color: var(--text-muted); }
#customer-latency-note { margin-top: 14px; }
@media (max-width: 600px) {
  .customer-latency-panel { padding: 14px; }
  .customer-latency-heading, .customer-latency-comparison { flex-wrap: wrap; }
  #customer-latency-latest { text-align: left; }
  .customer-latency-summary { grid-template-columns: 1fr; }
  .customer-latency-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .customer-latency-table tbody { display: block; }
  .customer-latency-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .customer-latency-table td { display: block; width: auto !important; padding: 0; border: 0; }
  .customer-latency-table td:first-child, .customer-latency-table td[colspan] { grid-column: 1 / -1; }
  .customer-latency-table td:last-child::before { content: "Measured "; font-family: var(--font-sans); }
  .customer-latency-table td[colspan]::before { content: none; }
  .customer-latency-reading { gap: 8px; }
  .customer-latency-value { min-width: 0; }
}
.compact-model-row:hover { background: rgba(99, 102, 241, 0.045); }
.compact-model-row:last-child { border-bottom: 0; }
.compact-model-row > div:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.model-identity-cell strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--accent-deep);
}
.free-model-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.copy-model-id {
  opacity: 0; padding: 3px 6px; border: 0; border-radius: 5px;
  background: transparent; color: var(--text-muted); font-size: 10.5px; cursor: pointer;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.compact-model-row:hover .copy-model-id, .copy-model-id:focus-visible { opacity: 1; }
.copy-model-id:hover { background: var(--surface-active); color: var(--text); }
.model-modalities { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.modality-badge {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-hover); color: var(--text-secondary);
  font-size: 10.5px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.modality-badge.vision { border-color: var(--accent-soft); background: var(--accent-tint); color: var(--accent-deep); }
.modality-badge.video { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.modality-badge.file { border-color: #bfdbfe; background: #eff6ff; color: #1e40af; }
.modality-badge svg { width: 12px; height: 12px; flex: 0 0 auto; }
.legend-icon { display: inline-grid; place-items: center; width: 12px; height: 12px; color: currentColor; font: 700 10px/1 var(--font-mono); }
.model-cell { color: var(--text-secondary); font-size: 12.5px; }
.numeric-cell { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.rate-cell { color: var(--text); font-weight: 700; }
.model-row strong { font-family: var(--font-mono); font-size: 15.5px; font-weight: 700; color: var(--accent-strong); letter-spacing: -0.01em; }
.model-row small { color: var(--text-muted); font-size: 13px; }
.model-row dl { display: flex; gap: 24px; margin: 0; }
.model-row dl div { text-align: right; }
.model-row dt { color: var(--text-muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.model-row dd { margin: 4px 0 0; font: 700 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.model-empty, .model-error, .model-loading { margin: 0; padding: 28px 16px; color: var(--text-muted); font-size: 13px; text-align: center; }
.model-error { display: flex; align-items: center; justify-content: center; gap: 12px; }

/* ================================================================
   Messages / feedback
   ================================================================ */

.message {
  margin-top: 16px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: var(--danger-bg);
  color: var(--danger-bright);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px; line-height: 1.45;
}
.message.success {
  border-color: rgba(4, 120, 87, 0.35);
  background: var(--success-bg);
  color: var(--success);
}

/* ================================================================
   Footer
   ================================================================ */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  color: var(--text-muted); font-size: 13px;
}
.footer-brand-lockup { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-brand-logo { display: block; width: 108px; height: auto; }
.site-foot a { color: var(--text-secondary); text-decoration: none; }
.site-foot a:hover { color: var(--text); }
.foot-links { display: flex; gap: 22px; }
.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text-secondary);
  font: 500 12px/1.4 var(--font-sans);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.visitor-count #visitor-count-value { color: var(--text); font-weight: 650; }
.visitor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
}

/* ================================================================
   API keys page
   ================================================================ */

.keys-layout { display: grid; gap: 20px; }
.api-base-url-card {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-hover);
}
.api-base-url-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.api-base-url-copy-row > div { display: grid; gap: 5px; min-width: 0; }
.api-base-url-copy-row small { color: var(--text-muted); font-size: 12.5px; }
.api-base-url-card code {
  color: var(--accent-deep);
  overflow-wrap: anywhere;
  font: 600 12.5px var(--font-mono);
}
.api-base-url-card p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* ================================================================
   Top up flow
   ================================================================ */

.topup-flow { display: grid; gap: 16px; }
.topup-section,
.coupon-disclosure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.topup-section { overflow: hidden; }
.compact-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 58px; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.compact-section-head h2 { margin: 0; font: 700 18px var(--font-display); letter-spacing: -.025em; }
.compact-section-head span, .compact-section-head p { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.pack-table-head,
.pack-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(100px, .65fr) minmax(100px, .65fr) 64px;
  gap: 14px; align-items: center;
}
.pack-table-head,
.purchase-table-head {
  padding: 8px 18px;
  color: var(--text-muted); background: var(--surface-hover);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .055em;
}
.pack-list { display: grid; }
.pack-row {
  min-height: 58px; padding: 9px 18px;
  color: var(--text-secondary); border-bottom: 1px solid var(--line);
  font-size: 13px; cursor: pointer; transition: background var(--t-fast);
}
.pack-row:last-child { border-bottom: 0; }
.pack-row:hover { background: var(--surface-hover); }
.pack-row.selected { background: var(--accent-tint); color: var(--text); }
.pack-identity { display: flex; align-items: center; gap: 10px; }
.pack-identity input { width: 16px; min-height: 16px; padding: 0; accent-color: var(--accent-strong); }
.pack-identity strong, .pack-row > strong { color: var(--text); font-weight: 700; }
.pack-row > span:not(.pack-identity) { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pack-select-copy { color: var(--accent-deep); font-family: var(--font-sans) !important; font-weight: 600; text-align: right; }
.cart-quantity-control { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.cart-quantity-control button, .cart-quantity-control input { min-height: 40px; border: 1px solid var(--line-bright); border-radius: var(--r-sm); background: var(--surface); color: var(--text); text-align: center; font: 700 13px var(--font-mono); }
.cart-quantity-control button { min-width: 40px; cursor: pointer; }
.cart-quantity-control input { width: 54px; padding: 4px; }
.cart-quantity-control button:disabled, .cart-quantity-control input:disabled { opacity: .48; cursor: not-allowed; }
.cart-lines { padding-left: 18px; margin: 6px 0; color: var(--text-secondary); font-size: 12px; }
.pack-selection-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 66px; padding: 10px 18px;
  background: var(--surface-hover); border-top: 1px solid var(--line);
}
.pack-selection-summary p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.pack-selection-summary .button { min-height: 40px; padding-block: 7px; }
.payment-method-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 18px 0;
  padding: 0;
  border: 0;
}
.payment-method-selector legend {
  grid-column: 1 / -1;
  padding: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.payment-method-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.payment-method-option:has(input:checked) {
  border-color: var(--accent-strong);
  background: var(--accent-tint);
}
.payment-method-option:focus-within { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.payment-method-option input { flex: 0 0 auto; width: 16px; min-height: 16px; margin-top: 2px; accent-color: var(--accent-strong); }
.payment-method-icon { flex: 0 0 48px; width: 48px; height: 48px; object-fit: contain; align-self: center; }
.payment-method-option span { display: grid; gap: 4px; min-width: 0; }
.payment-method-option strong { color: var(--text); font-size: 13px; }
.payment-method-option small { color: var(--text-muted); font-size: 11.5px; line-height: 1.45; }
.credit-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 18px 14px;
}
.credit-breakdown span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.credit-breakdown strong { color: var(--text); font: 700 13px var(--font-mono); letter-spacing: 0; }
.checkout-price-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 18px 14px; }
.checkout-price-summary span { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text-secondary); font-size: 11px; }
.checkout-price-summary strong { color: var(--text); font: 700 14px var(--font-mono); }
#continue-purchase { display: block; margin: 0 18px 16px auto; }
@media (max-width: 600px) { .checkout-price-summary { grid-template-columns: 1fr; } #continue-purchase { width: calc(100% - 36px); } }
.fpx-handoff {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px 14px;
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-md);
  background: var(--accent-tint);
}
.fpx-handoff > strong { color: var(--accent-deep); font: 700 16px var(--font-display); }
.fpx-handoff p { grid-column: 1; margin: 0; color: var(--text-secondary); font-size: 12.5px; line-height: 1.5; }
.pack-order-summary { display: flex; align-items: center; gap: 18px; min-width: 0; }
.quantity-control { display: inline-grid; grid-template-columns: auto 34px 54px 34px; align-items: center; gap: 4px; }
.quantity-control > span { margin-right: 4px; color: var(--text-muted); font-size: 11.5px; font-weight: 700; }
.quantity-control button,
.quantity-control input {
  min-height: 34px; border: 1px solid var(--line-bright); background: var(--surface); color: var(--text);
  font: 700 13px var(--font-mono); text-align: center;
}
.quantity-control button { padding: 0; border-radius: var(--r-sm); cursor: pointer; }
.quantity-control button:disabled { cursor: not-allowed; opacity: .48; }
.quantity-control input { width: 54px; padding: 4px; border-radius: var(--r-sm); }
.inline-flow-message { margin: 0 18px 14px; }
.pack-skeleton {
  height: 58px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 20%, var(--surface-hover) 50%, var(--surface) 80%);
  background-size: 220% 100%; animation: skeleton-shift 1.3s ease-in-out infinite;
}
@keyframes skeleton-shift { to { background-position: -220% 0; } }
.pack-error { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 92px; color: var(--text-muted); font-size: 13px; }
.payment-total {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 18px;
  margin: 18px 18px 0; padding: 14px 16px;
  border: 1px solid var(--accent-soft); border-radius: var(--r-md); background: var(--accent-tint);
}
.payment-total > span { color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.payment-total strong { grid-row: 1 / span 2; grid-column: 2; color: var(--accent-deep); font: 800 24px var(--font-display); font-variant-numeric: tabular-nums; }
.payment-total small { color: var(--text-muted); font: 500 11.5px var(--font-mono); }
.payment-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 18px; }
.qr-box {
  margin: 0; padding: 12px; display: grid; place-items: center;
  min-height: 200px; border: 1px dashed var(--line-bright); border-radius: var(--r-md); background: var(--bg);
}
.qr-box img { max-width: 190px; max-height: 190px; border-radius: var(--r-md); }
.receipt-form { display: grid; align-content: start; gap: 14px; }
.billing-profile {
  display: grid; gap: 12px;
  margin: 4px 0 16px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-deep);
}
.billing-summary-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.billing-summary-row h2 { flex-shrink: 0; margin: 0; font-size: 13px; }
.billing-summary-row h2 span { color: var(--text-muted); font-weight: 400; }
.billing-summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); font-size: 13px; }
.billing-summary-row .button { margin-left: auto; flex-shrink: 0; min-height: 36px; padding: 6px 10px; }
.billing-profile-form[hidden] { display: none; }
.billing-profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.billing-profile-form .billing-wide { grid-column: 1 / -1; }
.billing-profile-form label { font-size: 13px; gap: 6px; }
.billing-profile-form input { min-height: 42px; }
.billing-profile-form .billing-actions {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.billing-profile-form .message { margin-top: 0; }
.billing-policy-note {
  grid-column: 1 / -1; margin: 0;
  color: var(--text-muted); font-size: 12px; line-height: 1.6;
}
.billing-preview {
  grid-column: 1 / -1;
  white-space: pre-line;
  padding: 12px 14px;
  border: 1px dashed var(--line-bright); border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text-secondary); font-size: 12.5px; line-height: 1.6;
}
@media (max-width: 720px) {
  .billing-profile-form { grid-template-columns: 1fr; }
  .billing-profile { padding: 14px; }
}
.receipt-form small { color: var(--text-muted); font-size: 11.5px; font-weight: 400; }
.receipt-form .button { justify-self: start; }
.receipt-form .message { margin-top: 0; }
.reference-out {
  display: block; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg);
  font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--accent-deep); letter-spacing: .035em;
}
.coupon-toggle {
  width: 100%; min-height: 64px; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 0; background: transparent; cursor: pointer; text-align: left;
}
.coupon-toggle:hover { background: var(--surface-hover); }
.coupon-toggle > span:first-child { display: grid; gap: 2px; }
.coupon-toggle strong { font-size: 14px; }
.coupon-toggle small { color: var(--text-muted); font-size: 12px; }
.coupon-toggle > span:last-child { color: var(--accent-deep); font-size: 22px; font-weight: 400; }
.coupon-panel { padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.coupon-inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.coupon-inline-form .button { min-height: 46px; }
.coupon-panel .message { margin-top: 10px; }
.purchase-table-head,
.purchase-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(110px, .8fr) minmax(90px, .7fr) minmax(85px, .65fr) minmax(100px, .75fr) minmax(140px, 1.1fr) minmax(100px, .7fr) minmax(110px, .75fr); gap: 10px; align-items: center; }
.purchase-row { min-height: 54px; padding: 9px 18px; border-bottom: 1px solid var(--line); color: var(--text-secondary); font-size: 12.5px; }
.purchase-row > * { min-width: 0; overflow-wrap: anywhere; }
.purchase-row:last-child { border-bottom: 0; }
.purchase-row strong { color: var(--text); font-family: var(--font-mono); font-size: 12.5px; }
.purchase-row > span { font-variant-numeric: tabular-nums; }
.purchase-list > .muted { margin: 0; padding: 22px 18px; font-size: 13px; }
.key-badge.status-pending { color: var(--orange-text); background: var(--warning-bg); }
.key-badge.status-awaiting_review { color: var(--accent-deep); background: var(--accent-tint); }
.key-badge.status-approved { color: var(--success); background: var(--success-bg); }
.key-badge.status-fulfilled { color: var(--success); background: var(--success-bg); }
.key-badge.status-rejected { color: var(--danger); background: var(--danger-bg); }
.key-badge.status-cancelled { color: var(--text-muted); background: var(--line); }
.key-badge.status-applied { color: var(--success); background: var(--success-bg); }
.purchase-row .cancel-purchase { justify-self: start; }

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

/* ================================================================
   Request log page
   ================================================================ */

.log-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.log-sort-label { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.log-sort-label select {
  min-height: 34px;
  max-width: 150px;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--line-bright);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.log-refresh-status { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.log-refresh-status.ok { color: var(--success); }
.log-refresh-status.warning { color: var(--orange-text); }

.log-table th, .log-table td { font-size: 12.5px; padding: 10px 14px; }
.log-row-failed td { background: var(--danger-bg); }
.log-row-failed:hover td { background: rgba(220, 38, 38, 0.14) !important; }


.key-badge.status-ok { color: var(--success); background: var(--success-bg); }
.key-badge.status-failed { color: var(--danger); background: var(--danger-bg); }

/* ================================================================
   Customer docs (Amanai-style sidebar, asAi tokens)
   ================================================================ */

.docs-shell { padding-bottom: 80px; }
.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  padding-top: 32px;
  align-items: start;
}
.docs-side {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  display: grid;
  gap: 14px;
}
.docs-nav {
  display: grid;
  gap: 4px;
}
.docs-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.docs-nav a:hover { background: var(--accent-tint); color: var(--accent-deep); }
.docs-nav a[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent-deep);
}
.docs-support { font-size: 13px; margin: 8px 0 0; }
.docs-article { min-width: 0; }
.docs-article h1 { margin: 0 0 12px; font-size: 34px; letter-spacing: -0.03em; }
.docs-article h2 { margin: 32px 0 10px; font-size: 20px; }
.docs-article h3 { margin: 20px 0 8px; font-size: 16px; }
.docs-article p, .docs-article li { color: var(--text-secondary); line-height: 1.65; }
.docs-article ul, .docs-article ol { padding-left: 20px; }
.docs-article pre {
  margin: 12px 0 18px;
  padding: 16px 18px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow-x: auto;
}
.docs-article pre code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}
.docs-article code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.table-wrap { overflow-x: auto; margin: 12px 0 20px; }
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.docs-table th, .docs-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.docs-table th { color: var(--text-muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.docs-steps { list-style: decimal; min-width: 0; padding-left: 22px; display: grid; gap: 8px; }
.docs-steps > li { min-width: 0; }
.docs-steps h2 { margin-top: 8px; }
.docs-article p code, .docs-article li code { overflow-wrap: anywhere; word-break: break-word; }

/* P1 Hermes guide: code-copy row, cost rows, FAQ, CTA. */
body[data-page="docs-hermes"] .docs-breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--text-muted); font-size: 13px; margin-bottom: 10px; }
body[data-page="docs-hermes"] .docs-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
body[data-page="docs-hermes"] .docs-code-copy { display: grid; gap: 8px; margin: 12px 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
body[data-page="docs-hermes"] .docs-code-copy pre { margin: 0; }
body[data-page="docs-hermes"] .copy-status { min-height: 1.2em; font-size: 13px; color: var(--text-muted); }
body[data-page="docs-hermes"] .cost-example-wrap { min-width: 0; }
body[data-page="docs-hermes"] .cost-examples { list-style: decimal; min-width: 0; padding-left: 22px; display: grid; gap: 10px; }
body[data-page="docs-hermes"] .cost-examples code { font: 13px var(--font-mono); overflow-wrap: anywhere; }
body[data-page="docs-hermes"] .docs-faq { display: grid; gap: 10px; margin: 12px 0 18px; }
body[data-page="docs-hermes"] .docs-faq details { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 12px 14px; }
body[data-page="docs-hermes"] .docs-faq summary { font-weight: 700; cursor: pointer; }
body[data-page="docs-hermes"] .docs-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body[data-page="docs-hermes"] .docs-faq p { margin: 8px 0 0; }
body[data-page="docs-hermes"] .docs-troubleshooting { display: grid; gap: 8px; min-width: 0; padding-left: 20px; }
body[data-page="docs-hermes"] .docs-final-cta { margin: 28px 0 12px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: grid; gap: 12px; }
body[data-page="docs-hermes"] .docs-final-cta > div { display: flex; gap: 12px; flex-wrap: wrap; }
body[data-page="docs-hermes"] .cost-example-wrap.p1-reveal .cost-examples li { animation: p1-cost-in 200ms cubic-bezier(.23,1,.32,1) both; }
body[data-page="docs-hermes"] .cost-example-wrap.p1-reveal .cost-examples li:nth-child(2) { animation-delay: 60ms; }
body[data-page="docs-hermes"] .cost-example-wrap.p1-reveal .cost-examples li:nth-child(3) { animation-delay: 120ms; }
@keyframes p1-cost-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  body[data-page="docs-hermes"] .cost-example-wrap.p1-reveal .cost-examples li { animation: none; }
}

.opencode-generator {
  margin: 14px 0 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.opencode-generator h3 { margin-top: 0; }
.opencode-generator > p { margin: 0 0 14px; }
.opencode-controls { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.2fr) auto; gap: 12px; align-items: end; }
.opencode-controls label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.opencode-controls select { min-height: 42px; padding: 0 12px; color: var(--text); background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--r-md); font: inherit; }
.opencode-output { margin-top: 16px; }
.opencode-output summary { cursor: pointer; color: var(--accent-deep); font-weight: 700; }
.opencode-output p { margin: 12px 0; }
.opencode-output pre { max-height: 360px; margin-bottom: 12px; }

@media (max-width: 920px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; }
  .docs-side { position: static; }
  .docs-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .log-controls { width: 100%; justify-content: space-between; }
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 1080px) {
  .metrics-strip { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topnav { gap: 12px; padding-inline: 20px; }
  .nav-tab { padding-inline: 10px; }
  .nav-tab .nav-label { display: none; }
  .nav-tab svg { width: 17px; height: 17px; opacity: 1; }
}

@media (max-width: 920px) {
  .home-hero, .login-layout { grid-template-columns: 1fr; gap: 44px; padding-top: 48px; }
  .login-layout { padding-top: 40px; }
  .workspace { grid-template-columns: 1fr; }
  .topnav { padding: 0 20px; }
  /* B3/B4: single icon-only state for the whole mobile range, equal-width columns */
  .main-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    width: 100%; gap: 0;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-tab { padding: 8px 0; min-width: 0; min-height: 40px; justify-content: center; }
  .nav-tab .nav-label { display: none; }
  .nav-tab svg { display: block; width: clamp(15px, 4.4vw, 19px); height: clamp(15px, 4.4vw, 19px); opacity: 1; }
  .nav-beta { display: none; }
  .model-table-head { display: none; }
  .model-row.compact-model-row {
    grid-template-columns: minmax(210px, 1.4fr) repeat(3, minmax(76px, .5fr));
    min-height: 74px;
  }
  .compact-model-row .compact-modalities,
  .compact-model-row .model-cell:nth-of-type(3),
  .compact-model-row .model-cell:nth-of-type(4),
  .compact-model-row .model-cell:nth-of-type(7) { display: none; }
}

@media (max-width: 640px) {
  .shell { padding: 0 16px 72px; }
  .topnav { flex-wrap: wrap; height: auto; min-height: var(--nav-h); padding: 10px 16px; row-gap: 10px; }
  .brand { order: 1; }
  body[data-page="login"] .brand { order: 0; }
  .nav-right { order: 2; margin-left: auto; }
  .main-nav { order: 3; width: 100%; }
  .nav-tab { min-width: 0; justify-content: center; padding-inline: 0; }
  .stats-grid, .metrics-strip { grid-template-columns: 1fr 1fr; }
  .metrics-strip { grid-template-columns: repeat(2, 1fr); }
  .page-head { padding-top: 24px; }
  .topup-bonus-announcement { margin-top: 18px; }
  .announcement-slide {
    min-height: 190px;
    padding: 16px 18px;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .topup-bonus-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .topup-bonus-announcement .button { width: 100%; }
  .announcement-controls { padding-inline: 10px; }
  .announcement-arrow { min-height: 44px; }
  .topup-bonus-announcement + .page-head { padding-top: 24px; }
  .balance-pill .pill-label { display: none; }
  .auth-panel { padding: 0 20px 22px; }
  .tabs { margin: 0 -20px 22px; }
  .model-row:not(.compact-model-row) { grid-template-columns: 1fr; }
  .model-row dl { justify-content: space-between; }
  .model-row dl div { text-align: left; }
  .opencode-controls { grid-template-columns: 1fr; }
  .opencode-controls .button { width: 100%; }
  .opencode-output pre { max-height: 300px; }
  .model-toolbar { align-items: stretch; flex-wrap: wrap; }
  .model-search-label { width: 100%; }
  .model-filter { flex: 1; }
  .filter-chip { flex: 1; min-height: 44px; }
  .model-result-count { align-self: center; }
  .model-row.compact-model-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px; padding: 12px 16px;
  }
  .compact-model-row > div:first-child { grid-column: 1 / -1; }
  .compact-model-row .compact-modalities { display: none !important; }
  .compact-model-row .status-cell { grid-column: 1 / -1; }
  .model-cell { display: grid; gap: 2px; text-align: left; }
  .model-cell::before { content: attr(data-label); color: var(--text-muted); font: 600 9.5px var(--font-sans); text-transform: uppercase; letter-spacing: .05em; }
  .copy-model-id { opacity: 1; min-width: 44px; min-height: 44px; padding: 8px; }
  .pack-table-head, .purchase-table-head { display: none; }
  .pack-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; padding: 13px 16px; }
  .pack-row > *::before { content: attr(data-label); display: block; color: var(--text-muted); font: 600 9.5px var(--font-sans); text-transform: uppercase; letter-spacing: .05em; }
  .pack-identity { grid-column: 1 / -1; }
  .pack-select-copy { display: none; }
  .pack-selection-summary { align-items: stretch; flex-direction: column; }
  .pack-order-summary { align-items: stretch; flex-direction: column; gap: 10px; }
  .quantity-control { grid-template-columns: minmax(0, 1fr) 40px 58px 40px; }
  .payment-method-selector { grid-template-columns: 1fr; }
  .credit-breakdown { grid-template-columns: 1fr; }
  .fpx-handoff { grid-template-columns: 1fr; }
  .fpx-handoff p { grid-column: 1; }
  .fpx-handoff .button { width: 100%; }
  .payment-grid { grid-template-columns: 1fr; }
  .payment-total { grid-template-columns: 1fr; }
  .payment-total strong { grid-row: auto; grid-column: auto; }
  .qr-box { min-height: 180px; }
  .purchase-row { grid-template-columns: 1fr 1fr; gap: 12px; padding: 13px 16px; }
  .purchase-row > * { display: grid; gap: 2px; }
  .purchase-row > *::before { content: attr(data-label); color: var(--text-muted); font: 600 9.5px var(--font-sans); text-transform: uppercase; letter-spacing: .05em; }
  .coupon-inline-form { grid-template-columns: 1fr; }
  .range-tabs { overflow-x: auto; }
}

@media (max-width: 430px) {
  body:is([data-page="dashboard"], [data-page="models"], [data-page="keys"], [data-page="topup"], [data-page="logs"]) .brand-logo-full { display: none; }
  body:is([data-page="dashboard"], [data-page="models"], [data-page="keys"], [data-page="topup"], [data-page="logs"]) .brand-logo-mark { display: block; }
}

@media (max-width: 920px) {
  body:is([data-page="dashboard"], [data-page="models"], [data-page="keys"], [data-page="topup"], [data-page="logs"]) .brand-logo-full { display: none; }
  body:is([data-page="dashboard"], [data-page="models"], [data-page="keys"], [data-page="topup"], [data-page="logs"]) .brand-logo-mark { display: block; }
  .topnav { gap: 12px; padding-inline: 20px; }
  .nav-right { gap: 4px; }
  .button.sm { padding-inline: 10px; }
  .main-nav { gap: 0; padding: 3px; }
  .main-nav .nav-tab { min-width: 0; padding: 8px 0; }
}


/* asAi homepage reinvention, palette intentionally unchanged */
.home-nav { display: flex; align-items: center; gap: 28px; }
.home-nav a { color: var(--text-secondary); font-size: 14px; font-weight: 600; text-decoration: none; }
.home-nav a:hover { color: var(--accent-strong); }
.nav-beta {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* Public-page mobile menu (P0 home 2026-09-27; P1b adds docs/terms/privacy): toggle only below 920px */
.nav-menu-toggle { display: none; }
.nav-menu-panel { display: none; }
@media (max-width: 920px) {
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; margin-right: -8px;
    border: 0; border-radius: var(--r-md); background: transparent; color: var(--text);
    cursor: pointer; transition: background-color 150ms ease;
  }
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-menu-toggle:hover { background: var(--surface-hover); }
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-menu-toggle:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
  .nav-menu-bars, .nav-menu-bars::before, .nav-menu-bars::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform 180ms ease-out, opacity 150ms ease-out;
  }
  .nav-menu-bars { position: relative; }
  .nav-menu-bars::before, .nav-menu-bars::after { content: ""; position: absolute; left: 0; }
  .nav-menu-bars::before { top: -6px; }
  .nav-menu-bars::after { top: 6px; }
  .nav-menu-toggle[aria-expanded="true"] .nav-menu-bars { background: transparent; }
  .nav-menu-toggle[aria-expanded="true"] .nav-menu-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-menu-toggle[aria-expanded="true"] .nav-menu-bars::after { transform: translateY(-6px) rotate(-45deg); }
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-menu-panel:not([hidden]) {
    display: grid; gap: 12px;
    position: absolute; top: 100%; left: 0; right: 0;
    padding: 12px 18px 20px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 32px rgba(25, 28, 31, .08);
    animation: nav-menu-in 180ms ease-out;
  }
  .nav-menu-panel nav { display: grid; }
  .nav-menu-panel nav a {
    display: flex; align-items: center; min-height: 48px; padding: 0 4px;
    color: var(--text); font-size: 16px; font-weight: 600; text-decoration: none;
    border-bottom: 1px solid var(--line);
  }
  .nav-menu-panel nav a:hover { color: var(--accent-strong); }
  .nav-menu-panel nav a .nav-beta { margin-left: 8px; }
  .nav-menu-panel .nav-menu-cta { width: 100%; min-height: 48px; justify-content: center; }
}
@keyframes nav-menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-menu-panel:not([hidden]) { animation: none; }
  .nav-menu-bars, .nav-menu-bars::before, .nav-menu-bars::after { transition: none; }
}
.home-hero-v2 { min-height: auto; padding: 56px 0 64px; }
.home-hero-v2 h1 { max-width: 780px; font-size: clamp(48px, 6vw, 76px); }
.home-hero-v2 h1 span { color: var(--accent-strong); }
.text-link { display: inline-flex; gap: 8px; align-items: center; color: var(--accent-deep); font-weight: 700; text-decoration: none; }
.text-link:hover { color: var(--accent-strong); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--text-muted); font-size: 13px; }
.hero-facts li { position: relative; }
.hero-facts li:not(:last-child)::after { content: ""; position: absolute; right: -13px; top: 50%; width: 3px; height: 3px; border-radius: 50%; background: var(--line-bright); }
.cost-console { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: 0 24px 60px rgba(67, 56, 202, .08); }
.console-head, .cost-console dl > div, .console-total, .console-balance { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.console-head { padding: 18px 22px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.console-status { color: var(--success); }
.cost-console dl { margin: 0; padding: 12px 22px; }
.cost-console dl > div { padding: 9px 0; }
.cost-console dt { color: var(--text-muted); font-size: 14px; }
.cost-console dd { min-width: 0; overflow-wrap: anywhere; margin: 0; color: var(--text); font-family: var(--font-mono); font-size: 13px; text-align: right; }
.console-total { margin: 4px 22px 0; padding: 20px 0; border-top: 1px solid var(--line); }
.console-total span, .console-balance span { color: var(--text-secondary); font-size: 13px; }
.console-total strong { color: var(--accent-deep); font-family: var(--font-mono); font-size: clamp(24px, 4vw, 30px); overflow-wrap: anywhere; }
.console-balance { padding: 18px 22px; background: var(--accent-tint); }
.console-balance strong { color: var(--accent-deep); font-size: 14px; text-align: right; }
.cost-console > small { display: block; padding: 12px 22px 16px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.home-chapter { padding: 80px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--nav-h) + 20px); }
.chapter-heading { max-width: 780px; }
.chapter-heading h2, .home-chapter h2, .final-cta h2 { margin: 0; font-family: var(--font-display); font-size: clamp(34px, 4vw, 52px); letter-spacing: -.045em; line-height: 1.06; }
.chapter-heading p, .rm-intro > p:not(.kicker), .integration-copy > p:not(.kicker) { margin: 20px 0 0; color: var(--text-secondary); font-size: 17px; line-height: 1.65; }
.compact-heading h2 { font-size: clamp(32px, 3.5vw, 46px); }
.featured-model-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-top: 44px; }
.featured-model { min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); transition: transform var(--t-slow), border-color var(--t-normal); }
.featured-model:hover { transform: translateY(-3px); border-color: var(--accent-soft); }
.featured-model-primary { grid-row: span 3; min-height: 456px; background: var(--accent-tint); border-color: var(--accent-soft); }
.featured-model span { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.featured-model h3 { margin: 14px 0 8px; font-family: var(--font-display); font-size: 26px; letter-spacing: -.03em; }
.featured-model-primary h3 { font-size: 40px; }
.featured-model p { max-width: 48ch; margin: 0; color: var(--text-secondary); line-height: 1.6; }
.featured-model > strong { color: var(--accent-deep); font-family: var(--font-mono); font-size: 13px; }
.chapter-link { margin-top: 28px; }
.rm-proof, .integration-section, .trust-section { display: grid; grid-template-columns: minmax(0, .8fr) minmax(480px, 1.2fr); gap: 80px; align-items: center; }
.rm-intro .button { margin-top: 28px; }
.cost-board { border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); overflow: hidden; }
.cost-board article { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.cost-board article > div { display: grid; gap: 5px; }
.cost-board article > div:last-child { text-align: right; }
.cost-board span { font-weight: 700; }
.cost-board strong { color: var(--accent-deep); font-family: var(--font-mono); font-size: 18px; }
.cost-board small { color: var(--text-muted); line-height: 1.4; }
.cost-board > p { margin: 0; padding: 16px 24px; color: var(--text-muted); background: var(--bg); font-size: 11px; line-height: 1.55; }
.value-grid { display: grid; grid-template-columns: 1.2fr .8fr; margin-top: 44px; border-top: 1px solid var(--line); }
.value-grid article { min-height: 170px; padding: 28px 28px 28px 0; border-bottom: 1px solid var(--line); }
.value-grid article:nth-child(even) { padding-left: 28px; border-left: 1px solid var(--line); }
.value-grid strong { color: var(--accent-deep); font-size: 17px; }
.value-grid p { max-width: 48ch; margin: 10px 0 0; color: var(--text-secondary); line-height: 1.6; }
.integration-code { margin: 0; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--bg-deep); overflow-x: auto; }
.integration-code code { font-family: var(--font-mono); font-size: 13px; line-height: 1.7; }
.integration-copy .text-link { margin-top: 24px; }
.usage-flow { display: grid; grid-template-columns: repeat(4, 1fr); margin: 44px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.usage-flow li { min-height: 180px; display: grid; align-content: start; gap: 28px; padding: 24px 24px 24px 0; }
.usage-flow li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.usage-flow span { color: var(--accent-strong); font-family: var(--font-mono); font-size: 13px; }
.usage-flow strong { font-size: 16px; }
.usage-flow p { margin: 8px 0 0; color: var(--text-secondary); line-height: 1.55; }
.trust-section { align-items: start; }
.trust-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); }
.trust-grid article { padding: 26px; }
.trust-grid article + article { border-left: 1px solid var(--line); background: var(--accent-tint); }
.trust-grid strong { color: var(--accent-deep); }
.trust-grid ul { margin: 18px 0 0; padding-left: 18px; color: var(--text-secondary); line-height: 1.8; }
.trust-note { grid-column: 2; margin: -48px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.faq-list { margin-top: 38px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; padding: 22px 0; color: var(--text); font-size: 16px; font-weight: 700; }
.faq-list p { max-width: 70ch; margin: -4px 0 22px; color: var(--text-secondary); line-height: 1.65; }
.final-cta { display: flex; justify-content: space-between; align-items: end; gap: 48px; margin: 24px 0 72px; padding: 50px; border-radius: var(--r-xl); background: var(--accent-tint); border: 1px solid var(--accent-soft); }
.final-cta h2 { max-width: 720px; font-size: clamp(34px, 4vw, 50px); color: var(--accent-deep); }
.final-cta p { margin: 16px 0 0; color: var(--text-secondary); }
.final-actions { display: flex; gap: 10px; flex-shrink: 0; }
@media (max-width: 920px) {
  .home-nav { display: none; }
  .home-hero-v2 { min-height: 0; }
  .rm-proof, .integration-section, .trust-section { grid-template-columns: 1fr; gap: 42px; }
  .featured-model-grid { grid-template-columns: 1fr; }
  .featured-model-primary { grid-row: auto; min-height: 300px; }
  .usage-flow { grid-template-columns: 1fr 1fr; }
  .usage-flow li:nth-child(3) { border-left: 0; }
  .trust-note { grid-column: auto; margin: -24px 0 0; }
  .final-cta { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) {
  .shell { padding-left: 18px; padding-right: 18px; }
  body[data-page="home"] .topnav { height: 60px; }
  .nav-right .ghost { display: none; }
  .nav-right .button { min-height: 38px; padding: 0 14px; font-size: 13px; }
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-right .nav-signin { display: inline-flex; }
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-right .nav-register { display: none; }
  body:is([data-page="home"], [data-page^="docs"], [data-page="terms"], [data-page="privacy"]) .nav-right .button { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .home-hero-v2 { padding: 42px 0 56px; }
  .home-hero-v2 h1 { font-size: clamp(42px, 12vw, 58px); }
  .home-hero .hero-sub { font-size: 16px; margin-top: 20px; }
  .hero-actions { align-items: flex-start; flex-direction: column; margin-top: 28px; }
  .cost-console { margin-top: 4px; }
  .console-balance { align-items: flex-start; flex-direction: column; }
  .console-balance strong { text-align: left; }
  .home-chapter { padding: 56px 0; }
  .chapter-heading h2, .home-chapter h2 { font-size: 36px; }
  .featured-model { min-height: 180px; padding: 22px; }
  .featured-model-primary { min-height: 230px; }
  .featured-model-primary h3 { font-size: 32px; }
  .cost-board article { grid-template-columns: 1fr; gap: 16px; }
  .cost-board article > div:last-child { text-align: left; }
  .value-grid { grid-template-columns: 1fr; }
  .value-grid article, .value-grid article:nth-child(even) { min-height: 0; padding: 24px 0; border-left: 0; }
  .usage-flow { grid-template-columns: 1fr; }
  .usage-flow li, .usage-flow li + li { min-height: 0; grid-template-columns: 40px 1fr; gap: 8px; padding: 22px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
  .final-cta { padding: 30px 24px; }
  .final-actions { width: 100%; flex-direction: column; }
  .final-actions .button { width: 100%; }
}

/* Pricing page (2026-10-11). Scoped to body[data-page="pricing"] so no global
   button/topnav behaviour changes. Palette comes from the existing tokens. */
body[data-page="pricing"] .pricing-page { max-width: 1180px; }
body[data-page="pricing"] .pricing-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .6fr); gap: 48px; align-items: center; padding: 56px 0 40px; }
body[data-page="pricing"] .pricing-hero h1 { max-width: 780px; margin: 0; font-family: var(--font-display); font-size: clamp(44px, 6vw, 72px); letter-spacing: -.05em; line-height: 1.02; }
body[data-page="pricing"] .pricing-hero-copy { max-width: 620px; margin: 20px 0 0; color: var(--text-secondary); font-size: 18px; line-height: 1.6; }
body[data-page="pricing"] .pricing-hero-note { display: grid; gap: 8px; padding: 26px; border: 1px solid var(--accent-soft); border-radius: var(--r-xl); background: var(--accent-tint); }
body[data-page="pricing"] .pricing-hero-note strong { font-family: var(--font-display); font-size: 20px; color: var(--accent-deep); }
body[data-page="pricing"] .pricing-hero-note span { color: var(--text-secondary); font-size: 14px; }
body[data-page="pricing"] .pricing-hero-bonus { color: var(--orange-text) !important; font-weight: 800; }

body[data-page="pricing"] .pricing-section { padding: 46px 0; border-top: 1px solid var(--line); }
body[data-page="pricing"] .pricing-section:first-of-type { border-top: 0; }

/* Prepaid pack carousel: single-line scroll-snap strip (2026-10-11).
   Replaces the auto-fit grid, which wrapped 5 packs onto 2 lines. */
body[data-page="pricing"] .pricing-pack-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  margin-top: 32px;
  position: relative;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 12px; /* keeps the thin scrollbar from shifting layout */
  scrollbar-width: thin;
  scrollbar-color: var(--line-bright) transparent;
  -webkit-overflow-scrolling: touch;
}
body[data-page="pricing"] .pricing-pack-grid::-webkit-scrollbar { height: 4px; }
body[data-page="pricing"] .pricing-pack-grid::-webkit-scrollbar-track { background: transparent; }
body[data-page="pricing"] .pricing-pack-grid::-webkit-scrollbar-thumb {
  background: var(--line-bright);
  border-radius: var(--r-full);
}
/* Desktop fade peek: signals there are more packs off-screen. */
body[data-page="pricing"] .pricing-pack-grid::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 12px;
  width: 80px;
  background: linear-gradient(to right, transparent, var(--surface));
  pointer-events: none;
}
@media (hover: none) {
  /* Touch devices scroll by swipe: the fade would just sit over the last card. */
  body[data-page="pricing"] .pricing-pack-grid::after { display: none; }
}
body[data-page="pricing"] .pricing-pack-card {
  display: grid;
  gap: 10px;
  flex: 0 0 260px; /* fixed width: one line, uniform cards */
  scroll-snap-align: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  transition: border-color var(--t-normal), transform var(--t-slow);
}
@media (max-width: 639px) {
  body[data-page="pricing"] .pricing-pack-card { flex-basis: 78vw; }
}
body[data-page="pricing"] .pricing-pack-card:hover { transform: translateY(-3px); border-color: var(--accent-soft); }
body[data-page="pricing"] .pricing-pack-label { margin: 0; color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
body[data-page="pricing"] .pricing-pack-price { margin: 0; font-family: var(--font-display); font-size: clamp(30px, 4vw, 40px); letter-spacing: -.04em; }
body[data-page="pricing"] .pricing-pack-credits { margin: 0; color: var(--text-secondary); font-size: 15px; }
body[data-page="pricing"] .pricing-pack-credits strong { color: var(--accent-deep); font-family: var(--font-mono); font-size: 18px; }
body[data-page="pricing"] .pricing-pack-facts { display: grid; gap: 6px; margin: 4px 0 8px; padding: 0; }
body[data-page="pricing"] .pricing-pack-facts > div { display: flex; justify-content: space-between; gap: 12px; }
body[data-page="pricing"] .pricing-pack-facts dt { color: var(--text-muted); font-size: 13px; }
body[data-page="pricing"] .pricing-pack-facts dd { margin: 0; color: var(--text); font-family: var(--font-mono); font-size: 13px; }
body[data-page="pricing"] .pricing-pack-cta { width: 100%; min-height: 48px; }
body[data-page="pricing"] .pricing-unavailable { padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text-secondary); }

body[data-page="pricing"] .pricing-guidance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 32px; border-top: 1px solid var(--line); }
body[data-page="pricing"] .pricing-guidance-grid article { display: grid; gap: 6px; min-height: 150px; align-content: start; padding: 24px 24px 24px 0; border-bottom: 1px solid var(--line); }
body[data-page="pricing"] .pricing-guidance-grid article + article { padding-left: 24px; border-left: 1px solid var(--line); }
body[data-page="pricing"] .pricing-guidance-grid strong { font-size: 16px; }
body[data-page="pricing"] .pricing-guidance-grid span { color: var(--accent-deep); font-family: var(--font-mono); font-size: 13px; }
body[data-page="pricing"] .pricing-guidance-grid p { margin: 0; color: var(--text-secondary); line-height: 1.55; }
body[data-page="pricing"] .pricing-disclaimer { margin: 18px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; }

body[data-page="pricing"] .referral-section { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 48px; align-items: center; }
body[data-page="pricing"] .referral-facts { display: grid; gap: 12px; }
body[data-page="pricing"] .referral-facts span { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text-secondary); font-size: 14px; }
body[data-page="pricing"] .referral-facts strong { color: var(--accent-deep); font-family: var(--font-mono); }
body[data-page="pricing"] .referral-actions { grid-column: 2; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

body[data-page="pricing"] .payment-methods-section .payment-lead { margin: 12px 0 0; color: var(--text-secondary); }
body[data-page="pricing"] .payment-method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 30px; }
body[data-page="pricing"] .payment-method-card { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 18px; align-items: center; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
body[data-page="pricing"] .payment-method-card-featured { border-color: var(--accent); background: var(--accent-tint); }
body[data-page="pricing"] .payment-logo-slot { display: grid; place-items: center; min-height: 56px; }
body[data-page="pricing"] .payment-logo-slot img { max-width: 76px; height: 56px; object-fit: contain; }
body[data-page="pricing"] .payment-method-content h3 { margin: 0; font-size: 18px; }
body[data-page="pricing"] .payment-method-benefit { margin: 4px 0 0; color: var(--success); font-size: 13px; font-weight: 700; }
body[data-page="pricing"] .payment-method-content p { margin: 8px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
body[data-page="pricing"] .payment-method-content small { display: block; margin-top: 8px; color: var(--text-muted); font-size: 12px; }
body[data-page="pricing"] .payment-bonus-badge { position: absolute; top: 14px; right: 14px; padding: 5px 10px; border-radius: var(--r-full); background: var(--accent-strong); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
body[data-page="pricing"] .payment-trust-note { display: grid; gap: 6px; margin-top: 20px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
body[data-page="pricing"] .payment-trust-note strong { color: var(--text); }
body[data-page="pricing"] .payment-trust-note span { color: var(--text-muted); font-size: 13px; line-height: 1.55; }
body[data-page="pricing"] .payment-trust-note a { color: var(--accent-deep); }

@media (max-width: 900px) {
  body[data-page="pricing"] .pricing-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 44px; }
  body[data-page="pricing"] .referral-section { grid-template-columns: 1fr; gap: 28px; }
  body[data-page="pricing"] .referral-actions { grid-column: auto; }
}
@media (max-width: 768px) {
  body[data-page="pricing"] .payment-method-grid { grid-template-columns: 1fr; }
  body[data-page="pricing"] .pricing-guidance-grid { grid-template-columns: 1fr; }
  body[data-page="pricing"] .pricing-guidance-grid article, body[data-page="pricing"] .pricing-guidance-grid article + article { min-height: 0; padding: 22px 0; border-left: 0; }
}
@media (max-width: 430px) {
  body[data-page="pricing"] .pricing-pack-card { padding: 20px; }
  body[data-page="pricing"] .payment-method-card { grid-template-columns: 1fr; }
  body[data-page="pricing"] .payment-logo-slot { place-items: start; }
  body[data-page="pricing"] .payment-bonus-badge { position: static; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="pricing"] .pricing-pack-card { transition: none; }
  body[data-page="pricing"] .pricing-pack-card:hover { transform: none; }
}

body[data-page="home"] .home-hero-v2 {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .72fr);
  gap: clamp(44px, 6vw, 88px);
}
body[data-page="home"] .hero-copy { max-width: 760px; }
body[data-page="home"] .pack-console { position: relative; }
body[data-page="home"] .pack-console::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent-strong);
}
body[data-page="home"] .pack-hero-value {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 30px 22px 22px;
}
body[data-page="home"] .pack-hero-value strong {
  color: var(--accent-deep);
  font: 700 clamp(52px, 6vw, 72px)/.9 var(--font-display);
  letter-spacing: -.06em;
  font-variant-numeric: tabular-nums;
}
body[data-page="home"] .pack-hero-value span,
body[data-page="home"] .pack-credit-value span {
  color: var(--text-muted);
  font-size: 12px;
}
body[data-page="home"] .pack-credit-value {
  display: grid;
  gap: 6px;
  margin: 0 22px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
body[data-page="home"] .pack-credit-value strong {
  color: var(--text);
  font: 700 20px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
body[data-page="home"] .cost-board code {
  color: var(--text-muted);
  font: 12px/1.4 var(--font-mono);
  overflow-wrap: anywhere;
}
body[data-page="home"] .cost-board article:first-child {
  background: var(--accent-tint);
}
body[data-page="home"] .build-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .68fr);
  gap: clamp(48px, 7vw, 92px);
  align-items: start;
}
body[data-page="home"] .build-section .value-grid { margin-top: 38px; }
body[data-page="home"] .build-path {
  padding: 30px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-xl);
  background: var(--accent-tint);
}
body[data-page="home"] .compact-flow {
  grid-template-columns: 1fr;
  margin-top: 18px;
  border-top: 0;
}
body[data-page="home"] .compact-flow li,
body[data-page="home"] .compact-flow li + li {
  min-height: 0;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 18px 0;
  border-left: 0;
  border-bottom: 1px solid var(--accent-soft);
}
body[data-page="home"] .compact-flow li:last-child { border-bottom: 0; }
body[data-page="home"] .final-cta { margin-top: 48px; margin-bottom: 48px; }
body[data-page="home"] .site-foot { padding-bottom: 12px; }

/* P1 content cut (2026-09-27): single-column hero, 4-up trust strip */
body[data-page="home"] .home-hero-p1 { grid-template-columns: 1fr; }
body[data-page="home"] .home-hero-p1 .hero-copy { max-width: 820px; }
body[data-page="home"] .build-value .compact-flow { margin-top: 24px; }
body[data-page="home"] .build-value code {
  font: 13px/1.4 var(--font-mono);
  color: var(--accent-deep);
  overflow-wrap: anywhere;
}
body[data-page="home"] .trust-strip { display: block; }
body[data-page="home"] .trust-grid-4 { grid-template-columns: repeat(4, 1fr); }
body[data-page="home"] .trust-grid-4 article + article { border-left: 1px solid var(--line); border-top: 0; }
body[data-page="home"] .trust-grid-4 a { color: var(--accent-strong); }
body[data-page="home"] .faq-list code { font: 13px/1.4 var(--font-mono); color: var(--accent-deep); }
body[data-page="home"] .foot-links { flex-wrap: wrap; row-gap: 10px; }
@media (max-width: 920px) {
  body[data-page="home"] .trust-grid-4 { grid-template-columns: 1fr 1fr; }
  body[data-page="home"] .trust-grid-4 article:nth-child(3) { border-left: 0; }
  body[data-page="home"] .trust-grid-4 article:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  body[data-page="home"] .trust-grid-4 { grid-template-columns: 1fr; }
  body[data-page="home"] .trust-grid-4 article + article { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 920px) {
  body[data-page="home"] .home-hero-v2,
  body[data-page="home"] .build-section { grid-template-columns: 1fr; }
  body[data-page="home"] .pack-console { max-width: 620px; }
}

@media (max-width: 640px) {
  body[data-page="home"] .home-hero-v2 { gap: 32px; padding-bottom: 48px; }
  body[data-page="home"] .home-hero-v2 h1 { font-size: clamp(40px, 11.5vw, 54px); }
  body[data-page="home"] .home-hero .hero-sub { max-width: 34ch; }
  body[data-page="home"] .integration-code { padding: 20px 16px; }
  body[data-page="home"] .integration-code code {
    font-size: 11px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  body[data-page="home"] .pack-hero-value { align-items: flex-start; flex-direction: column; gap: 12px; }
  body[data-page="home"] .pack-credit-value strong { font-size: 17px; }
  body[data-page="home"] .build-path { padding: 24px 20px; }
  body[data-page="home"] .compact-flow li,
  body[data-page="home"] .compact-flow li + li { grid-template-columns: 36px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .featured-model { transition: none; }
  body[data-page="home"] .featured-model:hover { transform: none; }
}

/* P3 homepage: typographic tool strip, illustrative terminal, precise calculator. */
body[data-page="home"] .home-hero-p1 { grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); align-items: center; gap: clamp(32px, 5vw, 72px); }
body[data-page="home"] .build-value, body[data-page="home"] .build-path { min-width: 0; }
body[data-page="home"] .home-hero-p1 .hero-copy { min-width: 0; }
body[data-page="home"] .hermes-terminal { min-width: 0; overflow: hidden; border: 1px solid #333949; border-radius: var(--r-xl); background: #191c27; color: var(--inverse); box-shadow: 0 18px 36px rgba(25, 28, 31, .11); }
body[data-page="home"] .hermes-terminal-head { display: flex; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,.18); font: 11px/1.4 var(--font-mono); }
body[data-page="home"] .hermes-terminal-lines { display: grid; gap: 9px; margin: 0; padding: 20px 18px 24px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 var(--font-mono); }
body[data-page="home"] .hermes-terminal-lines span { display: block; }
body[data-page="home"] .hermes-terminal.p3-animate .hermes-terminal-lines span { opacity: .82; transform: none; transition: opacity 240ms cubic-bezier(.23,1,.32,1); }
body[data-page="home"] .hermes-terminal.p3-animate .hermes-terminal-lines span.visible { opacity: 1; transform: none; }
body[data-page="home"] .home-works-with { padding: 18px 0 22px; border-top: 1px solid var(--line); }
body[data-page="home"] .home-works-with p { margin: 0 0 10px; font-size: 12px; color: var(--text-muted); }
body[data-page="home"] .home-tools { display: flex; align-items: center; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; }
body[data-page="home"] .home-tools a { flex: none; scroll-snap-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-size: 12px; font-weight: 600; }
body[data-page="home"] .home-tools a:hover, body[data-page="home"] .home-tools a:focus-visible { color: var(--accent-deep); border-color: var(--accent-soft); }
body[data-page="home"] .hermes-showcase { display: grid; grid-template-columns: minmax(0, .74fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
body[data-page="home"] .hermes-intro p:not(.kicker), body[data-page="home"] .hermes-why { color: var(--text-secondary); line-height: 1.65; }
body[data-page="home"] .hermes-intro .text-link { margin-top: 10px; }
body[data-page="home"] .hermes-capabilities { display: grid; border-top: 1px solid var(--line); }
body[data-page="home"] .hermes-capabilities article { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
body[data-page="home"] .hermes-capabilities span { grid-row: span 2; color: var(--accent-strong); font: 12px var(--font-mono); }
body[data-page="home"] .hermes-capabilities strong { font-size: 16px; }
body[data-page="home"] .hermes-capabilities p { margin: 5px 0 0; color: var(--text-secondary); line-height: 1.45; }
body[data-page="home"] .hermes-capabilities.p3-reveal article { animation: p3-section-in 240ms cubic-bezier(.23,1,.32,1) both; }
body[data-page="home"] .hermes-capabilities.p3-reveal article:nth-child(2) { animation-delay: 40ms; }
body[data-page="home"] .hermes-capabilities.p3-reveal article:nth-child(3) { animation-delay: 80ms; }
@keyframes p3-section-in { from { opacity: .4; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body[data-page="home"] .hermes-why { margin: 18px 0 24px; }
body[data-page="home"] .hermes-setup { padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
body[data-page="home"] .hermes-setup ol { padding-left: 22px; color: var(--text-secondary); line-height: 1.7; }
body[data-page="home"] .hermes-setup code { font: 12px var(--font-mono); overflow-wrap: anywhere; }
body[data-page="home"] .hermes-setup p { margin-bottom: 0; }
body[data-page="home"] .rm5-calculator { min-width: 0; display: grid; gap: 12px; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
body[data-page="home"] .rm5-calculator label { font-size: 13px; font-weight: 700; }
body[data-page="home"] .rm5-calculator select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
body[data-page="home"] .rm5-usage { display: flex; gap: 6px; flex-wrap: wrap; }
body[data-page="home"] .rm5-usage button { min-height: 44px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-secondary); cursor: pointer; }
body[data-page="home"] .rm5-usage button[aria-pressed="true"] { border-color: var(--accent-strong); background: var(--accent-tint); color: var(--accent-deep); }
body[data-page="home"] .rm5-result { margin: 8px 0 0; font-size: 13px; color: var(--text-secondary); }
body[data-page="home"] .rm5-result strong { display: block; color: var(--accent-deep); font: 700 clamp(32px,4vw,52px)/1 var(--font-display); font-variant-numeric: tabular-nums; }
body[data-page="home"] .rm5-disclaimer { margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
body[data-page="home"] .home-example-tabs { display: flex; min-width: 0; max-width: 100%; overflow-x: auto; gap: 4px; margin-bottom: 12px; }
body[data-page="home"] .home-example-tabs button { min-height: 44px; flex: none; padding: 7px 10px; border: 0; border-bottom: 2px solid transparent; color: var(--text-secondary); background: transparent; cursor: pointer; font-weight: 600; }
body[data-page="home"] .home-example-tabs button[aria-selected="true"] { color: var(--accent-deep); border-color: var(--accent-strong); }
body[data-page="home"] .home-example-content { min-width: 0; max-width: 100%; overflow: hidden; }
body[data-page="home"] .home-copy-example { min-height: 44px; margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent-deep); background: var(--surface); cursor: pointer; }
body[data-page="home"] .home-example-guide { margin-left: 10px; font-size: 12px; }
body[data-page="home"] .home-attribution { max-width: 75ch; color: var(--text-muted); font-size: 11px; line-height: 1.5; }
body[data-page="home"] .home-sticky-cta[hidden] { display: none; }
body[data-page="home"] .home-sticky-cta { display: none; }
body[data-page="home"] .hermes-setup a:focus-visible, body[data-page="home"] .home-tools a:focus-visible, body[data-page="home"] .rm5-calculator button:focus-visible, body[data-page="home"] .rm5-calculator select:focus-visible, body[data-page="home"] .home-example-tabs button:focus-visible, body[data-page="home"] .home-copy-example:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
@media (max-width: 920px) {
  body[data-page="home"] .home-hero-p1, body[data-page="home"] .hermes-showcase { grid-template-columns: 1fr; }
  body[data-page="home"] .build-section { grid-template-columns: minmax(0, 1fr); }
  body[data-page="home"] .hermes-terminal { max-width: 680px; }
}
@media (max-width: 640px) {
  body[data-page="home"] .home-hero-p1 { gap: 18px; }
  body[data-page="home"] .hermes-terminal-lines { font-size: 11px; }
  body[data-page="home"] .rm5-calculator { padding: 18px; }
  body[data-page="home"] .home-sticky-cta:not([hidden]) { position: fixed; z-index: 20; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -10px 24px rgba(25,28,31,.08); font-size: 13px; font-weight: 700; }
  body[data-page="home"] .home-sticky-cta .button { min-height: 44px; }
  body[data-page="home"] .shell { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .hermes-terminal.p3-animate .hermes-terminal-lines span { opacity: 1; transform: none; transition: none; }
  body[data-page="home"] .hermes-capabilities.p3-reveal article { animation: none; }
  body[data-page="home"] .home-tools { scroll-behavior: auto; }
}

/* P2 public model catalog: same table on home and docs, cards on narrow screens. */
.public-catalog { min-width: 0; margin-top: 28px; color: var(--text); }
.catalog-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-bottom: 18px; }
.catalog-controls label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; }
.catalog-controls input, .catalog-controls select { min-height: 44px; min-width: 170px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.catalog-filters { display: flex; flex: 1 1 100%; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.catalog-filters button { min-height: 44px; flex: none; padding: 7px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.catalog-filters button[aria-pressed="true"] { border-color: var(--accent-strong); color: var(--accent-deep); background: var(--accent-tint); }
.catalog-scroll { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.catalog-table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 13px; }
.catalog-table caption { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.catalog-table th { position: sticky; top: 0; z-index: 1; padding: 13px 12px; background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
.catalog-table th button { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.catalog-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.catalog-table th[aria-sort="descending"] button::after { content: " ↓"; }
.catalog-row td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.catalog-row:hover { background: var(--accent-tint); }
.catalog-row[hidden], .catalog-empty[hidden] { display: none !important; }
.catalog-row td:first-child { min-width: 210px; }
.catalog-row code { font: 11px/1.6 var(--font-mono); overflow-wrap: anywhere; }
.catalog-row strong { font-weight: 700; }
.catalog-recommended { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--accent-deep); }
.catalog-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.catalog-detail { margin-top: 5px; color: var(--text-secondary); font-size: 11px; }
.catalog-detail summary, .catalog-copy, .catalog-empty button { cursor: pointer; color: var(--accent-deep); }
.catalog-detail span { display: block; max-width: 25ch; }
.catalog-copy { border: 0; background: transparent; font-size: 11px; min-height: 28px; }
.catalog-footer, .catalog-unavailable, .catalog-stale, .catalog-empty { margin: 14px 0; color: var(--text-secondary); font-size: 13px; }
.catalog-empty { padding: 20px; text-align: center; }
.public-catalog button:focus-visible, .public-catalog input:focus-visible, .public-catalog select:focus-visible, .catalog-detail summary:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
@media (max-width: 700px) {
  .catalog-scroll { max-height: none; overflow: visible; border: 0; }
  .catalog-table, .catalog-table tbody, .catalog-row { display: block; }
  .catalog-table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .catalog-row { margin-bottom: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
  .catalog-row td { display: inline-block; padding: 3px 8px 3px 0; border: 0; font-size: 12px; }
  .catalog-row td:first-child { display: block; min-width: 0; }
  .catalog-row td[data-label]::before { content: attr(data-label) ": "; color: var(--text-muted); }
  .catalog-number { text-align: left; }
  .catalog-controls label { flex: 1 1 150px; }
  .catalog-controls input, .catalog-controls select { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .catalog-row { transition: none; } }

/* ================================================================
   Legal documents
   ================================================================ */

.legal-shell { padding-bottom: 64px; }
.docs-layout.legal-layout {
  grid-template-columns: 200px minmax(0, 720px);
  justify-content: center;
  gap: 56px;
  padding: 48px 0 56px;
}
.legal-side {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 24px;
  max-height: calc(100dvh - var(--nav-h) - 48px);
  min-width: 0;
}
.legal-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.78);
}
.legal-switch a {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.legal-switch a:hover { color: var(--accent-deep); }
.legal-switch a[aria-current="page"] {
  color: var(--accent-deep);
  background: var(--accent-tint);
}
.legal-toc {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-bright) transparent;
}
.legal-nav-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.legal-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 12px 8px 0;
  list-style: none;
}
.legal-toc a {
  display: block;
  padding: 6px 8px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.legal-toc a:hover {
  border-left-color: var(--accent-soft);
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.68);
}
.legal-article {
  width: 100%;
  max-width: 720px;
}
.docs-article.legal-article h1 {
  max-width: 14ch;
  margin: 0 0 24px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(40px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  text-wrap: balance;
}
.legal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 52px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
}
.legal-meta > div {
  min-width: 0;
  padding: 16px 18px;
}
.legal-meta > div:nth-child(even) { border-left: 1px solid var(--accent-soft); }
.legal-meta > div:nth-child(n + 3) { border-top: 1px solid var(--accent-soft); }
.legal-meta dt {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.legal-meta dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.legal-meta a,
.legal-article p a,
.legal-article li a {
  color: var(--accent-deep);
  text-decoration-color: var(--accent-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.legal-meta a:hover,
.legal-article p a:hover,
.legal-article li a:hover { text-decoration-color: currentColor; }
.legal-section {
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.legal-section + .legal-section {
  margin-top: 42px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.docs-article.legal-article .legal-section h2 {
  margin: 0 0 16px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  text-wrap: balance;
}
.docs-article.legal-article .legal-section h3 {
  margin: 28px 0 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.legal-article .legal-section p,
.legal-article .legal-section li {
  color: var(--text-secondary);
  line-height: 1.72;
}
.legal-article .legal-section p { margin: 0 0 16px; }
.legal-article .legal-section p:last-child { margin-bottom: 0; }
.legal-article .legal-section ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 20px;
  padding-left: 22px;
}
.legal-article .legal-section li { padding-left: 4px; }
.legal-article .legal-section strong { color: var(--text); }
.legal-article .legal-section code {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--accent-deep);
}

@media (max-width: 920px) {
  .docs-layout.legal-layout {
    grid-template-columns: minmax(0, 720px);
    gap: 32px;
    padding: 36px 0 48px;
  }
  .legal-side {
    position: static;
    max-height: none;
  }
  .legal-switch { width: min(100%, 320px); }
  .legal-toc { display: none; }
}

@media (max-width: 640px) {
  .legal-shell { padding-bottom: 48px; }
  .docs-layout.legal-layout { gap: 28px; padding: 28px 0 40px; }
  .legal-switch { width: 100%; }
  .docs-article.legal-article h1 {
    max-width: none;
    margin-bottom: 20px;
    font-size: clamp(34px, 10vw, 40px);
  }
  .legal-meta {
    grid-template-columns: 1fr;
    margin-bottom: 40px;
  }
  .legal-meta > div:nth-child(even) { border-left: 0; }
  .legal-meta > div + div { border-top: 1px solid var(--accent-soft); }
  .legal-section + .legal-section { margin-top: 34px; padding-top: 32px; }
  .docs-article.legal-article .legal-section h2 { font-size: 20px; }
  .legal-article .legal-section p,
  .legal-article .legal-section li { line-height: 1.68; }
  body:is([data-page="terms"], [data-page="privacy"]) .site-foot {
    align-items: flex-start;
    flex-direction: column;
  }
  body:is([data-page="terms"], [data-page="privacy"]) .foot-links {
    width: 100%;
    gap: 12px 20px;
    flex-wrap: wrap;
  }
}

/* M1 homepage ticker, product visual, and below-fold reveals */
body[data-page="home"] .ticker {
  margin-inline: calc(50% - 50vw);
  border-block: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface-hover);
}
body[data-page="home"] .ticker-inner {
  display: flex;
  width: max-content;
  padding: 16px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-secondary);
  animation: marquee 30s linear infinite;
  will-change: transform;
}
body[data-page="home"] .ticker-group { display: flex; flex-shrink: 0; }
body[data-page="home"] .ticker-group span {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
body[data-page="home"] .ticker-group span::before {
  content: "·";
  color: var(--accent);
  margin-inline: 48px;
}
@keyframes marquee {
  100% { transform: translateX(-50%); }
}
body[data-page="home"] .hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}
body[data-page="home"] .hero-frame {
  position: relative;
  width: min(520px, 90vw);
  overflow: hidden;
  border: 1px solid #333949;
  border-radius: 12px;
  background: #1a1e23;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .12);
  transform: rotate(1deg);
}
body[data-page="home"] .hero-frame .frame-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #14171a;
}
body[data-page="home"] .hero-frame .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}
body[data-page="home"] .hero-frame .dot:nth-child(2) { background: #febc2e; }
body[data-page="home"] .hero-frame .dot:nth-child(3) { background: #28c840; }
body[data-page="home"] .hero-frame picture,
body[data-page="home"] .hero-frame img { display: block; }
body[data-page="home"] .hero-frame img {
  width: 100%;
  height: auto;
}
body[data-page="home"] .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms cubic-bezier(.23, 1, .32, 1), transform 240ms cubic-bezier(.23, 1, .32, 1);
}
body[data-page="home"] .reveal.revealed {
  opacity: 1;
  transform: none;
}
body[data-page="home"] .reveal > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms cubic-bezier(.23, 1, .32, 1), transform 240ms cubic-bezier(.23, 1, .32, 1);
}
body[data-page="home"] .reveal.revealed > * {
  opacity: 1;
  transform: none;
}
@media (max-width: 768px) {
  body[data-page="home"] .hero-frame { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .ticker { overflow-x: auto; }
  body[data-page="home"] .ticker-inner { animation: none; will-change: auto; }
  body[data-page="home"] .ticker-group[aria-hidden="true"] { display: none; }
  body[data-page="home"] .reveal,
  body[data-page="home"] .reveal > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Customer review carousel (2026-10-11). Scoped to the homepage. */
body[data-page="home"] .review-carousel-section {
  display: grid;
  gap: 24px;
  overflow: hidden;
}
body[data-page="home"] .review-carousel-section .chapter-heading p {
  max-width: 48ch;
  margin: 8px 0 0;
  color: var(--text-secondary);
}
body[data-page="home"] .review-carousel { min-width: 0; }
body[data-page="home"] .review-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 3);
  gap: 16px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  list-style: none;
}
body[data-page="home"] .review-track::-webkit-scrollbar { display: none; }
body[data-page="home"] .review-slide {
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
body[data-page="home"] .review-card {
  height: 100%;
  min-height: 286px;
  margin: 0;
  display: grid;
  grid-template-rows: 164px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
body[data-page="home"] .review-shot {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
body[data-page="home"] .review-image {
  display: block;
  width: 100%;
  max-height: 128px;
  object-fit: contain;
  border-radius: var(--r-sm);
}
body[data-page="home"] .review-caption {
  align-self: start;
  padding: 16px 18px 20px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}
body[data-page="home"] .review-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, auto) 44px;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
body[data-page="home"] .review-arrow {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--accent-deep);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font: 700 24px/1 var(--font-display);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
body[data-page="home"] .review-arrow:hover {
  color: var(--accent-strong);
  background: var(--accent-tint);
  border-color: var(--accent-soft);
}
body[data-page="home"] .review-arrow:active { transform: translateY(1px); }
body[data-page="home"] .review-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
body[data-page="home"] .review-dot {
  width: 18px;
  height: 44px;
  padding: 0;
  position: relative;
  background: transparent;
  border: 0;
  cursor: pointer;
}
body[data-page="home"] .review-dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  background: var(--line-bright);
  border-radius: var(--r-full);
  transition: width var(--t-fast), background var(--t-fast);
}
body[data-page="home"] .review-dot[aria-current="true"]::before {
  width: 18px;
  background: var(--accent-strong);
}
body[data-page="home"] .review-status {
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1023px) {
  body[data-page="home"] .review-track { grid-auto-columns: calc((100% - 16px) / 2); }
}
@media (max-width: 639px) {
  body[data-page="home"] .review-track {
    grid-auto-columns: 88%;
    gap: 12px;
  }
  body[data-page="home"] .review-card {
    min-height: 280px;
    grid-template-rows: 158px auto;
  }
  body[data-page="home"] .review-shot { padding: 14px; }
  body[data-page="home"] .review-image { max-height: 126px; }
  body[data-page="home"] .review-caption { padding: 14px 16px 18px; }
  body[data-page="home"] .review-controls { gap: 8px; }
  body[data-page="home"] .review-dots { gap: 2px; }
  body[data-page="home"] .review-dot { width: 12px; }
  body[data-page="home"] .review-dot[aria-current="true"]::before { width: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .review-track { scroll-behavior: auto; }
  body[data-page="home"] .review-arrow,
  body[data-page="home"] .review-dot::before { transition: none; }
  body[data-page="home"] .review-arrow:active { transform: none; }
}

/* P2 SEO marketing shell: hero split, proof strip, steps, FAQ, sticky CTA. */
body[data-seo-page] .seo-shell { padding-bottom: 72px; }
body[data-seo-page] .seo-hero { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-top: 40px; }
body[data-seo-page] .seo-hero h1 { margin: 0 0 10px; font-size: clamp(30px, 4.2vw, 44px); letter-spacing: -0.03em; }
body[data-seo-page] .seo-sub { max-width: 52ch; }
body[data-seo-page] .seo-console { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 18px; display: grid; gap: 12px; }
body[data-seo-page] .seo-console pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.55 var(--font-mono); }
body[data-seo-page] .seo-console .seo-console-actions { display: flex; gap: 12px; flex-wrap: wrap; }
body[data-seo-page] .seo-copy-status { min-height: 1.2em; font-size: 13px; color: var(--text-muted); }
body[data-seo-page] .seo-proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; }
body[data-seo-page] .seo-fact { padding: 14px 14px 14px 0; border-top: 0; }
body[data-seo-page] .seo-fact + .seo-fact { border-left: 1px solid var(--line); padding-left: 14px; }
body[data-seo-page] .seo-fact strong { display: block; font: 700 20px var(--font-mono); font-variant-numeric: tabular-nums; }
body[data-seo-page] .seo-fact span { color: var(--text-muted); font-size: 13px; }
body[data-seo-page] .seo-proof.p2-reveal .seo-fact { animation: p2-proof-in 150ms ease-out both; }
body[data-seo-page] .seo-proof.p2-reveal .seo-fact:nth-child(2) { animation-delay: 60ms; }
body[data-seo-page] .seo-proof.p2-reveal .seo-fact:nth-child(3) { animation-delay: 120ms; }
body[data-seo-page] .seo-proof.p2-reveal .seo-fact:nth-child(4) { animation-delay: 180ms; }
@keyframes p2-proof-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body[data-seo-page] .seo-steps { list-style: none; padding: 0; margin: 12px 0 20px; display: grid; gap: 12px; }
body[data-seo-page] .seo-steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
body[data-seo-page] .seo-steps span { color: var(--accent-strong); font: 12px var(--font-mono); }
body[data-seo-page] .seo-faq { display: grid; gap: 10px; margin: 12px 0 20px; }
body[data-seo-page] .seo-faq details { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 12px 14px; }
body[data-seo-page] .seo-faq summary { font-weight: 700; cursor: pointer; }
body[data-seo-page] .seo-faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body[data-seo-page] .seo-faq p { margin: 8px 0 0; color: var(--text-secondary); line-height: 1.65; }
body[data-seo-page] .seo-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
body[data-seo-page] .seo-mobile-cta { display: none; position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
body[data-seo-page] .seo-article h2 { margin: 30px 0 10px; font-size: 20px; }
body[data-seo-page] .seo-article p, body[data-seo-page] .seo-article li { color: var(--text-secondary); line-height: 1.65; }
body[data-seo-page] .seo-cost-wrap p code, body[data-seo-page] .seo-article code { overflow-wrap: anywhere; word-break: break-word; }
body[data-seo-page] .seo-cost-wrap ol { padding-left: 22px; display: grid; gap: 10px; }
@media (max-width: 768px) {
  body[data-seo-page] .seo-hero { grid-template-columns: minmax(0, 1fr); }
  body[data-seo-page] .seo-proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-seo-page] .seo-fact + .seo-fact { border-left: 0; padding-left: 0; }
  body[data-seo-page] .seo-fact:nth-child(even) { border-left: 1px solid var(--line); padding-left: 14px; }
  body[data-seo-page] .seo-mobile-cta { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-seo-page] .seo-proof.p2-reveal .seo-fact { animation: none; }
  body[data-seo-page] a, body[data-seo-page] button { transition: none; }
}


/* M1 homepage ticker, product visual, and below-fold reveals */
body[data-page="home"] .ticker {
  margin-inline: calc(50% - 50vw);
  border-block: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface-hover);
}
body[data-page="home"] .ticker-inner {
  display: flex;
  width: max-content;
  padding: 16px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-secondary);
  animation: marquee 30s linear infinite;
  will-change: transform;
}
body[data-page="home"] .ticker-group { display: flex; flex-shrink: 0; }
body[data-page="home"] .ticker-group span {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
body[data-page="home"] .ticker-group span::before {
  content: "·";
  color: var(--accent);
  margin-inline: 48px;
}
@keyframes marquee {
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="home"] .ticker { overflow-x: auto; }
  body[data-page="home"] .ticker-inner { animation: none; will-change: auto; }
  body[data-page="home"] .ticker-group[aria-hidden="true"] { display: none; }
}


/* Restored Hermes product visual below the section heading. */
body[data-page="home"] .hermes-media {
  margin: 28px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
body[data-page="home"] .hermes-media picture,
body[data-page="home"] .hermes-media img { display: block; }
body[data-page="home"] .hermes-media img { width: 100%; height: auto; }

/* Chat product proof: only on the public homepage, using existing colors and type. */
body[data-page="home"] .chat-promo {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}
body[data-page="home"] .chat-promo-copy { min-width: 0; }
body[data-page="home"] .chat-promo-copy h2 { max-width: 14ch; }
body[data-page="home"] .chat-promo-copy > p:not(.kicker) {
  max-width: 48ch;
  margin: 20px 0 22px;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.65;
}
body[data-page="home"] .chat-promo-visual { min-width: 0; margin: 0; }
body[data-page="home"] .chat-promo-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-bright);
  border-radius: var(--r-lg);
}
body[data-page="home"] .chat-promo-visual figcaption {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12px;
}
@media (max-width: 920px) {
  body[data-page="home"] .chat-promo { grid-template-columns: 1fr; }
  body[data-page="home"] .chat-promo-copy h2 { max-width: 22ch; }
}

/* The referral card shares the top-up sections' 18px content inset. */
.referral-card { min-width: 0; padding: 0 18px 20px; }
.referral-card > .compact-section-head { margin-inline: -18px; }
.referral-card > p { line-height: 1.55; }
.referral-tier-intro { margin-block: 18px 16px; }
.referral-tier-intro h3 { margin: 0 0 5px; font: 700 16px var(--font-display); }
.referral-tier-intro p { margin: 0; max-width: 100ch; line-height: 1.55; color: var(--text-secondary); }
.referral-tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.referral-tier-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); line-height: 1.4; }
.referral-tier-card strong { color: var(--accent-deep); font: 700 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.referral-tier-card:nth-child(2) { background: var(--surface-hover); }
.referral-tier-card:nth-child(3) { border-color: var(--line-bright); background: var(--surface-hover); }
.referral-tier-card .referral-tier-range { font-weight: 650; color: var(--text); }
.referral-tier-card span:last-child { color: var(--text-secondary); font-size: 13px; }
.referral-card > .referral-tier-note { margin-block: 14px 12px; max-width: 85ch; color: var(--text-secondary); font-size: 13px; }
.referral-card > .referral-tier-note + p { margin-block: 0 14px; font-size: 13px; color: var(--text-secondary); }
@media (max-width: 700px) {
  .referral-tier-grid { grid-template-columns: 1fr; }
  .referral-tier-card { padding: 14px 16px; }
}
.referral-link-row { display: flex; gap: 10px; margin: 8px 0; min-width: 0; }
.referral-link-row input { width: 100%; min-width: 0; flex: 1; }
.referral-link-row button { flex-shrink: 0; min-height: 44px; }
.referral-totals { display: flex; gap: 24px; flex-wrap: wrap; margin: 16px 0; }
.referral-totals dt { font-size: .8rem; color: var(--muted); }
.referral-totals dd { margin: 4px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.referral-history { padding-left: 20px; overflow-wrap: anywhere; }
.hitpay-countdown { font-variant-numeric: tabular-nums; font-weight: 700; margin: .5rem 0; }
.referral-card > small { display: block; margin-top: 16px; line-height: 1.5; }
.signup-referral-field { display: grid; gap: 8px; margin-top: 16px; }
.signup-referral-field small { color: var(--muted); line-height: 1.5; }
@media (max-width: 480px) {
  .referral-link-row { flex-direction: column; }
  .referral-link-row button { width: 100%; }
  .referral-totals { gap: 16px; }
}

/* Tier achievement: website tokens inherit light/dark palettes and typography. */
.tier-achievement { margin-bottom: 20px; padding: 24px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
.tier-achievement-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.tier-achievement-copy { min-width: 0; flex: 1 1 260px; }
.tier-achievement h2 { margin: 0; color: var(--text); font: 600 23px/1.3 var(--font-display); letter-spacing: -.025em; }
.tier-allocation { margin: 5px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.8; }
.tier-allocation strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.tier-fup-group { display: inline-block; white-space: nowrap; }
.tier-reset-clock { color: var(--text-muted); font-size: 12px; }
#tier-countdown { font-variant-numeric: tabular-nums; }
.tier-next-plan { display: flex; flex-direction: column; text-align: right; max-width: 180px; }
.tier-next-plan > span { font-size: 11px; color: var(--text-muted); }
.tier-next-plan > strong { font: 600 17px/1.5 var(--font-display); color: var(--accent-deep); }
.tier-progress { --tier-progress: 0; position: relative; height: 8px; border: 1px solid var(--accent); border-radius: 20px; margin: 16px 0 9px; }
.tier-progress::before { content: ""; position: absolute; inset: 1px; border-radius: inherit; background: var(--accent); transform-origin: left; transform: scaleX(var(--tier-progress)); transition: transform 250ms cubic-bezier(.23,1,.32,1); }
.tier-bar-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; color: var(--text-muted); font-size: 12px; }
#tier-current { color: var(--accent-deep); font-weight: 600; }
.tier-reset-note { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.tier-reset-note { margin-top: 4px; }
@media (max-width: 600px) {
  .tier-achievement { padding: 20px 18px; }
  .tier-achievement-copy { flex-basis: 230px; }
  .tier-achievement h2 { font-size: 22px; }
  .tier-allocation { font-size: 12px; }
  .tier-fup-group { display: block; }
  .tier-allocation-divider { display: none; }
  .tier-next-plan > strong { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .tier-progress::before { transition: none; } }

/* Monthly tier comparison: four columns on desktop, pricing-style swipe on mobile. */
.tier-benefits { scroll-margin-top: 100px; }
.tier-benefits-link { display: inline-flex; margin: 12px 0 8px; font-size: 13px; }
.tier-benefit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px 18px 0; }
.tier-benefit-card { min-width: 0; padding: 22px 18px; border: 2px solid var(--line-bright); border-radius: var(--r-xl); background: var(--surface); }
.tier-benefit-card[aria-current="true"] { border-color: var(--accent); }
.tier-benefit-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 54px; }
.tier-benefit-heading h3 { margin: 0; font: 600 22px/1.3 var(--font-display); color: var(--text); }
.tier-current-badge { color: var(--accent-deep); font-size: 11px; font-weight: 600; }
.tier-benefit-threshold { display: grid; gap: 4px; margin: 20px 0; color: var(--text-muted); font-size: 12px; }
.tier-benefit-threshold strong { color: var(--text); font: 600 26px/1.2 var(--font-display); }
.tier-benefit-card dl { margin: 0; display: grid; gap: 14px; }
.tier-benefit-card dt { font-size: 12px; color: var(--text-muted); }
.tier-benefit-card dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--text); }
.tier-benefits-note { margin: 18px 18px 20px; font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.tier-benefit-grid:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 767px) {
  .tier-benefit-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 2px 0 12px; scrollbar-width: thin; scrollbar-color: var(--line-bright) transparent; -webkit-overflow-scrolling: touch; }
  .tier-benefit-card { flex: 0 0 min(78vw, 320px); scroll-snap-align: start; }
  .tier-benefit-grid::-webkit-scrollbar { height: 4px; }
  .tier-benefit-grid::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: var(--r-full); }
}

/* Customer log only: wrap evidence, never hide it behind a horizontal scrollbar. */
#request-log .log-table { table-layout: fixed; }
#request-log .log-table th, #request-log .log-table td { padding: 10px 8px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
#request-log .log-table th:nth-child(1) { width: 17%; }
#request-log .log-table th:nth-child(2) { width: 23%; }
#request-log .log-table th:nth-child(3) { width: 8%; }
#request-log .log-table th:nth-child(4), #request-log .log-table th:nth-child(5), #request-log .log-table th:nth-child(6), #request-log .log-table th:nth-child(7) { width: 9%; }
#request-log .log-table th:nth-child(8) { width: 16%; }
#request-log .log-table td.num:not(.req-credits) { white-space: nowrap; }

#request-log .key-badge { text-transform: none; white-space: normal; }
#request-log .req-credits small { display: block; font-weight: 400; }
@media (max-width: 1200px) {
  #request-log .log-table, #request-log .log-table tbody { display: block; }
  #request-log .log-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #request-log .log-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; border-bottom: 1px solid var(--line); }
  #request-log .log-table tbody tr:last-child { border-bottom: 0; }
  #request-log .log-table td { display: block; min-width: 0; border-bottom: 0; padding: 8px; text-align: left; }
  #request-log .log-table td::before { content: attr(data-label); display: block; margin-bottom: 5px; font: 500 11px/1.4 var(--font-sans); color: var(--text-muted); }
  #request-log .log-table td:nth-child(1), #request-log .log-table td:nth-child(2), #request-log .log-table td:nth-child(8) { grid-column: 1 / -1; }
  #request-log .log-row-failed { background: var(--danger-bg); }
  #request-log .log-row-failed td { background: transparent; }
}
