/* ============================================================
   Baseline Labs - Global Stylesheet
   baseline.css

   This is the single source of truth for all site styling.
   Changes here reflect everywhere - the design system page,
   the product, the blog, everywhere.
   ============================================================ */

/* The HTML `hidden` attribute is supposed to hide an element. The UA
   stylesheet rule for it (display:none) loses to any inline `style=`
   that sets display, so several skeleton placeholders with inline
   `style="display:flex"` were staying visible after `hidden=true`.
   This !important reset matches normalize.css and makes `hidden`
   actually hide the element regardless of competing inline styles. */
[hidden] { display: none !important; }

/* ============================================================
     SCSS-STYLE DESIGN TOKENS (CSS Custom Properties)
     ============================================================ */

  :root {
    /* - Colour: Warm Neutrals (Anthropic DNA) - */
    --c-bg:           #faf8f5;
    --c-bg-raised:    #ffffff;
    --c-bg-sunken:    #f2efe9;
    --c-bg-hover:     #edeae3;
    --c-border:       #e0ddd4;
    --c-border-subtle:#ece9e1;
    --c-text:         #1a1916;
    --c-text-secondary:#6b6860;
    --c-text-tertiary:#9e9a90;

    /* - Accents - */
    --c-accent:       #c8553a;
    --c-accent-hover: #b34830;
    --c-accent-soft:  rgba(200, 85, 58, 0.08);
    /* Hot: alerts, failures, destructive actions, bad scores. Kept apart from
       the brand accent so a reskin can recolour one without the other. */
    --c-hot:          #c8553a;
    --c-hot-hover:    #b34830;
    --c-hot-soft:     rgba(200, 85, 58, 0.08);
    /* Text and marks that sit on a filled accent, hot or status colour. */
    --c-on-accent:    #fff;
    --c-blue:         #5a8fb4;
    --c-blue-soft:    rgba(90, 143, 180, 0.08);
    --c-green:        #6b8f5c;
    --c-green-soft:   rgba(107, 143, 92, 0.08);
    --c-amber:        #e09430;
    --c-amber-soft:   rgba(224, 148, 48, 0.08);

    /* - Typography Scale (Major Third - 1.25) - */
    --fs-xs:    0.694rem;  /* 11.1px */
    --fs-sm:    0.833rem;  /* 13.3px */
    --fs-base:  1rem;      /* 16px   */
    --fs-md:    1.125rem;  /* 18px   */
    --fs-lg:    1.25rem;   /* 20px   */
    --fs-xl:    1.563rem;  /* 25px   */
    --fs-2xl:   1.953rem;  /* 31.3px */
    --fs-3xl:   2.441rem;  /* 39px   */

    --ff-sans: 'Plus Jakarta Sans', -apple-system, sans-serif; /* retired 2026-05-14, aliased to --ff-product */
    --ff-product: 'Plus Jakarta Sans', -apple-system, sans-serif;
    /* --ff-serif: retired 2026-05-12. Aliased to product font so legacy
       usages render in Plus Jakarta Sans without per-file churn. Do not
       use --ff-serif in new code - reach for --ff-product instead. */
    --ff-serif: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --ff-mono:  'JetBrains Mono', monospace;

    --lh-tight:   1.25;
    --lh-normal:  1.5;
    --lh-relaxed: 1.7;

    --fw-light:   300;
    --fw-regular: 400;
    --fw-medium:  500;
    --fw-semi:    600;

    /* - Spacing (8px base grid) - */
    --sp-1:  0.25rem;  /* 4px  */
    --sp-2:  0.5rem;   /* 8px  */
    --sp-3:  0.75rem;  /* 12px */
    --sp-4:  1rem;     /* 16px */
    --sp-5:  1.5rem;   /* 24px */
    --sp-6:  2rem;     /* 32px */
    --sp-7:  2.5rem;   /* 40px */
    --sp-8:  3rem;     /* 48px */
    --sp-9:  4rem;     /* 64px */
    --sp-10: 5rem;     /* 80px */
    --sp-12: 6rem;     /* 96px */

    /* - Radii - */
    --r-sm:  4px;
    --r-md:  8px;
    --r-lg:  12px;
    --r-xl:  16px;
    --r-pill:9999px;

    /* - Shadows - */
    --shadow-sm:  0 1px 2px rgba(26,25,22,0.04);
    --shadow-md:  0 2px 8px rgba(26,25,22,0.06), 0 1px 2px rgba(26,25,22,0.04);
    --shadow-lg:  0 8px 24px rgba(26,25,22,0.08), 0 2px 6px rgba(26,25,22,0.04);
    --shadow-inset: inset 0 1px 3px rgba(26,25,22,0.06);

    /* - Transitions - */
    --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in:    cubic-bezier(0.55, 0, 1, 0.45);
    --ease-in-out:cubic-bezier(0.65, 0, 0.35, 1);
    /* motion.dev's house curve - crafted reveals (clip-path wipes). */
    --ease-swift: cubic-bezier(0.25, 0, 0, 1);
    --dur-fast:   120ms;
    --dur-normal: 200ms;
    --dur-slow:   400ms;

    /* - Spring easings - real physics as CSS linear(), zero runtime.
       Generated author-time with motion@13.1.1: String(spring(visualDuration,
       bounce)). Always use the -dur token with its curve. Springs belong on
       transform/width/stroke-dashoffset where overshoot is visible - keep
       opacity on --ease-out. Exits never spring. */
    /* tight - 0.2s/0.1: buttons, toggles, checkboxes */
    --spring-tight-dur: 400ms;
    --spring-tight: linear(0, 0.2271, 0.5535, 0.7826, 0.9088, 0.9679, 0.9918, 0.9997, 1.0015, 1.0013, 1.0008, 1, 1);
    /* snappy - 0.3s/0.15: card lift, nav, tabs, bar fills */
    --spring-snappy-dur: 550ms;
    --spring-snappy: linear(0, 0.1157, 0.3366, 0.5536, 0.7259, 0.8465, 0.9234, 0.9681, 0.9916, 1.0023, 1.0059, 1.0061, 1.005, 1.0035, 1.0023, 1.0014, 1.0007, 1);
    /* ui - 0.4s/0.25: modal panels */
    --spring-ui-dur: 700ms;
    --spring-ui: linear(0, 0.0702, 0.226, 0.4079, 0.5805, 0.7263, 0.8392, 0.92, 0.9735, 1.0055, 1.0219, 1.0279, 1.0276, 1.0239, 1.0189, 1.0138, 1.0093, 1.0057, 1.0031, 1.0013, 1.0001, 0.9995, 1);
    /* toast - 0.35s/0.2: toast slide-in */
    --spring-toast-dur: 650ms;
    --spring-toast: linear(0, 0.0836, 0.2597, 0.4539, 0.6277, 0.7659, 0.8666, 0.9345, 0.9766, 1.0001, 1.0113, 1.015, 1.0145, 1.0121, 1.0092, 1.0064, 1.0041, 1.0024, 1.0013, 1.0005, 1.0001, 1);
    /* pop - 0.5s/0.4: step-completion tick, celebration moments */
    --spring-pop-dur: 1100ms;
    --spring-pop: linear(0, 0.0448, 0.1559, 0.3027, 0.4615, 0.6151, 0.7521, 0.8663, 0.9554, 1.0199, 1.0621, 1.0856, 1.0944, 1.0924, 1.0833, 1.0701, 1.0552, 1.0403, 1.0268, 1.0154, 1.0063, 0.9996, 0.995, 0.9923, 0.9912, 0.9911, 0.9918, 0.993, 0.9944, 0.9958, 0.9971, 0.9983, 0.9992, 0.9999, 1.0004, 1, 1);
    /* emphatic - 0.6s/0.3: hero entrances, the score-ring needle */
    --spring-emphatic-dur: 1000ms;
    --spring-emphatic: linear(0, 0.0327, 0.1144, 0.2246, 0.3475, 0.4714, 0.5885, 0.6938, 0.7844, 0.8595, 0.9194, 0.9653, 0.9987, 1.0216, 1.0359, 1.0435, 1.046, 1.0448, 1.0413, 1.0364, 1.0308, 1.025, 1.0196, 1.0147, 1.0104, 1.0069, 1.004, 1.0018, 1.0002, 0.9991, 0.9984, 1, 1);
  }

  /* ============================================================
     DARK MODE
     ============================================================ */
  [data-theme="dark"] {
    --c-bg:           #141413;
    --c-bg-raised:    #1e1d1b;
    --c-bg-sunken:    #0e0e0d;
    --c-bg-hover:     #2a2926;
    --c-border:       #2e2d2a;
    --c-border-subtle:#242320;
    --c-text:         #f0ede6;
    --c-text-secondary:#a09c92;
    --c-text-tertiary:#706c63;

    --c-accent-soft:  rgba(200, 85, 58, 0.12);
    --c-hot-soft:     rgba(200, 85, 58, 0.12);
    --c-blue-soft:    rgba(90, 143, 180, 0.12);
    --c-green-soft:   rgba(107, 143, 92, 0.12);
    --c-amber-soft:   rgba(224, 148, 48, 0.12);

    --shadow-sm:  0 1px 2px rgba(0,0,0,0.2);
    --shadow-md:  0 2px 8px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg:  0 8px 24px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.2);
    --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.3);
  }

  /* ============================================================
     RESET & BASE
     ============================================================ */
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

  html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    /* sticky topbar is 52px - keep anchor targets clear of it */
    scroll-padding-top: 64px;
  }
  /* Safety net for mobile: never allow a stray too-wide child (a
     long URL, an inline width override, a `minmax(320px, 1fr)` grid
     column on a 375px viewport) to make the whole page rock left
     and right. Individual elements that legitimately need horizontal
     overflow (data tables, code blocks) opt back in with overflow-x
     on themselves. `clip` keeps position:sticky working; we fall
     back to `hidden` for older browsers via the cascade. */
  html, body {
    overflow-x: hidden;
    overflow-x: clip;
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
  }

  body {
    font-family: var(--ff-product);
    font-weight: var(--fw-regular);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: var(--lh-normal);
    transition: background var(--dur-slow) var(--ease-out),
                color var(--dur-slow) var(--ease-out);
  }

  /* Without this a bare <code>, <kbd> or <samp> falls back to the browser's
     own `monospace`, a system font - measured on /schema-audit 2026-09-23.
     Family only: size stays with the component or page that owns the text. */
  code, kbd, samp { font-family: var(--ff-mono); }

  /* ============================================================
     LAYOUT SHELL
     ============================================================ */
  .shell {
    max-width: 1120px;
    margin: 0 auto;
    /* Top is --sp-6 (32px), not --sp-8 (48px): a 33% shave, owner call
       2026-08-30. A tool hub adds .hub-wrap's own --sp-4, so the old pairing
       put 64px above the first card. Bottom stays --sp-8 - that gap is the
       run-out under the last card and reads as short when trimmed. */
    padding: var(--sp-6) var(--sp-5) var(--sp-8);
  }

  .shell--wide {
    max-width: 1440px;
  }

  .masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-9);
    padding-bottom: var(--sp-5);
    border-bottom: 1px solid var(--c-border);
  }

  .masthead-left {
    display: flex;
    align-items: flex-end;
    gap: var(--sp-3);
  }

  .masthead-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--r-md);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
  }

  .masthead-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--dur-slow) var(--ease-out);
  }

  .masthead-logo .logo-dark {
    position: absolute;
    top: 0; left: 0;
    opacity: 0;
  }
  [data-theme="dark"] .masthead-logo .logo-light { opacity: 0; }
  [data-theme="dark"] .masthead-logo .logo-dark { opacity: 1; }

  .masthead-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    line-height: 1;
  }

  .masthead-title {
    font-family: var(--ff-product);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .masthead-sub {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    font-weight: var(--fw-medium);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 4px;
    line-height: 1;
  }

  .theme-toggle {
    appearance: none;
    border: none;
    background: none;
    color: var(--c-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 18px;
    transition: all var(--dur-normal) var(--ease-out);
  }
  .theme-toggle:hover {
    background: var(--c-bg-hover);
    color: var(--c-text);
  }

/* ---- Global language switcher (topbar) ---- */
.bl-lang { position: relative; }
.bl-lang-btn {
  appearance: none;
  border: none;
  background: none;
  color: var(--c-text-secondary);
  height: 36px;
  padding: 0 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all var(--dur-normal) var(--ease-out);
}
.bl-lang-btn:hover { background: var(--c-bg-hover); color: var(--c-text); }
.bl-lang-btn .ph-globe { font-size: 18px; }
.bl-lang-caret { font-size: 12px; opacity: 0.6; transition: transform var(--dur-normal) var(--ease-out); }
.bl-lang.open .bl-lang-caret { transform: rotate(180deg); }
.bl-lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--c-bg-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: none;
  z-index: 200;
  max-height: 70vh;
  overflow-y: auto;
}
.bl-lang.open .bl-lang-menu { display: block; }
.bl-lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--c-text);
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
}
.bl-lang-item:hover { background: var(--c-bg-hover); }
.bl-lang-item.is-current { color: var(--c-accent, var(--c-text)); font-weight: 700; }
.bl-lang-item .fi { width: 1.2em; height: 0.9em; border-radius: 2px; flex: none; }
/* "Translate" divider between native (T1) languages and machine translations. */
.bl-lang-sep {
  padding: 8px 10px 4px;
  border-top: 1px solid var(--c-border-subtle);
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-tertiary);
  pointer-events: none;
}


/* ============================================================
   TOPBAR + SIDEBAR NAVIGATION
   ============================================================ */
/* The topbar's full height (44px row + 1px border). A full-page view that
   must keep the nav (the workbench explorers, Media Centre) starts here and
   stacks under --z-topbar, so the topbar and the sidebar drawer stay usable. */
:root { --topbar-h: 45px; --z-topbar: 100; }
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  background: color-mix(in srgb, var(--c-bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border-subtle);
  transition: background var(--dur-slow) var(--ease-out),
              border-color var(--dur-slow) var(--ease-out);
}

[data-theme="dark"] .topbar {
  background: color-mix(in srgb, var(--c-bg) 85%, transparent);
}

.topbar-inner {
  padding: 0 var(--sp-3);
  display: flex;
  align-items: center;
  height: 44px;
  gap: var(--sp-3);
}

/* Hamburger - two lines that animate to X */
.hamburger {
  width: 32px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  border-radius: var(--r-md);
  transition: background var(--dur-fast) var(--ease-out);
  flex-shrink: 0;
}
.hamburger:hover { background: var(--c-bg-hover); }
.hamburger:active { transform: scale(0.93); }

.hamburger-line {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--c-text);
  border-radius: 1px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s var(--ease-out);
  transform-origin: center;
}

/* X state */
.hamburger.is-open .hamburger-line:first-child {
  transform: translateY(3.25px) rotate(45deg);
}
.hamburger.is-open .hamburger-line:last-child {
  transform: translateY(-3.25px) rotate(-45deg);
}

/* The brand is the part of the bar that yields; the controls never do.
   html/body clip overflow-x, so a bar wider than the screen does not
   scroll - its right end is silently cut off. Until 2026-09-28 the brand
   was flex-shrink: 0, and a blog post at 400px ("BaselineLabs - The
   Baseline") lost its language switcher and theme toggle, and every
   signed-in page lost its avatar, switcher and toggle. Now the wordmark
   truncates as a last resort and the media queries below take the
   context and labels away first. */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 32px; /* the logo: the wordmark can go, the mark stays */
}
.topbar-brand-text,
.topbar-brand-suffix {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-brand-logo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
}
.topbar-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.topbar-brand-logo .logo-dark {
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
}
[data-theme="dark"] .topbar-brand-logo .logo-light { opacity: 0; }
[data-theme="dark"] .topbar-brand-logo .logo-dark { opacity: 1; }

.topbar-spacer { flex: 1; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* Phone widths, in the order things give way: the blog's "- The Baseline"
   and its locale/tag suffix (compile.py _blog_brand_nav), the switcher's
   caret, then the gaps. A signed-in bar also carries the plan chip, credits
   and avatar, which no wordmark leaves room for, so there the wordmark and
   the switcher's language code go (the logo and the globe stay), and at the
   narrowest the Upgrade segment keeps its bolt and drops its word. */
@media (max-width: 640px) {
  .topbar-brand-sub,
  .topbar-brand-suffix,
  .bl-lang-caret { display: none; }
}
@media (max-width: 560px) {
  html.bl-user .topbar-brand-text,
  html.bl-known-user .topbar-brand-text { display: none; }
}
@media (max-width: 480px) {
  .topbar-inner { gap: var(--sp-2); }
  .topbar-actions { gap: var(--sp-1); }
  html.bl-user .bl-lang-cur,
  html.bl-known-user .bl-lang-cur { display: none; }
}
@media (max-width: 400px) {
  html.bl-user .topbar-plan-up,
  html.bl-known-user .topbar-plan-up { font-size: 0; gap: 0; }
}

/* ── Topbar plan chip ──
   The signed-in account's platform tier as a pill, with an Upgrade segment
   attached while there is a tier above it (owner call, 2026-09-22: a bare
   "Plans" link up here made no sense on its own; the tier and the way up
   do). Hidden until nav.html paints it - first from the cached chip, then
   from /api/core/billing/status - so it never shows for a visitor. Sits
   before the credits pill so money stays rightmost. An admin account gets
   an Admin segment first; past_due turns the tier amber and reads
   "Payment due". Labels come from billing status (core/shared/credits.py
   TIER_LABELS), never from the tier key. Under 640px only an upgradable
   chip survives, and as its Upgrade segment alone. */
.topbar-plan {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--r-pill);
  overflow: hidden;
  font-family: var(--ff-product);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.topbar-plan-admin,
.topbar-plan-tier,
.topbar-plan-up {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.topbar-plan-tier {
  background: var(--c-bg-sunken);
  color: var(--c-text-secondary);
}
.topbar-plan-tier:hover { color: var(--c-text); }
.topbar-plan-tier--due { color: var(--c-amber); }
.topbar-plan-admin {
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.topbar-plan-admin:hover { background: var(--c-bg-sunken); }
.topbar-plan-admin[hidden] { display: none; }
.topbar-plan i { font-size: 13px; }
.topbar-plan-up {
  background: var(--c-accent);
  color: var(--c-on-accent);
}
.topbar-plan-up:hover { background: var(--c-accent-hover); }
.topbar-plan-up[hidden] { display: none; }
.topbar-plan-tier:focus-visible,
.topbar-plan-up:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: -2px;
}

@media (max-width: 640px) {
  .topbar-plan { display: none; }
  .topbar-plan--up { display: inline-flex; }
  .topbar-plan--up .topbar-plan-tier,
  .topbar-plan--up .topbar-plan-admin { display: none; }
}

.topbar-credits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--c-bg-sunken);
  border: 1px solid var(--c-border-subtle);
  color: var(--c-text-secondary);
  font-family: var(--ff-product);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.topbar-credits:hover {
  border-color: var(--c-amber);
  color: var(--c-amber);
}
.topbar-credits i { font-size: 14px; color: var(--c-amber); }

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--c-accent-soft);
  color: var(--c-accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-family: var(--ff-product);
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease-out);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.topbar-avatar:hover {
  box-shadow: 0 0 0 2px var(--c-accent-soft);
}

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 25, 22, 0.3);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out);
}
[data-theme="dark"] .sidebar-overlay {
  background: rgba(0, 0, 0, 0.4);
}
.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar panel */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--c-bg-raised);
  border-right: 1px solid var(--c-border-subtle);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.35s var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.sidebar.is-open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border-subtle);
  flex-shrink: 0;
}

.sidebar-header-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
}
.sidebar-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.sidebar-header-logo .logo-dark {
  position: absolute;
  top: 0; left: 0;
  opacity: 0;
}
[data-theme="dark"] .sidebar-header-logo .logo-light { opacity: 0; }
[data-theme="dark"] .sidebar-header-logo .logo-dark { opacity: 1; }

.sidebar-header-name {
  font-family: var(--ff-product);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--c-text);
  letter-spacing: -0.02em;
}

.sidebar-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--c-text-tertiary);
  font-size: 20px;
  cursor: pointer;
  padding: var(--sp-1);
  border-radius: var(--r-md);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
  display: grid;
  place-items: center;
}
.sidebar-close:hover { color: var(--c-text); background: var(--c-bg-hover); }

.sidebar-nav {
  padding: var(--sp-3);
  flex: 1;
}

/* Sentence case, not caps (2026-09-22). These are package names -
   "Schema tools", "Your site" - and a name in caps stops being a name.
   Weight 600 on the tertiary colour is what makes it read as a label;
   the tracking keeps it from reading as a link. */
.sidebar-section-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  color: var(--c-text-tertiary);
  letter-spacing: 0.06em;
  padding: var(--sp-3) var(--sp-3) var(--sp-1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--ff-product);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-secondary);
  text-decoration: none;
  border-radius: var(--r-md);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  letter-spacing: -0.01em;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  line-height: 1.4;
}
.sidebar-link:hover {
  color: var(--c-text);
  background: var(--c-bg-hover);
}
.sidebar-link:active { transform: scale(0.98); }
.sidebar-link--active {
  color: var(--c-text);
  background: var(--c-bg-sunken);
}
.sidebar-link i { font-size: 18px; color: var(--c-text-tertiary); flex-shrink: 0; }
.sidebar-link--active i { color: var(--c-accent); }

.sidebar-footer {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--c-border-subtle);
  flex-shrink: 0;
}

.sidebar-switch {
  font-size: var(--fs-xs);
  color: var(--c-text-tertiary);
}
.sidebar-switch i { font-size: 14px; }

  /* ============================================================
     ANIMATION LANGUAGE
     ============================================================ */

  /* Slide in from right */
  @keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
  }

  /* Slide in from left */
  @keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
  }

  /* Slide in from bottom (modals, sheets) */
  @keyframes slideInUp {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }

  /* Scale in (modals, popups) */
  @keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
  }

  /* Fade in */
  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* Overlay backdrop */
  @keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* Animation demo classes */
  .anim-demo-area {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
  }

  .anim-demo {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    align-items: center;
  }

  .anim-demo-box {
    width: 100px;
    height: 64px;
    border-radius: var(--r-lg);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    display: grid;
    place-items: center;
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    font-family: var(--ff-mono);
    overflow: hidden;
    position: relative;
  }

  .anim-trigger {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    cursor: pointer;
    border: none;
    background: var(--c-bg-sunken);
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-family: var(--ff-mono);
    transition: all var(--dur-fast) var(--ease-out);
  }
  .anim-trigger:hover { background: var(--c-border); color: var(--c-text); }
  .anim-trigger:active { transform: scale(0.95); }

  .anim-target {
    width: 100%;
    height: 100%;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
  }


/* ── Reusable animation utility classes ── */

/* The dissolve - how deleted things leave (owner call, /reskin annotation
   2026-08-26). Add .is-removing to the row/card, remove the node on
   animationend. Exit rules apply: fast, eases in, never bounces. The blur
   reads as "gone", not "moved" - deletion has no destination. */
@keyframes bl-dissolve {
  to { opacity: 0; transform: scale(0.97); filter: blur(4px); }
}
.is-removing {
  animation: bl-dissolve var(--dur-normal) var(--ease-in) forwards;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .is-removing { animation-duration: 1ms; }
}

.anim-fade-in       { animation: fadeIn 0.4s var(--ease-out) both; }
.anim-slide-up      { animation: slideInUp 0.4s var(--ease-out) both; }
.anim-slide-right   { animation: slideInRight 0.4s var(--ease-out) both; }
.anim-slide-left    { animation: slideInLeft 0.4s var(--ease-out) both; }
.anim-scale-in      { animation: scaleIn 0.3s var(--ease-out) both; }
.anim-fade-up       { animation: fadeUp 0.5s var(--ease-out) both; }

/* Stagger delays - apply to children */
.anim-stagger > :nth-child(1)  { animation-delay: 0.05s; }
.anim-stagger > :nth-child(2)  { animation-delay: 0.1s; }
.anim-stagger > :nth-child(3)  { animation-delay: 0.15s; }
.anim-stagger > :nth-child(4)  { animation-delay: 0.2s; }
.anim-stagger > :nth-child(5)  { animation-delay: 0.25s; }
.anim-stagger > :nth-child(6)  { animation-delay: 0.3s; }
.anim-stagger > :nth-child(7)  { animation-delay: 0.35s; }
.anim-stagger > :nth-child(8)  { animation-delay: 0.4s; }
.anim-stagger > :nth-child(9)  { animation-delay: 0.45s; }
.anim-stagger > :nth-child(10) { animation-delay: 0.5s; }
.anim-stagger > :nth-child(11) { animation-delay: 0.55s; }
.anim-stagger > :nth-child(12) { animation-delay: 0.6s; }

/* ── .reveal - a visibility HOOK, no longer an entrance (2026-08-30) ──
   Content does not animate in any more. Owner call: the page should simply
   be there. `.reveal` used to start at opacity 0 with a 16px offset and
   transition in over 600ms, and there were five entry variants on top of
   that - which is exactly what made arrival feel inconsistent, because two
   of the five were noise and a third was banned by the house rules:

     .reveal--up     identical to plain .reveal (both translateY(16px)) - 22
                     uses that changed nothing but implied plain must differ
     .reveal--left   translateX, i.e. a sideways slide, which the settle rule
     .reveal--right  forbids outright ("nothing scales, slides sideways")
     .reveal--fade   the one principled variant: no movement, used on
                     top-of-page furniture that has nothing above to rise into
     .reveal--pop    the 2026-08-29 scale experiment, adopted by zero pages
     .reveal--wipe   a clip-path heading reveal, adopted by zero pages

   All six are gone from the CSS and swept out of every page and locale twin.

   THE CLASS ITSELF STAYS, and it is load-bearing. `.is-visible` is still
   driven by /js/reveal.js and is still the gate the DATA gestures hang off:
   .chart-reveal bars, SVG scale-ins and the stroke-dasharray draw-on below
   all key on `:not(.is-visible)`, as does .reveal--grid's heatmap cascade.
   Those are information rather than entrances - a bar growing tells you it
   is a bar - so they survive on purpose. Delete `.reveal` from markup and
   you silently kill the charts.

   That split is also why the base rule below is empty rather than deleted:
   the hook must keep existing even though it no longer paints. */

html .reveal.is-visible {
  /* Kept as a safety net, not as the entrance. Anything that hides itself
     and waits for .is-visible - a scoped .reveal--grid brings its own hidden
     state - still lands correctly without re-declaring this per component. */
  opacity: 1;
  transform: none;
}

/* ── Chart animations on reveal (used with .chart-reveal modifier) ──
   The host element gets `.reveal.chart-reveal`; child chart parts (an
   .h-bar-fill or an inline <svg>) animate from a dormant state to
   their final shape when the host's `.is-visible` flips on. */

.reveal.chart-reveal:not(.is-visible) .h-bar-fill {
  width: 0 !important;
}
/* Inline-styled fills already have `transition: width 600ms ...`; we
   just delay the start of that transition by gating on visibility. */

.reveal.chart-reveal svg {
  transition: transform 700ms var(--ease-out) 0.1s, opacity 700ms var(--ease-out) 0.1s;
  transform-origin: center;
}
.reveal.chart-reveal:not(.is-visible) svg {
  opacity: 0;
  transform: scale(0.92);
}

/* Stroke-dasharray-driven SVG draw-on:
   give the host `.reveal.chart-reveal--draw` and any <circle>/<path>
   inside that has its own dash pattern animates its stroke-dashoffset
   from a parked value (`--park`, default the full circumference) down
   to its inline value when the host becomes visible. */
/* The draw's feel is tunable per host: a score ring wants the needle to
   overshoot and settle (--draw-ease: var(--spring-emphatic)), a trend line
   wants a pen at constant speed (--draw-ease: linear). Default unchanged. */
.reveal.chart-reveal--draw svg [stroke-dasharray] {
  transition: stroke-dashoffset var(--draw-dur, 1.1s) var(--draw-ease, var(--ease-out)) 0.15s;
}
.reveal.chart-reveal--draw:not(.is-visible) svg [stroke-dasharray] {
  stroke-dashoffset: var(--park, 320) !important;
}


@media (prefers-reduced-motion: reduce) {
  .reveal.chart-reveal svg,
  .reveal.chart-reveal--draw svg [stroke-dasharray] { transition: none; opacity: 1; transform: none; }
  .reveal.chart-reveal .h-bar-fill { transition: none; }
}

  /* Modal demo */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 25, 22, 0.4);
    /* Above the chat widget (300, chat.html) - a modal backdrop with the
       chat bubble painting through it reads as broken. Below the toasts
       (1000) that report on modal actions. */
    z-index: 500;
    display: grid;
    place-items: center;
    animation: overlayIn 0.2s var(--ease-out);
    cursor: pointer;
  }
  [data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.5);
  }

  .modal-panel {
    position: relative;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    padding: var(--sp-6);
    max-width: 440px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    /* Entry: panel lands on a spring (never the backdrop - it only fades).
       Browsers without linear() drop the second line and keep the plain one. */
    animation: modalIn 0.3s var(--ease-out);
    animation: modalIn var(--spring-ui-dur) var(--spring-ui);
    cursor: default;
  }
  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }

  /* Animated close: add .is-closing to the overlay, remove the node on
     animationend (or a ~150ms timeout). Exits are fast and never bounce.
     Modals that just remove the node still work - they close instantly,
     as before - so adoption is per call site. */
  .modal-overlay.is-closing {
    animation: overlayOut var(--dur-fast) var(--ease-in) both;
    pointer-events: none;
  }
  .modal-overlay.is-closing .modal-panel {
    animation: modalOut var(--dur-fast) var(--ease-in) both;
  }
  @keyframes overlayOut { to { opacity: 0; } }
  @keyframes modalOut   { to { opacity: 0; transform: scale(0.97); } }

  .modal-panel-title {
    font-family: var(--ff-product);
    font-weight: 600;
    font-size: var(--fs-lg);
    color: var(--c-text);
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-2);
  }

  .modal-panel-text {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--sp-5);
  }

  .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-2);
  }

  .modal-panel--wide { max-width: 560px; }

  /* Explainer head - icon chip + title + mono sub + close, the anatomy
     the metric-(i) dialogs on schema-audit and site-pulse rebuilt twice
     as .sav-popover / .spv-popover. Title drops to md inside a head row. */
  .modal-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
  }
  .modal-head .modal-panel-title { font-size: var(--fs-md); margin-bottom: 0; line-height: 1.2; }
  .modal-head-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-bg-sunken);
    flex-shrink: 0;
  }
  .modal-head-icon i { font-size: 22px; color: var(--c-text); }
  .modal-head-sub {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    font-family: var(--ff-mono);
    margin-top: 2px;
  }
  .modal-head .modal-close { position: static; margin-left: auto; }

  /* Labelled explainer sections inside a panel */
  .modal-section { margin-bottom: var(--sp-3); }
  .modal-section:last-child { margin-bottom: 0; }
  .modal-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-tertiary);
    font-weight: var(--fw-semi);
    margin-bottom: 4px;
  }
  .modal-section-body { font-size: var(--fs-sm); color: var(--c-text); line-height: 1.5; }
  .modal-section-body code {
    background: var(--c-bg-sunken);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--ff-mono);
    font-size: 0.92em;
  }

  /* Bare icon close, top-right inside the panel. Optional - small
     confirm dialogs don't need one; anything with form fields should
     carry it. */
  .modal-close {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    border: none;
    background: none;
    padding: var(--sp-1);
    color: var(--c-text-tertiary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--r-sm);
  }
  .modal-close:hover { color: var(--c-text); background: var(--c-bg-hover); }

  /* George in a modal - a spot beside the dialog's opening line, the place a
     modal speaks to the customer in its own voice (first use: the report
     levels popup, static/js/report-levels.js, 2026-09-29). The spot floor
     (104px), on the right, facing left into the copy; decoration only, so
     the img is alt="" aria-hidden="true" and it leaves under 560px, where a
     phone needs the width for the content. */
  .modal-george-row {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
  }
  .modal-george-row > :first-child { flex: 1; min-width: 0; margin-bottom: 0; }
  .modal-george {
    flex: none;
    width: 104px;
    height: 104px;
    object-fit: contain;
  }
  @media (max-width: 560px) {
    .modal-george { display: none; }
  }

  /* Report levels popup (static/js/report-levels.js). The cards are canon
     .card with .is-selected; these classes only lay out what sits inside
     them and the steps under the list. */
  .rl-sub {
    margin: 2px 0 0;
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    overflow-wrap: anywhere;
  }
  .rl-now {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: var(--sp-3);
    border-radius: var(--r-md);
    background: var(--c-bg-sunken);
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
  }
  .rl-now-label {
    font-size: 10px;
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-tertiary);
  }
  .rl-now-text { color: var(--c-text); }
  .rl-now-cost { margin-left: auto; font-variant-numeric: tabular-nums; }
  .rl-levels { display: flex; flex-direction: column; gap: var(--sp-2); }
  .rl-level {
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-2);
    cursor: pointer;
  }
  .rl-level:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-accent-soft); }
  .rl-level.is-selected:focus-visible { box-shadow: inset 0 0 0 1px var(--c-blue), 0 0 0 3px var(--c-blue-soft); }
  .rl-level.is-disabled { cursor: not-allowed; background: var(--c-bg-sunken); }
  .rl-level.is-disabled:hover { box-shadow: none; border-color: var(--c-border-subtle); }
  .rl-level.is-disabled .rl-level-title,
  .rl-level.is-disabled .rl-level-cost { color: var(--c-text-tertiary); }
  .rl-level-head {
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
  }
  .rl-level-title { flex: 1; min-width: 0; font-weight: var(--fw-semi); color: var(--c-text); }
  .rl-level-cost {
    white-space: nowrap;
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    font-variant-numeric: tabular-nums;
  }
  .rl-level-n { font-weight: var(--fw-semi); color: var(--c-text); }
  .rl-level-check { flex: none; align-self: center; font-size: 20px; color: var(--c-blue); opacity: 0.2; }
  .rl-level.is-selected .rl-level-check { opacity: 1; }
  .rl-level.is-disabled .rl-level-check { visibility: hidden; }
  .rl-level-line, .rl-level-warn { margin: 0; font-size: var(--fs-xs); line-height: 1.5; }
  .rl-level-line { color: var(--c-text-secondary); }
  .rl-level-warn { display: flex; align-items: center; gap: var(--sp-1); color: var(--c-amber); font-weight: var(--fw-semi); }
  .rl-level-warn.is-over { color: var(--c-hot); }
  .rl-star, .rl-disclaimer {
    margin: var(--sp-3) 0 0;
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--c-text-tertiary);
  }
  .rl-disclaimer { color: var(--c-text-secondary); }
  .rl-step {
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--c-border-subtle);
  }
  .rl-gap { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--c-text); line-height: 1.5; }
  .rl-step > .rl-gap:last-child { margin-bottom: 0; }
  .rl-fill-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
  .rl-fill-input { flex: 1 1 220px; min-width: 0; }
  .rl-hint { margin-top: var(--sp-2); }
  .rl-items {
    list-style: none;
    margin: var(--sp-3) 0 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-md);
  }
  .rl-items:empty { display: none; }
  .rl-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-3);
    min-height: 32px;
    font-size: var(--fs-sm);
  }
  .rl-item + .rl-item { border-top: 1px solid var(--c-border-subtle); }
  .rl-item > i { flex: none; color: var(--c-text-tertiary); }
  .rl-item.is-new > i { color: var(--c-blue); }
  .rl-item-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .rl-item.is-locked .rl-item-text { color: var(--c-text-secondary); }
  .rl-ack { margin-top: var(--sp-3); }
  .rl-ack-label {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--c-text);
    cursor: pointer;
  }
  .rl-ack-label .checkbox { margin-top: 1px; }
  .rl-modal .modal-actions { margin-top: var(--sp-5); }
  @media (max-width: 560px) {
    .rl-level-head { flex-wrap: wrap; }
    .rl-level-title { flex-basis: 100%; }
    .rl-level-check { margin-left: auto; }
    .rl-now-cost { margin-left: 0; }
    .rl-modal .modal-actions { flex-direction: column-reverse; }
    .rl-modal .modal-actions .btn { justify-content: center; }
  }

  /* ============================================================
     SECTION STRUCTURE
     ============================================================ */
  .section {
    margin-bottom: var(--sp-10);
  }

  .section-header {
    margin-bottom: var(--sp-5);
  }

  /* When section is used as a page title (header is the only child), tighten spacing */
  .section-header:last-child {
    margin-bottom: 0;
  }

  .section:has(> .section-header:only-child) {
    margin-bottom: var(--sp-5);
  }

  /* Sentence case, not caps (2026-09-22), and a size up with it: an
     11px accent eyebrow in caps at 0.1em was the loudest quiet thing on
     the page, and it names sections a reader is meant to read. */
  .section-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-accent);
    letter-spacing: 0.02em;
    margin-bottom: var(--sp-1);
  }

  .section-title {
    font-family: var(--ff-product);
    font-weight: 600;
    font-size: var(--fs-2xl);
    line-height: var(--lh-tight);
    color: var(--c-text);
    letter-spacing: -0.02em;
  }

  .section-desc {
    color: var(--c-text-secondary);
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    max-width: 560px;
    margin-top: var(--sp-2);
  }

  /* ============================================================
     TOOL HUB SHELL
     The signed-in tool landing page: savebar (study picker), stat
     strip, sections with head + right link, run history, template
     grid, empty states. Six pages carried this as byte-identical
     .vh-* copies (visibility, brand, site-pulse, schema-audit,
     fanout, active-competitors); reputation-audit (.rh-) and /site
     (.ys-) are the same shape still to converge. The hero band and
     .card-actions parts are their own canon families.
     ============================================================ */
  .hub-wrap { max-width: 1100px; margin: 0 auto; font-family: var(--ff-product); letter-spacing: -0.02em; padding: var(--sp-4) 0; }
  .hub-savebar { background: var(--c-bg-raised); border: 1px solid var(--c-border-subtle); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; position: relative; z-index: 20; }
  .hub-savebar-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-text-tertiary); font-weight: var(--fw-semi); }
  .hub-savebar .custom-select { flex: 1; min-width: 240px; }
  .hub-active-chip { display: inline-flex; min-width: 0; }
  .hub-active-chip:empty { display: none; }
  .hub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
  .hub-stat { background: var(--c-bg-raised); border: 1px solid var(--c-border-subtle); border-radius: var(--r-lg); padding: var(--sp-4); }
  .hub-stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-tertiary); font-weight: var(--fw-semi); margin-bottom: 6px; }
  .hub-stat-value { font-family: var(--ff-mono); font-size: var(--fs-2xl); font-weight: var(--fw-semi); color: var(--c-text); line-height: 1; }
  .hub-stat-sub { font-size: var(--fs-xs); color: var(--c-text-tertiary); margin-top: 6px; }
  .hub-section { background: var(--c-bg-raised); border: 1px solid var(--c-border-subtle); border-radius: var(--r-lg); padding: var(--sp-5); margin-bottom: var(--sp-4); }
  .hub-section-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
  .hub-section-title { font-size: var(--fs-xs); font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-tertiary); margin: 0; display: flex; align-items: center; gap: var(--sp-2); }
  .hub-section-link { font-size: var(--fs-xs); color: var(--c-text-tertiary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: color var(--dur-fast) var(--ease-out); }
  .hub-section-link:hover { color: var(--c-text); }
  .hub-runs { display: flex; flex-direction: column; gap: var(--sp-2); }
  .hub-run { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--c-bg); border: 1px solid var(--c-border-subtle); border-radius: var(--r-md); text-decoration: none; color: inherit; transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
  .hub-run:hover { border-color: var(--c-border); transform: translateY(-1px); }
  .hub-run-name { font-weight: var(--fw-semi); color: var(--c-text); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hub-run-meta { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--c-text-tertiary); white-space: nowrap; }
  .hub-run-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--fw-semi); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--c-border-subtle); }
  .hub-run-status[data-s="completed"] { color: var(--c-green); border-color: var(--c-green); }
  .hub-run-status[data-s="running"] { color: var(--c-blue); border-color: var(--c-blue); }
  .hub-run-status[data-s="failed"] { color: var(--c-hot); border-color: var(--c-hot); }
  .hub-run-status[data-s="queued"] { color: var(--c-text-tertiary); }
  @media (max-width: 720px) {
    /* The 1fr name track computes to 0 beside three nowrap meta cells
       (content-tool fixup verifier, 2026-08-29): fold meta to a second
       row so the row title survives phone width on every hub. */
    .hub-run { grid-template-columns: 1fr auto; row-gap: var(--sp-1); }
    .hub-run > :nth-child(2) { grid-row: 2; grid-column: 1; justify-self: start; white-space: normal; }
    .hub-run > :nth-child(3) { grid-row: 2; grid-column: 2; justify-self: end; }
    .hub-run > :last-child { grid-row: 1; grid-column: 2; }
  }
  .hub-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-3); }
  .hub-tpl { border: 1px solid var(--c-border-subtle); border-radius: var(--r-md); padding: var(--sp-4); background: var(--c-bg); display: flex; flex-direction: column; gap: var(--sp-3); transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
  .hub-tpl:hover { border-color: var(--c-border); transform: translateY(-1px); }
  .hub-tpl-name { font-weight: var(--fw-semi); font-size: var(--fs-md); color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hub-tpl-meta { font-size: var(--fs-xs); color: var(--c-text-tertiary); display: flex; gap: var(--sp-3); flex-wrap: wrap; }
  .hub-tpl-meta span { display: inline-flex; align-items: center; gap: 4px; }
  /* Gradient tokens must exist: the old var(--c-bg-subtle) was defined nowhere,
     which invalidated the whole background - hub placeholders were invisible
     (found by the schema-audit sweep verifier, 2026-08-29). The keyframes live
     here too; they previously existed only in each hub page's style block. */
  .hub-skeleton { background: linear-gradient(90deg, var(--c-bg-sunken) 0%, var(--c-bg-hover) 50%, var(--c-bg-sunken) 100%); background-size: 200% 100%; animation: vhshimmer 1.4s infinite linear; border-radius: var(--r-sm); height: 14px; }
  @keyframes vhshimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
  .hub-empty { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--c-text-tertiary); }
  .hub-empty > i { font-size: 32px; display: block; margin-bottom: var(--sp-3); opacity: 0.6; }
  .hub-empty-title { color: var(--c-text); font-size: var(--fs-md); font-weight: var(--fw-semi); margin-bottom: var(--sp-2); }
  .hub-empty-cta { margin-top: var(--sp-3); }
  @media (max-width: 720px) {
    .hub-active-chip { display: none; }
  }

  /* ============================================================
     PIN TILE
     A pinned audit template on a dashboard. One size and one anatomy
     for every audit kind: kind eyebrow, template name, one number,
     one sparkline, one signal line, one foot. Eight kinds used to
     render eight different bodies in three sizes with a sunken chart
     well, so a grid of pins read as eight unrelated widgets rather
     than one row of comparable things; the per-kind detail lives on
     each audit's own report page, which is where the tile links.
     Rendered by static/js/pin-tiles.js.
     ============================================================ */
  .pin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Not auto: 1fr rows make every tile as tall as the tallest, so a
       long signal line on one pin cannot leave its neighbours short. */
    grid-auto-rows: 1fr;
    gap: var(--sp-4);
  }
  /* 4 above 1100, 2 at and below 900, 1 at and below 560. The 3-column
     band between them exists only so the drop is not 4 straight to 2. */
  @media (max-width: 1100px) { .pin-grid { grid-template-columns: repeat(3, 1fr); } }
  @media (max-width: 900px)  { .pin-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 560px)  { .pin-grid { grid-template-columns: 1fr; } }

  .pin {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    min-width: 0;
    text-decoration: none;
    color: inherit;
    transition: transform var(--dur-normal) var(--ease-out),
                box-shadow var(--dur-normal) var(--ease-out);
  }
  /* A tile is a card, so it lifts. Cards lift, rows warm, never both. */
  .pin:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .pin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
  }
  /* Sentence case, not caps: the kind is a name ("Site pulse"), and the
     mono face plus the tracking already says "chrome". */
  .pin-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.06em;
    color: var(--c-text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pin-eyebrow i { font-size: 13px; flex-shrink: 0; }

  .pin-controls { display: flex; align-items: center; gap: var(--sp-1); flex-shrink: 0; }
  .pin-controls button {
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: var(--r-sm);
    color: var(--c-text-tertiary);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
  }
  .pin-controls button:hover { background: var(--c-bg-hover); color: var(--c-text); }
  .pin-controls button i { font-size: 14px; }

  .pin-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    line-height: var(--lh-tight);
    color: var(--c-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pin-score { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }
  .pin-score-value {
    font-family: var(--ff-mono);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-semi);
    line-height: 1;
    color: var(--c-text);
  }
  /* The graded-band vocabulary, the same three words the score heatmap
     uses. Only a real 0-100 score gets banded; a count or a percentage
     stays plain text, because there is no good or bad to claim. */
  .pin-score-value.s-good { color: var(--c-green); }
  .pin-score-value.s-mid  { color: var(--c-amber); }
  .pin-score-value.s-bad  { color: var(--c-hot); }
  .pin-unit {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }
  .pin-delta {
    margin-left: auto;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--c-text-tertiary);
    white-space: nowrap;
  }
  .pin-delta--up   { color: var(--c-green); }
  .pin-delta--down { color: var(--c-hot); }
  .pin-delta--flat { color: var(--c-text-tertiary); }

  /* The sparkline sits straight on the card ground. A sunken well inside
     a raised card is the murky grey the grey rules hunt down, and the
     well was the loudest thing on the old tile. margin-top:auto pins the
     line to the bottom so every tile's chart shares one baseline
     whatever the signal above it wrapped to. The SVG is drawn with
     preserveAspectRatio="none" and stretched, so the stroke is
     non-scaling and the head marker is an HTML dot - an SVG circle
     ovals under a non-uniform scale. */
  .pin-spark {
    position: relative;
    height: 44px;
    margin-top: auto;
  }
  .pin-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
  .pin-spark-line {
    fill: none;
    stroke: var(--c-blue);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
  }
  .pin-spark-area { fill: var(--c-blue); opacity: 0.08; stroke: none; }
  .pin-spark-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: var(--r-pill);
    background: var(--c-blue);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  /* One line, one severity. Longer than the tile is a truncation, not a
     wrap - the headline in full is on the report the tile links to. */
  .pin-signal {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    font-size: var(--fs-xs);
    line-height: var(--lh-normal);
    color: var(--c-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pin-signal i { font-size: 13px; flex-shrink: 0; }
  .pin-signal span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pin-signal--ok   { color: var(--c-green); }
  .pin-signal--warn { color: var(--c-amber); }
  .pin-signal--crit { color: var(--c-hot); }

  .pin-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--c-border-subtle);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }
  .pin-foot-open {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--c-accent);
    font-weight: var(--fw-semi);
    white-space: nowrap;
  }
  .pin:hover .pin-foot-open { color: var(--c-accent-hover); }

  /* The "pin something" slot, inside the grid rather than instead of it,
     so an empty dashboard already shows the shape it is about to fill. */
  .pin--empty {
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    text-align: center;
    background: none;
    border-style: dashed;
    color: var(--c-text-tertiary);
  }
  .pin--empty:hover { transform: none; box-shadow: none; }
  .pin--empty > i { font-size: 24px; }
  .pin--empty p { margin: 0; max-width: 24ch; font-size: var(--fs-xs); line-height: var(--lh-normal); }

  /* A live-data pin has no frozen run to score, so a .tag--blue "Live"
     takes the score slot. Same chassis, same height, nothing else moves. */
  .pin--live .pin-score { align-items: center; }

  /* ── FAQ block ──
     LOAD-BEARING for SEO, not just styling: core/shared/schema_builder.py
     detects a page as FAQPage by counting class="faq-item" (needs ≥3)
     and extracts Q/A pairs from class="faq-item*" wrapping an element
     whose class is EXACTLY "faq-q" (div or button) plus one exactly
     "faq-a". <details class="faq-item"> with <summary class="faq-q">
     extracts via the details fallback. Page modifiers go on .faq-list
     or a wrapper - never extra classes on q/a. Renaming these classes
     silently deletes the page's FAQ rich-result markup (it happened:
     rolling-schema/enterprise/api-reference, caught 2026-08-27).
     Accordion by default - page JS toggles .is-open on .faq-item, or
     use native <details> and skip the JS. .faq-list--flat renders
     always-open (schema-generator). */
  .faq-list { max-width: 720px; margin: 0 auto; }
  .faq-item { border-bottom: 1px solid var(--c-border-subtle); }
  .faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    width: 100%;
    padding: var(--sp-4) 0;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--ff-product);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-text);
    cursor: pointer;
  }
  .faq-q:hover { color: var(--c-accent); }
  .faq-q i {
    font-size: var(--fs-sm);
    color: var(--c-text-tertiary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
  }
  .faq-item.is-open .faq-q i { transform: rotate(180deg); }
  .faq-a {
    max-height: 0;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--c-text-secondary);
    transition: max-height 0.3s ease;
  }
  .faq-a a { color: var(--c-accent); }
  .faq-item.is-open .faq-a { max-height: 480px; padding-bottom: var(--sp-4); }

  /* Native-details form - no JS, browser owns the toggle */
  details.faq-item > summary.faq-q { list-style: none; }
  details.faq-item > summary.faq-q::-webkit-details-marker { display: none; }
  details.faq-item[open] .faq-q i { transform: rotate(180deg); }
  details.faq-item .faq-a { max-height: none; overflow: visible; }
  details.faq-item[open] .faq-a { padding-bottom: var(--sp-4); }

  /* Always-open list - plain Q&A, no toggle affordance */
  .faq-list--flat .faq-item { padding: var(--sp-4) 0; }
  .faq-list--flat .faq-q { cursor: default; padding: 0; margin-bottom: var(--sp-2); }
  .faq-list--flat .faq-q:hover { color: var(--c-text); }
  .faq-list--flat .faq-a { max-height: none; overflow: visible; line-height: 1.6; }

  /* ── Pricing tier cards ──
     The marketing tier grid from /pricing, promoted whole: per-card
     accent via --tier-color/--tier-soft inline vars, --featured glow,
     badge, icon chip, features list. .tier-limit-* (the free-tier
     gates in tier-limit.js / free-tier-banner.js) is a different
     family - the shared word is coincidence, keep them apart. */
  .pricing-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); margin-bottom: var(--sp-10); align-items: stretch; }
  .tier-card { --tier-color: var(--c-accent); --tier-soft: var(--c-accent-soft); position: relative; background: var(--c-bg-raised); border: 1px solid var(--c-border-subtle); border-radius: var(--r-lg); padding: var(--sp-5); display: flex; flex-direction: column; transition: box-shadow 200ms ease, border-color 200ms ease, transform 200ms ease; }
  .tier-card::before { content: ''; position: absolute; top: 0; right: 0; width: 180px; height: 180px; background: radial-gradient(circle at top right, var(--tier-soft) 0%, transparent 65%); opacity: 0.6; pointer-events: none; z-index: 0; border-radius: 0 var(--r-lg) 0 0; transition: opacity 200ms ease; }
  .tier-card > * { position: relative; z-index: 1; }
  .tier-card:hover { box-shadow: 0 10px 24px -12px rgba(40,30,20,0.18); border-color: var(--tier-color); transform: translateY(-3px); }
  .tier-card:hover::before { opacity: 1; }
  .tier-card--featured { border-color: var(--tier-color); box-shadow: 0 0 0 1px var(--tier-color), 0 12px 32px -14px color-mix(in srgb, var(--tier-color) 28%, transparent); }
  .tier-card--featured::before { width: 220px; height: 220px; opacity: 1; }
  .tier-card--featured::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 0 3px var(--tier-soft); animation: tier-pulse 2.2s ease-in-out infinite; pointer-events: none; z-index: 0; }
  .tier-card-badge { position: absolute; top: -10px; right: var(--sp-4); background: var(--tier-color); color: var(--c-on-accent); font-size: var(--fs-xs); font-weight: var(--fw-semi); padding: 3px 11px; border-radius: var(--r-pill); letter-spacing: 0.04em; text-transform: uppercase; z-index: 2; }
  .tier-card-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--tier-soft); color: var(--tier-color); display: inline-flex; align-items: center; justify-content: center; margin-bottom: var(--sp-3); transition: transform 200ms ease; }
  .tier-card-icon i { font-size: 26px; line-height: 1; }
  .tier-card:hover .tier-card-icon { transform: scale(1.06) rotate(-2deg); }
  .tier-name { font-family: var(--ff-product); font-size: var(--fs-lg); font-weight: 700; color: var(--c-text); margin-bottom: var(--sp-1); letter-spacing: -0.02em; }
  .tier-price { font-family: var(--ff-mono); font-size: 2.4rem; font-weight: 700; color: var(--c-text); letter-spacing: -0.02em; line-height: 1; margin-bottom: var(--sp-1); display: flex; align-items: baseline; gap: var(--sp-2); }
  .tier-price-note { font-family: var(--ff-product); font-size: var(--fs-xs); color: var(--c-text-tertiary); font-weight: 400; letter-spacing: 0; }
  .tier-desc { font-size: var(--fs-sm); color: var(--c-text-secondary); line-height: var(--lh-relaxed); margin-bottom: var(--sp-4); }
  .tier-divider { height: 1px; background: var(--c-border-subtle); margin: var(--sp-3) 0; }
  .tier-section-label { font-family: var(--ff-mono); font-size: 10px; font-weight: var(--fw-semi); color: var(--c-text-tertiary); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: var(--sp-2); }
  .tier-features { list-style: none; padding: 0; margin: 0 0 var(--sp-4) 0; display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
  .tier-features li { font-size: var(--fs-sm); color: var(--c-text-secondary); display: flex; align-items: flex-start; gap: var(--sp-2); }
  .tier-features li i.feat-check { color: var(--c-green); flex-shrink: 0; margin-top: 2px; }
  .tier-features li i.feat-dash { color: var(--c-text-tertiary); flex-shrink: 0; margin-top: 2px; }
  .tier-cta { margin-top: auto; }
  .tier-cta .btn { width: 100%; text-align: center; justify-content: center; }
  @keyframes tier-pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 0.85; } }
  @media (prefers-reduced-motion: reduce) { .tier-card--featured::after { animation: none; opacity: 0.45; } }

  /* ── Feedback tick + share/copy identity ──
     An action that completes in place confirms in place: swap the icon
     for a green tick popped on --spring-pop, restore after ~1.5s
     (blTick/blCopy in /js/copy.js own the swap). No toast for something
     the user just watched succeed - the button is the feedback.
     .btn-share / .btn-copy mark THE share and copy affordances on any
     .btn variant: blue action icon, springy hover. */
  @keyframes tick-pop { from { transform: scale(0); } to { transform: scale(1); } }
  .tick-pop {
    color: var(--c-green);
    animation: tick-pop 0.3s var(--ease-out);
    animation: tick-pop var(--spring-pop-dur) var(--spring-pop);
  }
  /* On solid-ground buttons the tick stays white - green-on-terracotta
     is mud (owner annotation, 2026-08-29). */
  .btn--primary .tick-pop, .btn--green .tick-pop,
  .btn--amber .tick-pop, .btn--blue .tick-pop {
    color: var(--c-on-accent);
  }
  .btn-share i, .btn-copy i {
    color: var(--c-blue);
    transition: transform var(--dur-fast) var(--ease-out);
  }
  .btn-share:hover i, .btn-copy:hover i { transform: scale(1.15) translateY(-1px); }

  /* Signed-out holding block - what authGate() shows during the
     redirect probe. Never a destination, just a calm interstitial. */
  .auth-gate {
    max-width: 800px;
    margin: var(--sp-10) auto;
    text-align: center;
    color: var(--c-text-secondary);
  }

  /* ── Public share frame ──
     The chrome around a logged-out shared view. All 7 shared-* pages
     rebuilt the banner + CTA + a hand-maintained print selector list;
     now anything tagged .share-chrome vanishes in print, so adding an
     element can't silently survive into the PDF. */
  .share-banner {
    background: var(--c-amber-soft);
    border-bottom: 1px solid var(--c-amber);
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--c-text);
    text-align: center;
    font-family: var(--ff-product);
    letter-spacing: -0.02em;
  }
  .share-banner strong { color: var(--c-amber); }
  .share-banner a { color: var(--c-accent); text-decoration: underline; margin-left: 8px; }
  .share-cta {
    text-align: center;
    padding: var(--sp-6) 0;
    margin-top: var(--sp-5);
    border-top: 1px solid var(--c-border-subtle);
  }
  .share-cta p { color: var(--c-text-secondary); font-size: var(--fs-sm); margin: 0 0 var(--sp-3); }
  @media print {
    .share-chrome { display: none !important; }
  }

  /* Run-a-scan footer: New template left, Cancel + Run right. Seven
     "/new" pages carried this as byte-identical inline styles.
     (Never write the literal star-slash-new page glob in a CSS comment:
     the star-slash closes the comment early and the parser eats the next
     rule as a garbage selector - that silently killed .run-bar sitewide
     until a /reskin annotation caught the unstyled demo, 2026-08-29.) */
  .run-bar {
    margin-top: var(--sp-4);
    display: flex;
    gap: var(--sp-3);
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
  }
  .run-bar-actions {
    display: flex;
    gap: var(--sp-3);
  }

  /* Two-column report header: label/title/desc left, action cluster
     right. Six audit view pages rebuilt this split under their own
     prefix (.spv-/.sav-/.fv-header ...). */
  .section-header--split {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-4);
    flex-wrap: wrap;
    margin-bottom: var(--sp-5);
  }
  .section-actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
  }
  .section-desc--mono {
    font-family: var(--ff-mono);
    word-break: break-all;
  }

  /* ============================================================
     HERO BAND
     The tool-page intro band that 11 pages rebuilt as .vh-hero /
     .rh-hero / .fr-hero / .acr-hero. `.hero--george` reserves the
     bottom-right corner for the mascot (and is what the breakpoints
     collapse); without it the band is just the gradient panel.
     A page that wants a different ground adds its own modifier class
     next to .hero rather than redefining these.
     ============================================================ */
  .hero {
    /* Plain raised ground. The accent-to-blue corner wash that used to sit
       here read as a blue-to-red gradient across every audit hero and the
       dashboard; owner call (2026-08-30): just white. */
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-xl);
    padding: var(--sp-5) var(--sp-6);
    margin-bottom: var(--sp-4);
    overflow: hidden;
    position: relative;
  }
  .hero--george {
    padding-right: 224px;
    min-height: 226px;
  }
  .hero-body { min-width: 0; }
  .hero-george {
    position: absolute;
    right: var(--sp-6);
    /* Vertically centred, not floor-anchored (owner call, 2026-08-30). He sat
       on `bottom: 0`, which left 46px of dead space above him on a
       min-height hero and read as him having sunk to the bottom of the card.

       Centring rather than a fixed lift because the assets are two heights:
       32 of the 35 are square (180px tall at this width) but three render
       225px (george-signpost is the one used in a .hero-george, on /surface).
       Any fixed `bottom` that centres the square ones pushes the tall one
       through the top of a 226px hero, and .hero has overflow:hidden, so it
       would crop his hat. translateY(-50%) is height-agnostic. */
    top: 50%;
    transform: translateY(-50%);
    width: 180px;
    /* The compiler stamps intrinsic width/height attributes on local
       <img>s; without this the height attribute wins over the scaled
       width and stretches George 7x (review-b1 D2). */
    height: auto;
    pointer-events: none;
  }
  .hero-title {
    font-family: var(--ff-product);
    font-size: clamp(1.75rem, 3.2vw, 2.4rem);
    font-weight: var(--fw-semi);
    letter-spacing: -0.03em;
    color: var(--c-text);
    margin: 0;
    line-height: 1.05;
  }
  .hero-sub {
    margin-top: 10px;
    color: var(--c-text-secondary);
    font-size: var(--fs-md);
    line-height: 1.45;
    max-width: 580px;
  }
  .hero-cta {
    display: flex;
    gap: var(--sp-2);
    margin-top: var(--sp-4);
    flex-wrap: wrap;
  }
  @media (max-width: 900px) {
    .hero--george { padding-right: 184px; min-height: 190px; }
    .hero-george { width: 144px; }
    .hero-sub { max-width: none; }
  }
  @media (max-width: 600px) {
    .hero--george { padding-right: var(--sp-6); min-height: 0; }
    .hero-george { display: none; }
  }

  /* ============================================================
     COLOUR PALETTE
     ============================================================ */
  .palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--sp-3);
  }

  .swatch {
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--c-border-subtle);
    background: var(--c-bg-raised);
    transition: transform var(--dur-normal) var(--ease-out),
                box-shadow var(--dur-normal) var(--ease-out);
  }
  .swatch:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .swatch-color {
    height: 72px;
    position: relative;
  }

  .swatch-info {
    padding: var(--sp-2) var(--sp-3);
  }

  .swatch-name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--c-text);
    margin-bottom: 2px;
  }

  .swatch-hex {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }

  /* ============================================================
     TYPOGRAPHY SPECIMENS
     ============================================================ */
  .type-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
  }

  .type-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    align-items: baseline;
    gap: var(--sp-4);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--c-border-subtle);
  }

  .type-label {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    flex-shrink: 0;
  }

  .type-specimen {
    color: var(--c-text);
    letter-spacing: -0.01em;
  }

  /* ============================================================
     SPACING VISUALISER
     ============================================================ */
  .spacing-row {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    margin-bottom: var(--sp-2);
  }

  .spacing-bar {
    height: 28px;
    background: var(--c-accent-soft);
    border-left: 3px solid var(--c-accent);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    transition: width var(--dur-slow) var(--ease-out);
  }

  .spacing-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 120px;
    flex-shrink: 0;
  }

  .spacing-token {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    min-width: 50px;
  }

  .spacing-value {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-secondary);
    background: var(--c-bg-sunken);
    padding: 2px 6px;
    border-radius: var(--r-sm);
  }

  /* ============================================================
     ICONS SHOWCASE
     ============================================================ */
  .icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--sp-3);
  }

  .icon-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-2);
    border-radius: var(--r-lg);
    border: 1px solid transparent;
    cursor: default;
    transition: all var(--dur-normal) var(--ease-out);
  }
  .icon-tile:hover {
    background: var(--c-bg-raised);
    border-color: var(--c-border);
    box-shadow: var(--shadow-sm);
  }

  .icon-tile i {
    font-size: 24px;
    color: var(--c-text);
    transition: color var(--dur-fast) var(--ease-out);
  }
  .icon-tile:hover i {
    color: var(--c-accent);
  }

  .icon-tile span {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    font-family: var(--ff-mono);
    text-align: center;
  }

  .icon-weights {
    display: flex;
    gap: var(--sp-6);
    align-items: center;
    padding: var(--sp-4);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    margin-bottom: var(--sp-5);
  }

  .icon-weight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
  }

  .icon-weight-item i {
    font-size: 28px;
    color: var(--c-text);
  }

  .icon-weight-item span {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }

  /* ============================================================
     LOADING BARS
     ============================================================ */
  .loaders-grid {
    display: flex;
    flex-direction: column;
    gap: var(--sp-6);
  }

  .loader-demo {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .loader-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--c-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }

  .loader-label i {
    font-size: 16px;
    color: var(--c-text-tertiary);
  }

  /* Determinate progress bar */
  .progress-track {
    height: 10px;
    background: var(--c-border);
    border-radius: var(--r-pill);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-inset);
  }

  .progress-fill {
    height: 100%;
    border-radius: var(--r-pill);
    background: var(--c-accent);
    position: relative;
    transition: width 1.2s var(--ease-out);
  }

  /* Complete state - no pulse */
  .progress-fill--complete::after {
    display: none;
  }

  .progress-fill--blue  { background: var(--c-blue); }
  .progress-fill--green { background: var(--c-green); }
  .progress-fill--amber { background: var(--c-amber); }

  /* Slim audit bar - the 8px in-flight scan bar that 13 report/shared
     pages rebuilt as .fv-/.sav-/.avv-progress. Fast transition on
     purpose: polling updates land every few seconds and the slow canon
     ease made the bar permanently behind. Pair with
     .progress-fill--blue. */
  .progress-track--slim {
    height: 8px;
    background: var(--c-border-subtle);
    box-shadow: none;
    margin-top: var(--sp-3);
  }
  .progress-track--slim .progress-fill { transition: width 200ms ease; }

  /* Spinner + live step label above the bar */
  .progress-head {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }

  /* Indeterminate shimmer */
  .progress-shimmer .progress-fill {
    width: 35% !important;
    animation: shimmer 2s var(--ease-in-out) infinite;
  }
  @keyframes shimmer {
    0%   { transform: translateX(-140%); }
    100% { transform: translateX(380%); }
  }

  /* Header row: label left, percentage right, same line */
  .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
  }

  .progress-status {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    letter-spacing: 0.02em;
    margin-top: 6px;
  }

  .progress-pct {
    font-family: var(--ff-mono);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    letter-spacing: -0.01em;
  }

  /* ── Page-transition fades ──
     Body fades in on every load; outgoing nav adds `.is-leaving` to
     fade out before window.location changes (intercept lives in the
     shell.html inline script). Auth-gated containers (#gs-app,
     #geo-app, #content, etc.) CSS-animate in when their hidden /
     display:none is removed, so the auth-check delay becomes a
     smooth reveal instead of a snap. */
  body {
    animation: page-in 260ms var(--ease-out) both;
  }
  body.is-leaving {
    animation: page-out 140ms var(--ease-in) both;
  }
  @keyframes page-in {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes page-out {
    from { opacity: 1; }
    to   { opacity: 0; }
  }

  /* Cross-document View Transitions. Free progressive enhancement: browsers
     without support ignore all of this and keep the fades above. Where it IS
     supported, shell.html stamps html.vt-native and the hand-rolled body fade
     + leave-delay stand down - otherwise every navigation double-fades and
     pays the 140ms JS delay on top of the native transition. Chrome (topbar,
     sidebar) is named so it holds still while the page body crossfades; names
     must be unique per document, and there is exactly one of each. */
  @view-transition { navigation: auto; }
  /* `navigation: auto` covers SCRIPT-initiated navigations too, not only
     link clicks. Every auth gate on the site redirects ~110-190ms after the
     page lands, which is INSIDE this 260ms wipe - so a logged-out visitor
     clicking a gated page saw two overlapping sweeps ("two swipe flickers",
     2026-08-30). The fix is not here: an involuntary redirect calls
     `blRedirectSilently()` (static/js/api.js), which appends
     `@view-transition { navigation: none; }` to the outgoing document before
     replacing the location, opting that one navigation out. Suppressing the
     wipe for redirects from THIS file is not possible - a stylesheet cannot
     tell a redirect from a click. See static/CLAUDE.md. */
  html.vt-native body { animation: none; }
  html.vt-native body.is-leaving { animation: none; }
  .topbar  { view-transition-name: bl-topbar; }
  .sidebar { view-transition-name: bl-sidebar; }
  /* ── Page transition: the UA crossfade (owner call, 2026-08-30) ──
     The curtain wipe that lived here from 2026-08-29 is gone. It was a
     staging experiment and it did not earn its keep: nine commits of repair
     (chrome pinning, topbar hydration, admin-chrome cache, prerender hold,
     drawer-close-before-navigate, arrive-settled, redirect opt-out) and the
     last of them only RECORDED a remaining defect rather than fixing it.

     The deciding argument is that it covered nothing. `pagereveal` in
     shell.html pre-reveals above-fold content before first paint and the hubs
     already ship skeletons at first paint, so the page is finished before any
     transition crosses it. And a sidebar click already slides the drawer shut
     for 360ms before navigating (nav.html) - a motivated gesture the visitor
     caused. The wipe was a second, unmotivated 260ms stacked on top of it.

     The UA default is a CROSSFADE, which the owner also rejected (2026-08-30).
     What runs now is a sequential fade: the old page fades out to the page
     background, then the new one fades in. Serial, not overlapped - that
     midpoint frame of bare `--c-bg` is the effect, not a gap in it.

     `mix-blend-mode: normal` is correct HERE and wrong for a crossfade, so do
     not carry this pairing across if the transition ever changes again. The UA
     default plus-lighter is right when two half-opaque layers sum to one, which
     is what a crossfade is. These two layers never overlap - `both` fill plus a
     delay means exactly one is painting at any moment - so plus-lighter would
     only mis-composite each layer against the backdrop.

     Timings are asymmetric on purpose and both live here: leaving is quick
     (100ms, --ease-in, exits never spring), arriving is gentler (140ms,
     --ease-out). 240ms total, which is the whole added latency of a
     navigation - the page itself is already loaded when this plays, so treat
     any increase as a direct cost to how fast the site feels.

     What is KEPT below is not curtain-specific and cost real debugging:
     the page background on ::view-transition (so no frame composites on UA
     white) and the pinned chrome groups (a plus-lighter crossfade of two
     near-identical translucent topbar snapshots reads as shimmer).

     `:not(.vt-theme)` stays load-bearing: these pseudo-elements belong to the
     root for EVERY view transition, so without it the same-document theme
     toggle would be pinned by the chrome rules too. */
  html.vt-native::view-transition { background: var(--c-bg); }
  html.vt-native:not(.vt-theme)::view-transition-group(bl-topbar),
  html.vt-native:not(.vt-theme)::view-transition-group(bl-sidebar) { animation: none; }
  html.vt-native:not(.vt-theme)::view-transition-image-pair(bl-topbar),
  html.vt-native:not(.vt-theme)::view-transition-image-pair(bl-sidebar) { isolation: auto; }
  html.vt-native:not(.vt-theme)::view-transition-old(bl-topbar),
  html.vt-native:not(.vt-theme)::view-transition-old(bl-sidebar) { animation: none; opacity: 0; }
  html.vt-native:not(.vt-theme)::view-transition-new(bl-topbar),
  html.vt-native:not(.vt-theme)::view-transition-new(bl-sidebar) { animation: none; opacity: 1; mix-blend-mode: normal; }
  html.vt-native:not(.vt-theme)::view-transition-old(root) {
    mix-blend-mode: normal;
    animation: bl-page-out 100ms var(--ease-in) both;
  }
  html.vt-native:not(.vt-theme)::view-transition-new(root) {
    mix-blend-mode: normal;
    animation: bl-page-in 140ms var(--ease-out) 100ms both;
  }
  @keyframes bl-page-out { to   { opacity: 0; } }
  @keyframes bl-page-in  { from { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) {
    /* Instant, not a crossfade - navigation: none skips the transition
       entirely; the animation reset is belt-and-braces for engines that
       honour the pseudo-elements anyway. */
    @view-transition { navigation: none; }
    html.vt-native::view-transition-old(root),
    html.vt-native::view-transition-new(root),
    html.vt-native::view-transition-group(bl-topbar),
    html.vt-native::view-transition-group(bl-sidebar) { animation: none; }
  }

  /* ── Theme flip as a same-document View Transition ──
     STAGING EXPERIMENT (2026-08-29, owner ask). toggleTheme() in
     core/templates/nav.html (and its 12 locale twins) wraps the data-theme
     flip in document.startViewTransition(), so light/dark crossfades as one
     image instead of every element re-tinting on its own clock.

     `.vt-theme` is on <html> only while that transition runs. It does two
     jobs, and the second is the one that makes it look clean:

     1. It excludes this transition from the curtain wipe above.
     2. It stands the per-property colour transitions down. `body` (and a
        long tail of components) transitions background/color over
        --dur-slow. A view transition crossfades a snapshot of the OLD state
        into a live view of the NEW one - so if those 400ms colour
        transitions also ran, the "new" side would itself be mid-tint for the
        whole crossfade and the result reads muddy, a fade into a fade. The
        crossfade IS the theme animation now, so the per-property ones yield.
        This is the same trade already made one block up, where
        `html.vt-native body` drops the hand-rolled page fade once the native
        transition takes over.

     Colours land instantly underneath the crossfade, so nothing jumps when
     the class comes off. Duration stays --dur-slow to match the 400ms the
     theme change has always taken. Reduced motion never reaches this: the
     toggle checks the query and flips directly, keeping today's behaviour. */
  html.vt-theme::view-transition-old(root),
  html.vt-theme::view-transition-new(root) {
    animation-duration: var(--dur-slow);
    animation-timing-function: var(--ease-out);
  }
  html.vt-theme *,
  html.vt-theme *::before,
  html.vt-theme *::after {
    transition: none !important;
  }

  /* Tab-bar SPA swap: fade .shell during innerHTML replacement so the
     footer (rendered first by the new tree) doesn't appear on its own
     against a white viewport while the new content is still laying out. */
  .shell {
    transition: opacity 140ms var(--ease-out);
  }
  .shell.is-leaving {
    opacity: 0;
  }
  @media (prefers-reduced-motion: reduce) {
    .shell { transition: none; }
    .shell.is-leaving { opacity: 1; }
  }

  /* Global disabled-state easing - opacity flips smoothly so save
     buttons that toggle between idle/ready don't snap. */
  .btn:disabled,
  .btn[disabled],
  .input:disabled,
  .select:disabled,
  .textarea:disabled,
  input:disabled,
  select:disabled,
  textarea:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .input, .select, .textarea, input, select, textarea {
    transition: opacity var(--dur-normal) var(--ease-out),
                background-color var(--dur-normal) var(--ease-out),
                border-color var(--dur-normal) var(--ease-out);
  }

  /* Auth-gated containers: CSS animations re-fire when display flips
     from none → block, so this gives both the initial paint and the
     post-auth reveal a soft fade-up rather than a snap. */
  #gs-app:not([hidden]),
  #geo-app,
  #content,
  #auth-gate,
  #subContent,
  .gs-wrap,
  .gen-wrap {
    animation: gated-in 240ms var(--ease-out) both;
  }
  @keyframes gated-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    body, body.is-leaving,
    #gs-app, #geo-app, #content, #auth-gate, #subContent,
    .gs-wrap, .gen-wrap {
      animation: none;
    }
  }

  /* Skeleton loader */
  .skeleton {
    background: var(--c-bg-sunken);
    border-radius: var(--r-md);
    position: relative;
    overflow: hidden;
    /* The sweep highlight, as one knob. Light mode lifts to the raised
       surface; dark mode needs a brighter target because raised (#1e1d1b)
       sits only ~16 levels above sunken (#0e0e0d) and the sweep reads as
       nothing on a large card. */
    --skeleton-hi: var(--c-bg-raised);
  }
  [data-theme="dark"] .skeleton { --skeleton-hi: var(--c-bg-hover); }
  .skeleton::after {
    content: '';
    position: absolute;
    /* Wider than the box on both sides so the diagonal highlight enters and
       leaves as a soft band instead of clipping to a hard vertical edge. */
    inset: 0 -25%;
    /* Light sweep, not dark: the highlight has to read against the sunken
       base on the warm paper background (owner call, /reskin annotation
       2026-08-26 - the motion.dev shimmer look, no JS needed).
       Upgraded 2026-08-29 to motion.dev's react-skeleton-shimmer feel: a
       wider, softer, slightly diagonal band with feathered shoulders rather
       than one hard midpoint stop. */
    background: linear-gradient(
      105deg,
      transparent 0%,
      color-mix(in srgb, var(--skeleton-hi) 40%, transparent) 32%,
      var(--skeleton-hi) 50%,
      color-mix(in srgb, var(--skeleton-hi) 40%, transparent) 68%,
      transparent 100%
    );
    animation: skeleton-sweep 2s linear infinite;
  }
  /* Cadence, not just speed: the band eases across for the first 65% of the
     cycle, then rests off-screen. A constant-velocity loop pulses at the
     seam; the rest beat is what makes it read as breathing. The easing lives
     on the keyframe, so the rest segment stays genuinely still. */
  @keyframes skeleton-sweep {
    0%   { transform: translateX(-90%); animation-timing-function: var(--ease-in-out); }
    65%  { transform: translateX(90%); }
    100% { transform: translateX(90%); }
  }
  @media (prefers-reduced-motion: reduce) {
    /* No guard existed before 2026-08-29 - the sweep ran regardless. Drop
       the band entirely rather than slowing it: the sunken block already
       says "pending" by its shape, which is the whole information. */
    .skeleton::after { display: none; }
  }

  .skeleton-card {
    padding: var(--sp-5);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    background: var(--c-bg-raised);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
  }

  .skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--r-pill);
  }

  .skeleton-line {
    height: 12px;
  }
  /* Adjacent lines breathe - a skeleton mirrors the eventual layout, and
     real text has line spacing (owner call, /reskin annotation 2026-08-26). */
  .skeleton-line + .skeleton-line { margin-top: var(--sp-2); }
  .skeleton-line--short { width: 60%; }
  .skeleton-line--med   { width: 85%; }
  .skeleton-line--full  { width: 100%; }

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

  /* Spinner */
  .spinner {
    display: inline-block;
    vertical-align: middle;
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--c-border);
    border-top-color: var(--c-accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
  }
  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  .spinner--sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }

  .spinner--lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
  }

  /* The Phosphor "spinner" / "spinner-gap" / "circle-notch" icons are
     loading affordances by name, but the font glyph itself doesn't
     spin - it just sits there looking sad. Auto-animate them so any
     `<i class="ph ph-spinner">` actually rotates. Opt out with .no-spin. */
  .ph-spinner:not(.no-spin),
  .ph-spinner-gap:not(.no-spin),
  .ph-circle-notch:not(.no-spin) {
    display: inline-block;
    animation: spin 0.8s linear infinite;
  }


  /* Pulse dot */
  .pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c-green);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-green) 40%, transparent);
    animation: pulse-ring 2s var(--ease-out) infinite;
  }
  @keyframes pulse-ring {
    0%       { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-green) 40%, transparent); }
    70%      { box-shadow: 0 0 0 8px transparent; }
    100%     { box-shadow: 0 0 0 0 transparent; }
  }

  .loader-inline {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
  }

  /* ============================================================
     COMPONENT DEMOS
     ============================================================ */
  .component-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-3);
    align-items: center;
  }

  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    border-radius: var(--r-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--dur-normal) var(--ease-out);
    text-decoration: none;
    line-height: 1.4;
  }
  .btn i { font-size: 16px; }

  .btn--primary {
    background: var(--c-accent);
    color: var(--c-on-accent);
    border-color: var(--c-accent);
  }
  .btn--primary:hover {
    background: var(--c-accent-hover);
    border-color: var(--c-accent-hover);
    box-shadow: var(--shadow-sm);
  }
  .btn--primary:active {
    transform: scale(0.97);
    box-shadow: none;
    background: color-mix(in srgb, var(--c-accent-hover) 85%, black);
  }

  .btn--secondary {
    background: var(--c-bg-raised);
    color: var(--c-text);
    border-color: var(--c-border);
  }
  .btn--secondary:hover {
    background: var(--c-bg-hover);
    border-color: var(--c-text-tertiary);
  }
  .btn--secondary:active {
    transform: scale(0.97);
    background: var(--c-bg-sunken);
  }

  .btn--ghost {
    /* A whisper of tone so the button reads as a button against the page
       (owner call, /reskin annotation 2026-08-26). currentColor keeps it
       working on both themes; the plain line is the no-color-mix fallback. */
    background: var(--c-bg-sunken);
    background: color-mix(in srgb, currentColor 6%, transparent);
    color: var(--c-text-secondary);
    border-color: transparent;
  }
  .btn--ghost:hover {
    background: var(--c-bg-hover);
    color: var(--c-text);
  }
  .btn--ghost:active {
    transform: scale(0.97);
    background: var(--c-border);
  }

  /* Tone buttons - solid accent ground, white text, the .btn--primary
     pattern in the other semantic colours (green = confirm/success,
     amber = caution, blue = informational; same jobs as the tags).
     Solid, not soft: the soft version read as washed-out next to the
     colour section (owner call, /reskin annotation 2026-08-27), and the
     site's own coloured buttons (save-btn--ready on /admin/editor) are
     solid. Colour is meaning: a tone button states what the action will
     do, it is not decoration. Destructive stays .btn--primary - terracotta
     is the product's "hot" colour and red is not in the palette. */
  .btn--green { background: var(--c-green); color: var(--c-on-accent); border-color: var(--c-green); }
  .btn--amber { background: var(--c-amber); color: var(--c-on-accent); border-color: var(--c-amber); }
  .btn--blue  { background: var(--c-blue);  color: var(--c-on-accent);  border-color: var(--c-blue); }
  .btn--green:hover { background: color-mix(in srgb, var(--c-green) 88%, black); box-shadow: var(--shadow-sm); }
  .btn--amber:hover { background: color-mix(in srgb, var(--c-amber) 88%, black); box-shadow: var(--shadow-sm); }
  .btn--blue:hover  { background: color-mix(in srgb, var(--c-blue) 88%, black);  box-shadow: var(--shadow-sm); }
  .btn--green:active, .btn--amber:active, .btn--blue:active { transform: scale(0.97); box-shadow: none; }

  /* Hold-to-confirm - the destructive affordance (owner ask via /reskin
     annotations, 2026-08-28, after motion.dev's hold-to-confirm). A click
     is too cheap for "delete study": the button arms on press-and-hold -
     a fill sweeps the ground at constant speed for --hold-dur, releasing
     early snaps it back, completing fires the action. Wire with blHold()
     from /js/hold.js (it owns pointer + keyboard paths - never hand-roll
     the timer). Pairs with the dissolve: complete → act → .is-removing
     on the row. The fill is linear on purpose: it is a progress readout,
     not a transition. */
  .btn--hold { position: relative; overflow: hidden; isolation: isolate; --hold-dur: 900ms; }
  .btn--hold::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background: var(--c-hot-soft);
    background: color-mix(in srgb, var(--c-hot) 18%, transparent);
    transform: scaleX(0); transform-origin: left center;
    transition: transform 160ms var(--ease-out);
  }
  .btn--primary.btn--hold::before { background: rgba(0, 0, 0, 0.22); }
  .btn--hold.is-holding { transform: scale(0.97); }
  .btn--hold.is-holding::before {
    transform: scaleX(1);
    transition: transform var(--hold-dur) linear;
  }

  .btn--sm {
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-xs);
  }

  /* Even smaller - table-row actions, dense admin grids, inline chips. */
  .btn--xs {
    padding: 2px 8px;
    font-size: 0.72rem;
    gap: 4px;
    border-radius: var(--r-sm);
  }
  .btn--xs i { font-size: 0.85em; }

  /* Hero CTA - the "important button". Use for primary purchase and
     contact actions that anchor a section. Two-line label (action +
     price/meta) and a sliding arrow. */
  .btn--hero {
    padding: var(--sp-3) var(--sp-5);
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
    background: var(--c-accent);
    color: var(--c-on-accent);
    border: none;
    gap: var(--sp-3);
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--c-accent) 60%, transparent);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 200ms ease,
                background 150ms ease;
  }
  .btn--hero::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 600ms ease;
    pointer-events: none;
  }
  .btn--hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--c-accent) 70%, transparent);
    background: color-mix(in srgb, var(--c-accent) 92%, black);
    color: var(--c-on-accent);
  }
  .btn--hero:hover::before { left: 100%; }
  .btn--hero:hover .btn__arrow { transform: translateX(4px); }
  .btn--hero:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--c-accent) 55%, transparent);
  }

  /* Two-line label: action on top, small uppercase sub below */
  .btn__label {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    gap: 1px;
  }
  /* Sentence case, not caps (2026-09-22): the sub line is a sentence
     ("Starts at EUR 79 a month"), not a status word. */
  .btn__sub {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    opacity: 0.85;
    letter-spacing: 0.02em;
  }
  .btn__arrow {
    font-size: 20px;
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Toggle switch */
  .toggle-wrap {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
  }

  .toggle {
    position: relative;
    width: 40px;
    height: 22px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--c-border);
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: background var(--dur-normal) var(--ease-out);
    border: none;
    outline: none;
    flex-shrink: 0;
  }

  .toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--c-bg-raised);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform var(--dur-normal) var(--ease-out);
  }

  .toggle:checked {
    background: var(--c-accent);
  }

  .toggle:checked::after {
    transform: translateX(18px);
  }

  .toggle:focus-visible {
    box-shadow: 0 0 0 3px var(--c-accent-soft);
  }

  .toggle-label {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    cursor: pointer;
    user-select: none;
  }

  /* Tags / Badges */
  .tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--r-pill);
    line-height: 1.4;
    /* Relief: a hairline in the tag's own colour lifts it off flat cards
       (owner call, /reskin annotation 2026-08-26). Inset shadow, not border,
       so the box size doesn't shift; no-ops where color-mix is missing. */
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent);
  }

  /* Ground at 14% and text mixed toward --c-text: the raw 8% soft +
     raw accent read as DRAB at xs size (owner annotation, 2026-08-29).
     First line of each pair is the no-color-mix fallback. */
  .tag--accent  { background: var(--c-accent-soft); color: var(--c-accent);
                  background: color-mix(in srgb, var(--c-accent) 14%, transparent);
                  color: color-mix(in srgb, var(--c-accent), var(--c-text) 30%); }
  .tag--blue    { background: var(--c-blue-soft);   color: var(--c-blue);
                  background: color-mix(in srgb, var(--c-blue) 14%, transparent);
                  color: color-mix(in srgb, var(--c-blue), var(--c-text) 30%); }
  .tag--green   { background: var(--c-green-soft);  color: var(--c-green);
                  background: color-mix(in srgb, var(--c-green) 14%, transparent);
                  color: color-mix(in srgb, var(--c-green), var(--c-text) 30%); }
  .tag--amber   { background: var(--c-amber-soft);  color: var(--c-amber);
                  background: color-mix(in srgb, var(--c-amber) 14%, transparent);
                  color: color-mix(in srgb, var(--c-amber), var(--c-text) 30%); }
  .tag--neutral {
    background: var(--c-bg-sunken);
    color: var(--c-text-secondary);
  }

  /* State tags - the pass/warn/fail verdict pill that 12 report/template
     pages each rebuilt under their own prefix (spr-, acr-, fr-, avo-, ...).
     The verdict typography (uppercase micro label) comes with the state,
     so `tag tag--pass` is the whole spelling. Most page copies referenced
     a --c-yellow token that never existed and silently rendered fallback
     hex; warn is amber here. Text is mixed toward --c-text because the
     raw accent tokens sit under AA at this size - in dark mode the same
     mix brightens them, which is the direction contrast needs there too.
     The pre-mix line is the no-color-mix fallback. */
  .tag--pass, .tag--warn, .tag--fail {
    font-size: 10px;
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
  }
  .tag--pass {
    background: var(--c-green-soft);
    color: var(--c-green);
    color: color-mix(in srgb, var(--c-green), var(--c-text) 30%);
  }
  .tag--warn {
    background: var(--c-amber-soft);
    color: var(--c-amber);
    color: color-mix(in srgb, var(--c-amber), var(--c-text) 42%);
  }
  .tag--fail {
    background: var(--c-hot-soft);
    color: var(--c-hot);
    color: color-mix(in srgb, var(--c-hot), var(--c-text) 32%);
  }

  /* Mono chip - a mono-face tag for machine words (domains, markets,
     model ids). The shape .ys-domain / .acs-market / .ace-pill and the
     /reskin AI chip all reach for. */
  .tag--mono {
    font-family: var(--ff-mono);
    background: var(--c-bg-sunken);
    color: var(--c-text-secondary);
  }

  /* ── Measurement grades ──
     Every number we publish answers three separate questions, and a grade
     chip states the answer beside it: breadth (did we look everywhere),
     depth (is the number stable), fidelity (was it the real surface). The
     vocabulary is owned by core/shared/sampling.py - never hardcode the
     label strings, they arrive in the payload.

     A chip is a tier badge then the label: "T4 Measured*". The tier is the
     grade's 1-5 strength and the chip takes that step of one red-to-green
     ramp, so three chips read as three comparable numbers at a glance (owner
     call, 2026-09-22, replacing the old icon + "4/5" + meaning-tone chip).
     The ramp is built only from the accent, amber and green tokens, mixed
     for the two in-between steps, and the text is pulled toward --c-text so
     it holds contrast on both themes:

       .grade--t1  accent (red)          .grade--t4  amber + green
       .grade--t2  accent + amber        .grade--t5  green
       .grade--t3  amber

     A grade with NO strength (Unknown breadth) carries no tier class and no
     badge, and stays the neutral default: the absence of a measurement is
     not the bottom of the ramp. Render with blGradeChip() (sampler.js),
     never by hand in page JS.

     Geometry is the .tag geometry on purpose, so a grade and a tag in one
     row share a height without either being stretched. */
  .grade {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    line-height: 1.4;
    border-radius: var(--r-pill);
    background: var(--c-bg-sunken);
    color: var(--c-text-secondary);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent);
    white-space: nowrap;
  }

  /* The tier badge, where the axis icon used to sit. Mono so T1..T5 line up
     down a ladder; tinted from the chip's own colour so it needs no rule of
     its own per tier. */
  .grade-tier {
    font-family: var(--ff-mono);
    font-size: 10px;
    font-weight: var(--fw-semi);
    line-height: 1.3;
    padding: 0 4px;
    margin-left: -4px;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, currentColor 16%, transparent);
  }

  .grade--t1 { --grade-c: var(--c-hot); }
  .grade--t2 { --grade-c: color-mix(in srgb, var(--c-hot), var(--c-amber)); }
  .grade--t3 { --grade-c: var(--c-amber); }
  .grade--t4 { --grade-c: color-mix(in srgb, var(--c-amber), var(--c-green)); }
  .grade--t5 { --grade-c: var(--c-green); }
  .grade--t1, .grade--t2, .grade--t3, .grade--t4, .grade--t5 {
    background: color-mix(in srgb, var(--grade-c) 14%, transparent);
    color: color-mix(in srgb, var(--grade-c), var(--c-text) 46%);
  }

  /* The three axes together. Wraps rather than scrolls - it sits under a
     headline number on narrow screens and a horizontal scroller there hides
     the very disclosure it exists to make. */
  .grade-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }

  /* One sentence under the row, for the blurb that explains a grade in
     plain words. Tertiary because it is read once and then ignored by
     anybody who already knows what "Saturated" means. */
  .grade-note {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    line-height: 1.5;
  }

  /* ── Chips ──
     Bordered pill on sunken ground, an icon slot first. Two jobs that
     five fanout/ai-vision pages rebuilt: a read-only platform status
     chip (state classes tint it), and - inside .chip-group--multi - a
     toggleable multi-select, deliberately distinct from the
     single-select .seg track. JS toggles .is-on per chip. */
  .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: var(--c-bg-sunken);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-pill);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--c-text-secondary);
  }
  .chip i { font-size: 14px; }
  .chip.is-ok i { color: var(--c-green); }
  .chip.is-warn {
    background: var(--c-amber-soft);
    border-color: var(--c-amber-soft);
    color: var(--c-text);
  }
  .chip.is-warn i { color: var(--c-amber); }
  .chip.is-bad { color: var(--c-hot); }
  .chip.is-good { color: var(--c-green); }

  .chip-group {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
  }
  .chip-group--multi .chip {
    cursor: pointer;
    user-select: none;
    transition: all var(--dur-fast) var(--ease-out);
  }
  .chip-group--multi .chip.is-on {
    background: var(--c-blue-soft);
    border-color: var(--c-blue);
    color: var(--c-blue);
  }

  /* Card action footer - the edit/run/ghost row that closes a template
     card, rebuilt 11 ways (.spt-/.avt-/.fot-card-actions,
     .vh-tpl-actions, ...). margin-top:auto pins it to the card bottom
     in a flex-column card. Primary/secondary stretch; ghosts stay
     natural width. */
  .card-actions {
    display: flex;
    gap: var(--sp-2);
    margin-top: auto;
    padding-top: var(--sp-3);
    border-top: 1px solid var(--c-border-subtle);
    flex-wrap: wrap;
  }
  .card-actions .btn { flex: 1; justify-content: center; }
  .card-actions .btn--ghost { flex: 0 0 auto; }

  /* Input */
  .input {
    padding: var(--sp-2) var(--sp-3);
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    color: var(--c-text);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color var(--dur-normal) var(--ease-out),
                box-shadow var(--dur-normal) var(--ease-out);
    width: 240px;
    max-width: 100%;
    box-sizing: border-box;
  }
  .input::placeholder { color: var(--c-text-tertiary); }
  .input:hover:not(:focus):not(:disabled) {
    border-color: color-mix(in srgb, var(--c-border), var(--c-text) 18%);
  }
  .input:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
  }
  .input:disabled {
    background: var(--c-bg-sunken);
    /* secondary, not tertiary: tertiary on the sunken fill is the exact
       placeholder colour, so a disabled VALUE read as hint text */
    color: var(--c-text-secondary);
    cursor: not-allowed;
    /* the global disabled rule adds opacity:.55 on top of the tertiary
       text - both landing takes contrast under 2:1, so opt back out */
    opacity: 1;
  }
  /* Invalid state - the house has no red; error speaks accent. Pair with
     a .field-error line naming what is wrong, never colour alone. */
  .input.is-invalid {
    border-color: var(--c-hot);
    background: var(--c-hot-soft);
  }
  .input--sm {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-xs);
    width: auto;
  }
  .input--mono { font-family: var(--ff-mono); }
  .input--block { width: 100%; }

  /* Field - the label + hint + control + error grouping every form
     rebuilt page-locally until 2026-08-27. The hint rides inside the
     label so the pair can never wrap apart. */
  .field { display: flex; flex-direction: column; gap: var(--sp-2); }
  .field-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
  }
  .field-hint {
    font-weight: var(--fw-normal);
    color: var(--c-text-tertiary);
  }
  .field-error {
    font-size: var(--fs-xs);
    color: var(--c-hot);
    display: flex;
    align-items: center;
    gap: var(--sp-1);
  }
  .field-error i { font-size: 13px; }

  /* Input group - a composed shell that owns the focus ring while the
     control inside is stripped bare; the button rides inside the border
     (the home hero capture field, canonised). */
  .input-group {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 3px;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    transition: border-color var(--dur-normal) var(--ease-out),
                box-shadow var(--dur-normal) var(--ease-out);
  }
  .input-group:focus-within {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
  }
  .input-group .input {
    flex: 1;
    min-width: 0;
    width: auto;
    border: 0;
    background: transparent;
  }
  .input-group .input:focus { box-shadow: none; }
  .input-group .btn { flex: none; }

  /* Checkbox - a real input, not a painted div; the tick is CSS-only. */
  .checkbox {
    appearance: none;
    width: 18px;
    height: 18px;
    flex: none;
    margin: 0;
    background: var(--c-bg-raised);
    border: 1.5px solid var(--c-border);
    border-radius: var(--r-sm);
    display: inline-grid;
    place-content: center;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out);
  }
  .checkbox::before {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform var(--dur-fast) var(--ease-out);
    background: var(--c-on-accent); /* same on-accent white as .btn--primary */
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  }
  .checkbox:checked {
    background: var(--c-accent);
    border-color: var(--c-accent);
  }
  .checkbox:checked::before { transform: scale(1); }
  .checkbox:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--c-accent-soft);
  }

  /* Card */
  .card {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    transition: box-shadow var(--dur-normal) var(--ease-out),
                border-color var(--dur-normal) var(--ease-out);
  }
  /* A card that is a link (the compiled tools hub, hub route cards) must
     not inherit browser-default blue and underlines: 66 such cards went
     blue on the home the day the hub was compiled (2026-09-22). */
  a.card { color: inherit; text-decoration: none; }
a.chip { color: inherit; text-decoration: none; }
  .card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--c-border);
  }

  /* Small card - dense grids of short facts (the /reskin principle cards
     are the origin; owner annotation 2026-08-26). Title stays bold with an
     inline icon, body drops a size. Never for content that needs a CTA -
     a card this small earns no button. */
  .card--mini { padding: var(--sp-4); gap: var(--sp-1); }
  .card--mini .card-title { font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--sp-2); }
  .card--mini .card-text  { font-size: var(--fs-xs); }

  /* Selected state - a clickable card that stays visibly chosen (keyword
     pickers, template choosers). Canonised from shared-report's .sr-kw
     (owner triage, 2026-08-27): the canon had no selection vocabulary, so
     pages kept inventing their own blue. Selection *behaviour* stays page
     JS; this is only the look. */
  .card.is-selected {
    border-color: var(--c-blue);
    background: var(--c-blue-soft);
    box-shadow: inset 0 0 0 1px var(--c-blue);
  }
  /* Grey secondary text goes muddy on the blue tint - full text colour on
     a selected card (owner annotation, 2026-08-29). */
  .card.is-selected .card-text { color: var(--c-text); }

  /* Label heading - the quiet uppercase eyebrow at the top of a panel-style
     card (canonised from schema-audit's .sa-panel-title, owner triage
     2026-08-27). Use INSTEAD of .card-title when the card is a labelled
     panel of content rather than a titled tile; never both on one card. */
  .card-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-tertiary);
    margin-bottom: var(--sp-3);
  }

  .card-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
  }

  .card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-size: 18px;
  }

  .card-title {
    font-weight: var(--fw-medium);
    font-size: var(--fs-base);
    color: var(--c-text);
  }

  .card-text {
    color: var(--c-text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
  }

  .cards-grid,
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    gap: var(--sp-4);
  }

  /* Divider */
  .divider {
    height: 1px;
    background: var(--c-border);
    border: none;
    margin: var(--sp-6) 0;
  }

  /* Stat widget */
  .stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: var(--sp-4);
  }

  .stat-card {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    padding: var(--sp-4) var(--sp-5);
  }

  .stat-card-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--c-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--sp-1);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }

  .stat-card-label i { font-size: 14px; }

  .stat-card-value {
    font-family: var(--ff-product);
    font-weight: 600;
    font-size: var(--fs-2xl);
    color: var(--c-text);
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
  }

  .stat-card-delta {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    margin-top: var(--sp-1);
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .stat-card-delta--up   { color: var(--c-green); }
  .stat-card-delta--down { color: var(--c-hot); }

  /* Verdict tint on the value - the audit tiles' pass/warn/fail.
     Values are 2xl (large text), so raw accent tokens clear contrast. */
  .stat-card--pass .stat-card-value { color: var(--c-green); }
  .stat-card--warn .stat-card-value { color: var(--c-amber); }
  .stat-card--fail .stat-card-value { color: var(--c-hot); }

  /* Score heatmap - the audit matrix (rows x pages) three overview
     pages rebuilt. One chassis; two cell types with distinct state
     vocabularies on purpose: verdict cells (s-pass/s-warn/s-fail,
     solid 28px squares) and scored cells (--score, s-good/s-mid/s-bad
     soft fills carrying the number). */
  .heatmap-wrap { overflow-x: auto; }
  .heatmap { display: grid; gap: 4px; font-size: var(--fs-xs); align-items: center; }
  .heatmap-cell {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    position: relative;
    cursor: default;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  }
  .heatmap-cell.is-visible { opacity: 1; transform: scale(1); }
  .heatmap-cell.is-visible:hover { transform: scale(1.1); box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
  .heatmap-cell.s-fail { background: var(--c-hot); }
  .heatmap-cell.s-warn { background: var(--c-amber); opacity: 0.85; }
  .heatmap-cell.s-pass { background: var(--c-green); opacity: 0.55; }
  .heatmap-cell.s-empty { background: var(--c-bg-sunken); border: 1px dashed var(--c-border-subtle); }
  .heatmap-cell--score {
    width: 44px;
    min-width: 44px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ff-mono);
    font-weight: var(--fw-semi);
    opacity: 1;
    transform: none;
  }
  .heatmap-cell--score.s-good { background: var(--c-green-soft); color: var(--c-green); }
  .heatmap-cell--score.s-mid { background: var(--c-amber-soft); color: var(--c-amber); }
  .heatmap-cell--score.s-bad { background: var(--c-hot-soft); color: var(--c-hot); }
  .heatmap-cell--score.s-empty { color: var(--c-text-tertiary); }
  .heatmap-row-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: var(--fw-semi);
    padding-right: var(--sp-3);
    color: var(--c-text);
    white-space: nowrap;
  }
  .heatmap-row-label i { font-size: 14px; color: var(--c-text-secondary); }
  .heatmap-col-label {
    font-size: 9px;
    color: var(--c-text-tertiary);
    text-align: center;
    transform: rotate(-45deg);
    transform-origin: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
  }
  .heatmap-col-label a { color: inherit; text-decoration: none; }
  .heatmap-col-label a:hover { color: var(--c-blue); text-decoration: underline; }
  .heatmap-legend {
    display: flex;
    gap: var(--sp-3);
    align-items: center;
    font-size: 10px;
    color: var(--c-text-tertiary);
    margin-top: var(--sp-3);
    flex-wrap: wrap;
  }
  .heatmap-legend .key { display: flex; align-items: center; gap: 4px; }
  .heatmap-legend .key span { width: 12px; height: 12px; border-radius: 2px; }

  /* Table pager - info + prev/next under a table. Four pages rebuilt
     it (bl-, schemas-, crm-, elog-pager). --center for the inline form. */
  .pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
  }
  .pager--center { justify-content: center; }
  .pager--rule { padding-top: var(--sp-4); border-top: 1px solid var(--c-border-subtle); }
  .pager-info {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    font-family: var(--ff-mono);
  }
  .pager-btns { display: flex; gap: var(--sp-2); align-items: center; }

  /* Code snippet with a copy affordance - the box every install/embed
     page rebuilt. Put blCopy on the button:
     onclick="blCopy(this.parentElement.querySelector('code').textContent, this)" */
  .snippet {
    position: relative;
    background: var(--c-bg-sunken);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
    font-family: var(--ff-mono);
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--c-text);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }
  .snippet .snippet-copy {
    position: absolute;
    top: var(--sp-2);
    right: var(--sp-2);
  }

  /* Blocked site - the one panel every surface shows when a client's bot
     protection turns GeorgeBot away (blSiteBlocked in static/js/api.js,
     detail from core/shared/site_access.py). A raised card with an amber
     rule down the left: a state with a fix, not a failure, so never the red
     error banner. George holds the stop sign at the spot size (104px), on
     the right facing left into the copy, and leaves under 560px. */
  .site-blocked {
    position: relative;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-left: 3px solid var(--c-amber);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    text-align: left;
  }
  .site-blocked-head {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
  }
  .site-blocked-intro { flex: 1; min-width: 0; }
  .site-blocked-title {
    font-family: var(--ff-product);
    font-size: var(--fs-lg);
    font-weight: 600;
    line-height: 1.3;
    color: var(--c-text);
    margin: var(--sp-2) 0 var(--sp-2);
    overflow-wrap: anywhere;
  }
  .site-blocked-lede,
  .site-blocked-note,
  .site-blocked-after {
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--c-text-secondary);
    margin: 0;
  }
  .site-blocked-note { margin-top: var(--sp-2); color: var(--c-text); }
  .site-blocked-george {
    flex: none;
    width: 104px;
    height: 104px;
    object-fit: contain;
  }
  .site-blocked-howto { display: flex; flex-direction: column; gap: var(--sp-3); }
  .site-blocked-steps {
    margin: 0;
    padding-left: var(--sp-5);
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--c-text);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
  }
  .site-blocked-rule { padding-right: var(--sp-8); }
  .site-blocked-more > summary { font-size: var(--fs-sm); }
  .site-blocked-more .card-label { margin-top: var(--sp-4); }
  .site-blocked-more .site-blocked-steps { margin: var(--sp-2) 0 var(--sp-3); }
  .site-blocked-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
  }
  .site-blocked-result {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
  }
  .site-blocked-result:empty { display: none; }
  .site-blocked-result.is-ok i { color: var(--c-green); }
  .site-blocked-result.is-warn i { color: var(--c-amber); }
  .site-blocked--compact { padding: var(--sp-4); gap: var(--sp-3); }
  @media (max-width: 560px) {
    .site-blocked { padding: var(--sp-4); }
    .site-blocked-george { display: none; }
    .site-blocked-actions .btn { flex: 1 1 auto; justify-content: center; }
  }

  /* Trend sparkline - the pure-SVG mini chart five overview pages
     rebuilt. Page JS draws the SVG; these class the parts. */
  .trend { width: 100%; height: 160px; display: block; }
  .trend-grid { stroke: var(--c-border-subtle); stroke-width: 1; }
  .trend-line { fill: none; stroke: var(--c-blue); stroke-width: 2; }
  .trend-dot { fill: var(--c-blue); }
  /* Level change on a run-indexed trend chart: blLevelMarker() in
     static/js/report-levels.js, drawn between the two runs blLevelBreaks()
     says measured differently. Hairline and dashed so it reads as a note on
     the chart, never as data. */
  .bl-level-mark line {
    stroke: var(--c-text-tertiary);
    stroke-width: 1;
    stroke-dasharray: 4 3;
  }
  .bl-level-mark text {
    font-family: var(--ff-product);
    font-size: 9px;
    fill: var(--c-text-tertiary);
  }

  /* Responsive tile row - the wrapper every audit/overview page
     re-declared around its stat tiles. */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
  }

  /* Toast / notification */
  .toast {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    font-size: var(--fs-sm);
    color: var(--c-text);
    max-width: 380px;
  }
  .toast i {
    font-size: 20px;
    flex-shrink: 0;
  }
  .toast--success i { color: var(--c-green); }
  .toast--error   i { color: var(--c-hot); }
  .toast--info    i { color: var(--c-blue); }

  /* ============================================================
     RADIUS DEMO
     ============================================================ */
  .radius-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
  }

  .radius-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
  }

  .radius-box {
    width: 56px;
    height: 56px;
    border: 2px solid var(--c-accent);
    background: var(--c-accent-soft);
  }

  .radius-item span {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }

  /* ============================================================
     SHADOW DEMO
     ============================================================ */
  .shadow-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-5);
  }

  .shadow-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
  }

  .shadow-box {
    width: 80px;
    height: 80px;
    background: var(--c-bg-raised);
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border-subtle);
  }

  .shadow-item span {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }

  /* ============================================================
     CHARTS
     ============================================================ */
  .chart-container {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    transition: box-shadow var(--dur-normal) var(--ease-out);
  }
  .chart-container:hover {
    box-shadow: var(--shadow-md);
  }

  .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--sp-5);
  }

  .chart-title {
    font-weight: var(--fw-medium);
    font-size: var(--fs-base);
    color: var(--c-text);
  }

  .chart-subtitle {
    font-size: var(--fs-sm);
    color: var(--c-text-tertiary);
    margin-top: 2px;
  }

  .chart-value {
    font-family: var(--ff-product);
    font-weight: 600;
    font-size: var(--fs-xl);
    color: var(--c-text);
    letter-spacing: -0.02em;
    text-align: right;
  }

  .chart-delta {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-align: right;
    margin-top: 2px;
  }

  .charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: var(--sp-4);
  }

  /* Bar chart */
  .bar-chart {
    display: flex;
    align-items: flex-end;
    gap: var(--sp-2);
    height: 140px;
    padding-top: var(--sp-2);
  }

  .bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: var(--sp-1);
  }

  .bar {
    width: 100%;
    max-width: 36px;
    border-radius: var(--r-sm) var(--r-sm) 0 0;
    transition: height 0.8s var(--ease-out), opacity var(--dur-normal) var(--ease-out);
    position: relative;
    cursor: default;
  }
  .bar:hover { opacity: 0.8; }

  .bar--accent { background: var(--c-accent); }
  .bar--blue   { background: var(--c-blue); }
  .bar--green  { background: var(--c-green); }
  .bar--saffron{ background: var(--c-amber); }
  .bar--muted  { background: var(--c-border); }

  .bar-label {
    font-family: var(--ff-mono);
    font-size: 9px;
    color: var(--c-text-tertiary);
    text-align: center;
    letter-spacing: 0.02em;
  }

  /* Sparkline (SVG) */
  .sparkline-wrap {
    position: relative;
    height: 100px;
    margin-top: var(--sp-2);
  }

  .sparkline-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .sparkline-axis {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--c-border-subtle);
  }

  /* Donut chart */
  .donut-wrap {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
  }

  .donut-chart {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
  }

  .donut-chart svg {
    transform: rotate(-90deg);
  }

  .donut-legend {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
  }

  .donut-legend-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
  }

  .donut-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .donut-legend-value {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    margin-left: auto;
    padding-left: var(--sp-3);
  }

  /* Chart axis labels */
  .chart-axis-row {
    display: flex;
    justify-content: space-between;
    margin-top: var(--sp-1);
    padding: 0 2px;
  }

  .chart-axis-label {
    font-family: var(--ff-mono);
    font-size: 9px;
    color: var(--c-text-tertiary);
  }

  /* ============================================================
     NOTIFICATIONS
     ============================================================ */
  .notif-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
  }

  /* Inline banner notifications */
  .notif-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--r-lg);
    border: 1px solid;
    position: relative;
    /* The mount points these render into (<div id="x-err"></div>) carry no
       spacing of their own, so without this the banner's bottom edge sits on
       the exact pixel the next block starts - the page header collided with
       the error telling you why the page was empty. Margin lives here rather
       than on 91 pages' error regions, and collapses to nothing when the
       region is empty. Toasts are .toast-popup and are unaffected. */
    margin-bottom: var(--sp-5);
  }

  .notif-banner i {
    font-size: 20px;
    flex-shrink: 0;
    /* Centred against the banner's whole content block, not hung off the
       first line (owner call, /reskin annotation 2026-08-26). align-self
       beats changing the banner's align-items, which long action rows use. */
    align-self: center;
    margin-top: 0;
  }

  .notif-body {
    flex: 1;
    min-width: 0;
  }

  .notif-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    margin-bottom: 2px;
  }

  .notif-text {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: var(--lh-relaxed);
  }

  .notif-time {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    flex-shrink: 0;
    margin-top: 1px;
  }

  .notif-dismiss {
    position: absolute;
    top: var(--sp-3);
    right: var(--sp-3);
    background: none;
    border: none;
    color: var(--c-text-tertiary);
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    border-radius: var(--r-sm);
    transition: color var(--dur-fast) var(--ease-out);
    line-height: 1;
  }
  .notif-dismiss:hover { color: var(--c-text); }

  .notif--info {
    background: var(--c-blue-soft);
    border-color: color-mix(in srgb, var(--c-blue) 20%, transparent);
  }
  .notif--info i { color: var(--c-blue); }

  .notif--success {
    background: var(--c-green-soft);
    border-color: color-mix(in srgb, var(--c-green) 20%, transparent);
  }
  .notif--success i { color: var(--c-green); }

  .notif--warning {
    background: var(--c-amber-soft);
    border-color: color-mix(in srgb, var(--c-amber) 20%, transparent);
  }
  .notif--warning i { color: var(--c-amber); }

  .notif--error {
    background: var(--c-hot-soft);
    border-color: color-mix(in srgb, var(--c-hot) 20%, transparent);
  }
  .notif--error i { color: var(--c-hot); }

  /* notif--sm: compact for field errors and tight spaces */
  .notif-banner.notif--sm {
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
    border-radius: var(--r-md);
  }
  .notif-banner.notif--sm > i {
    font-size: 15px;
  }
  .notif-banner.notif--sm .notif-title,
  .notif-banner.notif--sm .notif-text {
    font-size: var(--fs-xs);
  }
  .notif-banner.notif--sm .notif-dismiss {
    top: var(--sp-1);
    right: var(--sp-2);
    font-size: 12px;
  }

  /* notif--lg: prominent page-level errors and key alerts */
  .notif-banner.notif--lg {
    padding: var(--sp-5);
    gap: var(--sp-4);
    border-radius: var(--r-xl);
  }
  .notif-banner.notif--lg > i {
    font-size: 28px;
    margin-top: 2px;
  }
  .notif-banner.notif--lg .notif-title {
    font-size: var(--fs-base);
    margin-bottom: var(--sp-1);
  }

  /* Notification actions */
  .notif-actions {
    display: flex;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
  }

  /* Notification list (activity feed style) */
  .notif-list {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    overflow: hidden;
  }

  .notif-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--c-border-subtle);
  }

  .notif-list-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
  }

  .notif-count {
    background: var(--c-hot);
    color: var(--c-on-accent);
    font-size: 10px;
    font-weight: var(--fw-semi);
    padding: 1px 6px;
    border-radius: var(--r-pill);
    line-height: 1.5;
  }

  .notif-list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--c-border-subtle);
    transition: background var(--dur-fast) var(--ease-out);
    cursor: default;
  }
  .notif-list-item:last-child { border-bottom: none; }
  .notif-list-item:hover { background: var(--c-bg-sunken); }

  .notif-list-item--unread {
    background: color-mix(in srgb, var(--c-blue) 3%, transparent);
  }
  .notif-list-item--unread::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-blue);
    flex-shrink: 0;
    /* centred against the 32px .notif-icon: (32 - 6) / 2 */
    margin-top: 13px;
  }

  .notif-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
  }

  .notif-list-body {
    flex: 1;
    min-width: 0;
    /* first text line (fs-sm at lh-normal, ~20px) optically centred with the 32px icon */
    margin-top: 5px;
  }

  .notif-list-text {
    font-size: var(--fs-sm);
    color: var(--c-text);
    line-height: var(--lh-normal);
  }

  .notif-list-meta {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    margin-top: 2px;
  }

  /* ============================================================
     TOAST POPUPS
     ============================================================ */
  .toast-container {
    position: fixed;
    bottom: var(--sp-5);
    right: var(--sp-5);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--sp-3);
    z-index: 1000;
    pointer-events: none;
  }

  .toast-popup {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-4);
    padding-bottom: calc(var(--sp-4) + 4px);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 420px;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    transform: translateX(calc(100% + var(--sp-5)));
    opacity: 0;
    /* This is the EXIT transition (transitions read from the destination
       state): fast, no bounce - a dialog that wobbles on the way out reads
       as unstable. Entry is on .is-open below. */
    transition: transform var(--dur-normal) var(--ease-in),
                opacity var(--dur-normal) var(--ease-in);
  }

  /* Entry: thrown on with a spring (transform only - opacity finishes early
     on --ease-out, fading for the whole settle looks like a rendering
     glitch). The second transition line is the spring; browsers without
     linear() drop it and keep the first. @starting-style replaces the old
     .toast-enter double-rAF dance in api.js: the transition now fires on
     insertion with no forced reflow. */
  .toast-popup.is-open {
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.4s var(--ease-out), opacity var(--dur-normal) var(--ease-out);
    transition: transform var(--spring-toast-dur) var(--spring-toast),
                opacity var(--dur-normal) var(--ease-out);
  }
  @starting-style {
    .toast-popup.is-open {
      transform: translateX(calc(100% + var(--sp-5)));
      opacity: 0;
    }
  }

  .toast-popup i.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
  }

  .toast-popup .toast-content {
    flex: 1;
    min-width: 0;
  }

  .toast-popup .toast-msg-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    margin-bottom: 2px;
  }

  .toast-popup .toast-msg-text {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: var(--lh-relaxed);
  }

  .toast .toast-close,
  .toast-popup .toast-close {
    background: none;
    border: none;
    color: var(--c-text-tertiary);
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    border-radius: var(--r-sm);
    transition: color var(--dur-fast) var(--ease-out);
    flex-shrink: 0;
    line-height: 1;
  }
  .toast .toast-close:hover,
  .toast-popup .toast-close:hover { color: var(--c-text); }
  .toast .toast-close i { font-size: 16px; }

  /* Progress bar at bottom of toast for auto-dismiss */
  .toast-timer {
    position: absolute;
    bottom: 0;
    left: var(--sp-3);
    right: var(--sp-3);
    height: 2px;
    background: var(--c-border-subtle);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    overflow: hidden;
  }

  .toast-timer-fill {
    height: 100%;
    border-radius: var(--r-pill);
    transition: width linear;
  }

  /* Toast demo button row */
  .toast-demo-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
  }

  /* ============================================================
     CREDIT GATE - 402 insufficient credits state
     ============================================================ */
  .credit-gate {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-5);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    animation: fadeIn 0.3s var(--ease-out);
    /* Compressed, the CTA wraps under the body instead of overflowing the
       card edge (owner annotation, 2026-08-29). */
    flex-wrap: wrap;
  }
  @media (max-width: 720px) {
    .credit-gate-actions { width: 100%; }
    .credit-gate-actions .btn { width: 100%; justify-content: center; }
  }

  .credit-gate-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: var(--c-amber-soft);
    color: var(--c-amber);
    display: grid;
    place-items: center;
    font-size: 20px;
    flex-shrink: 0;
  }

  .credit-gate-body {
    flex: 1;
    min-width: 0;
  }

  .credit-gate-title {
    font-family: var(--ff-product);
    font-size: var(--fs-base);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    margin-bottom: var(--sp-1);
  }

  .credit-gate-text {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: var(--lh-normal);
    /* --sp-2, and meta carries no trailing margin: the old sp-4/sp-3 pair
       left the body ragged against the action column (owner annotation,
       2026-08-26). */
    margin-bottom: var(--sp-2);
  }

  .credit-gate-meta {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    margin-bottom: 0;
  }

  .credit-gate-actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
  }

  .credit-gate--compact {
    padding: var(--sp-4);
    gap: var(--sp-3);
  }

  .credit-gate--compact .credit-gate-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .credit-gate--compact .credit-gate-title {
    font-size: var(--fs-sm);
  }

  .credit-gate--compact .credit-gate-text {
    font-size: var(--fs-xs);
    margin-bottom: var(--sp-3);
  }

  .credit-gate--banner {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Tier-limit banner - inline upgrade prompt for limit errors */
  .tier-limit-banner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-amber-soft);
    border: 1px solid color-mix(in srgb, var(--c-amber) 30%, transparent);
    border-radius: var(--r-md);
    animation: fadeIn 0.3s var(--ease-out);
  }

  .tier-limit-icon {
    font-size: 20px;
    color: var(--c-amber);
    flex-shrink: 0;
  }

  .tier-limit-body { flex: 1; min-width: 0; }

  .tier-limit-title {
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
  }

  .tier-limit-msg {
    font-size: var(--fs-xs);
    color: var(--c-text-secondary);
    line-height: var(--lh-normal);
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ============================================================
     DATA TABLES
     ============================================================ */
  .data-table-wrap {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    overflow: hidden;
  }

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

  .data-table thead {
    border-bottom: 1px solid var(--c-border);
  }

  .data-table th {
    padding: var(--sp-3) var(--sp-4);
    text-align: left;
    font-weight: var(--fw-semi);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }

  .data-table td {
    padding: var(--sp-3) var(--sp-4);
    color: var(--c-text);
    border-bottom: 1px solid var(--c-border-subtle);
    vertical-align: middle;
  }

  .data-table tbody tr {
    transition: background var(--dur-fast) var(--ease-out);
  }

  /* Dense variant for per-page findings tables */
  .data-table--compact th, .data-table--compact td { padding: var(--sp-2) var(--sp-3); }
  .data-table--compact th { font-size: 10px; }

  /* Numeric cell - right-aligned mono, the .num convention every
     hand-rolled history table reinvented. */
  .data-table .num { text-align: right; font-family: var(--ff-mono); }
  .data-table tbody tr:hover {
    background: var(--c-bg-sunken);
  }
  .data-table tbody tr:last-child td {
    border-bottom: none;
  }

  .table-query {
    font-weight: var(--fw-medium);
    color: var(--c-text);
  }

  .table-mono {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-secondary);
  }

  .table-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
  }
  .table-trend--up   { color: var(--c-green); }
  .table-trend--down { color: var(--c-hot); }

  .table-time {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }

  .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-4);
    border-bottom: 1px solid var(--c-border-subtle);
  }

  .table-title {
    font-weight: var(--fw-medium);
    font-size: var(--fs-base);
    color: var(--c-text);
  }

  /* Position badge */
  .pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 22px;
    border-radius: var(--r-sm);
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    background: var(--c-bg-sunken);
    color: var(--c-text-secondary);
  }
  .pos-badge--top3 {
    background: var(--c-accent-soft);
    color: var(--c-accent);
  }

  /* ============================================================
     TAB BAR (page groups)
     ============================================================ */
  .tab-bar {
    display: flex;
    gap: var(--sp-1);
    border-bottom: 1px solid var(--c-border-subtle);
    margin-bottom: var(--sp-5);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar { display: none; }

  .tab-bar-link {
    position: relative;
    padding: var(--sp-3) var(--sp-4);
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out);
    letter-spacing: -0.01em;
  }
  .tab-bar-link:hover {
    color: var(--c-text);
  }
  .tab-bar-link--active {
    color: var(--c-text);
    font-weight: 600;
  }
  .tab-bar-link--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: var(--sp-4);
    right: var(--sp-4);
    height: 2px;
    background: var(--c-accent);
    border-radius: 2px 2px 0 0;
  }

  .tab-panel {
    animation: tabFadeIn 200ms var(--ease-out);
  }
  @keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* --- Sidebar nav group (collapsible) --- */
  .sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-text-secondary);
    text-decoration: none;
    border-radius: var(--r-md);
    transition: color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
    letter-spacing: -0.01em;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    line-height: 1.4;
  }
  .sidebar-group-toggle:hover {
    color: var(--c-text);
    background: var(--c-bg-hover);
  }
  .sidebar-group-toggle i:first-child {
    font-size: 18px;
    color: var(--c-text-tertiary);
    flex-shrink: 0;
  }
  .sidebar-group-toggle .sidebar-group-chevron {
    font-size: 12px;
    margin-left: auto;
    color: var(--c-text-tertiary);
    transition: transform var(--dur-normal) var(--ease-out);
  }
  .sidebar-group--open > .sidebar-group-toggle {
    color: var(--c-text);
  }
  .sidebar-group--open > .sidebar-group-toggle i:first-child {
    color: var(--c-accent);
  }
  .sidebar-group--open > .sidebar-group-toggle .sidebar-group-chevron {
    transform: rotate(180deg);
  }
  .sidebar-group-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-dropdown) var(--ease-out);
  }
  .sidebar-group--open > .sidebar-group-children {
    max-height: 640px;
  }
  .sidebar-group-children .sidebar-link {
    padding-left: calc(var(--sp-3) + 18px + var(--sp-3));
    font-size: var(--fs-xs);
  }

  /* --- Sidebar nav model (compile.py NAV_MODEL, FOLD_SCRIPT) ---
     A long package shows its pinned rows and a "more" row that opens the
     rest. The section label stays a label; the control is a row. */
  .sidebar-more {
    width: 100%;
    font-family: inherit;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-text-tertiary);
  }
  .sidebar-more:hover { color: var(--c-text); }
  .sidebar-more-chevron {
    transition: transform var(--dur-normal) var(--ease-out);
  }
  .sidebar-section--fold.is-open .sidebar-more-chevron { transform: rotate(90deg); }
  .sidebar-more-count {
    margin-left: auto;
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }
  .sidebar-section--fold.is-open .sidebar-more-count { visibility: hidden; }
  .sidebar-section--fold:not(.is-open) > [data-nav-member] { display: none; }
  .package-hub { margin-top: var(--sp-3); }

  /* ============================================================
     DROPDOWNS
     ============================================================ */
  .dropdown {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: box-shadow var(--dur-normal) var(--ease-out);
  }
  .dropdown:hover {
    box-shadow: var(--shadow-sm);
  }

  .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: var(--sp-4);
    background: none;
    border: none;
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    color: var(--c-text);
    cursor: pointer;
    text-align: left;
    transition: background var(--dur-fast) var(--ease-out);
  }
  .dropdown-trigger:hover {
    background: var(--c-bg-sunken);
  }

  .dropdown-trigger-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
  }

  .dropdown-trigger-content {
    flex: 1;
    min-width: 0;
  }

  .dropdown-trigger-title {
    font-weight: var(--fw-medium);
    color: var(--c-text);
    margin-bottom: 1px;
  }

  .dropdown-trigger-sub {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }

  .dropdown-chevron {
    font-size: 18px;
    color: var(--c-text-tertiary);
    transition: transform 0.3s var(--ease-out);
    flex-shrink: 0;
  }

  .dropdown.dropdown--open .dropdown-chevron {
    transform: rotate(180deg);
  }

  .dropdown-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease-out);
  }

  .dropdown--open .dropdown-body {
    max-height: 600px;
  }

  .dropdown-inner {
    padding: 0 var(--sp-4) var(--sp-4);
    border-top: 1px solid var(--c-border-subtle);
    padding-top: var(--sp-4);
  }

  .dropdown-inner p {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--sp-3);
  }
  .dropdown-inner p:last-child { margin-bottom: 0; }

  .dropdown-meta {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
  }

  .dropdown-meta-item {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }
  .dropdown-meta-item i { font-size: 14px; }

  .dropdown-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
  }

  /* Custom select - replaces native <select> with design-system styling */
  .custom-select {
    position: relative;
    min-width: 200px;
  }

  .custom-select-trigger {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    padding-right: var(--sp-4);
    /* raised like .input, so selects and inputs match in one form */
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: var(--fs-sm);
    color: var(--c-text);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
    text-align: left;
    line-height: var(--lh-normal);
  }

  .custom-select-trigger:hover {
    border-color: color-mix(in srgb, var(--c-border), var(--c-text) 18%);
  }

  .custom-select.is-open .custom-select-trigger {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
  }

  .custom-select-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .custom-select-label--placeholder {
    color: var(--c-text-tertiary);
  }

  .custom-select-chevron {
    font-size: 14px;
    color: var(--c-text-tertiary);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-out);
  }

  .custom-select.is-open .custom-select-chevron {
    transform: rotate(180deg);
  }

  .custom-select-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    padding: var(--sp-1) 0;
  }

  .custom-select.is-open .custom-select-menu {
    display: block;
  }

  /* An option is a <button type="button"> so it is operable by keyboard and
     announced as such. The reset below is a no-op for the legacy <div> form
     (block, full width, transparent, inherited font already) and undoes the
     UA button chrome for the canon one, so both render identically. */
  .custom-select-option {
    display: block;
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    background: none;
    border: 0;
    font-family: inherit;
    font-size: var(--fs-sm);
    text-align: left;
    color: var(--c-text);
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .custom-select-option:hover {
    background: var(--c-bg-sunken);
  }

  .custom-select-option:focus-visible {
    background: var(--c-bg-sunken);
    outline: none;
    box-shadow: inset 0 0 0 2px var(--c-accent);
  }

  .custom-select-option.is-selected {
    color: var(--c-accent);
    font-weight: var(--fw-medium);
  }

  .custom-select-option--placeholder {
    color: var(--c-text-tertiary);
  }

  /* ============================================================
     MENU - anchored action popover (2026-08-27)
     The click-open panel every page hand-rolled (save dropdowns,
     locale pickers, row actions). .dropdown is the accordion and
     keeps its name; this is the anchored one. Page JS toggles
     .is-open on .menu; the panel springs in via @starting-style.
     ============================================================ */
  .menu { position: relative; display: inline-flex; }
  .menu-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-1);
    z-index: 200;
  }
  .menu.is-open .menu-panel { display: block; }
  .menu-panel--right { left: auto; right: 0; }
  @supports (transition-behavior: allow-discrete) {
    .menu-panel {
      opacity: 0;
      transform: translateY(-4px) scale(0.98);
      transition: opacity var(--dur-fast) var(--ease-out),
                  transform var(--spring-snappy-dur, 300ms) var(--spring-snappy, var(--ease-out)),
                  display var(--dur-fast) allow-discrete;
    }
    .menu.is-open .menu-panel {
      opacity: 1;
      transform: none;
      @starting-style {
        opacity: 0;
        transform: translateY(-4px) scale(0.98);
      }
    }
  }
  .menu-item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 0;
    background: none;
    border-radius: var(--r-sm);
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    color: var(--c-text);
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out);
  }
  .menu-item:hover { background: var(--c-bg-sunken); }
  .menu-item i { font-size: 15px; color: var(--c-text-secondary); }
  .menu-item.is-active { color: var(--c-accent); }
  .menu-item.is-active i { color: var(--c-accent); }
  .menu-item[disabled] { color: var(--c-text-tertiary); cursor: not-allowed; }
  .menu-item[disabled]:hover { background: none; }
  .menu-sep { height: 1px; background: var(--c-border-subtle); margin: var(--sp-1) var(--sp-2); }
  .menu-heading {
    padding: var(--sp-1) var(--sp-3);
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
  }

  /* Split button - primary action + a caret that opens a .menu of
     alternatives. The caret half is its own .menu so the panel
     anchors under the caret, not the whole group. */
  .btn-split { display: inline-flex; }
  .btn-split > .btn:first-child,
  .btn-split > .menu:last-child > .btn {
    position: relative;
  }
  .btn-split > .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .btn-split > .menu:last-child > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-inline: var(--sp-2);
    margin-left: 1px;
  }
  .btn-split .menu-panel { left: auto; right: 0; }

  /* ============================================================
     DESIGN PRINCIPLES (Section 0)
     ============================================================ */
  .principles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-5);
  }

  .principle {
    padding: var(--sp-5);
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border-subtle);
    background: var(--c-bg-raised);
    transition: border-color var(--dur-normal) var(--ease-out);
  }
  .principle:hover { border-color: var(--c-border); }

  .principle-number {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-accent);
    margin-bottom: var(--sp-2);
    letter-spacing: 0.04em;
  }

  .principle-title {
    font-weight: var(--fw-semi);
    font-size: var(--fs-base);
    color: var(--c-text);
    margin-bottom: var(--sp-2);
    line-height: var(--lh-tight);
  }

  .principle-text {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: var(--lh-relaxed);
  }

  .dl-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--sp-1) var(--sp-4);
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--c-border-subtle);
  }

  .dl-label {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    padding: var(--sp-1) 0;
  }

  .dl-value {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    padding: var(--sp-1) 0;
    border-bottom: 1px solid var(--c-border-subtle);
  }
  .dl-value:last-child { border-bottom: none; }

  .dl-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
  }

  /* ============================================================
     FILTER PANEL
     ============================================================ */
  .filter-panel {
    display: none;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--c-border-subtle);
    background: var(--c-bg-sunken);
    gap: var(--sp-3);
    flex-wrap: wrap;
    align-items: center;
  }
  .filter-panel.filter-open { display: flex; }

  .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 4px 10px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    border-radius: var(--r-pill);
    border: 1px solid var(--c-border);
    background: var(--c-bg-raised);
    color: var(--c-text-secondary);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
  }
  .filter-chip:hover { border-color: var(--c-text-tertiary); }
  .filter-chip.filter-active {
    background: var(--c-accent-soft);
    border-color: var(--c-accent);
    color: var(--c-accent);
  }
  .filter-chip i { font-size: 12px; }

  /* ============================================================
     CHATBOT
     ============================================================ */
  .chat-window {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-xl);
    overflow: hidden;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
  }

  .chat-header {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-bottom: 1px solid var(--c-border-subtle);
  }

  .chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--r-pill);
    display: grid;
    place-items: center;
    font-size: 16px;
    flex-shrink: 0;
  }

  .chat-header-info {
    flex: 1;
  }

  .chat-header-name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
  }

  .chat-header-status {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .chat-body {
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    overflow-y: auto;
  }
  .chat-window .chat-body {
    min-height: 320px;
    max-height: 420px;
  }

  /* Message rows */
  .chat-row {
    display: flex;
    gap: var(--sp-2);
    align-items: flex-end;
    opacity: 0;
    transform: translateY(8px);
    animation: chatIn 0.3s var(--ease-out) forwards;
  }
  .chat-row--user {
    flex-direction: row-reverse;
  }

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

  .chat-msg-avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--r-pill);
    display: grid;
    place-items: center;
    font-size: 11px;
    flex-shrink: 0;
    margin-bottom: 2px;
  }

  /* Bubbles */
  .chat-bubble {
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
    max-width: 80%;
  }

  .chat-bubble--bot {
    background: var(--c-bg-sunken);
    color: var(--c-text);
    border-radius: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-sm);
  }

  .chat-bubble--user {
    background: var(--c-accent);
    color: var(--c-on-accent);
    border-radius: var(--r-lg) var(--r-lg) var(--r-sm) var(--r-lg);
  }

  /* Tutorial-narration bubble - visually distinct from free-form George
     replies so users can tell when they're being walked through a script. */
  .chat-bubble--tutorial {
    background: var(--c-accent-soft);
    border-left: 3px solid var(--c-accent);
    color: var(--c-text);
  }
  .chat-bubble--tutorial::before {
    content: 'TUTORIAL';
    display: block;
    font-family: var(--ff-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--c-accent);
    margin-bottom: var(--sp-1);
    opacity: 0.8;
  }

  /* Tool use card */
  .chat-tool {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    background: var(--c-bg-raised);
    max-width: 80%;
    font-size: var(--fs-xs);
  }

  .chat-tool-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-size: 14px;
    flex-shrink: 0;
  }

  .chat-tool-info {
    flex: 1;
    min-width: 0;
  }

  .chat-tool-name {
    font-weight: var(--fw-semi);
    color: var(--c-text);
    margin-bottom: 1px;
  }

  .chat-tool-detail {
    color: var(--c-text-tertiary);
    font-family: var(--ff-mono);
  }

  .chat-tool-status {
    font-size: 14px;
    flex-shrink: 0;
  }

  /* Typing indicator */
  .chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-bg-sunken);
    border-radius: var(--r-lg) var(--r-lg) var(--r-lg) var(--r-sm);
    width: fit-content;
  }

  .typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-text-tertiary);
    animation: typingBounce 1.2s var(--ease-in-out) infinite;
  }
  .typing-dot:nth-child(2) { animation-delay: 0.15s; }
  .typing-dot:nth-child(3) { animation-delay: 0.3s; }

  @keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-4px); opacity: 1; }
  }

  /* Chat input bar */
  .chat-input-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    border-top: 1px solid var(--c-border-subtle);
  }

  .chat-input {
    flex: 1;
    padding: var(--sp-2) var(--sp-3);
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    color: var(--c-text);
    background: var(--c-bg-sunken);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    outline: none;
    transition: border-color var(--dur-fast) var(--ease-out);
  }
  .chat-input:focus { border-color: var(--c-border); }
  .chat-input::placeholder { color: var(--c-text-tertiary); }

  .chat-send {
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    border: none;
    background: var(--c-accent);
    color: var(--c-on-accent);
    display: grid;
    place-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
  }
  .chat-send:hover { background: var(--c-accent-hover); }
  .chat-send:active { transform: scale(0.92); }

  /* The .section stagger entrance was removed on 2026-08-30 with the rest
     of the arrival. It was a SECOND entrance system, independent of
     .reveal and easy to miss: .section set opacity 0 + translateY(16px)
     and ran `fadeUp` on LOAD with :nth-child delays out to 0.95s, while
     .reveal transitioned over 600ms on SCROLL. Two triggers, two
     durations, both firing on the same page - which is most of why
     arrival read as inconsistent from one block to the next. It covered
     108 pages, so removing only the .reveal half would have fixed
     almost nothing. Do not reintroduce either.

     @keyframes fadeUp survives below because .anim-fade-up still cites
     it. That whole .anim-* family is legacy with zero live pages; it is
     left alone here rather than swept as a side effect. */

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

  /* ============================================================
     RESPONSIVE
     ============================================================ */
  @media (max-width: 640px) {
    .shell { padding: var(--sp-5) var(--sp-4); }
    .masthead { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
    .type-row { grid-template-columns: 1fr; gap: var(--sp-1); }
    .icon-weights { flex-wrap: wrap; gap: var(--sp-4); }
    .stat-row { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .principles { grid-template-columns: 1fr; }
    .dl-grid { grid-template-columns: 1fr; gap: 0 var(--sp-2); }
    .donut-wrap { flex-direction: column; align-items: flex-start; }
    .notif-list { max-width: 100% !important; }
    .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .dropdown-stack { max-width: 100% !important; }
}

/* ============================================================
   Tutorial / Onboarding system
   ------------------------------------------------------------
   Loaded by static/js/tutorial.js. Two-layer overlay: an SVG
   mask paints the dim (visual), four hit-test divs sit around
   the spotlight (catch clicks). All consumes existing tokens.
   ============================================================ */

:root {
    --z-tutorial-dim:        380;
    --z-tutorial-bubble:     420;
    --z-tutorial-fab-bubble: 390;
    --tut-dim-color:         rgba(20, 20, 19, 0.38);
}
[data-theme="dark"] {
    --tut-dim-color: rgba(0, 0, 0, 0.48);
}

.tut-root {
    position: fixed; inset: 0;
    z-index: var(--z-tutorial-dim);
    pointer-events: none;
    visibility: hidden;
}
.tut-root.is-active { visibility: visible; }
/* Prompt-only mode: show the FAB bubble (e.g. follow-up offers) without
   the dim overlay or click-blocking hits. */
.tut-root.is-prompt { visibility: visible; }
.tut-root.is-prompt .tut-mask,
.tut-root.is-prompt .tut-hit { display: none; }

.tut-mask {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
}
.tut-mask .tut-dim { fill: var(--tut-dim-color); }

.tut-hit {
    position: fixed;
    background: transparent;
    pointer-events: auto;
    cursor: default;
    /* Allow touch pan gestures to scroll the underlying page through the
       overlay - without this, mobile users can't scroll while a tutorial
       step is active and the spotlight looks frozen out of place. */
    touch-action: pan-x pan-y;
}

.tut-bubble {
    position: fixed;
    width: 320px; max-width: calc(100vw - var(--sp-5));
    padding: var(--sp-4);
    background: var(--c-bg-raised);
    color: var(--c-text);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-tutorial-bubble);
    pointer-events: auto;
    font-family: var(--ff-product);
    opacity: 0;
    transform: translateY(4px) scale(0.98);
    transition: opacity var(--dur-normal) var(--ease-out),
                transform var(--dur-normal) var(--ease-out);
}
.tut-bubble.is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.tut-bubble__progress {
    font-family: var(--ff-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-text-tertiary);
    margin-bottom: var(--sp-2);
}
.tut-bubble__msg {
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.55;
}
.tut-bubble__msg code {
    background: var(--c-bg-sunken);
    border-radius: var(--r-sm);
    padding: 1px 4px;
    font-family: var(--ff-mono);
    font-size: 0.9em;
}
.tut-bubble__msg a { color: var(--c-accent); }
.tut-bubble__actions {
    display: flex; gap: var(--sp-2);
    justify-content: flex-end;
    margin-top: var(--sp-3);
}
.tut-bubble__tail {
    position: absolute;
    width: 12px; height: 12px;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    transform: rotate(45deg);
    pointer-events: none;
    display: none;
}
.tut-bubble--top    .tut-bubble__tail { display: block; bottom: -7px; left: 50%; margin-left: -6px;
                                        border-top: 0; border-left: 0; }
.tut-bubble--bottom .tut-bubble__tail { display: block; top: -7px;    left: 50%; margin-left: -6px;
                                        border-bottom: 0; border-right: 0; }
.tut-bubble--left   .tut-bubble__tail { display: block; right: -7px;  top: 50%; margin-top: -6px;
                                        border-bottom: 0; border-left: 0; }
.tut-bubble--right  .tut-bubble__tail { display: block; left: -7px;   top: 50%; margin-top: -6px;
                                        border-right: 0; border-top: 0; }

/* FAB-anchored bubble (chat panel closed). The tail points down at the
   chat icon (#chat-fab sits at right:24px bottom:24px, 52px square). */
.tut-fab-bubble {
    position: fixed;
    right: var(--sp-5);
    bottom: calc(var(--sp-5) + 52px + var(--sp-3));
    width: 320px; max-width: calc(100vw - var(--sp-5));
    padding: var(--sp-4);
    background: var(--c-bg-raised);
    color: var(--c-text);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-tutorial-fab-bubble);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity var(--dur-normal) var(--ease-out),
                transform var(--dur-normal) var(--ease-out);
    display: none;
    font-family: var(--ff-product);
    font-size: 14px;
    line-height: 1.55;
}
.tut-fab-bubble.is-in { display: block; opacity: 1; transform: translateY(0) scale(1); }
.tut-bubble .btn:disabled,
.tut-fab-bubble .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.tut-fab-bubble__actions {
    display: flex; gap: var(--sp-2);
    justify-content: flex-end;
    margin-top: var(--sp-3);
}
.tut-fab-bubble__tail {
    position: absolute;
    right: 22px; bottom: -7px;
    width: 12px; height: 12px;
    background: var(--c-bg-raised);
    border-right: 1px solid var(--c-border-subtle);
    border-bottom: 1px solid var(--c-border-subtle);
    transform: rotate(45deg);
}

/* Spotlight pulse: opt-in via [data-tutorial-highlight="pulse"] on the target. */
[data-tutorial-highlight="pulse"] {
    position: relative;
    border-radius: var(--r-md);
    animation: tut-pulse 1.8s var(--ease-out) infinite;
}
@keyframes tut-pulse {
    0%   { box-shadow: 0 0 0 0    color-mix(in srgb, var(--c-accent) 45%, transparent); }
    70%  { box-shadow: 0 0 0 14px transparent; }
    100% { box-shadow: 0 0 0 0    transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .tut-bubble, .tut-fab-bubble { transition: none; }
    [data-tutorial-highlight] { animation: none; }
}

@media (max-width: 600px) {
    /* Bubble docks as a bottom sheet on mobile; tail hidden. */
    .tut-bubble--bottom,
    .tut-bubble--top,
    .tut-bubble--left,
    .tut-bubble--right {
        left: var(--sp-3) !important;
        right: var(--sp-3) !important;
        top: auto !important;
        bottom: var(--sp-3) !important;
        width: auto;
        max-width: none;
    }
    .tut-bubble__tail { display: none !important; }
    .tut-fab-bubble {
        left: var(--sp-3); right: var(--sp-3); width: auto;
    }
}

@media (forced-colors: active) {
    .tut-mask .tut-dim { fill: Canvas; opacity: 0.6; }
    .tut-bubble, .tut-fab-bubble {
        border-color: CanvasText;
        background: Canvas; color: CanvasText;
    }
  }
/* ──────────────────────────────────────────────────────────────
   Related tools - crosslink block at the foot of product landing
   pages. Injected by each landing page's content.html between
   <!-- BEGIN related-tools --> ... <!-- END related-tools -->
   ────────────────────────────────────────────────────────────── */
.related-tools {
    margin: var(--sp-10) 0 var(--sp-8);
    padding: var(--sp-8) 0;
    border-top: 1px solid var(--c-border-subtle);
}
.related-tools__head {
    text-align: center;
    margin-bottom: var(--sp-6);
}
/* Sentence case, not caps (2026-09-22) - the mono face already says
   chrome, and "More Baseline Labs tools" carries a brand name. */
.related-tools__label {
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--c-text-tertiary);
}
.related-tools__title {
    font-family: var(--ff-product);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: var(--sp-2) 0 0;
    color: var(--c-text);
}
.related-tools__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-3);
}
.related-tools__card {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-md, 8px);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.related-tools__card:hover {
    border-color: var(--c-accent);
    background: var(--c-bg);
    transform: translateY(-2px);
}
.related-tools__icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-accent-soft);
    color: var(--c-accent);
    border-radius: var(--r-sm, 6px);
    font-size: 1.2rem;
}
.related-tools__name {
    font-family: var(--ff-product);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    color: var(--c-text);
}
.related-tools__blurb {
    font-family: var(--ff-product);
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--c-text-secondary);
    margin: 0;
}
@media (max-width: 640px) {
    .related-tools { margin: var(--sp-8) 0 var(--sp-6); padding: var(--sp-6) 0; }
    .related-tools__title { font-size: 1.2rem; }
}

/* ──────────────────────────────────────────────────────────────
   Dual-mode tool pages - logged-out visitors and crawlers see the
   .tool-marketing block (in the static HTML, so it's indexable);
   signed-up users see .tool-app (the tool UI). The toggle is driven
   by classes on <html>: bl-known-user (optimistic, set synchronously
   from a localStorage hint in shell.html for flash-free returns) and
   bl-user / bl-anon (authoritative, set by nav.html once
   /api/core/auth/me resolves). Default state shows marketing so
   crawlers and first-time visitors always get the indexable copy.
   ────────────────────────────────────────────────────────────── */
.tool-marketing { display: block; }
.tool-app { display: none; }
html.bl-known-user .tool-marketing,
html.bl-user .tool-marketing { display: none; }
html.bl-known-user .tool-app,
html.bl-user .tool-app { display: block; }
/* Authoritative anon result overrides the optimistic hint. */
html.bl-anon .tool-marketing { display: block; }
html.bl-anon .tool-app { display: none; }
/* A package hub has no .tool-app half, so hiding its marketing block
   for a signed-in user leaves an empty page (found 2026-09-22: /schema
   and /developers rendered a 0px main). The modifier keeps such a page
   visible for everyone; a page WITH a tool half never carries it. */
html.bl-known-user .tool-marketing.tool-marketing--always,
html.bl-user .tool-marketing.tool-marketing--always { display: block; }

.tool-marketing {
    max-width: 940px;
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-4) 0;
}
.tm-hero { text-align: center; padding: var(--sp-6) 0 var(--sp-8); }
.tm-eyebrow {
    font-family: var(--ff-product);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    letter-spacing: -0.01em;
    color: var(--c-accent);
    margin: 0 0 var(--sp-3);
}
.tm-hero h1 {
    font-family: var(--ff-product);
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin: 0 0 var(--sp-4);
    color: var(--c-text);
}
.tm-sub {
    font-family: var(--ff-product);
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--c-text-secondary);
    max-width: 620px;
    margin: 0 auto var(--sp-6);
}
.tm-entry {
    display: flex;
    gap: var(--sp-2);
    max-width: 520px;
    margin: 0 auto;
}
.tm-entry input {
    flex: 1 1 auto;
    padding: 0.7rem 0.9rem;
    font-family: var(--ff-product);
    font-size: 0.95rem;
    color: var(--c-text);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md, 8px);
}
.tm-entry input:focus { outline: none; border-color: var(--c-accent); }
.tm-cta-note {
    font-family: var(--ff-product);
    font-size: 0.82rem;
    color: var(--c-text-tertiary);
    margin: var(--sp-3) 0 0;
}
/* Scan-entry failures. tool-marketing.js creates this on demand between the
   form and the reassurance note; the note itself used to carry .tm-error and
   got overwritten, which cost the "no card required" copy for the session.
   Sized to .tm-entry so a message lines up with the input rather than the
   centred hero, and left-aligned because request failures render a
   .notif-banner in here - only the local "that isn't an address" validation
   line is bare text. */
.tm-error {
    font-family: var(--ff-product);
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--c-hot);
    max-width: 520px;
    margin: var(--sp-3) auto 0;
    text-align: left;
}
.tm-error:empty { display: none; }
.tm-error .notif-banner { margin-bottom: 0; }
.tm-section { padding: var(--sp-6) 0; }
.tm-section > h2 {
    font-family: var(--ff-product);
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    margin: 0 0 var(--sp-5);
    color: var(--c-text);
}
/* The lede under a marketing section heading. Canon since 2026-09-23: before
   that nine pages each defined .tmc-lead page-locally, with bottom gaps from
   --sp-2 to --sp-7 and four font sizes, and /rolling-schema, finding no canon,
   wrote bare <p>s that sat 0px above their card grids. The bare-p selector
   gives that markup (and its locale twins) the same lede. Heading to lede is
   --sp-4 (the h2's --sp-5 less --sp-2); lede to content is --sp-6. The size
   steps down from .tm-sub (1.15rem) the way the h2 steps down from the h1,
   so a section lede never competes with the hero's. */
.tmc-lead,
.tm-section > h2 + p:not([class]) {
    max-width: 52ch;
    margin: calc(-1 * var(--sp-2)) auto var(--sp-6);
    text-align: center;
    font-family: var(--ff-product);
    font-size: var(--fs-base);
    line-height: 1.5;
    color: var(--c-text-secondary);
}
/* A lede can carry a provenance line naming the real scan the specimen below
   is built from ("Site Pulse scan of baselinelabs.ai - 25 August 2026 - ...").
   The two read as one unit, so the lede gives up its gap and the provenance
   line carries it on to the specimen. */
.tmc-lead:has(+ .tmc-prov) { margin-bottom: var(--sp-2); }
.tmc-prov {
    margin: 0 auto var(--sp-6);
    text-align: center;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0;
    color: var(--c-text-tertiary);
}
.tm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--sp-3);
}
.tm-card {
    padding: var(--sp-4);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-md, 8px);
}
.tm-card-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-accent-soft);
    color: var(--c-accent);
    border-radius: var(--r-sm, 6px);
    font-size: 1.2rem;
    margin: 0 0 var(--sp-3);
}
.tm-card h3 {
    font-family: var(--ff-product);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 var(--sp-2);
    color: var(--c-text);
}
.tm-card p {
    font-family: var(--ff-product);
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--c-text-secondary);
    margin: 0;
}
.tm-sample {
    padding: var(--sp-5);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg, 12px);
}
.tm-cta-foot {
    text-align: center;
    padding: var(--sp-8) 0 var(--sp-6);
}
.tm-cta-foot h2 {
    font-family: var(--ff-product);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 var(--sp-4);
    color: var(--c-text);
}
@media (max-width: 640px) {
    .tm-hero h1 { font-size: 2rem; }
    .tm-entry { flex-direction: column; }
}

/* ============================================================
   PACKAGE HUB
   ------------------------------------------------------------
   The furniture a package overview page adds on top of the
   marketing canon: the tier row, the "which one do you need"
   decision list, the numbered how-it-works steps, and an opt-in
   prose link colour. Promoted from /schema's page-local .sh-*
   block so the five sibling hubs cannot each reinvent it; every
   other part of a hub is already canon (.tool-marketing, .tm-*,
   .pricing-cards, .tier-card, .card-grid, .faq-list).
   ============================================================ */

/* A wrapper class ON .pricing-cards, not a redefinition of it. Canon
   .pricing-cards is a hard repeat(3, 1fr) with no breakpoint - /pricing
   carries its own @media, so every other consumer inherited three 156px
   columns on a phone. The top margin is the headroom .tier-card-badge
   needs: it is absolute at top:-10px and would otherwise sit on the
   paragraph above. */
.pk-tiers { margin-top: var(--sp-7); }
@media (max-width: 900px) { .pk-tiers { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .pk-tiers { grid-template-columns: 1fr; } }

/* The decision guide, and deliberately not a third card grid on a page
   that already has two: the reader's own intent on the left, where to
   start on the right. A <dl>, because that is what it is. */
.pk-pick { margin: var(--sp-5) 0 0; padding: 0; }
.pk-pick-row {
    display: grid;
    grid-template-columns: minmax(200px, 18rem) 1fr;
    gap: var(--sp-5);
    padding: var(--sp-4) 0;
    border-top: 1px solid var(--c-border);
    align-items: start;
}
.pk-pick-row:last-child { border-bottom: 1px solid var(--c-border); }
.pk-pick dt {
    display: flex;
    gap: var(--sp-2);
    font-family: var(--ff-product);
    font-weight: var(--fw-semi);
    line-height: var(--lh-normal);
    color: var(--c-text);
}
/* ph-quotes: the dt is the visitor speaking, not a heading. */
.pk-pick dt i { color: var(--c-accent); flex-shrink: 0; margin-top: 3px; }
.pk-pick dd {
    margin: 0;
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    color: var(--c-text-secondary);
}
@media (max-width: 720px) {
    .pk-pick-row { grid-template-columns: 1fr; gap: var(--sp-2); }
}

/* How it works. The counter circle rides accent-soft rather than sunken
   grey: a sunken box on a raised page is the murky grey the grey rules
   hunt down, and the number is a marker, not a well. */
.pk-steps {
    counter-reset: pk-step;
    list-style: none;
    padding: 0;
    margin: var(--sp-5) 0 0;
}
.pk-steps li {
    counter-increment: pk-step;
    position: relative;
    padding-left: 2.6rem;
    margin-bottom: var(--sp-4);
    line-height: var(--lh-relaxed);
}
.pk-steps li::before {
    content: counter(pk-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--r-pill);
    background: var(--c-accent-soft);
    color: var(--c-accent);
    font-family: var(--ff-mono);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Opt-in, scoped, and never a bare descendant selector: a blanket
   "a inside this section" repaints every component the section holds -
   card titles, tier CTAs, FAQ chrome. Put .prose-link on the outer
   .tool-marketing element of a hub and only the five prose slots below
   take the accent (.tier-features rows included: a hub lists its members
   as linked rows, which /schema never did). */
.prose-link .card-text a,
.prose-link .faq-a a,
.prose-link .tm-cta-note a,
.prose-link .pk-pick dd a,
.prose-link .tier-features a,
.prose-link .tm-section > p a {
    color: var(--c-accent);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--c-accent) 40%, transparent);
    transition: border-color var(--dur-fast) var(--ease-out);
}
.prose-link .card-text a:hover,
.prose-link .faq-a a:hover,
.prose-link .tm-cta-note a:hover,
.prose-link .pk-pick dd a:hover,
.prose-link .tier-features a:hover,
.prose-link .tm-section > p a:hover { border-bottom-color: var(--c-accent); }


/* ============================================================
   LIVE REPORT EMBED
   ------------------------------------------------------------
   A real shared report iframed into a marketing page (/r /b /v /t
   with &embed=1). It works because the viewer's CSP is
   frame-ancestors 'self'. Nine pages carried this as byte-identical
   copies before it was promoted here.
   Seamless on purpose: no border, no radius, no box, so the report
   runs edge to edge with the page around it. The height below is a
   FALLBACK only - /js/embed-autosize.js grows the frame to the inner
   document, and honours data-max-height when the page sets one.
   ============================================================ */
.tmx-live { margin: var(--sp-6) 0 var(--sp-4); }

.tmx-live-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--sp-2);
}

.tmx-live-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
    color: var(--c-text-tertiary);
    text-decoration: none;
    white-space: nowrap;
}
.tmx-live-open:hover { color: var(--c-accent); }

.tmx-live-frame {
    display: block;
    width: 100%;
    height: min(900px, 85vh);
    border: 0;
    border-radius: 0;
    background: transparent;
}

/* A capped frame stops mid-report, and a hard edge across a half-read
   table reads as a rendering fault rather than as "there is more". 80px
   of page ground over the last of the frame says it instead. Only for
   frames that actually carry data-max-height - on an uncapped embed the
   fade would sit over the report's own last row. */
.tmx-live--capped { position: relative; }
.tmx-live--capped::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--c-bg));
    pointer-events: none;
}

/* ============================================================
   Inspector chrome
   ------------------------------------------------------------
   Shared toolbar/stat/panel/chart components for "inspector"
   pages - the continuous-data counterpart to audit pages. An
   audit page scores a single crawl; an inspector page plots a
   source (site, project) against a rolling time window and
   never "completes". Consumed by geo/pages/traffic/content.html
   and geo/pages/analytics/content.html. Distilled from the
   duplicated tr- and an- prefixed page-local CSS both pages used
   to carry. NOTE: never write a star-slash glob (like "tr-" + star
   + slash) inside a CSS comment - it terminates the comment early
   and the parser then swallows the NEXT rule. That exact bug shipped
   here once (killed .insp-toolbar's display:flex) and once in
   pdf-preview.css (killed the shell-hide rule).

   Stat tiles reuse the existing .stat-card / .stat-card-label /
   .stat-card-value components above - only .stat-card-sub and
   .stat-card-value--mono are new, added next to that block.

   Chart bars use var(--c-blue) for the primary series, not
   var(--c-border)/grey. The old grey "total" bars measured at
   ~1.36:1 contrast against the panel background - near invisible.
   --c-blue is this design system's designated "secondary data"
   color and reads clearly at normal panel contrast.
   ============================================================ */

.insp-toolbar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    flex-wrap: wrap;
}

.insp-toolbar .custom-select {
    flex: 1;
    min-width: 220px;
}

.insp-actions {
    display: inline-flex;
    gap: var(--sp-2);
    margin-left: auto;
}

/* Generic segmented control (window pills, view toggles).
   Sunken track + raised active tab - the proportions the llms.txt page
   proved out. .seg--accent trades the raised tab for a flat accent-soft
   tint (the CRM treatment); .seg--lg is the page-level switcher size. */
.seg {
    display: inline-flex;
    background: var(--c-bg-sunken);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-md);
    padding: 3px;
    gap: 2px;
}

.seg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--sp-1) var(--sp-3);
    border: 0;
    background: transparent;
    /* Full text colour - secondary read "super grey" on the sunken track
       (owner annotation, 2026-08-29); the raised is-on tab still carries
       the selection, colour is not the only cue. */
    color: var(--c-text);
    font-family: var(--ff-product);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    line-height: var(--lh-normal);
    cursor: pointer;
    border-radius: calc(var(--r-md) - 2px);
    transition: color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.seg-btn i { font-size: 14px; }
.seg-btn:hover:not(.is-on) { color: var(--c-text); }

.seg-btn.is-on { background: var(--c-bg-raised); color: var(--c-text); box-shadow: var(--shadow-sm); }
.seg-btn--custom.is-on { white-space: nowrap; }

.seg--accent .seg-btn.is-on {
    background: var(--c-accent-soft);
    /* accent alone is 3.4:1 at this size - pull it toward text for AA,
       and keep a hairline ring so colour is not the only selection cue */
    color: color-mix(in srgb, var(--c-accent), var(--c-text) 30%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-accent), transparent 55%);
}

.seg--lg .seg-btn {
    padding: var(--sp-2) var(--sp-4);
    font-size: var(--fs-sm);
}

.seg--block { display: flex; }
/* nowrap is load-bearing, not cosmetic: flex:1 means flex-basis 0, and Chrome
   computes the row's cross size from content wrapped at that zero basis - an
   icon+label button contributes a phantom TWO-line height, so every stretched
   seg rendered 56px tall around one line of text (owner annotation st#42,
   2026-08-30). nowrap keeps the intrinsic contribution one line; widths stay
   equal thirds. */
.seg--block .seg-btn { flex: 1; white-space: nowrap; }

/* Small popover panel - e.g. custom date-range picker anchored to a seg-btn */
.insp-range-anchor { position: relative; }

.insp-range {
    position: absolute;
    top: calc(100% + var(--sp-2));
    right: 0;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    padding: var(--sp-3);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    z-index: 150;
}

.insp-range[hidden] { display: none; }

.insp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}

.stat-card-sub { font-size: var(--fs-xs); color: var(--c-text-tertiary); margin-top: 4px; }
.stat-card-value--mono { font-family: var(--ff-mono); }

.insp-panel {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    margin-bottom: var(--sp-4);
}

.insp-panel-title {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-tertiary);
    margin: 0 0 var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

/* Compact filter/search input with a leading icon */
.insp-search { position: relative; }
.insp-search i {
    position: absolute;
    left: var(--sp-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-tertiary);
    pointer-events: none;
}
.insp-search .input { padding-left: calc(var(--sp-3) * 2 + 14px); }

.insp-empty-mini { text-align: center; padding: var(--sp-6) var(--sp-3); color: var(--c-text-tertiary); }
/* Direct child ONLY - same trap as `.empty-state > i` below (see the comment
   there): `.insp-empty-mini i` and `.btn i` (:1430) both score (0,1,1), so this
   rule won every icon inside a CTA button nested in the empty state. */
.insp-empty-mini > i { font-size: 28px; display: block; margin-bottom: var(--sp-2); opacity: 0.4; }

/* ═══ Empty state (shared) - icon, title, description, optional actions row ═══ */
.empty-state {
    text-align: center;
    padding: var(--sp-7) var(--sp-5);
    background: var(--c-bg-raised);
    border: 1px dashed var(--c-border);
    border-radius: var(--r-lg);
    color: var(--c-text-tertiary);
}
/* Direct child ONLY - do not widen back to a descendant selector.
   `.empty-state i` and `.btn i` (:1430) have identical specificity (0,1,1), so
   source order alone made this rule win for icons inside buttons inside empty
   states: every `.empty-state-actions > .btn > i` rendered as a 32px block at
   0.6 opacity (11 sites, 2026-07-28). The hero icon is always a direct child;
   anything nested is chrome and must keep its own sizing. */
.empty-state > i {
    font-size: 32px;
    display: block;
    margin-bottom: var(--sp-3);
    opacity: 0.6;
}
.empty-state-title {
    color: var(--c-text);
    font-size: var(--fs-md);
    font-weight: var(--fw-semi);
    margin-bottom: var(--sp-2);
}
.empty-state p { margin: 0; }
.empty-state-actions {
    margin-top: var(--sp-4);
    display: flex;
    gap: var(--sp-2);
    justify-content: center;
    flex-wrap: wrap;
}

/* Compact modifier - inline loading/no-data placeholder inside tables & panels,
   no card chrome (used by admin grids and dashboard tiles). */
.empty-state--compact {
    padding: var(--sp-5);
    background: none;
    border: none;
    border-radius: 0;
    font-size: var(--fs-sm);
}
/* Direct child ONLY - same trap as `.empty-state > i` above. */
.empty-state--compact > i {
    font-size: 28px;
    opacity: 0.3;
    margin-bottom: var(--sp-2);
}

/* Chart - pure SVG, classed markup only. See static/js/inspector-chart.js */
.insp-chart-wrap { position: relative; margin-top: var(--sp-3); }
.insp-chart-svg { display: block; width: 100%; height: 220px; overflow: visible; }

.insp-chart-grid line {
    stroke: var(--c-border-subtle);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}

.insp-chart-axis text {
    font-family: var(--ff-mono);
    font-size: 9px;
    fill: var(--c-text-tertiary);
}

.insp-bar-primary { fill: var(--c-blue); }
.insp-bar-overlay { fill: var(--c-accent); }

/* Stacked multi-series mode (inspector-chart.js `series` opt) - fixed
   categorical order, always blue -> accent -> amber, never reordered per
   dataset. Palette validated 2026-07-02: worst adjacent pair CVD ΔE 24.8
   (passes); amber is only 2.49:1 on light surfaces, so don't rely on hue
   alone - segment gaps, per-segment <title> tooltips, and the legend swatch
   carry the rest of the distinction. Do not add an s4 - a fourth series
   needs its own design pass, not a silent reuse of the status green. */
.insp-bar-s1 { fill: var(--c-blue); }
.insp-bar-s2 { fill: var(--c-accent); }
.insp-bar-s3 { fill: var(--c-amber); }
.insp-legend-swatch--s1 { background: var(--c-blue); }
.insp-legend-swatch--s2 { background: var(--c-accent); }
.insp-legend-swatch--s3 { background: var(--c-amber); }

.insp-legend {
    display: flex;
    gap: var(--sp-4);
    flex-wrap: wrap;
    margin-top: var(--sp-3);
    justify-content: center;
}

.insp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--c-text-secondary);
}

.insp-legend-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.insp-legend-swatch--primary { background: var(--c-blue); }
.insp-legend-swatch--overlay { background: var(--c-accent); }

/* ── Measurement disclosure ─────────────────────────────────────────────── */
.method-line {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    font-family: var(--ff-product);
    line-height: 1.5;
}

.chip--ai {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    background: var(--c-blue-soft);
    color: var(--c-blue);
    white-space: nowrap;
}

/* ═══ Disclosure (.disclose) - animated native <details>/<summary> ═══════════
   The one accordion primitive. Reach for this instead of hand-rolling summary
   chrome again (see .claude/rules/design-rules.md).

       <details class="disclose">
         <summary>How this score is calculated</summary>
         <div>…body…</div>
       </details>

   Body children are padded via `:where()` so the rule keeps class-level
   specificity (0,1,0) - a page can add its own body class alongside
   (`<details class="disclose vis-score-explain">` + `.vis-score-explain-body`)
   and its typography wins without an `!important`, because page <style> is
   emitted after this stylesheet. All selectors use `>` so nested disclosures
   don't inherit their parent's chrome.

   Progressive enhancement: the chevron is CSS-drawn and works everywhere; the
   open/close animation needs `::details-content`, and engines without it fall
   back to an instant toggle - i.e. exactly the behaviour we had before. */
.disclose {
    /* --c-border, not -subtle: raised-on-raised rows with a subtle line
       lose their edges entirely (owner annotation, 2026-08-29). */
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-bg-raised);
    /* Scoped to .disclose DELIBERATELY. `interpolate-size` is what makes the
       0 → auto block-size transition below possible, but it changes how every
       size keyword interpolates for the element and its descendants. Hoisting
       it to :root would silently alter keyword interpolation sitewide. */
    interpolate-size: allow-keywords;
}

.disclose > summary {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--c-text);
    cursor: pointer;
    border-radius: inherit;
    list-style: none; /* Firefox marker */
    /* Border always present, colour animated: a border that appears on
       [open] shifts the content 1px mid-animation - part of the "jumps"
       annotation, 2026-08-26. */
    border-bottom: 1px solid transparent;
    transition: background var(--dur-normal) var(--ease-out),
                border-bottom-color var(--dur-normal) var(--ease-out);
}
/* Own rule on purpose: this selector is invalid outside WebKit/Blink, and an
   invalid selector inside a list would drop the whole rule. */
.disclose > summary::-webkit-details-marker { display: none; }

/* CSS-drawn chevron. Deliberately NOT a Phosphor codepoint - this is the only
   thing telling the user the row toggles, so it must survive a webfont
   failure. Ships even where the expand animation no-ops. */
.disclose > summary::after {
    content: "";
    flex: none;
    margin-left: auto;
    width: 0.45em;
    height: 0.45em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transform-origin: center;
    opacity: 0.5;
    transition: transform var(--dur-normal) var(--ease-out);
}
.disclose[open] > summary::after { transform: rotate(-135deg); }

.disclose > summary:hover { background: var(--c-bg-hover); }
.disclose > summary:focus-visible {
    outline: 2px solid var(--c-blue);
    outline-offset: -2px;
}

.disclose[open] > summary {
    border-bottom-color: var(--c-border-subtle);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.disclose > :where(:not(summary)) { padding: var(--sp-4); }
.disclose + .disclose { margin-top: var(--sp-2); }

/* Padding lives on the body child, never here: `block-size` is the content box,
   so padding on ::details-content would still paint a strip while collapsed. */
.disclose::details-content {
    block-size: 0;
    overflow: hidden;
    content-visibility: hidden;
    opacity: 0;
    /* --dur-normal, not slow: block-size animation is layout work every
       frame, and on a long page 400ms of reflow reads as chop ("choppy and
       it jumps" - owner annotation 2026-08-26). Shorter + an opacity fade
       masks the reflow instead of showcasing it. */
    transition: block-size var(--dur-normal) var(--ease-out),
                opacity var(--dur-normal) var(--ease-out),
                content-visibility var(--dur-normal) var(--ease-out) allow-discrete;
}
.disclose[open]::details-content {
    block-size: auto;
    content-visibility: visible;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .disclose > summary,
    .disclose > summary::after { transition: none; }
    /* Separate rule: on engines without ::details-content this selector is
       invalid, and merging it above would drop the chevron reset too. */
    .disclose::details-content { transition: none; }
}

/* ═══ Info tip (.info-tip) - the hover (i) ════════════════════════════════
   A quiet info dot whose bubble explains one thing on hover or keyboard
   focus. CSS-only, canonised 2026-08-27 from getting-started/results'
   .gss-cite-stat-info (the best of five page-local tooltip rebuilds).
   For a sentence of context on a label or stat - anything longer is a
   .disclose, anything essential goes in the copy itself.

       <span class="info-tip" tabindex="0"><i class="ph ph-info"></i>
         <span class="info-tip-bubble">Counted from referrer headers.</span>
       </span>
*/
.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--c-text-tertiary);
    cursor: help;
    border-radius: var(--r-sm);
}
.info-tip > i { font-size: 14px; }
.info-tip:hover, .info-tip:focus-visible {
    color: var(--c-text);
    outline: none;
}
.info-tip-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 240px;
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    color: var(--c-text-secondary);
    line-height: 1.5;
    text-transform: none;
    letter-spacing: normal;
    text-align: left;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    z-index: 60;
    transition: opacity var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus-visible .info-tip-bubble,
.info-tip:focus-within .info-tip-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .info-tip-bubble { transition: opacity var(--dur-fast) var(--ease-out); }
}

/* ═══ Explainer (.explain) - the click-open "why does this say that" ══════
   The third rung of the disclosure ladder, and it exists because the other
   two could not carry this weight:

     .info-tip   one sentence, on hover. No good on touch, and it cannot
                 hold a definition plus an example.
     .disclose   as long as you like, but it is an INLINE accordion, so
                 opening one in a toolbar shoves the whole row down.
     .explain    anchored, click-opened, holds a short title and a
                 paragraph, and moves nothing around it.

   It exists because we shipped the failure it prevents. The corpus chip on
   /reports/new explained itself through a bare `title=` attribute: a native
   browser tooltip with no affordance, no styling, nothing on touch, and no
   sign it was there at all. The owner clicked it, got nothing, and reported
   it as broken - correctly. `method-line.js` does the same thing with its
   notes. Any measurement that needs a caveat to be read honestly must not
   hide that caveat in a `title`.

   Anchoring and open-state deliberately copy .menu rather than inventing a
   second mechanism: same .is-open toggle, same @starting-style entry, same
   outside-click and Escape handling, driven by /js/explain.js.

       <span class="explain">
         <button class="explain-btn" aria-expanded="false"
                 aria-label="Why does this say that?">
           <i class="ph ph-question"></i></button>
         <span class="explain-panel" role="dialog">
           <span class="explain-title">Retrieval systems</span>
           <span class="explain-body">Google, ChatGPT, Claude and DeepSeek
             all read the same result set we fetch.</span>
         </span>
       </span>
*/
.explain { position: relative; display: inline-flex; align-items: center; }

.explain-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-text-tertiary);
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.explain-btn > i { font-size: 13px; }
.explain-btn:hover,
.explain-btn:focus-visible {
    color: var(--c-text);
    background: var(--c-bg-hover);
    outline: none;
}
.explain-btn[aria-expanded="true"] { color: var(--c-text); background: var(--c-bg-hover); }

.explain-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    gap: 4px;
    width: max-content;
    max-width: min(300px, calc(100vw - var(--sp-5)));
    padding: var(--sp-3);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    z-index: 260;
}
/* z 260 sits above the topbar and sidebar (100-200) and below modals (500)
   and toasts (1000) - an explainer opened from a sticky toolbar must clear
   the chrome it is anchored to, and must never cover a dialog. */

.explain.is-open .explain-panel { display: flex; }

@starting-style {
    .explain.is-open .explain-panel { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}
.explain.is-open .explain-panel {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

/* Flip to the edges when the trigger sits near the viewport edge - set by
   explain.js, which measures rather than guesses. */
.explain-panel--left  { left: 0; right: auto; transform: none; }
.explain-panel--right { left: auto; right: 0; transform: none; }
.explain.is-open .explain-panel--left,
.explain.is-open .explain-panel--right { transform: none; }
@starting-style {
    .explain.is-open .explain-panel--left,
    .explain.is-open .explain-panel--right { opacity: 0; transform: translateY(-4px); }
}

.explain-title {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--c-text);
}
.explain-body {
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    color: var(--c-text-secondary);
    line-height: 1.5;
}
.explain-body + .explain-body { margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
    .explain.is-open .explain-panel { transition: none; }
}

/* ═══ Sample selector (.sampler) - the ladder dropdown ════════════════════
   One component, two roles: a control on run screens (pick n, see what it
   buys and costs before spending), a readout on results (what this run WAS,
   with the rest of the ladder as context). Built by /js/sampler.js from
   /api/geo/sampling/ladders; the grade vocabulary never lives in markup.
   The face reads prefix + n + grade together - a grade chip without its
   referent is a random badge, and the prefix is the referent. */
/* inline-flex so the help button (.explain--help, from blSampler's help
   option) sits beside the face and wraps WITH it, never onto a line alone. */
.sampler { position: relative; display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.sampler > .sampler-face { min-width: 0; }

.sampler-face {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 12px;
    font-size: var(--fs-sm);
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.sampler-face:hover,
.sampler-face:focus-visible {
    border-color: var(--c-text-tertiary);
    background: var(--c-bg-hover);
    outline: none;
}
/* --c-border-strong, which these used, is not a token: the declaration was
   invalid and the border fell back to currentColor. */
.sampler-face[aria-expanded="true"] { border-color: var(--c-text-tertiary); }

.sampler-prefix {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text-tertiary);
}
.sampler-n {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-secondary);
    white-space: nowrap;
}
.sampler-caret { font-size: 12px; color: var(--c-text-tertiary); }
.sampler.is-open .sampler-caret { transform: rotate(180deg); }

/* A readout is history, not a control: a quieter face. The face itself
   still opens the ladder on click or Enter (the ladder is the context), so
   it keeps its pointer; nothing inside the panel selects, and the rungs say
   so by not reacting to hover at all. */
.sampler--readout > .sampler-face { background: transparent; }

.sampler-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    display: none;
    flex-direction: column;
    gap: 2px;
    width: max-content;
    max-width: min(360px, calc(100vw - var(--sp-5)));
    padding: var(--sp-2);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    z-index: 260;   /* same layer as .explain-panel, for the same reasons */
}
.sampler.is-open .sampler-panel { display: flex; }
.sampler-panel--right { left: auto; right: 0; }

.sampler-unit {
    padding: 2px 8px 6px;
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 4px;
}

/* One rung: mark, n, grade, price on the first line; the note wraps below.
   Grid rather than flex so the note can span while the first line keeps
   its columns aligned across rungs. */
.sampler-rung {
    display: grid;
    grid-template-columns: 16px auto auto 1fr;
    align-items: center;
    gap: 4px 8px;
    padding: 6px 8px;
    font-size: var(--fs-sm);
    font-family: inherit;
    text-align: left;
    color: var(--c-text);
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    cursor: pointer;
}
/* Only a control rung (a <button>) reacts to the pointer. A readout rung is
   a plain <div>: it states the ladder and a click does nothing, so it gets
   no hover wash and no hand cursor - looking clickable while doing nothing
   was the bug (owner report, 2026-09-22). Selection is the check mark alone,
   never a background, so a hovered row can never be mistaken for the
   selected one. */
div.sampler-rung { cursor: default; }
button.sampler-rung:hover { background: var(--c-bg-hover); }
button.sampler-rung:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--c-accent);   /* as .custom-select-option */
}

.sampler-rung-mark { width: 16px; font-size: 13px; color: var(--c-green); }
.sampler-rung-n {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-secondary);
    min-width: 2ch;
}
.sampler-price {
    justify-self: end;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    white-space: nowrap;
}
.sampler-rung-note {
    grid-column: 2 / -1;
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    line-height: 1.5;
    max-width: 300px;
}

/* Why a ladder tops out below T5. Tiers are absolute across audits, so a
   top rung of T3 is the truth about that audit, not a broken ladder - and
   without a sentence saying so it reads as one (owner, 2026-09-23). Written
   per ladder in core/shared/ladders.py (ceiling_note); sampler.js renders it
   only when the highest rung is below the top tier. */
.sampler-ceiling-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
    padding: 6px 8px 2px;
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    line-height: 1.5;
    border-top: 1px solid var(--c-border);
    max-width: 320px;
}
.sampler-ceiling-title { font-weight: var(--fw-semi); color: var(--c-text-secondary); }

/* The star, spelled out once at the bottom of every panel that shows one.
   The chip labels carry the * themselves - this line is what it means. */
.sampler-star-note {
    margin-top: 4px;
    padding: 6px 8px 2px;
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    line-height: 1.5;
    border-top: 1px solid var(--c-border);
    max-width: 320px;
}

/* ═══ First-run note (.first-note) - dismissable onboarding hint ══════════
   A quiet blue note that sits at the top of a card or section the first
   time someone opens a screen, and leaves for good when dismissed
   (2026-08-27). This is onboarding furniture, NOT a notification surface -
   errors and events still go through banners and toasts only. Wire the
   persistence with /js/first-note.js:

       <div class="first-note" data-first-note="dashboard-strategy" hidden>
         <i class="ph ph-lightbulb"></i>
         <div><strong>New here?</strong> Pin a competitor to compare …</div>
         <button class="first-note-dismiss" type="button" aria-label="Dismiss">
           <i class="ph ph-x"></i></button>
       </div>
       <script src="/js/first-note.js" defer></script>

   Ships `hidden`; the script unhides it unless its key was dismissed -
   so returning users never see a flash. Dismissal leaves on the dissolve. */
.first-note {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    background: var(--c-blue-soft);
    border: 1px solid color-mix(in srgb, var(--c-blue) 30%, transparent);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: 1.55;
    margin-bottom: var(--sp-4);
}
.first-note > i {
    color: var(--c-blue);
    font-size: 18px;
    flex: none;
    margin-top: 1px;
}
.first-note strong { color: var(--c-text); }
.first-note-dismiss {
    margin-left: auto;
    flex: none;
    border: 0;
    background: none;
    padding: 2px 4px;
    color: var(--c-text-tertiary);
    cursor: pointer;
    border-radius: var(--r-sm);
    line-height: 1;
}
.first-note-dismiss:hover {
    color: var(--c-text);
    /* Blue-tinted, not the grey hover token - a grey square on the blue
       note reads as a glitch (owner annotation, 2026-08-29). */
    background: var(--c-blue-soft);
    background: color-mix(in srgb, var(--c-blue) 15%, transparent);
}
/* Onboarding furniture leaves faster than cards - the 200ms card dissolve
   reads slow on a one-line note (owner annotation, 2026-08-29). */
.first-note.is-removing { animation-duration: var(--dur-fast); }

/* ── Native <select> chevron ─────────────────────────────────────────────
   `.input` pads symmetrically, which is right for a text input and wrong
   for a select: the browser draws its own arrow hard against the right
   border with nothing between them. Five pages rendered `<select
   class="input">` and all five had it (install, schema-generator,
   dashboard ×2, competitor), which is what moved this out of page CSS -
   five copies of the same override drift, and the first one to be edited
   silently stops matching the rest.

   Scoped to `select.input` so text inputs are untouched. Applies to every
   existing select with NO markup change, which is the point: the fix must
   not depend on each page remembering to add a wrapper.

   The chevron is a background SVG rather than a mask, because a mask
   clips the element it is applied to and would take the select's own
   background with it. That means the stroke colour is baked in, so the
   dark-theme override below is not optional - one grey cannot serve both
   surfaces. Both values track `--c-text-tertiary`; if that token moves,
   move these. */
select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: calc(var(--sp-3) * 2 + 10px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239e9a90' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  background-size: 14px 14px;
  cursor: pointer;
}
select.input::-ms-expand { display: none; }
[data-theme="dark"] select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23706c63' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

/* ──────────────────────────────────────────────────────────────
   Marketing hero mascot - George on a CENTRED public hero
   ──────────────────────────────────────────────────────────────
   `.tm-hero-frame` on the hero container, `<img class="tm-hero-george">`
   as its last child. Used by every `.tm-hero` in the dual-mode tool
   pages' `.tool-marketing` block, plus `/home` (`.geo-hero`) and the
   markupschema funnel front door (`.entry`) - hence the separate frame
   class rather than positioning `.tm-hero` itself: two of the thirteen
   public heroes are not `.tm-hero`, and baseline.css must not learn
   page-local class names.

   This is NOT the `.{p}-hero-george` pattern the signed-in audit heroes
   use (see geo/CLAUDE.md → "George hero pattern"). Those heroes are
   LEFT-aligned, so they reserve George's width with a `padding-right`
   magic number. A `.tm-hero` is `text-align: center` - its h1 spans the
   full content column and its sub/entry are centred inside their own
   max-widths, so there is no edge to pad against. George instead sits in
   the empty gutter beside the *bottom* of the hero, where the centred
   text is at its narrowest (`.tm-sub` 620px, `.tm-entry` 520px inside a
   940px column), and disappears entirely once that gutter closes.

   The hide breakpoint is on the VIEWPORT, and it is generous on purpose:
   below it George would be squeezed against the CTA rather than sitting
   beside it, and a squashed mascot reads as a bug. He is decoration -
   losing him costs the page nothing.

   Fixed box + `object-fit: contain` because the George assets are not one
   aspect ratio (most are square, `george-waving` is 0.66). A bare
   `width` would render the tall ones half again as high and push them out
   of the hero. */
.tm-hero-frame { position: relative; }
/* George is 220px wide at right:0 of a 940px column, and a centred 620px
   .tm-sub runs about 76px under him. Inside the framed hero the sub and
   the note stay narrow so the copy never reads through the mascot
   (measured on nine pages, 2026-09-22). */
.tm-hero-frame .tm-sub,
.tm-hero-frame .tm-cta-note { max-width: 460px; }
.tm-hero-frame .tm-cta-note { margin-inline: auto; }
.tm-hero-george {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 220px;
  height: 220px;
  object-fit: contain;
  object-position: right bottom;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
@media (max-width: 1240px) {
  .tm-hero-george { display: none; }
}

/* ============================================================
   DASHBOARD SPOT GEORGE
   The "Your site" dashboards (/site, /install, /rolling-schema,
   /traffic) carry a 180px spot George in the top-right of the
   masthead - the /install placement, promoted to a shared class
   2026-08-29. Dashboards are working screens, so George stays
   spot-sized; the .hero--george band (180px George) is for audit
   HUBS only. Never both on one page. The masthead container takes
   .bl-spot-head (reserves the gutter), the <img> takes
   .bl-spot-george and is always alt="" aria-hidden="true".
   ============================================================ */
.bl-spot-head { position: relative; padding-right: 204px; }
.bl-spot-george {
  position: absolute;
  top: -16px;
  right: 0;
  width: 180px;
  height: auto;
  pointer-events: none;
}
@media (max-width: 860px) {
  .bl-spot-head { padding-right: 0; }
  .bl-spot-george { display: none; }
}

/* ──────────────────────────────────────────────────────────────
   Load-order calm (2026-08-30)

   1. The related-tools footer is a logged-out marketing block. A signed-in
      user has every tool in the sidebar, and because the grid is static
      HTML it painted BEFORE the JS-driven tool UI - on a slow boot it was
      the only content on screen. Hidden outright for signed-in states
      (bl-known-user is the optimistic pre-auth hint, so returning users
      never see it flash either).

   2. The hub pages ship #hub-runs / #hub-tpls empty and inject their
      .hub-skeleton rows from boot JS - after the auth probe and fetch
      start, which is too late for first paint and for what a view
      transition captures. While the container is :empty, draw the same
      shimmer rows in pure CSS; the moment boot JS writes anything
      (skeletons included) the rule stops matching on its own. Signed-in
      states only - for anon visitors .tool-app is display:none and the
      marketing block already fills the page. Keyframes are local to this
      block reuses the vhshimmer keyframes centralised beside .hub-skeleton.
   ────────────────────────────────────────────────────────────── */
html.bl-known-user .related-tools,
html.bl-user .related-tools { display: none; }

html.bl-known-user #hub-runs:empty,
html.bl-user #hub-runs:empty,
html.bl-known-user #hub-tpls:empty,
html.bl-user #hub-tpls:empty {
    min-height: 160px;
    border-radius: var(--r-sm);
    background-image:
        repeating-linear-gradient(180deg, transparent 0 48px, var(--c-bg) 48px 56px),
        linear-gradient(90deg, var(--c-bg-sunken) 0%, var(--c-bg-raised) 50%, var(--c-bg-sunken) 100%);
    background-size: auto, 200% 100%;
    animation: vhshimmer 1.4s infinite linear;
}
@media (prefers-reduced-motion: reduce) {
    html.bl-known-user #hub-runs:empty,
    html.bl-user #hub-runs:empty,
    html.bl-known-user #hub-tpls:empty,
    html.bl-user #hub-tpls:empty { animation: none; }
}

/* ============================================================
   QUESTION-BANK HEADER (.qbank) - 2026-09-22
   The header at the top of every audit editor's question list:
   what the bank has EARNED (count + grade) on the right of the
   title, then one sunken bar holding the target rung, any depth
   control, and the single "Generate N from description" action.
   Built by static/js/question-bank.js (blQuestionBank); editors
   with no bank of their own put their control in the slot. The
   grade chips and samplers inside are canon and styled in their
   own sections - nothing here reaches into them.
   ============================================================ */
.qbank { display: flex; flex-direction: column; gap: var(--sp-3); }
.qbank-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-3);
    flex-wrap: wrap;
}
.qbank-head > .card-label { margin: 0; }
.qbank-earned { display: inline-flex; align-items: center; gap: var(--sp-2); }
.qbank-count {
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-secondary);
    white-space: nowrap;
}
.qbank-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3) var(--sp-5);
    flex-wrap: wrap;
    padding: var(--sp-3) var(--sp-4);
    background: var(--c-bg-sunken);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-md);
}
.qbank-bar:not(:has(:is(.qbank-go, .qbank-ctl):not([hidden]))) { display: none; }
/* Pickers on the right, the Generate action on the left (2026-09-23). */
.qbank-ctls {
    display: flex;
    align-items: center;
    gap: var(--sp-3) var(--sp-5);
    flex-wrap: wrap;
    margin-left: auto;
    min-width: 0;
}
.qbank-ctls:not(:has(> :not([hidden]))) { display: none; }
.qbank-ctl { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.qbank-ctl-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--c-text-secondary);
    white-space: nowrap;
}
.qbank-ctl-label:empty { display: none; }
.qbank-go {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
}
.qbank-gap {
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    white-space: nowrap;
}
.qbank-note {
    margin: 0;
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--c-text-tertiary);
}
@media (max-width: 640px) {
    .qbank-bar { flex-direction: column; align-items: stretch; padding: var(--sp-3); }
    .qbank-ctl { flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
    .qbank-ctl .sampler, .qbank-ctl > select, .qbank-ctl > .input { max-width: 100%; }
    /* The one reach into a canon piece: a phone is narrower than a face
       carrying prefix, count and grade, so the face may wrap its grade
       onto a second line instead of pushing out of the bar. */
    .qbank-ctl .sampler-face { flex-wrap: wrap; max-width: 100%; text-align: left; }
    .qbank-ctls { margin-left: 0; flex-direction: column; align-items: stretch; }
    .qbank-go { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
    .qbank-go .btn { justify-content: center; white-space: normal; }
}


/* --------------------------------------------------------------
   Audit run screen - the eight "run a new audit" pickers (reports,
   brand-reports, reputation-audit-reports, ai-vision-reports,
   active-competitors-reports, fanout-reports, site-pulse-reports and
   schema-audit-reports, each at /new). One anatomy, in this order:
     .run-screen-panel  "Pick a template"  - .run-screen-tpl rows
     .run-screen-panel  "Measurement"      - audit inputs, then
                        .run-screen-measure (depth control, or the n=1
                        Verified readout, plus the breadth readout),
                        .run-screen-hint, .run-screen-cost, .run-bar
   Eight page-local copies of this drifted apart within one day
   (2026-09-22): three spacings, two selection looks, meta lines split
   mid-word by word-break:break-all, and a run button that wrapped to
   two lines at 375px. The sampler and grade chips are NOT styled here -
   see .sampler and .grade. Headings are canon .card-label.
   -------------------------------------------------------------- */
.run-screen {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--sp-4) 0;
    font-family: var(--ff-product);
    letter-spacing: -0.02em;
}
.run-screen-panel {
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    margin-bottom: var(--sp-4);
}
.run-screen-panel[hidden] { display: none; }
/* One vertical rhythm inside a panel, whatever the audit puts there. */
.run-screen-panel > * + * { margin-top: var(--sp-4); }
.run-screen-panel > .card-label { margin-bottom: 0; }
.run-screen-panel > * + .run-screen-hint { margin-top: var(--sp-2); }
/* A template row is a real <button>: focusable, and it warms on hover
   rather than lifting, because it is a row in a list, not a card. */
.run-screen-tpl {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-md);
    background: var(--c-bg);
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.run-screen-tpl + .run-screen-tpl { margin-top: var(--sp-2); }
.run-screen-tpl:hover { border-color: var(--c-border); background: var(--c-bg-hover); }
.run-screen-tpl:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-accent-soft); }
.run-screen-tpl.is-selected { background: var(--c-blue-soft); border-color: var(--c-blue); }
.run-screen-tpl-body { flex: 1; min-width: 0; }
.run-screen-tpl-name { display: block; font-weight: var(--fw-semi); overflow-wrap: anywhere; }
.run-screen-tpl-meta {
    display: block;
    margin-top: 2px;
    font-family: var(--ff-mono);
    font-size: var(--fs-xs);
    color: var(--c-text-tertiary);
    overflow-wrap: anywhere;
}
.run-screen-tpl-check { flex-shrink: 0; font-size: 20px; color: var(--c-blue); opacity: 0.2; }
.run-screen-tpl.is-selected .run-screen-tpl-check { opacity: 1; }
.run-screen-measure { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.run-screen-measure:empty { display: none; }
.run-screen-hint {
    margin: 0;
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--c-text-tertiary);
}
.run-screen-hint[hidden] { display: none; }
/* The price line, painted by blRunCost.paint() (static/js/credit-costs.js).
   A receipt row, not a box: it closes the Measurement panel on a hairline,
   the way .card-actions closes a card, and sits directly above the run bar
   so the price and the Run button read as one decision.
     3 keywords x 3 engines x 1 wording .............. ~36 credits
   The left side is the calculation - the factors are the controls above it,
   mono like the sampler's own n - and the right side is the total, the only
   figure on the line, set like a stat value. The line used to be a sunken
   slab tinted by band inside a raised panel: the murky nested grey the
   colour rules hunt down, with an uppercase COST eyebrow under the panel's
   own eyebrow. Colour is the run's size in credits (fixed bands, see
   credit-costs.js) and lands on the total alone: --ok green (an ordinary
   run, calm), --warn amber, --big terracotta. Short of credits is a
   separate fact (.is-short) and gets its own row. */
.run-screen-cost {
    display: grid;
    gap: var(--sp-2);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--c-border-subtle);
}
.run-screen-cost-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--sp-3);
    row-gap: var(--sp-1);
    min-width: 0;
}
.run-screen-cost-calc {
    margin: 0;
    min-width: 0;
    font-family: var(--ff-mono);
    font-size: var(--fs-sm);
    letter-spacing: 0;
    line-height: 1.5;
    color: var(--c-text-secondary);
}
.run-screen-cost-term { white-space: nowrap; }
.run-screen-cost-f { border-radius: var(--r-sm); }
.run-screen-cost-fn { font-weight: var(--fw-medium); color: var(--c-text); }
.run-screen-cost-op { color: var(--c-text-tertiary); }
/* One beat on the factor whose count just moved, so a depth or engine change
   visibly lands on one term of the calculation. */
.run-screen-cost-f.is-changed { animation: run-screen-cost-moved 900ms var(--ease-out); }
.run-screen-cost-f.is-changed .run-screen-cost-fn { animation: run-screen-cost-moved-n 900ms var(--ease-out); }
@keyframes run-screen-cost-moved {
    from { background: var(--c-blue-soft); box-shadow: 0 0 0 3px var(--c-blue-soft); }
    to   { background: transparent; box-shadow: 0 0 0 3px transparent; }
}
@keyframes run-screen-cost-moved-n { from { color: var(--c-blue); } }
.run-screen-cost-msg { margin: 0; font-size: var(--fs-sm); color: var(--c-text-secondary); }
.run-screen-cost-calc:empty, .run-screen-cost-msg:empty { display: none; }
/* A dotted leader carries the eye from the last factor to the total. */
.run-screen-cost-lead {
    flex: 1 1 var(--sp-6);
    align-self: baseline;
    height: 0;
    border-bottom: 1px dotted var(--c-border);
}
.run-screen-cost-total {
    display: none;
    margin: 0 0 0 auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    line-height: var(--lh-tight);
}
.run-screen-cost.is-priced .run-screen-cost-total { display: block; }
.run-screen-cost:not(.is-priced) .run-screen-cost-lead { display: none; }
.run-screen-cost-n {
    font-size: var(--fs-xl);
    font-weight: var(--fw-semi);
    letter-spacing: -0.02em;
    color: var(--c-text);
    transition: color var(--dur-normal) var(--ease-out);
}
.run-screen-cost-unit { font-size: var(--fs-sm); color: var(--c-text-secondary); }
/* .rl-cost--* is the same band on a report level card (report-levels.js),
   grouped here so the two can never colour one band differently. */
.run-screen-cost--ok .run-screen-cost-n, .rl-cost--ok { color: var(--c-green); }
.run-screen-cost--warn .run-screen-cost-n, .rl-cost--warn { color: var(--c-amber); }
.run-screen-cost--big .run-screen-cost-n, .rl-cost--big { color: var(--c-hot); }
.run-screen-cost-side {
    display: none;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
}
.run-screen-cost.is-short .run-screen-cost-side { display: flex; }
.run-screen-cost-left {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    font-variant-numeric: tabular-nums;
    color: var(--c-hot);
    white-space: nowrap;
}
.run-screen-cost-note {
    margin: 0;
    font-size: var(--fs-xs);
    line-height: 1.5;
    color: var(--c-text-tertiary);
}
/* The run bar right under the line: the checkout reads as one block. */
.run-screen-cost + .run-bar { margin-top: var(--sp-3); }
/* A phone wraps the calculation, and a leader stranded on the second line
   reads as an underline, so the total simply takes the right edge. */
@media (max-width: 560px) {
    .run-screen-cost-lead { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .run-screen-cost-n { transition: none; }
    .run-screen-cost-f.is-changed,
    .run-screen-cost-f.is-changed .run-screen-cost-fn { animation: none; }
}
/* The corpus chip on /reports/new is a readout; its explainer sits beside
   it, so the chip itself must not promise a tooltip with cursor:help. */
.run-screen .chip.is-warn { cursor: default; }
/* Phone width: the priced run button is the longest label on the screen
   and wrapped to two lines beside Cancel. Stack the bar, primary first. */
@media (max-width: 560px) {
    .run-screen .run-bar { flex-direction: column-reverse; align-items: stretch; }
    .run-screen .run-bar-actions { flex-direction: column-reverse; }
    .run-screen .run-bar .btn { justify-content: center; }
}


/* === Measurement block (.measure) - "How this was measured" =============
   One block per audit results view, same anatomy and same place on all
   eight (2026-09-22). Before it, each view dropped its depth readout, breadth
   chip, corpus chips and method line wherever there was room - on
   /reports/view the depth readout sat as a bare div above the AI summary and
   read as something wedged in rather than part of the report.

   PLACEMENT: it closes the report's overview - after the headline numbers
   and the summary, before the first findings section. It qualifies what the
   reader has just read, so it comes after it, not before.

       <section class="measure" id="x-measure" hidden aria-labelledby="x-measure-title">
         <div class="measure-head">
           <h2 class="measure-title" id="x-measure-title"><i class="ph ph-ruler"></i> How this was measured</h2>
           <a class="measure-link" href="/methodology/visibility">How we measure <i class="ph ph-arrow-right"></i></a>
         </div>
         <div class="measure-axes"></div>     one row: .sampler--readout faces and .measure-axis
         <ul class="measure-notes"></ul>      one sentence per li: frame, caveats, method line
       </section>

   .measure-axis is the static twin of a readout .sampler face (same padding,
   border and font), for an axis with no ladder rung to open - a measured
   breadth, or the retrieval count. Its grade comes from blGradeChip(); this
   block never draws a grade itself. Any "why" goes through blExplain(), never
   a title= attribute (see .explain). Leave .measure-axes and .measure-notes
   with no whitespace inside so :empty hides them until page JS fills them. */
.measure {
    margin: 0 0 var(--sp-5);
    padding: var(--sp-4) var(--sp-5);
    background: var(--c-bg-raised);
    border: 1px solid var(--c-border-subtle);
    border-radius: var(--r-lg);
}
.measure[hidden] { display: none; }

.measure-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2) var(--sp-3);
    flex-wrap: wrap;
    margin-bottom: var(--sp-3);
}
.measure-title {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    line-height: 1.4;
    color: var(--c-text);
}
.measure-title > i { font-size: 16px; color: var(--c-text-tertiary); }
.measure-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs-xs);
    color: var(--c-blue);
    text-decoration: none;
    white-space: nowrap;
}
.measure-link:hover { text-decoration: underline; }

/* stretch, so a .measure-axis with no grade chip still matches the height
   of a readout face beside it - one row, one height. */
.measure-axes {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: var(--sp-2);
}
.measure-axes:empty { display: none; }

.measure-axis {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 5px 10px 5px 12px;
    font-size: var(--fs-sm);
    color: var(--c-text);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
}

.measure-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: var(--sp-3) 0 0;
    padding: var(--sp-3) 0 0;
    list-style: none;
    border-top: 1px solid var(--c-border-subtle);
    font-size: var(--fs-xs);
    line-height: 1.55;
    color: var(--c-text-tertiary);
}
.measure-notes:empty { display: none; }
.measure-axes:empty + .measure-notes { margin-top: 0; padding-top: 0; border-top: 0; }
.measure-notes > li { overflow-wrap: anywhere; }
.measure-notes > li > .explain { vertical-align: middle; margin-left: 2px; }
.measure-notes a { color: var(--c-blue); text-decoration: none; }
.measure-notes a:hover { text-decoration: underline; }
/* The method line is a sentence here, not a strip: let it wrap. */
.measure-notes .method-line { display: inline; }

/* A static axis plus its help button, kept together (blMeasureAxis). The
   item stretches so its bordered axis matches a readout face beside it. */
.measure-item { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.measure-item > .measure-axis { align-self: stretch; min-width: 0; flex-wrap: wrap; }

/* The action slot at the foot of an explainer: one "Find out more" button
   to the methodology section behind the sentence (blExplain opts.more,
   blHelp href). Every help explainer ends here, so the way out is always
   in the same place. */
.explain-actions { display: flex; margin-top: 6px; }
.explain-action { text-decoration: none; }

/* A "read more" link inside an .explain-panel body - the explainer says the
   one plain sentence, the link goes to the page that argues it. */
.explain-more {
    display: flex;
    align-items: center;
    gap: 4px;
    width: max-content;
    margin-top: 6px;
    font-size: var(--fs-xs);
    color: var(--c-blue);
    text-decoration: none;
}
.explain-more:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .measure { padding: var(--sp-4); }
}

/* -- Ladder tables and the methodology page frame (2026-09-23) --
   .ladder-table rides on .data-table: one audit axis on the absolute T1-T5
   scale, generated at compile time by core/shared/ladder_tables.py from
   core/shared/ladders.py (placeholder <!-- ladder:KIND:AXIS -->), never
   hand-written. Rungs the audit sells carry their normal .grade chip; tiers
   the ladder does not reach are .ladder-off rows with a .grade--off chip,
   so a reader sees where the audit tops out. .ladder-ceiling says why,
   .ladder-star explains the asterisk.

   .data-table--stack is the phone form of any short prose table (ladder
   tables carry it): under 640px the header hides and each row restacks -
   the leading cells on one line, the last cell full width beneath - so a
   table of sentences never clips inside .data-table-wrap's overflow.

   .mth-* is the shared frame of the nine /methodology pages: one column,
   one vertical rhythm (--sp-8 between sections, --sp-4 between everything
   inside one), so a table can never sit flush against the prose above it. */
.ladder-table td { vertical-align: top; }
.ladder-table th:first-child { white-space: normal; min-width: 6em; }
.ladder-table td:first-child { white-space: nowrap; }
.ladder-table td:last-child { color: var(--c-text-secondary); line-height: var(--lh-relaxed); }
.ladder-table .ladder-n { font-family: var(--ff-mono); }
.ladder-table .ladder-n .tag { margin-left: var(--sp-1); font-family: var(--ff-product); vertical-align: 1px; }
.ladder-table .num { white-space: nowrap; }
.ladder-off td { color: var(--c-text-tertiary); background: var(--c-bg-sunken); }
.ladder-table .ladder-off td:last-child { color: var(--c-text-tertiary); }
.grade--off {
    background: transparent;
    color: var(--c-text-tertiary);
    box-shadow: inset 0 0 0 1px var(--c-border);
}
.ladder-ceiling, .ladder-star {
    font-size: var(--fs-sm);
    color: var(--c-text-secondary);
    line-height: var(--lh-relaxed);
}
.ladder-star { font-size: var(--fs-xs); color: var(--c-text-tertiary); }
@media (max-width: 640px) {
    .data-table--stack thead { display: none; }
    .data-table--stack tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        column-gap: var(--sp-3);
        align-items: center;
        padding: var(--sp-3) var(--sp-4);
        border-bottom: 1px solid var(--c-border-subtle);
    }
    .data-table--stack tbody tr:last-child { border-bottom: none; }
    .data-table--stack td { padding: 0; border: none; }
    .data-table--stack td:last-child { grid-column: 1 / -1; margin-top: var(--sp-2); font-size: var(--fs-sm); }
    .data-table--stack td:first-child:nth-last-child(2) { grid-column: 1 / -1; font-weight: var(--fw-semi); }
    .data-table--stack td:first-child:nth-last-child(2) + td { margin-top: var(--sp-1); }
    .ladder-off { background: var(--c-bg-sunken); }
}

.mth-wrap { max-width: 880px; margin: 0 auto; padding: var(--sp-4) 0 var(--sp-10); }
.mth-back { margin-bottom: var(--sp-4); }
.mth-section { margin-top: var(--sp-8); }
.mth-section > * { margin: 0; }
.mth-section > * + * { margin-top: var(--sp-4); }
.mth-section > h2 { font-size: var(--fs-xl); font-weight: var(--fw-semi); letter-spacing: -0.02em; scroll-margin-top: 80px; }
.mth-section > h3 { font-size: var(--fs-md); font-weight: var(--fw-semi); margin-top: var(--sp-6); scroll-margin-top: 80px; }
.mth-section > p, .mth-section > ul { color: var(--c-text-secondary); line-height: var(--lh-relaxed); max-width: 72ch; }
.mth-section > ul { padding-left: var(--sp-5); }
.mth-section > ul li + li { margin-top: var(--sp-2); }
.mth-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
/* Other audits: a card per audit showing how far its ladders reach. */
.mth-audit-grid { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: var(--sp-3); }
.mth-audit { gap: var(--sp-3); transition: border-color var(--dur-fast) var(--ease-out); }
.mth-audit:hover, .mth-audit:focus-visible { border-color: var(--c-text-tertiary); }
.mth-audit .card-title { width: 100%; }
.mth-audit-go { margin-left: auto; color: var(--c-text-tertiary); transition: transform var(--dur-fast) var(--ease-out); }
.mth-audit:hover .mth-audit-go { transform: translateX(2px); color: var(--c-text-secondary); }
.mth-audit-tiers { display: flex; flex-direction: column; gap: var(--sp-2); }
.mth-audit-tier { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.mth-audit-axis { font-size: var(--fs-xs); font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-text-tertiary); }
.mth-audit-back { margin-top: var(--sp-4); }
@media (max-width: 600px) {
    .mth-audit-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
    .mth-audit-tier { flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
}
@media (prefers-reduced-motion: reduce) { .mth-audit, .mth-audit-go { transition: none; } }
.data-table--stack .tag { white-space: nowrap; }

/* ── Arrows inside links never carry the link's underline (2026-10-15) ──
   A link's underline is drawn by every inline box inside it, each from its
   own font: the Phosphor icon (or the fallback font that supplies a text
   arrow) sat its line at a different offset and thickness from the words, and
   in an inline-flex link the gap between label and icon broke the line. An
   inline-block box is atomic, so a parent's decoration is not propagated into
   it: the underline stays one continuous line under the words and the glyph
   sits clear of it. Icons do it on their ::before; a text arrow (&rarr;) goes
   in <span class="arr">. */
a [class*="ph-"]::before,
.arr {
    display: inline-block;
    text-decoration: none;
}

/* Native app chrome is supplied before the document's first paint. Only the
   site footer (a direct child of body) hides: content may use <footer> too. */
html[data-app] .topbar,
html[data-app] .sidebar,
html[data-app] .sidebar-overlay,
html[data-app] .hamburger,
html[data-app] body > footer,
html[data-app] #cc-main {
  display: none !important;
}

@media (max-width: 640px) {
  .topbar-inner { height: var(--sp-8); }
  .hamburger, .theme-toggle, .bl-lang-btn {
    min-width: calc(var(--sp-7) + var(--sp-1));
    height: calc(var(--sp-7) + var(--sp-1));
    flex-shrink: 0;
  }
  .topbar-brand-logo {
    width: calc(var(--sp-6) + var(--sp-1));
    height: calc(var(--sp-6) + var(--sp-1));
  }
  .topbar-brand-text { font-size: var(--fs-lg) !important; }
}
