/* =========================================================
   PromotionBot — shared stylesheet
   Editorial, paper + ink + electric lime accent
   ========================================================= */

/* ── Motion tokens (transitions.dev scale) ──────────────────────────────────
 * Shared duration/easing/distance/scale/blur scale — reference via var(--…)
 * instead of hardcoding new transition values. See transitions-polish skill. */
:root {
  /* Durations */
  --duration-stagger: 40ms;  /* per-item stagger offset */
  --duration-micro: 80ms;  /* tooltip/path delay, shake segment, large stagger */
  --duration-quick: 150ms;  /* modal/dropdown close, text swap, tooltip appear */
  --duration-fast: 250ms;  /* icon swap, dropdown/modal open, tabs sliding, page slide */
  --duration-medium: 350ms;  /* panel close, toast close */
  --duration-slow: 400ms;  /* panel open, skeleton content reveal, input clear */
  --duration-very-slow: 500ms;  /* emphasis moments, badge appear, text reveal, success check */
  /* Easings */
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);  /* modal/dropdown/panel open + close, page slide, resize, position change */
  --ease-in-out: ease-in-out;  /* icon swap, text swap, text reveal, skeleton reveal */
  --ease-out: ease-out;  /* tooltip open / close */
  --ease-linear: linear;  /* shimmer, skeleton pulse, spinner */
  --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);  /* badge pop open */
  --ease-bounce-strong: cubic-bezier(0.34, 3.85, 0.64, 1);  /* bouncy hover-out (avatar return) */
  /* Distances */
  --distance-micro: 4px;  /* text swap */
  --distance-small: 6px;  /* error shake (small segment) */
  --distance-base: 8px;  /* badge diagonal reveal, page slide, error shake (large segment) */
  --distance-medium: 12px;  /* text reveal */
  --distance-large: 30px;  /* check badge appear */
  /* Scales */
  --scale-large: 0.96;  /* modal open / close */
  --scale-medium: 0.97;  /* dropdown open */
  --scale-small: 0.98;  /* tooltip open */
  --scale-tiny: 0.99;  /* dropdown close */
  /* Blur */
  --blur-small: 2px;  /* panel reveal, icon swap, text swap, skeleton reveal, number pop-in */
  --blur-medium: 3px;  /* page slide, text reveal */
  --blur-large: 8px;  /* success check open */

  /* Error-state shake (see transitions-dev "12-error-state-shake") */
  --shake-distance: var(--distance-small);  /* 6px */
  --shake-overshoot: 4px;
  --shake-dur-a: var(--duration-micro);  /* 80ms */
  --shake-dur-b: 60ms;
  --shake-ease: var(--ease-smooth-out);
}

/* ---- View Transitions ------------------------------------------------------
   Two effects share the root view-transition:
   1. Page-to-page navigation → a curtain clip-wipe (cross-document VT). Pure
      progressive enhancement: browsers without cross-doc VT just navigate.
   2. Theme toggle (same-document, JS-driven in site.js) → a circular reveal;
      it sets html[data-pb-theme-vt="active"] to override the nav curtain so the
      JS clip is the only thing animating ::view-transition-new(root). */
@view-transition { navigation: auto; }

::view-transition-group(root) { animation-duration: var(--duration-fast); }
::view-transition-old(root) {
  animation: pb-nav-out var(--duration-fast) var(--ease-smooth-out) both;
}
::view-transition-new(root) {
  animation: pb-nav-in var(--duration-fast) var(--ease-smooth-out) both;
  mix-blend-mode: normal;
}
@keyframes pb-nav-in  { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes pb-nav-out { from { transform: none; opacity: 1; } to { transform: scale(0.985); opacity: 0.5; } }

/* Theme toggle overrides the nav curtain (site.js drives the clip via WAAPI). */
html[data-pb-theme-vt="active"]::view-transition-old(root),
html[data-pb-theme-vt="active"]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[data-pb-theme-vt="active"]::view-transition-group(root) {
  animation-duration: var(--pb-theme-vt-duration, 450ms);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}

:root {
  /* Color tokens — light (operator-grade: cool-neutral grays + grass-green signal).
     Retuned from the legacy warm-paper + electric-lime palette to the redesign's
     "one signal color" system (DESIGN.md). The whole site retunes from here. */
  --paper:      oklch(98.6% 0.0015 250);
  --paper-2:    oklch(96.5% 0.003 250);  /* alt-bg sections */
  --surface:    oklch(99.5% 0.001 250);  /* cards above paper */
  --ink:        oklch(21% 0.008 250);
  --ink-2:      oklch(33% 0.008 250);    /* secondary text */
  --muted:      oklch(50% 0.008 250);
  --line:       oklch(91.5% 0.004 250);
  --line-2:     oklch(84% 0.005 250);
  --accent:     oklch(72% 0.18 148);     /* grass green — primary action signal */
  --accent-bg:  oklch(72% 0.18 148);
  --accent-ink: oklch(25% 0.07 150);     /* dark-green ink on a green fill */
  --accent-soft:oklch(95% 0.045 150);    /* soft green tint */

  --ok:         oklch(72% 0.18 150);
  --warn:       oklch(70% 0.15 70);
  --bad:        oklch(57% 0.20 25);

  /* Geometry */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-sm: 0 1px 0 oklch(0% 0 0 / 0.04), 0 1px 2px oklch(0% 0 0 / 0.04);
  --shadow-md: 0 1px 0 oklch(0% 0 0 / 0.04), 0 8px 24px -12px oklch(0% 0 0 / 0.18);
  --overlay:   oklch(0% 0 0 / 0.4);

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-xs:   10.5px;
  --text-sm:   12.5px;
  --text-base: 14.5px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  28px;
  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --leading-tight:   1.15;
  --leading-snug:    1.35;
  --leading-normal:  1.55;
  --leading-relaxed: 1.65;

  /* Spacing (4 px base) */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-7:  28px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-14: 56px;

  /* Layout */
  --maxw: 1180px;
  --pad: clamp(20px, 4vw, 40px);
  --rhythm: clamp(48px, 7vw, 88px);
}

/* Cross-document view transition — eliminates white flash between pages (Chrome 126+) */
@view-transition { navigation: auto; }

/* Paint the html element itself so background is ready before body renders */
html                { background-color: oklch(98.6% 0.0015 250); }
html.dark           { background-color: oklch(16% 0.008 250); }

html.dark {
  --paper:      oklch(16% 0.008 250);
  --paper-2:    oklch(19% 0.01 250);
  --surface:    oklch(20.5% 0.01 250);
  --ink:        oklch(96% 0.004 250);
  --ink-2:      oklch(82% 0.006 250);
  --muted:      oklch(64% 0.01 250);
  --line:       oklch(28% 0.012 250);
  --line-2:     oklch(34% 0.014 250);
  --accent:     oklch(72% 0.18 148);
  --accent-bg:  oklch(72% 0.18 148);
  --accent-ink: oklch(98% 0.01 150);
  --accent-soft:oklch(28% 0.08 150);

  --shadow-sm: 0 1px 0 oklch(0% 0 0 / 0.4), 0 1px 2px oklch(0% 0 0 / 0.4);
  --shadow-md: 0 1px 0 oklch(0% 0 0 / 0.4), 0 12px 32px -10px oklch(0% 0 0 / 0.55);
}

/* =========================================================
   Reset
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  transition: background-color .25s ease, color .25s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, button, textarea, select { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* Visually hidden but available to assistive tech (screen readers).
   Use for off-screen labels and suffixes that add context the visible UI
   conveys via colour or icon. */
.sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
}
/* Becomes visible when keyboard-focused — used by .skip-link below. */
.sr-only-focusable:focus, .sr-only-focusable:active {
  position: fixed !important;
  top: 8px; left: 8px;
  width: auto !important; height: auto !important;
  padding: 8px 14px !important; margin: 0 !important;
  overflow: visible !important; clip: auto !important;
  white-space: normal !important;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 6px; z-index: 9999;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  font-weight: 600;
}

/* =========================================================
   Typography
   ========================================================= */
.display {
  font-size: clamp(44px, 7.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; font-weight: 600; }
h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.05; letter-spacing: -0.025em; text-wrap: balance; }
h3 { font-size: 18px; line-height: 1.35; }
h4 { font-size: 17px; line-height: 1.35; }
p  { margin: 0; }
.lead {
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
  text-wrap: pretty;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--ink);
  opacity: .55;
}
.mono { font-family: var(--font-mono); }

/* =========================================================
   Layout primitives
   ========================================================= */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--pad);
}
.section { padding-block: var(--rhythm); }
.section.alt { background: var(--paper-2); }
.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 40px;
  max-width: 760px;
}
.rule {
  height: 1px;
  background: var(--line);
  width: 100%;
}

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in oklab, var(--paper) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
}
.brand-mark {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  position: relative;
  flex: none;
  border-radius: 9px;
  background: var(--accent);
}
.brand-mark svg { width: 60%; height: 60%; display: block; }
.brand-mark .bm-glyph { stroke: var(--accent-ink); }
.nav-links {
  display: flex; align-items: center; gap: 8px;
}
.nav-link {
  font-size: 14px; color: var(--ink-2);
  padding: 8px 12px; border-radius: var(--r-sm);
  transition: color .15s ease, background-color .15s ease;
}
.nav-link:hover { color: var(--ink); background: var(--paper-2); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--accent);
  margin-left: 8px;
  border-radius: 2px;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* Theme toggle button */
.theme-toggle {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease;
}
.theme-toggle:hover { background: var(--paper-2); color: var(--ink); }
.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
html.dark .theme-toggle .sun { display: block; }
html.dark .theme-toggle .moon { display: none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-size: 14.5px; font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent-bg);
  color: var(--accent-ink);
  border-color: oklch(from var(--accent) calc(l - 0.08) c h);
}
.btn-primary:hover { background: oklch(from var(--accent) calc(l + 0.02) c h); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink); }
.btn-dark {
  background: var(--ink); color: var(--paper);
}
.btn-dark:hover { background: oklch(from var(--ink) calc(l + 0.08) c h); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }
.btn-lg { padding: 14px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn:disabled:active, .btn[aria-disabled="true"]:active {
  transform: none;
}
.btn-arrow { transition: transform .2s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  position: relative;
}
.card.lift:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow-md);
}
.card.lift::after {
  /* lime reveal line on hover */
  content: "";
  position: absolute;
  left: 28px; bottom: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .25s ease;
}
.card.lift:hover::after { width: 40px; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(48px, 7vw, 88px);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
}
.hero-left .kicker { margin-bottom: 24px; }
.hero-left h1 { margin-bottom: 28px; }
.hero-left h1 .accent-mark {
  background: linear-gradient(transparent 14%, var(--accent) 14%, var(--accent) 86%, transparent 86%);
  color: var(--accent-ink);
  padding: 0 0.13em;
  border-radius: 5px;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}
.hero-left h1 .accent-mark::after { content: none; }
.hero-left .lead { margin-bottom: 36px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 28px;
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted); letter-spacing: 0.05em;
}
.hero-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in oklab, var(--ok) 22%, transparent); }
.hero-right {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex; flex-direction: column; gap: 28px;
}

/* Counters */
.counters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.counter {
  display: grid;
  grid-template-columns: minmax(140px, max-content) 1fr;
  column-gap: 28px;
  align-items: center;
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.counter:first-child { border-top: 0; padding-top: 4px; }
.counter:last-child { padding-bottom: 4px; }
.counter-num {
  font-family: var(--font-mono);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.counter-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.counter-label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
}
.counter-sub {
  font-size: 13px; color: var(--ink-2);
}

/* =========================================================
   Features grid
   ========================================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
/* Two-up variant — for sections with exactly two cards (e.g. the
   "when to choose each" comparison) so they don't leave an empty
   third column on wide screens. Collapses to one column on phones. */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 680px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.feature-icon {
  width: 40px; height: 40px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 20px;
}
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }

/* =========================================================
   How it works
   ========================================================= */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  /* Suppress the default OL markers — the lime step-num badges ARE the numbering. */
  list-style: none;
  padding: 0;
  margin: 0;
}
.step {
  list-style: none;
  padding: 36px 28px 36px 0;
  border-right: 1px solid var(--line);
  position: relative;
}
.step:last-child { border-right: 0; padding-right: 0; }
.step:not(:first-child) { padding-left: 28px; }
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-ink);
  display: inline-grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 13px;
  margin-bottom: 20px;
}
.step h4 { margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }

/* =========================================================
   Audience pills
   ========================================================= */
.pills {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 14px;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.pill:hover { transform: translateY(-1px); border-color: var(--ink); }
.pill .pill-dot {
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}

/* =========================================================
   Pricing
   ========================================================= */
.pricing-toggle-container {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}
.pricing-toggle {
  display: inline-flex;
  position: relative;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 30px;
}
.pricing-toggle .toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-2);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.pricing-toggle .toggle-btn.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.pricing-toggle .discount-badge {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  display: flex; flex-direction: column;
  position: relative;
}
.price-card.popular {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.popular-badge {
  position: absolute; top: -11px; left: 32px;
  background: var(--accent-bg);
  color: var(--accent-ink);
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}
.price-card .tier {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.price-amount {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 6px;
}
.price-amount .num {
  font-size: 48px; font-weight: 600; letter-spacing: -0.04em; line-height: 1;
}
.price-amount .per {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--muted);
}
.price-card .blurb {
  font-size: 14.5px; color: var(--ink-2);
  margin-bottom: 24px;
  min-height: 2.6em;
}
.price-card .feat {
  list-style: none; padding: 0; margin: 0 0 28px 0;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 14.5px;
}
.price-card .feat li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-2);
}
.price-card .feat li svg {
  width: 14px; height: 14px;
  color: var(--accent-ink);
  background: var(--accent-bg);
  border-radius: 50%;
  padding: 2px;
  margin-top: 3px;
}
.price-card .btn { margin-top: auto; }

/* =========================================================
   FAQ accordion
   ========================================================= */
.faq {
  max-width: 760px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.faq-item {
  border-bottom: 1px solid var(--line);
}
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  text-align: left;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color .15s ease;
}
.faq-q:hover { color: var(--ink); }
.faq-q .plus {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--muted);
  transition: transform .25s ease, color .15s ease;
  line-height: 1;
}
.faq-item[open] .faq-q .plus { transform: rotate(45deg); color: var(--ink); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}
.faq-a-inner {
  padding: 0 0 24px 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
  max-width: 65ch;
}
.faq-item[open] .faq-a { max-height: 600px; }

/* =========================================================
   CTA strip
   ========================================================= */
.cta-strip {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(36px, 6vw, 56px);
  background: var(--surface);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.cta-strip::before {
  /* corner lime mark */
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 96px; height: 96px;
  background: var(--accent);
  border-bottom-left-radius: 120px;
  opacity: .9;
}
.cta-strip h2 { max-width: 18ch; }
.cta-strip .sub { color: var(--ink-2); margin-top: 10px; font-size: 16px; }
.cta-strip .actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 64px 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 56px;
}
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 16px; max-width: 32ch; }
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px 0;
  font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--ink-2); transition: color .15s ease; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* =========================================================
   Status page
   ========================================================= */
.status-banner {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 40px;
}
.status-banner.ok { background: color-mix(in oklab, var(--ok) 10%, var(--surface)); border-color: color-mix(in oklab, var(--ok) 40%, var(--line)); }
.status-banner.warn { background: color-mix(in oklab, var(--warn) 14%, var(--surface)); border-color: color-mix(in oklab, var(--warn) 50%, var(--line)); }
.status-banner.bad { background: color-mix(in oklab, var(--bad) 14%, var(--surface)); border-color: color-mix(in oklab, var(--bad) 50%, var(--line)); }
.status-banner .pulse {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ok); flex: none;
  position: relative;
}
.status-banner .pulse::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%;
  background: inherit; opacity: .3;
  animation: pulse 1.8s ease-out infinite;
}
.status-banner.warn .pulse { background: var(--warn); }
.status-banner.bad .pulse { background: var(--bad); }
@keyframes pulse {
  0% { transform: scale(.8); opacity: .5; }
  100% { transform: scale(2.2); opacity: 0; }
}
.status-banner h2 { font-size: 22px; }
.status-banner .meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 4px; }

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.status-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  background: var(--surface);
}
.status-card .label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px;
  font-weight: 500;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status-pill.warn .dot { background: var(--warn); }
.status-pill.bad .dot { background: var(--bad); }
.status-pill.warn { color: oklch(from var(--warn) calc(l - 0.2) c h); }
html.dark .status-pill.warn { color: var(--warn); }
.status-pill.bad { color: var(--bad); }

.metric .v {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 6px;
}
.metric .v-sub { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

.history-note {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 20px 24px;
  font-size: 14px;
  color: var(--muted);
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-2);
}

/* =========================================================
   Auth pages (login / signup)
   ========================================================= */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(ellipse 70% 60% at 50% 0%, color-mix(in oklab, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 100%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 70%),
    var(--paper);
  position: relative;
}
.auth-page::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 32px 32px;
  opacity: .35;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 40%, black, transparent 75%);
}
.auth-card {
  position: relative;
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
  font-weight: 600; font-size: 15px;
}
.auth-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.auth-card h1 {
  font-size: 26px; letter-spacing: -0.02em; line-height: 1.2;
  margin-bottom: 8px;
}
.auth-lead {
  font-size: 14px; color: var(--ink-2); line-height: 1.55;
  margin-bottom: 28px;
  max-width: 34ch;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.field input {
  height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--paper);
  padding: 0 14px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 30%, transparent);
}
.field input::placeholder { color: var(--muted); opacity: .8; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: var(--font-mono); }
.field .err {
  font-size: 12.5px; color: var(--bad); margin-top: 2px;
  font-family: var(--font-mono);
  display: none;
}
.field.has-err input { border-color: var(--bad); }
.field.has-err .err { display: block; }

/* Password reveal toggle — shared by signup.html + reset-password.html. The
   input keeps its normal .field styling; the wrapper just adds room on the
   right for the eye button so the input border isn't touched. */
.field .pw-wrap { position: relative; }
.field .pw-wrap input { padding-right: 42px; width: 100%; box-sizing: border-box; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--ink-2); background: var(--paper-2); }
.pw-toggle svg { width: 18px; height: 18px; }
.pw-toggle .pw-eye-off { display: none; }
.pw-toggle.is-visible .pw-eye { display: none; }
.pw-toggle.is-visible .pw-eye-off { display: block; }

/* Error-state shake: replayed by JS via remove/reflow/add of .is-shaking
   alongside .has-err (see the auth pages' submit-error handlers). Per-stop
   easing so each leg of the shake follows its own curve independently. */
.field.is-shaking input {
  animation: field-shake calc(var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2) linear;
  will-change: transform;
}
@keyframes field-shake {
  0%     { transform: translateX(0);                                 animation-timing-function: var(--shake-ease); }
  28.57% { transform: translateX(var(--shake-distance));              animation-timing-function: var(--shake-ease); }
  57.14% { transform: translateX(calc(var(--shake-distance) * -1));   animation-timing-function: var(--shake-ease); }
  78.57% { transform: translateX(var(--shake-overshoot));             animation-timing-function: var(--shake-ease); }
  100%   { transform: translateX(0); }
}

.auth-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--muted);
}
.auth-foot a { color: var(--ink); font-weight: 500; }
.auth-foot a:hover { text-decoration: underline; }

.auth-back {
  position: absolute; top: 24px; left: 24px;
  font-size: 13px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.auth-back:hover { color: var(--ink); }
.auth-back svg { width: 14px; height: 14px; }

/* =========================================================
   Page header (for non-landing pages)
   ========================================================= */
.page-head {
  padding-top: clamp(64px, 8vw, 100px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.page-head .kicker { margin-bottom: 20px; }
.page-head h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin-bottom: 20px;
  max-width: 14ch;
  text-wrap: balance;
}
.page-head .lead { max-width: 50ch; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-right { border-top: 1px solid var(--line); padding-top: 40px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); border: 0; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 0; }
  .step:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 28px; }
  .step:nth-child(even) { padding-left: 28px; }
  .step:nth-last-child(-n+2) { border-bottom: 0; }
  .pricing-grid { grid-template-columns: 1fr; }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .cta-strip { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* Keep Pricing + Status visible on phones — only two links, and hiding
     them behind a hamburger that doesn't exist used to leave users no way
     to find them outside the footer. Shrink padding instead.
     flex-wrap:wrap used to be here; it let the bar grow to a 96px two-row
     nav with the logo stranded on row 2. Stay on one row and shrink. */
  .nav-inner { gap: 10px; }
  .nav-links { gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
  .nav-links .nav-link { padding: 4px 6px; font-size: 12.5px; }
  /* align-items:center is load-bearing, not cosmetic: `display:inline-flex`
     makes the .nav-link.active::after status dot a FLEX ITEM, which silently
     drops the `vertical-align:middle` it relies on at desktop widths. With the
     default `normal`/stretch and a fixed 6px height the dot pins to the top of
     the 27px anchor — ~6px (a full dot) above the label's centre, which reads
     as the same stray marker the nowrap rule below is there to prevent. */
  .nav-links .nav-link.hide-mobile { display: inline-flex; align-items: center; }
  .nav-links .btn { padding: 6px 10px; font-size: 12.5px; }
  /* The .nav-link.active dot is an ::after inside the anchor — without this it
     can wrap onto its own line and read as a stray artefact in the corner. */
  .nav-links .nav-link, .nav-links .btn, .brand { white-space: nowrap; }
  /* WCAG 2.2 target size — footer links are 18px tall with no padding.
     Mobile-only so the desktop footer keeps its 10px vertical rhythm. */
  .footer-col ul { gap: 0; }
  .footer a { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 560px) {
  /* At phone widths the five nav items + wordmark no longer fit one row.
     Drop the wordmark (the mark still links home) rather than the links. */
  .nav-inner { padding-block: 12px; gap: 8px; }
  .brand > span:not(.brand-mark) { display: none; }
  .nav-links { gap: 2px; }
  .nav-links .nav-link { padding: 4px 5px; font-size: 12px; }
  .nav-links .btn { padding: 6px 9px; font-size: 12px; }
  .theme-toggle { width: 30px; height: 30px; }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .step, .step:nth-child(odd), .step:nth-child(even) { border-right: 0; padding: 24px 0; }
  .status-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .auth-card { padding: 28px 22px; }
  .hero-meta { flex-wrap: wrap; }
}

/* =========================================================
   Docs  (/docs — generated by scripts/build-docs.js)
   Three-column shell: nav sidebar · article · on-page TOC.
   Every rule is .docs-* scoped so it cannot leak into the
   marketing/auth pages that share this stylesheet.
   ========================================================= */
.docs-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--sp-8) var(--pad) var(--rhythm);
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 210px;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

/* ---- Sidebar ---- */
.docs-sidebar { position: sticky; top: 84px; }
.docs-sidebar-disclosure > summary { display: none; }  /* disclosure is mobile-only */
.docs-search { margin-bottom: var(--sp-4); }
.docs-search input {
  width: 100%;
  padding: 7px 10px;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.docs-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.docs-nav { display: flex; flex-direction: column; gap: var(--sp-5); }
.docs-navgroup { display: flex; flex-direction: column; gap: 2px; }
.docs-navtitle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.docs-navlink {
  display: block;
  padding: 5px 10px;
  margin-left: -10px;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  text-decoration: none;
}
.docs-navlink:hover { background: var(--paper-2); color: var(--ink); }
.docs-navlink.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: var(--weight-medium);
}
/* `--accent-soft` is a LIGHT mint in light mode but a DARK green in dark mode
   (28% L), while `--accent-ink` stays dark (20% L) — so the light-mode pairing
   is dark-on-light and the dark-mode pairing is dark-on-dark, i.e. unreadable.
   Anywhere the docs put accent ink on a soft/plain surface needs the dark
   override below. Verified in-browser in both themes. */
html.dark .docs-navlink.active { color: var(--accent); }

/* ---- Article ---- */
.docs-main { min-width: 0; }
.docs-article { max-width: 74ch; }
.docs-head { padding-bottom: var(--sp-6); margin-bottom: var(--sp-8); border-bottom: 1px solid var(--line); }
.docs-head h1 { margin: var(--sp-3) 0 var(--sp-4); }
.docs-head .lead { margin: 0; max-width: 62ch; }
.docs-headcta { margin-top: var(--sp-5); }

.docs-article h2 {
  margin: var(--sp-12) 0 var(--sp-4);
  padding-top: var(--sp-2);
  font-size: var(--text-xl);
  scroll-margin-top: 84px;
}
.docs-article h3 {
  margin: var(--sp-8) 0 var(--sp-3);
  font-size: var(--text-md);
  scroll-margin-top: 84px;
}
.docs-article h4 { margin: var(--sp-6) 0 var(--sp-2); font-size: var(--text-base); }
.docs-article p, .docs-article li { line-height: var(--leading-relaxed); }
/* styles.css resets block margins globally and lets each component set its own
   spacing, so prose here needs explicit vertical rhythm — without these rules
   consecutive <p> tags render as one undifferentiated wall of text. */
.docs-article > p, .docs-article li > p { margin: 0 0 var(--sp-5); }
.docs-article ul, .docs-article ol { padding-left: 1.25em; margin: 0 0 var(--sp-5); }
.docs-article li + li { margin-top: var(--sp-2); }
.docs-article li > ul, .docs-article li > ol { margin: var(--sp-2) 0 0; }
.docs-article > p:last-child, .docs-article > ul:last-child, .docs-article > ol:last-child { margin-bottom: 0; }
.docs-article hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-10) 0; }

/* Body links MUST be visibly links. The global reset is
   `a { color: inherit; text-decoration: none; }`, which is right for the
   marketing pages (their links are all buttons/nav) and catastrophic here — the
   docs are built on cross-linking, and inheriting body colour with no underline
   makes every "see Groups, tags & caps" reference indistinguishable from prose.
   Scoped to the article so the sidebar, TOC, pager, and cards keep their own
   treatments (each sets text-decoration: none explicitly). */
.docs-article a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent);
}
.docs-article a:hover { text-decoration-color: var(--accent); }
/* Dark mode: --accent-ink is a near-black green, invisible on the dark page. */
html.dark .docs-article a { color: var(--accent); }
.docs-article a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
/* The chrome links inside the article opt out of the underline treatment. */
.docs-article .docs-relcard, .docs-article .docs-pagerlink, .docs-article .docs-anchor,
.docs-article .docs-card, .docs-article .btn { text-decoration: none; }

/* Heading permalink — revealed on hover/focus so it never adds visual noise. */
.docs-anchor {
  margin-left: 8px;
  font-weight: var(--weight-normal);
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
h2:hover > .docs-anchor, h3:hover > .docs-anchor, h4:hover > .docs-anchor,
.docs-anchor:focus-visible { opacity: 1; }

/* Deep-link into the product (rendered for /app-next/* hrefs). */
.docs-applink { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.docs-applink svg { flex: none; opacity: 0.65; }

.docs-article blockquote {
  margin: var(--sp-6) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: var(--text-base);
}
.docs-article blockquote > :first-child { margin-top: 0; }
.docs-article blockquote > :last-child { margin-bottom: 0; }

.docs-article code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 5px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.docs-article pre {
  margin: var(--sp-5) 0;
  padding: var(--sp-4);
  overflow-x: auto;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.docs-article pre code { padding: 0; background: none; border: 0; font-size: var(--text-sm); }

.docs-tablewrap { overflow-x: auto; margin: var(--sp-5) 0; }
.docs-tablewrap table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.docs-tablewrap th, .docs-tablewrap td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.docs-tablewrap th {
  font-weight: var(--weight-semibold);
  color: var(--ink);
  border-bottom-color: var(--line-2);
  white-space: nowrap;
}
.docs-tablewrap td { color: var(--ink-2); }

/* ---- Hub card grid (raw HTML in content/docs/index.md) ---- */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-6) 0;
}
.docs-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: border-color 0.14s ease, transform 0.14s ease;
}
.docs-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.docs-card strong { color: var(--ink); font-size: var(--text-base); }
.docs-card span { color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-snug); }

/* ---- Related + pager ---- */
.docs-related { margin-top: var(--sp-12); }
.docs-relgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }
.docs-relcard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
}
.docs-relcard:hover { border-color: var(--line-2); }
.docs-relcard strong { font-size: var(--text-sm); color: var(--ink); }
.docs-relcard span { font-size: var(--text-xs); line-height: var(--leading-snug); color: var(--muted); }

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-10);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
}
.docs-pagerlink { display: flex; flex-direction: column; gap: 3px; text-decoration: none; max-width: 46%; }
.docs-pagerlink.next { text-align: right; margin-left: auto; }
.docs-pagerlink span {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.docs-pagerlink strong { font-size: var(--text-base); color: var(--ink); }
.docs-pagerlink:hover strong { color: var(--accent-ink); }
/* Same dark-mode inversion as .docs-navlink.active above — accent ink on the
   page background is invisible in dark mode. */
html.dark .docs-pagerlink:hover strong { color: var(--accent); }

/* ---- On-page TOC ---- */
.docs-toc {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: var(--text-sm);
}
.docs-toclink {
  padding: 3px 0 3px 10px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  line-height: var(--leading-snug);
  text-decoration: none;
}
.docs-toclink:hover { color: var(--ink); border-left-color: var(--line-2); }
.docs-toclink.sub { padding-left: 22px; font-size: var(--text-xs); }

/* ---- Responsive ---- */
@media (max-width: 1120px) {
  /* Drop the on-page TOC first — the sidebar is the more valuable of the two. */
  .docs-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
  .docs-sidebar { position: static; }
  /* Reveal the <details> summary so the page list becomes collapsible on a
     phone. It ships `open` (the sidebar must stay a plain always-visible nav on
     desktop, where the summary is display:none) — one tap folds it away. */
  .docs-sidebar-disclosure > summary {
    display: flex;
    align-items: baseline;
    gap: var(--sp-2);
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--ink);
  }
  .docs-sidebar-hint { color: var(--muted); font-weight: var(--weight-normal); font-size: var(--text-xs); }
  .docs-sidebar-disclosure[open] > summary { margin-bottom: var(--sp-4); }
  .docs-article { max-width: none; }
  .docs-pager { flex-direction: column; }
  .docs-pagerlink, .docs-pagerlink.next { max-width: none; text-align: left; margin-left: 0; }
}

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