/* === css/tokens.css === */
/* ──────────────────────────────────────────────────────────────────
   tokens.css — design tokens (StackSutra vibrant-editorial)
   Dark-first, mobile-first. Light theme via [data-theme="light"].
   No hardcoded colours outside this file.
   ────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* Breakpoints (used in @media queries; not consumed as CSS vars) */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* ── Type scale ───────────────────────────────────────────────── */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: clamp(1.3rem, 1.15rem + 0.7vw, 1.55rem);
  --fs-2xl: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  --fs-3xl: clamp(1.875rem, 1.45rem + 1.6vw, 2.5rem);

  --lh-tight: 1.25;
  --lh-snug: 1.4;
  --lh-base: 1.6;
  --lh-prose: 1.7;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* ── Spacing scale (4 px base) ─────────────────────────────────── */
  --space-1: 0.25rem;   /* 4  */
  --space-2: 0.5rem;    /* 8  */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.25rem;   /* 20 */
  --space-6: 1.5rem;    /* 24 */
  --space-8: 2rem;      /* 32 */
  --space-10: 2.5rem;   /* 40 */
  --space-12: 3rem;     /* 48 */
  --space-16: 4rem;     /* 64 */
  --space-20: 5rem;     /* 80 */
  --space-24: 6rem;     /* 96 */

  /* ── Radius / depth ───────────────────────────────────────────── */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.22);
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.40);
  --hairline: 1px solid var(--border);

  /* ── Motion ───────────────────────────────────────────────────── */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 280ms;

  /* ── Layout metrics ───────────────────────────────────────────── */
  --header-h: 56px;                       /* mobile */
  --rail-w: 280px;
  --right-rail-w: 280px;
  --content-max-w: 72ch;
  --main-pad-x: var(--space-6);
  --site-max-w: 1440px;
  --tap-min: 44px;                        /* a11y minimum */

  /* ──────────────────────────────────────────────────────────────
     Colour system — DARK theme (default)
     vibrant-editorial: violet primary, cyan accent-2, amber warm.
     ────────────────────────────────────────────────────────────── */
  --bg: #0b0b12;
  --surface: #15151f;
  --surface-elevated: #1c1c28;
  --surface-overlay: #20202c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --backdrop: rgba(11, 11, 18, 0.75);

  --ink: #f1f0f6;
  --ink-muted: #b6b6c6;
  --ink-subtle: #8c8c9e;
  --ink-inverse: #0b0b12;

  --accent: #7c5cff;                       /* violet primary */
  --accent-hover: #9a82ff;
  --accent-quiet: rgba(124, 92, 255, 0.16);
  --accent-ink: #0b0b12;

  --accent-2: #22d3ee;                     /* cyan secondary */
  --accent-2-quiet: rgba(34, 211, 238, 0.15);

  --grad: linear-gradient(120deg, var(--accent), var(--accent-2));

  --warm: #f59e0b;                         /* amber highlight */
  --warm-quiet: rgba(245, 158, 11, 0.16);
  --warm-ink: #231400;

  --success: #7be495;
  --success-quiet: rgba(123, 228, 149, 0.14);
  --danger: #ff6b6b;
  --danger-quiet: rgba(255, 107, 107, 0.14);
  --warning: #ffd166;
  --warning-quiet: rgba(255, 209, 102, 0.14);

  /* Component-specific aliases */
  --link-color: var(--accent);
  --link-hover: var(--accent-hover);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  --code-bg: #0e0e1a;
  --code-ink: #e8e8f0;
  --code-border: rgba(255, 255, 255, 0.08);

  --table-stripe: rgba(255, 255, 255, 0.03);
  --table-hover: rgba(124, 92, 255, 0.07);
  --table-grid: rgba(255, 255, 255, 0.09);

  --scrollbar-thumb: rgba(255, 255, 255, 0.18);
  --scrollbar-track: transparent;
}

/* ── Light theme override ──────────────────────────────────────── */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #faf9fb;
  --surface: #ffffff;
  --surface-elevated: #f3f1f8;
  --surface-overlay: #ffffff;
  --border: rgba(20, 18, 28, 0.10);
  --border-strong: rgba(20, 18, 28, 0.20);
  --backdrop: rgba(20, 18, 28, 0.40);

  --ink: #15131c;
  --ink-muted: #54515f;
  --ink-subtle: #78747f;
  --ink-inverse: #ffffff;

  --accent: #6d4bff;                       /* violet primary (light) */
  --accent-hover: #5a39e6;
  --accent-quiet: rgba(109, 75, 255, 0.12);
  --accent-ink: #ffffff;

  --accent-2: #0894b3;                     /* cyan (light) */
  --accent-2-quiet: rgba(8, 148, 179, 0.12);

  --warm: #c2710a;
  --warm-quiet: rgba(194, 113, 10, 0.14);
  --warm-ink: #ffffff;

  --success: #1f7a3d;
  --success-quiet: rgba(31, 122, 61, 0.12);
  --danger: #b3261e;
  --danger-quiet: rgba(179, 38, 30, 0.10);
  --warning: #8a5a00;
  --warning-quiet: rgba(138, 90, 0, 0.12);

  --code-bg: #f2f0f9;
  --code-ink: #15131c;
  --code-border: rgba(20, 18, 28, 0.10);

  --table-stripe: rgba(20, 18, 28, 0.025);
  --table-hover: rgba(109, 75, 255, 0.07);
  --table-grid: rgba(20, 18, 28, 0.10);

  --scrollbar-thumb: rgba(20, 18, 28, 0.22);
  --scrollbar-track: transparent;
}

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast: 1ms;
    --t-base: 1ms;
    --t-slow: 1ms;
  }
}

/* ── Larger taps on touch devices ──────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  :root {
    --tap-min: 48px;
  }
}

/* ── Header grows on wider screens ─────────────────────────────── */
@media (min-width: 1024px) {
  :root {
    --header-h: 64px;
  }
}

/* === css/base.css === */
/* ──────────────────────────────────────────────────────────────────
   base.css — modern reset + body defaults (mobile-first)
   ────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video, canvas, picture { display: block; max-width: 100%; height: auto; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

a {
  color: var(--link-color);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: color var(--t-fast) var(--ease-out);
}
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-xs); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); }

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

::selection { background: var(--accent-quiet); color: var(--ink); }

/* Custom scrollbars (subtle) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: var(--scrollbar-track); }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 999px; }

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
h5, h6 { font-size: var(--fs-base); }

p { margin: 0 0 var(--space-4); }

ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-6); }
li + li { margin-top: var(--space-1); }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

pre {
  margin: 0 0 var(--space-4);
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--code-border);
}

code:not(pre code) {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 0.125em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--code-border);
  font-size: 0.92em;
}

blockquote {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-5);
  border-left: 3px solid var(--accent);
  background: var(--accent-quiet);
  color: var(--ink);
  border-radius: var(--radius-sm);
}

/* Visually hidden helper (a11y) */
.visually-hidden {
  position: absolute !important;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  white-space: nowrap; border: 0;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  transform: translateY(-200%);
  transition: transform var(--t-fast) var(--ease-out);
  z-index: 100;
}
.skip-link:focus-visible { transform: translateY(0); }

/* === css/layout.css === */
/* ──────────────────────────────────────────────────────────────────
   layout.css — app shell, header, three-column grid (mobile-first)
   ────────────────────────────────────────────────────────────────── */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
}

/* ── Reading-progress bar (top of page, fixed) ─────────────────── */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width 80ms linear;
  will-change: width;
}

/* ── Header (sticky) ──────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-h);
  padding: 0 var(--space-4);
  max-width: var(--site-max-w);
  margin: 0 auto;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  font-size: var(--fs-lg);
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.brand:hover { opacity: 0.85; text-decoration: none; }

/* Primary nav: hidden on mobile, visible from md up. */
.primary-nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-2);
}
.primary-nav__link {
  display: inline-flex;
  align-items: center;
  height: var(--tap-min);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: color var(--t-fast), background var(--t-fast);
}
.primary-nav__link:hover {
  color: var(--ink);
  background: var(--surface-elevated);
  text-decoration: none;
}
.primary-nav__link[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-quiet);
}

@media (min-width: 768px) {
  .primary-nav { display: inline-flex; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

/* Hamburger toggle: visible on mobile/tablet, hidden on desktop */
.rail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.rail-toggle:hover { background: var(--surface-elevated); color: var(--ink); }
.rail-toggle__icon { width: 22px; height: 22px; stroke: currentColor; }

@media (min-width: 1024px) {
  .rail-toggle { display: none; }
}

/* ── Body grid (mobile = single column, desktop = three columns) ─ */
.site-body {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  padding: 0 var(--space-4);
}

.site-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: flex-start;
}

@media (min-width: 1024px) {
  .site-grid {
    grid-template-columns:
      var(--rail-w-current, var(--rail-w))
      6px
      minmax(0, 1fr)
      6px
      var(--right-rail-w-current, var(--right-rail-w));
    gap: 0 var(--space-8);
  }
}

@media (min-width: 1280px) {
  .site-grid { gap: 0 var(--space-10); }
}

/* ── Collapsed left rail ────────────────────────────────────────── */
body[data-left-rail-collapsed="true"] {
  --rail-w-current: 48px !important;
}
body[data-left-rail-collapsed="true"] .site-rail--left > :not(.rail-collapse-btn) {
  display: none;
}

/* ── Resizer handles ────────────────────────────────────────────── */
.site-resizer {
  display: none;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  transition: background var(--t-fast);
  align-self: stretch;
  position: relative;
  z-index: 10;
}
.site-resizer::after {
  content: "";
  display: block;
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 2px;
  background: var(--border);
  transition: background var(--t-fast), width var(--t-fast);
}
.site-resizer:hover::after,
.site-resizer:focus-visible::after {
  background: var(--accent);
  width: 3px;
}
.site-resizer:focus-visible {
  outline: none;
}
@media (min-width: 1024px) {
  .site-resizer { display: block; }
}

/* ── Left rail ─────────────────────────────────────────────────── */
.site-rail {
  min-width: 0;
}
.site-rail--left {
  /* Mobile: hidden by default; revealed as a drawer when [data-nav-open] on body */
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: min(85vw, 320px);
  z-index: 40;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-4);
  transform: translateX(-100%);
  transition: transform var(--t-base) var(--ease-out);
}
body[data-nav-open="true"] .site-rail--left {
  display: block;
  transform: translateX(0);
}
@media (min-width: 1024px) {
  .site-rail--left {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--space-4));
    transform: none;
    background: transparent;
    border-right: 0;
    padding: var(--space-4) 0 var(--space-6);
    max-height: calc(100dvh - var(--header-h) - var(--space-4));
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    transition: width var(--t-base) var(--ease-out);
    width: auto;
  }
}

/* Prevent left-rail content from overflowing when the rail is narrow */
.left-toc, .left-toc__link,
.rail-nav, .rail-nav__link, .rail-nav__group-link {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ── Mobile drawer extras: hub tabs (top) + auth (bottom) ──────────
   The header hides the inline hub tabs + sign-in on phones, so they live
   in the drawer. Shown ONLY < 768px; hidden on tablet + desktop, where the
   rail is the section-nav/TOC column and the header carries tabs + auth.   */
.rail-tabs { display: none; }
.rail-auth-slot { display: none; }

@media (max-width: 767px) {
  /* Make the open drawer a flex column so the auth slot can pin to the bottom. */
  body[data-nav-open="true"] .site-rail--left {
    display: flex;
    flex-direction: column;
  }

  .rail-tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
  }
  .rail-tabs__link {
    display: flex;
    align-items: center;
    height: var(--tap-min);
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-weight: var(--fw-medium);
    text-decoration: none;
  }
  .rail-tabs__link:hover { background: var(--surface-elevated); text-decoration: none; }
  .rail-tabs__link[aria-current="page"] { color: var(--accent); background: var(--accent-quiet); }

  .rail-auth-slot {
    display: block;
    margin-top: auto;            /* pin to the bottom of the flex drawer */
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
  }
  /* Hide the auth widget while it still sits in the header on a phone (pre-JS /
     no-JS fallback); core.js relocates the node into .rail-auth-slot. */
  .header-actions .header-auth { display: none; }
}

/* ── Right rail (per-page TOC) ─────────────────────────────────── */
.site-rail--right {
  order: 3;
  margin-top: var(--space-6);
}
@media (min-width: 1024px) {
  .site-rail--right {
    order: unset;
    margin-top: 0;
    position: sticky;
    top: calc(var(--header-h) + var(--space-4));
    max-height: calc(100dvh - var(--header-h) - var(--space-4));
    overflow-y: auto;
    padding: var(--space-4) 0;
  }
}

/* ── Main content column ───────────────────────────────────────── */
.site-main {
  min-width: 0;
  padding: var(--space-4) 0 var(--space-12);
}
@media (min-width: 1024px) {
  .site-main { padding: var(--space-6) var(--main-pad-x) var(--space-16); }
}

/* ── Mobile drawer backdrop ────────────────────────────────────── */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--backdrop);
  z-index: 35;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
body[data-nav-open="true"] .drawer-backdrop { display: block; }

/* Lock scroll when drawer or palette is open */
body[data-nav-open="true"],
body[data-palette-open="true"] {
  overflow: hidden;
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--ink-subtle);
  font-size: var(--fs-sm);
  margin-top: auto;
}
.site-footer a { color: var(--ink-muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer__affiliate-disclosure {
  max-width: 42rem;
  margin: var(--space-3) auto 0;
  color: var(--ink-subtle);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* ── Rail collapse toggle ──────────────────────────────────────── */
.rail-collapse-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
  margin-bottom: var(--space-2);
}
.rail-collapse-btn:hover { background: var(--surface-elevated); color: var(--ink); }
.rail-collapse-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rail-collapse-btn__icon {
  width: 18px; height: 18px;
  stroke: currentColor;
  transition: transform var(--t-base) var(--ease-out);
}
body[data-left-rail-collapsed="true"] .rail-collapse-btn__icon {
  transform: rotate(180deg);
}
@media (min-width: 1024px) {
  .rail-collapse-btn { display: inline-flex; }
}

/* ── Left rail in-page TOC ─────────────────────────────────────── */
.left-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.left-toc__link {
  display: block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xs);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  line-height: var(--lh-snug);
  transition: color var(--t-fast), background var(--t-fast);
}
.left-toc__link:hover {
  color: var(--ink);
  background: var(--surface-elevated);
  text-decoration: none;
}
.left-toc__link--level-3 {
  padding-left: var(--space-4);
  font-size: var(--fs-xs);
}

/* ── Left rail collapsible TOC groups ─────────────────────────── */
.left-toc__group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-xs);
}
.left-toc__group > summary::-webkit-details-marker {
  display: none;
}
.left-toc__group > summary > .left-toc__link {
  flex: 1 1 auto;
  min-width: 0;
}
.left-toc__caret {
  flex: 0 0 auto;
  color: var(--ink-subtle);
  transition: transform 0.15s ease;
}
.left-toc__group[open] > summary > .left-toc__caret {
  transform: rotate(90deg);
}
.left-toc__group > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ──────────────────────────────────────────────────────────────────
   Relaunch wide / magazine layout (B1: section hubs + home).
   Additive only — no existing rule modified. A page opts in by setting
   `{% block body_class %} layout-wide{% endblock %}` (base.html), which
   collapses the three-column docs grid into a single full-bleed column
   so the card-rich hub + magazine templates can run edge-to-edge.
   Card components themselves come from cards.css (unchanged).
   ────────────────────────────────────────────────────────────────── */
.layout-wide .site-body { padding: 0; }
.layout-wide .site-grid {
  display: block;
  gap: 0;
}
.layout-wide .site-rail,
.layout-wide .site-resizer { display: none; }
.layout-wide .site-main {
  padding: 0 0 var(--space-16);
  min-width: 0;
}
@media (min-width: 1024px) {
  .layout-wide .site-main { padding: 0 0 var(--space-16); }
}

/* Inner wrapper: caps width + centres + side gutters (mirrors the mockup's
   .container). Hero / methodology / cards / CTA bands each wrap their inner
   content in .rl-inner. */
.rl-inner {
  max-width: var(--site-max-w);
  margin-inline: auto;
  padding-inline: var(--space-8);
}
@media (max-width: 600px) {
  .rl-inner { padding-inline: var(--space-4); }
}

/* Vertical section rhythm. */
.rl-section { padding-block: var(--space-12); }
.rl-section--tight { padding-block: var(--space-8); }
.rl-section--flush-top { padding-top: 0; }
.rl-section--surface {
  background: var(--surface);
  border-block: 1px solid var(--border);
}
@media (max-width: 768px) {
  .rl-section { padding-block: var(--space-8); }
}

/* Breadcrumbs sit flush in the wide layout — give them the inner gutter. */
.layout-wide main > nav[aria-label="Breadcrumb"] {
  max-width: var(--site-max-w);
  margin-inline: auto;
  padding: var(--space-4) var(--space-8) 0;
}

/* Home magazine hero (no hero image yet — token gradient band). */
.rl-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 8vw, 6rem);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.rl-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 90% at 12% 30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(ellipse 60% 80% at 95% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 60%);
  pointer-events: none;
}
.rl-hero__inner { position: relative; z-index: 1; }
.rl-hero h1 {
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-block: var(--space-3) var(--space-4);
  max-width: 32ch;
}
.rl-hero__sub {
  font-size: var(--fs-lg);
  color: var(--ink-muted);
  max-width: 80ch;
  line-height: var(--lh-base);
}
.rl-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* Section-hub hero lead (the .section-hero from cards.css carries the band). */
.rl-hero-lead {
  font-size: var(--fs-lg);
  color: var(--ink-muted);
  max-width: 50ch;
  line-height: var(--lh-base);
  margin-block: var(--space-3) var(--space-5);
}

/* Guide-card image placeholder — real imagery arrives in a later brief.
   A tasteful token gradient + the title's initial, cycled across a few hues. */
.card-img-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.card-img-ph__glyph {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  opacity: 0.92;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.card-img-ph--1 { background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.card-img-ph--2 { background: linear-gradient(135deg, var(--accent), var(--warm)); }
.card-img-ph--3 { background: linear-gradient(135deg, var(--warm), var(--accent-2)); }
.card-img-ph--4 { background: linear-gradient(160deg, var(--accent-2), var(--warm)); }
.card-img-ph--5 { background: linear-gradient(160deg, var(--warm), var(--accent)); }

/* Graceful empty state (a section with no child pages yet). */
.rl-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  color: var(--ink-muted);
}
.rl-empty h3 { color: var(--ink); margin-bottom: var(--space-2); }
.rl-empty p { max-width: 52ch; margin-inline: auto; }

/* Newsletter / CTA band. */
.rl-newsletter {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), var(--surface));
  border-block: 1px solid var(--border);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}
.rl-newsletter__inner { max-width: 56ch; margin-inline: auto; padding-inline: var(--space-6); }
.rl-newsletter h2 { margin-bottom: var(--space-3); }
.rl-newsletter p { color: var(--ink-muted); margin-inline: auto; max-width: 48ch; }
.rl-newsletter__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-6);
}
.rl-newsletter__note { font-size: var(--fs-sm); color: var(--ink-subtle); margin-top: var(--space-4); }

/* Hub intro prose lives in the wide column — keep it readable. */
.rl-prose { max-width: 72ch; }

/* The hub guide-card grid heading reuses .section-header from cards.css. */

/* === css/components.css === */
/* ──────────────────────────────────────────────────────────────────
   components.css — buttons, breadcrumbs, palette, toggle, code-copy,
   left rail tree, right rail TOC, error pages.
   All mobile-first; touch-friendly tap targets (>= --tap-min).
   ────────────────────────────────────────────────────────────────── */

/* ── Buttons ───────────────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--tap-min);
  padding: 0 var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), transform var(--t-fast);
}
.button:hover { text-decoration: none; }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

.button--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.button--primary:hover { background: var(--accent-hover); color: var(--accent-ink); }

.button--warm {
  background: var(--warm);
  color: var(--warm-ink);
}
.button--warm:hover { background: var(--warm); color: var(--warm-ink); filter: brightness(1.05); }

.button--secondary {
  background: var(--surface-elevated);
  color: var(--ink);
  border-color: var(--border);
}
.button--secondary:hover {
  background: var(--surface-overlay);
  border-color: var(--border-strong);
  color: var(--ink);
}

.button--ghost {
  background: transparent;
  color: var(--ink-muted);
}
.button--ghost:hover { background: var(--surface-elevated); color: var(--ink); }

.button--icon {
  width: var(--tap-min);
  padding: 0;
}

/* ── Breadcrumbs ───────────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--ink-subtle);
  margin-bottom: var(--space-4);
  list-style: none;
  padding: 0;
}
.breadcrumbs__item { display: inline-flex; align-items: center; gap: var(--space-2); }
.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  color: var(--ink-subtle);
  opacity: 0.6;
}
.breadcrumbs__link {
  color: var(--ink-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xs);
  transition: color var(--t-fast), background var(--t-fast);
}
.breadcrumbs__link:hover { color: var(--ink); background: var(--surface-elevated); text-decoration: none; }
.breadcrumbs__current { color: var(--ink); font-weight: var(--fw-medium); }

/* ── Theme toggle ──────────────────────────────────────────────── */
.theme-toggle {
  width: var(--tap-min);
  height: var(--tap-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.theme-toggle:hover { background: var(--surface-elevated); color: var(--ink); }
.theme-toggle__icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.theme-toggle__icon--sun { display: none; }
.theme-toggle__icon--moon { display: block; }
:root[data-theme="light"] .theme-toggle__icon--sun { display: block; }
:root[data-theme="light"] .theme-toggle__icon--moon { display: none; }

/* ── Header auth (sign in / user menu) ─────────────────────────── */
.header-auth { position: relative; }
/* Google sign-in reduced to a bare, clickable multicolour G logo — transparent
   background (no chip), so it sits cleanly in both the dark and light headers.
   Hover gets a subtle theme-adaptive tint; focus-visible a ring for a11y. */
.header-auth__signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--t-base) var(--ease-out),
    transform var(--t-base) var(--ease-out);
}
.header-auth__signin:hover {
  background: var(--surface-overlay);
}
.header-auth__signin:active {
  transform: scale(0.95);
}
.header-auth__signin:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.header-auth__signin svg {
  width: 22px;
  height: 22px;
  display: block;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--radius-pill);
  background: var(--accent-quiet);
  color: var(--accent);
  font-weight: var(--fw-semibold);
}
.user-trigger:hover { background: var(--accent); color: var(--accent-ink); }
.user-trigger__avatar {
  width: 100%; height: 100%;
  border-radius: var(--radius-pill);
  object-fit: cover;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(var(--tap-min) + var(--space-2));
  min-width: 240px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: var(--space-3);
  z-index: 55;
}
.user-menu[hidden] { display: none; }
.user-menu__name { font-weight: var(--fw-semibold); margin-bottom: var(--space-2); }
.user-menu__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
}
.user-menu__signout { display: block; margin-top: var(--space-3); }

/* Pre-sign-in popover — reuses .user-menu positioning/visibility; only the
   single row's top border and the full-width Google button need overriding. */
.signin-menu__row { border-top: 0; padding-top: 0; }
.signin-menu__google { width: 100%; margin-top: var(--space-3); }

/* Toggle switch */
.user-switch { position: relative; display: inline-flex; align-items: center; }
.user-switch input { position: absolute; opacity: 0; pointer-events: none; }
.user-switch__track {
  width: 36px; height: 20px;
  background: var(--surface-overlay);
  border-radius: 999px;
  border: 1px solid var(--border);
  position: relative;
  transition: background var(--t-fast);
}
.user-switch__thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--ink-muted);
  border-radius: 999px;
  transition: transform var(--t-fast), background var(--t-fast);
}
.user-switch input:checked ~ .user-switch__track { background: var(--accent); border-color: var(--accent); }
.user-switch input:checked ~ .user-switch__track .user-switch__thumb {
  transform: translateX(16px);
  background: var(--accent-ink);
}

/* ── Left rail nav (recursive tree) ────────────────────────────── */
.rail-nav { display: flex; flex-direction: column; gap: var(--space-1); }
.rail-nav__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.rail-nav__item { }
.rail-nav__group {
  display: flex; flex-direction: column;
}
.rail-nav__group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  min-height: var(--tap-min);
  transition: background var(--t-fast), color var(--t-fast);
}
.rail-nav__group-toggle:hover { background: var(--surface-elevated); color: var(--ink); }
.rail-nav__group-toggle::after {
  content: "›";
  display: inline-block;
  transform: rotate(90deg);
  transition: transform var(--t-fast) var(--ease-out);
  color: var(--ink-subtle);
}
.rail-nav__group[data-open="false"] > .rail-nav__group-toggle::after { transform: rotate(0deg); }
.rail-nav__group[data-open="false"] > .rail-nav__list { display: none; }
.rail-nav__list--depth { padding-left: var(--space-3); border-left: 1px solid var(--border); margin-left: var(--space-3); }

.rail-nav__link {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.rail-nav__link:hover { background: var(--surface-elevated); color: var(--ink); text-decoration: none; }
.rail-nav__link[aria-current="page"] {
  background: var(--accent-quiet);
  color: var(--accent);
}

/* ── Right rail TOC ────────────────────────────────────────────── */
.toc {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.toc__heading {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0;
  padding: 0 var(--space-2);
}
.toc__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.toc__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid transparent;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.toc__link:hover { color: var(--ink); background: var(--surface-elevated); text-decoration: none; }
.toc__link.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc__link--level-3 { padding-left: var(--space-5); font-size: var(--fs-xs); color: var(--ink-subtle); }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.card__title { margin: 0 0 var(--space-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); }
.card__desc { color: var(--ink-muted); font-size: var(--fs-sm); margin: 0; }

/* ── Code-copy button (sits over <pre>) ────────────────────────── */
.code-block { position: relative; }
.code-copy {
  position: absolute;
  top: var(--space-2); right: var(--space-2);
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--surface-overlay);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  opacity: 0;
  transition: opacity var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.code-block:hover .code-copy,
.code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--ink); background: var(--surface-elevated); }
.code-copy[data-copied="true"] { color: var(--success); border-color: var(--success); }

/* ── Command palette (Cmd/Ctrl+K) ──────────────────────────────── */
.palette {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-12) var(--space-4) var(--space-4);
}
.palette[hidden] { display: none; }
.palette__panel {
  width: 100%;
  max-width: 640px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--space-16));
}
.palette__input {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: transparent;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-md);
  outline: none;
}
.palette__input::placeholder { color: var(--ink-subtle); }
.palette__list {
  flex: 1 1 auto;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: var(--space-2);
}
.palette__item {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--ink);
}
.palette__item.is-active,
.palette__item:hover {
  background: var(--accent-quiet);
}
.palette__item-title { font-weight: var(--fw-medium); }
.palette__item-meta { color: var(--ink-subtle); font-size: var(--fs-xs); }
.palette__empty {
  padding: var(--space-6) var(--space-5);
  text-align: center;
  color: var(--ink-subtle);
  font-size: var(--fs-sm);
}
.palette__hint {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--ink-subtle);
  font-size: var(--fs-xs);
}
.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* Search trigger button in header */
/* Icon-only search affordance: just the magnifier (no "Search" label, no ⌘K hint). */
.search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-subtle);
}
.search-trigger:hover { color: var(--ink); border-color: var(--border-strong); }

/* ── Error page ────────────────────────────────────────────────── */
.error-shell {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}
.error-page { text-align: center; max-width: 520px; }
.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5rem);
  margin: 0 0 var(--space-2);
  color: var(--accent);
  letter-spacing: 0.04em;
}
.error-page__title { font-size: var(--fs-xl); margin: 0 0 var(--space-3); }
.error-page__detail { color: var(--ink-muted); margin: 0 0 var(--space-6); }
.error-page__actions { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

/* ── Hero / home callout (used by home.html) ───────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 30% 40%, var(--accent-quiet), transparent 70%),
              radial-gradient(ellipse 60% 50% at 80% 60%, var(--accent-2-quiet), transparent 70%),
              var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  margin: 0 0 var(--space-8);
}
@media (min-width: 768px) {
  .hero { padding: var(--space-12) var(--space-8); }
}
.hero__eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-2);
}
.hero__title {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-3);
}
.hero__lede {
  font-size: var(--fs-md);
  color: var(--ink-muted);
  margin: 0 0 var(--space-6);
  max-width: 60ch;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ── Orbitron wordmark ─────────────────────────────────────── */
.brand {
  font-family: "Orbitron", var(--font-display), sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .015em;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: initial;
}
.wm-stack { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.wm-sutra { color: var(--accent-2); -webkit-text-fill-color: var(--accent-2); }

/* ─── Pager (build-time hub pagination) ─────────────────────────────────────
   Leaf-category hubs + /learn /deals /news paginate at app.hub_page_size cards.
   Pure <a> links (no JS) so the control carries to the static CF Pages export. */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-8);
}
.pager__pages {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.pager__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: border-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.pager__link:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.pager__link.is-current {
  /* Solid accent fill + on-accent ink — the same proven pairing as .button--primary.
     (--accent-ink is meant for SOLID --accent; over the faint --accent-quiet tint it
     rendered near-black-on-dark and hid the number.) Legible in both themes. */
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: var(--fw-semibold);
}
.pager__link.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pager__gap {
  padding: 0 var(--space-1);
  color: var(--ink-subtle);
}

/* === css/cards.css === */
/* ──────────────────────────────────────────────────────────────────
   cards.css — card components, grids, section hero, comparison table,
   FAQ accordion, editorial verdict, article layout helpers.
   Additive; all colours via webify design tokens. No existing class
   modified. Responsive / WCAG-AA.
   ────────────────────────────────────────────────────────────────── */

/* ── Local token extensions (no equivalent in tokens.css) ──────── */
:root {
  --radius-xl: 24px;
  --grad-warm: linear-gradient(120deg, var(--warm), var(--danger));
}

/* ── Typography helpers ─────────────────────────────────────────── */
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ── Layout helpers ─────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.section-header h2 { margin-bottom: 0; }

.see-all {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--t-base) var(--ease-out);
}
.see-all::after { content: '→'; transition: transform var(--t-base) var(--ease-out); }
.see-all:hover::after { transform: translateX(4px); }
.see-all:hover { color: var(--accent-2); }

/* ── Grid systems ───────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-5); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--space-6); }

/* ── Guide card ─────────────────────────────────────────────────── */
.guide-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
  text-decoration: none;
  color: inherit;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.guide-card:focus-visible { transform: translateY(-4px); }

.card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease-out);
}

/* picture inside card-img-wrap: must be block so the img fills the pane. */
.card-img-wrap picture {
  display: block;
  width: 100%;
  height: 100%;
}

.guide-card:hover .card-img-wrap img { transform: scale(1.04); }

/* ── Card type chip (page-type badge, top-right of image pane) ───── */
.card-type-chip {
  position: absolute;
  top: .75rem;
  right: .75rem;
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--accent-2) 90%, transparent);
  color: #fff;
  pointer-events: none;
}

.card-tag {
  position: absolute;
  top: .75rem;
  left: .75rem;
  font-family: var(--font-display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--accent) 90%, transparent);
  color: #fff;
}

.card-body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: var(--lh-snug);
  color: var(--ink);
  letter-spacing: -.02em;
}

.card-body p {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  max-width: none;
  line-height: var(--lh-base);
  margin: 0;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.card-meta span { display: flex; align-items: center; gap: .3rem; }

.guide-card.large .card-body h3 { font-size: 1.25rem; }

/* Contact-page picker cards reuse the guide-card vocabulary inside prose.
   The higher-specificity rules preserve card typography/link treatment after
   the general prose rules load later in the bundle. */
.prose .contact-picker-grid { margin: var(--space-5) 0; }

.prose a.contact-picker-card {
  color: inherit;
  text-decoration: none;
}

.prose a.contact-picker-card:hover { color: inherit; }

.prose .contact-picker-card .card-img-wrap { aspect-ratio: 3 / 1; }

.prose .contact-picker-card .card-body h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: var(--lh-snug);
}

.prose .contact-picker-card .card-body p { margin: 0; }

/* ── Category card ──────────────────────────────────────────────── */
.cat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}

.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
  border-color: color-mix(in srgb, var(--accent-2) 35%, transparent);
}

.cat-img-wrap {
  position: relative;
  aspect-ratio: 4/2.5;
  overflow: hidden;
}

.cat-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease-out);
  filter: brightness(.75) saturate(1.1);
}

.cat-card:hover .cat-img-wrap img { transform: scale(1.05); filter: brightness(.85) saturate(1.2); }

.cat-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.65) 100%);
}

.cat-icon {
  position: absolute;
  top: .75rem;
  left: .75rem;
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}

.cat-body {
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cat-body h4 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
}

.cat-count {
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  background: var(--surface-elevated);
  padding: .2rem .65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* ── Product card (Top Pick) — commerce-free 2-col grid ────────── */
.product-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px 1fr;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.product-img-wrap {
  position: relative;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 180px;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s var(--ease-out);
}

.product-card:hover .product-img-wrap img { transform: scale(1.05); }

.rank-badge {
  position: absolute;
  top: .65rem;
  left: .65rem;
  background: var(--grad);
  color: #fff;
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.product-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.product-verdict {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  max-width: none;
  line-height: var(--lh-base);
  margin: 0;
}

.product-why {
  font-size: .82rem;
  /* Normal (theme-aware) body text — NOT the accent/link colour, so the summary
     never reads as a hyperlink. Adapts to light/dark via the --ink-muted token. */
  color: var(--ink-muted);
  font-weight: 500;
  margin: .25rem 0 0;
  max-width: none;
  line-height: var(--lh-base);
}

.spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .25rem;
}

.chip {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-2) 25%, transparent);
  padding: .25rem .65rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.product-actions {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  border-left: 1px solid var(--border);
  min-width: 140px;
}

.price-cta { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }

.price-line {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
}

.price-line small {
  font-size: .7rem;
  font-weight: 400;
  color: var(--ink-muted);
  display: block;
  line-height: 1;
  margin-bottom: .1rem;
}

/* Expert-aggregate signal (CITED source badge; no numeric editorial score) */
.expert-signal {
  font-size: .72rem;
  color: var(--ink-muted);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .35rem .6rem;
  line-height: 1.4;
  text-align: center;
}

.expert-signal strong { color: var(--accent-2); display: block; font-size: .82rem; }

/* ── CTA button (Check Price) ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: .65rem var(--space-6);
  transition: all var(--t-base) var(--ease-out);
  cursor: pointer;
  border: none;
  letter-spacing: -.01em;
  white-space: nowrap;
  min-height: var(--tap-min);
  text-decoration: none;
}

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--accent) 50%, transparent);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--ink);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: .6rem 1.35rem;
}

.btn-ghost:hover { background: var(--accent); color: #fff; }

.btn-warm {
  background: var(--grad-warm);
  color: #fff;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--warm) 30%, transparent);
}

.btn-warm:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--warm) 45%, transparent);
  color: #fff;
}

.btn-sm {
  font-size: .8rem;
  padding: .45rem 1rem;
  min-height: 36px;
}

/* ── Comparison card ────────────────────────────────────────────── */
.compare-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}

.compare-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
  border-color: color-mix(in srgb, var(--accent-2) 30%, transparent);
}

.compare-thumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.compare-thumb {
  width: 70px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface-elevated);
}

.compare-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vs-tag {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--ink-muted);
  background: var(--surface-elevated);
  padding: .2rem .5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.compare-card h4 { font-size: .95rem; line-height: var(--lh-snug); }
.compare-card p  { font-size: .8rem;  max-width: none; margin: 0; }

/* ── Deal card ──────────────────────────────────────────────────── */
.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}

.deal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-pop);
  border-color: color-mix(in srgb, var(--warm) 35%, transparent);
}

.deal-img-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface-elevated);
}

.deal-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease-out);
}

.deal-card:hover .deal-img-wrap img { transform: scale(1.04); }

.deal-tag {
  position: absolute;
  top: .65rem;
  left: .65rem;
  background: var(--grad-warm);
  color: #fff;
  font-family: var(--font-display);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border-radius: var(--radius-pill);
}

.deal-body { padding: 1.1rem; display: flex; flex-direction: column; gap: .4rem; }
.deal-body h4  { font-size: .95rem; color: var(--ink); font-weight: 700; }
.deal-body p   { font-size: .8rem;  color: var(--ink-muted); max-width: none; margin: 0; line-height: var(--lh-snug); }
.deal-price    { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--warm); }
.deal-price small { font-size: .75rem; color: var(--ink-muted); text-decoration: line-through; margin-left: .35rem; font-weight: 400; }

/* ── Section hero ───────────────────────────────────────────────── */
.section-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0;
  position: relative;
  overflow: hidden;
}

.section-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 100% at 0% 50%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%),
    radial-gradient(ellipse 60% 80% at 100% 0%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 60%);
  pointer-events: none;
}

.section-hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--site-max-w);
  margin: 0 auto;
  padding: 0 var(--space-8);
}

/* Hero content panel (home + hubs): the lead text sits in its own elevated
   card spanning the hero band, so the wide space reads as a deliberate unit. */
.hero-panel {
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 44px rgba(0, 0, 0, 0.07);
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1.75rem, 4vw, 3.5rem);
  border-left: 4px solid var(--accent);
}
.hero-panel .eyebrow { margin-top: 0; }
.hero-panel > :last-child { margin-bottom: 0; }

/* ── Home "Why StackSutra" value band ───────────────────────────── */
.value-lead {
  max-width: 68ch;
  margin: var(--space-4) 0 var(--space-8);
  color: var(--ink-muted);
  font-size: var(--fs-md);
  line-height: var(--lh-prose);
}
.value-card {
  position: relative;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow: hidden;
  --card-accent: var(--accent);
}
.value-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--card-accent);
}
.value-card h3 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--ink);
}
.value-card p {
  margin: 0;
  color: var(--ink-muted);
  line-height: var(--lh-base);
}
/* Cycle the accent bar so any card count (3 value props, 5 sections) stays varied. */
.value-grid .value-card:nth-child(3n + 1) { --card-accent: var(--accent); }
.value-grid .value-card:nth-child(3n + 2) { --card-accent: var(--accent-2); }
.value-grid .value-card:nth-child(3n)     { --card-accent: var(--warm); }
/* Linked value cards (section overview) — clickable affordance + hover lift. */
a.value-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
a.value-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
a.value-card h3::after {
  content: " \2192";
  color: var(--card-accent);
}

/* ── Subscribe page card (/subscribe) ───────────────────────────────
   Mirrors the unsubscribe surface: one centred, accent-topped card owns the
   page heading and account action. The four states (loading / signed-out /
   confirm / done) live in the DOM; subscribe.js reveals one via [hidden]. */
.subscribe-page {
  min-height: calc(100dvh - var(--header-h));
  display: grid;
  place-items: center;
  padding: clamp(2rem, 8vw, 5rem) var(--space-4);
  background:
    radial-gradient(60% 50% at 50% 0%, var(--accent-quiet), transparent 72%),
    radial-gradient(42% 42% at 92% 10%, var(--accent-2-quiet), transparent 72%);
}
.subscribe-card {
  width: 100%;
  max-width: 34rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  text-align: center;
}
.subscribe-card__header { margin-bottom: var(--space-6); }
.subscribe-card__header .eyebrow { margin: 0 0 var(--space-3); }
.subscribe-card__header h1 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4vw, 2rem);
  line-height: var(--lh-tight);
  color: var(--ink);
}
.subscribe-card__lead {
  max-width: 38ch;
  margin: 0 auto;
  color: var(--ink-muted);
  line-height: var(--lh-prose);
}
.subscribe-state[hidden] { display: none; }
.subscribe-state h2 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--ink);
}
.subscribe-state > p {
  margin: 0 auto var(--space-6);
  max-width: 42ch;
  color: var(--ink-muted);
  line-height: var(--lh-prose);
}
.subscribe-state .button { min-width: 15rem; }
.subscribe-google { gap: var(--space-2); }
.subscribe-fineprint {
  margin: var(--space-5) auto 0;
  font-size: var(--fs-sm);
  color: var(--ink-subtle);
}
.subscribe-error {
  margin: var(--space-4) auto 0;
  color: var(--danger, #dc2626);
  font-size: var(--fs-sm);
}
.subscribe-status { color: var(--ink-muted); }
.subscribe-check {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--space-4);
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
}

/* ── Quick answer ───────────────────────────────────────────────── */
.quick-answer {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin: var(--space-8) 0;
  position: relative;
  overflow: hidden;
}

.quick-answer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 100%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent);
  pointer-events: none;
}

.quick-answer-label {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.quick-answer h2 { font-size: 1.15rem; color: var(--ink); margin-bottom: .5rem; }
.quick-answer p  { font-size: .9rem; max-width: none; margin: 0; }

/* ── Editorial verdict ──────────────────────────────────────────── */
.verdict-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-8);
  margin: var(--space-8) 0;
  position: relative;
  overflow: hidden;
}

.verdict-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 8%, transparent),
    color-mix(in srgb, var(--accent-2) 4%, transparent));
  pointer-events: none;
}

.verdict-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.verdict-box p   { font-size: 1rem; line-height: var(--lh-prose); max-width: none; }
.verdict-byline  { font-size: .78rem; color: var(--ink-muted); margin-top: .75rem; font-style: italic; }

/* ── FAQ accordion ──────────────────────────────────────────────── */
.faq-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-2); }

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-out);
}

.faq-item.open { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 1.1rem var(--space-5);
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: color var(--t-base) var(--ease-out);
  min-height: var(--tap-min);
}

.faq-btn:hover { color: var(--accent); }

.faq-icon {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform .2s var(--ease-out);
  line-height: 1;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 0 var(--space-5) 1.1rem;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  line-height: var(--lh-prose);
}

.faq-item.open .faq-answer { display: block; }

/* ── Comparison table ───────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: var(--space-6) 0;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.compare-table th {
  background: var(--surface-elevated);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: .9rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.compare-table td {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-muted);
  vertical-align: middle;
}

.compare-table tr:last-child td { border-bottom: none; }

.compare-table tr.highlight-row td {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--ink);
  font-weight: 600;
}

.compare-table td:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.check { color: var(--accent-2); font-size: 1.05rem; }
.cross  { color: var(--danger); font-size: .9rem; }

/* ── Cross-CTA cards ────────────────────────────────────────────── */
.cta-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.cta-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: transform var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease-out);
}

.cta-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.cta-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.cta-card:hover::before { opacity: .05; }

.cta-card .icon { font-size: 1.75rem; }
.cta-card h3    { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.cta-card p     { font-size: .825rem; max-width: none; margin: 0; line-height: var(--lh-snug); }
.cta-arrow      { font-size: var(--fs-sm); color: var(--accent); margin-top: auto; font-weight: 600; }

/* ── Article layout ─────────────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-8) var(--space-16);
}

.article-content { min-width: 0; }

.article-toc {
  position: sticky;
  top: calc(var(--header-h) + var(--space-5));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.toc-label {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: .85rem;
}

.toc-list { list-style: none; display: flex; flex-direction: column; gap: .15rem; }

.toc-list a {
  display: block;
  font-size: .82rem;
  color: var(--ink-muted);
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
  border-left: 2px solid transparent;
  text-decoration: none;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left-color: var(--accent);
}

/* ── Article hero image ─────────────────────────────────────────── */
.article-hero-img {
  width: 100%;
  aspect-ratio: 16/6;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-6) 0 var(--space-8);
  position: relative;
}

.article-hero-img img { width: 100%; height: 100%; object-fit: cover; }

.article-byline {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  font-size: .82rem;
  color: var(--ink-muted);
}

.article-byline .bullet { color: var(--border); }

/* ── How-we-research / methodology block ───────────────────────── */
.methodology {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin: var(--space-8) 0;
  position: relative;
  overflow: hidden;
}

.methodology::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 0%,
    color-mix(in srgb, var(--accent-2) 8%, transparent),
    transparent 60%);
  pointer-events: none;
}

.methodology-label {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: var(--space-2);
}

.methodology h2 { font-size: 1.1rem; margin-bottom: var(--space-4); }

/* Intro callout panel — a hub's lead prose styled as a surface card (matches
   .methodology). Authored as <aside class="intro-panel"> in a hub's pages/<hub>.md
   body; nested inside .prose, so the > p rules override .prose p. */
.intro-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin: var(--space-8) 0;
  position: relative;
  overflow: hidden;
}

.intro-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 0%,
    color-mix(in srgb, var(--accent-2) 8%, transparent),
    transparent 60%);
  pointer-events: none;
}

.prose .intro-panel > p { position: relative; margin: 0 0 var(--space-4); }
.prose .intro-panel > p:last-child { margin-bottom: 0; }
.prose .intro-panel > p:first-child {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
}

.criteria-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; margin-top: .75rem; }

.criteria-list li {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  padding: .85rem 1.1rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  position: relative;
  z-index: 1;
}

.criteria-list li .icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.criteria-list li strong { color: var(--ink); display: block; font-size: .9rem; margin-bottom: .15rem; }

/* ── Sources ────────────────────────────────────────────────────── */
.sources-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.sources-list li { font-size: .825rem; display: flex; align-items: baseline; gap: .35rem; }
.sources-list a { color: var(--accent-2); display: inline-flex; align-items: center; gap: .2rem; text-decoration: none; }
.sources-list a::after { content: '↗'; font-size: .7rem; }
.sources-list a:hover { text-decoration: underline; }

.affiliate-disclosure {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: .9rem 1.1rem;
  font-size: .775rem;
  color: var(--ink-muted);
  line-height: var(--lh-base);
  margin-top: var(--space-8);
}

/* Compact UP-FRONT variant — top of commercial pages (UK ASA: at the link). */
.affiliate-disclosure--top {
  margin-top: 0;
  margin-bottom: var(--space-8);
  padding: .6rem .85rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-elevated));
}
.affiliate-disclosure--top a { color: var(--accent); }

/* ── Article hero gradient fallback (no external image) ─────────── */
.article-hero-gradient {
  background:
    radial-gradient(ellipse 80% 100% at 0% 50%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%),
    radial-gradient(ellipse 60% 80% at 100% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 60%),
    var(--surface);
}

/* ── Product image placeholder (no image supplied by pick) ───────── */
.product-img-ph {
  width: 100%;
  height: 100%;
  min-height: 160px;
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    var(--surface-elevated);
}

/* ── Article heading (article template, above byline) ────────────── */
.article-heading { margin: 0 0 .5rem; }

/* ── Prose sections ─────────────────────────────────────────────── */
.prose-section { margin: var(--space-10) 0; }
.prose-section h2 { margin-bottom: var(--space-4); }
.prose-section p { color: var(--ink-muted); font-size: .95rem; }

/* ── Content section panels (.content-card) ─────────────────────── */
/* Render-time h2-sections are wrapped in these for article pages.   */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-soft);
}

/* Override .prose h2 margin/padding inside a panel (higher specificity). */
.prose .content-card > h2 {
  margin: 0 0 var(--space-5);
  padding: 0 0 var(--space-3) 1.1rem;
  padding-top: 0;
  border-left: 3px solid var(--accent);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  line-height: var(--lh-snug);
}

@media (max-width: 640px) {
  .content-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }
  .prose .content-card > h2 {
    padding-left: .75rem;
    font-size: var(--fs-lg);
  }
}

/* ── News card grid ─────────────────────────────────────────────── */
/* overview lede — displayed before the card grid on news pages */
.news-overview {
  font-size: 1.05rem;
  line-height: var(--lh-prose);
  color: var(--ink-muted);
  margin: var(--space-6) 0 var(--space-8);
  max-width: none;
}

/* Single-column stack, matching the .product-list layout */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: var(--space-4) 0 var(--space-8);
}

/* Product-card shape: 2-col grid (image pane ~200px | body) */
.news-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px 1fr;
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* Image pane — mirrors .product-img-wrap */
.news-img-wrap {
  position: relative;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 180px;
}

.news-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s var(--ease-out);
}

.news-card:hover .news-img-wrap img { transform: scale(1.05); }

/* Gradient placeholder when no story image — mirrors .product-img-ph */
.news-img-ph {
  width: 100%;
  height: 100%;
  min-height: 160px;
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, color-mix(in srgb, var(--accent) 12%, transparent), transparent),
    var(--surface-elevated);
}

/* Body pane (right column) — mirrors .product-body */
.news-card-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.news-card-headline {
  font-size: 1rem;
  font-weight: 700;
  line-height: var(--lh-snug);
  color: var(--ink);
  letter-spacing: -.02em;
  margin: 0;
}

.news-card-headline a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-base) var(--ease-out);
}

.news-card-headline a:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-card-summary {
  font-size: var(--fs-sm);
  color: var(--ink-muted);
  line-height: var(--lh-base);
  margin: 0;
  max-width: none;
}

.news-meta {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: baseline;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.news-also { color: var(--ink-muted); opacity: .8; }

/* dark theme default; light theme overrides via data-theme="light" */
[data-theme="light"] .news-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="light"] .news-card:hover {
  box-shadow: 0 8px 40px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Mobile: stack image above body, same as .product-card */
@media (max-width: 768px) {
  .news-card { grid-template-columns: 1fr; }
  .news-img-wrap { min-height: 160px; }
}

/* ── Load more ──────────────────────────────────────────────────── */
.load-more-wrap { text-align: center; margin-top: var(--space-10); }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-toc { display: none; }
  .cta-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .product-card { grid-template-columns: 1fr; }
  .product-img-wrap { min-height: 160px; }
  .cta-cards { grid-template-columns: 1fr; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .compare-table { font-size: .8rem; }
}

/* ── Affiliate affordances (render-derived from pick.buy; dormant until a program
   is registered). Mockup-approved 2026-06-23. Honest: "where to buy" / "check
   current price", never a quoted number; every link is the /go/ cloak. ───────── */
.buy-row {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.buy-row .lbl {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-muted);
}
.merchant-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .4rem .8rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-quiet);
  transition: background var(--t-base) var(--ease-out), border-color var(--t-base) var(--ease-out);
}
.merchant-chip:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
}
.buy-cta-row { margin: var(--space-4) 0 0; }
.buy-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .62rem 1.05rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: var(--fs-sm);
  text-decoration: none;
  /* Solid violet + white: legible on BOTH themes. (Was var(--accent-ink) on
     var(--grad) — near-black on the violet→cyan gradient, unreadable on the
     violet end; no single text colour is legible across the whole gradient.) */
  color: #fff;
  background: var(--accent);
}
.buy-cta:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.buy-cta--ghost {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.buy-cta--ghost:hover { background: var(--accent-quiet); }

/* ── "Where to buy" box — affiliate affordances surfaced above the fold ──── */
.where-to-buy {
  margin: var(--space-4) 0 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
}
.where-to-buy__eyebrow {
  margin: 0 0 var(--space-3);
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-subtle);
}
.where-to-buy__row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.where-to-buy__row + .where-to-buy__row {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.where-to-buy__meta { flex: 1 1 240px; min-width: 0; }
.where-to-buy__name { display: block; font-weight: 700; color: var(--ink); }
.where-to-buy__why {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--ink-muted);
}
.where-to-buy__action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.sponsored-tag {
  display: inline-block;
  font-size: .66rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-left: .5rem;
  vertical-align: middle;
}

/* === css/prose.css === */
/* ──────────────────────────────────────────────────────────────────
   prose.css — long-form content typography. Mobile-first.
   Applied via `.prose` on the rendered article wrapper.
   ────────────────────────────────────────────────────────────────── */

.prose {
  max-width: none;
  margin: 0 auto;
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: var(--lh-prose);
  word-wrap: break-word;
}

@media (min-width: 768px) {
  .prose { font-size: 1.0625rem; }
}

.prose h1 {
  font-size: var(--fs-3xl);
  margin: 0 0 var(--space-4);
}
.prose h2 {
  font-size: var(--fs-2xl);
  margin: var(--space-10) 0 var(--space-3);
  padding-top: var(--space-2);
}
.prose h3 {
  font-size: var(--fs-xl);
  margin: var(--space-8) 0 var(--space-3);
}
.prose h4 { font-size: var(--fs-lg); margin: var(--space-6) 0 var(--space-2); }
.prose h5, .prose h6 { font-size: var(--fs-md); margin: var(--space-5) 0 var(--space-2); }

.prose :is(h2, h3, h4)[id] { scroll-margin-top: calc(var(--header-h) + var(--space-4)); }

.prose p { margin: 0 0 var(--space-5); }
.prose a { color: var(--link-color); text-decoration: underline; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--link-hover); }

.prose ul, .prose ol { margin: 0 0 var(--space-5); padding-left: var(--space-6); }
.prose li { margin: var(--space-1) 0; }

.prose blockquote {
  font-style: italic;
  color: var(--ink-muted);
}

/* Inline code */
.prose code:not(pre code) {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-xs);
  padding: 0.1em 0.4em;
  font-size: 0.92em;
}

/* Code block + copy button (hooked up in core.js) */
.prose pre {
  position: relative;
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--code-border);
  font-size: 0.92em;
  line-height: 1.55;
  overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Tables — wrapped in .content-table for horizontal scroll on small screens */
.prose .content-table {
  margin: var(--space-6) 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 480px;
}
.prose thead th {
  text-align: left;
  background: var(--surface-elevated);
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.prose tbody td {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--table-grid);
  color: var(--ink-muted);
  vertical-align: middle;
}
.prose tbody td:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.prose tbody tr:nth-child(even) { background: var(--table-stripe); }
.prose tbody tr:hover { background: var(--table-hover); }
.prose tbody tr:last-child td { border-bottom: 0; }

/* Images and figures */
.prose img { border-radius: var(--radius-sm); margin: var(--space-3) 0; }
.prose figure { margin: var(--space-5) 0; }
.prose figcaption { text-align: center; color: var(--ink-subtle); font-size: var(--fs-sm); margin-top: var(--space-2); }

/* Horizontal rule */
.prose hr { margin: var(--space-10) 0; }

/* Visualization wrappers */
.prose .content-diagram {
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* Drop the auto-anchor "#" pseudo on small screens to save horizontal room */
@media (max-width: 767px) {
  .prose :is(h2, h3, h4)[id]::before { display: none; }
}

/* === css/utilities.css === */
/* ──────────────────────────────────────────────────────────────────
   utilities.css — small helper classes only.
   ────────────────────────────────────────────────────────────────── */

.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack--lg { gap: var(--space-6); }

.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }

.muted { color: var(--ink-muted); }
.subtle { color: var(--ink-subtle); }

.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--accent-quiet);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge--warm { background: var(--warm-quiet); color: var(--warm); }
.badge--success { background: var(--success-quiet); color: var(--success); }
.badge--danger { background: var(--danger-quiet); color: var(--danger); }

.card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 768px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.no-scroll { overflow: hidden !important; }
