/* The Infinite Archive — design-language CSS
 *
 * Tokens, reset, base typography, scanline overlay, and shared header /
 * logo / nav chrome. Loaded by every page; page-specific styles continue
 * to live in each page's <style> block until Phase 1 step 3 moves them
 * out into per-page CSS or templates.
 *
 * Phase 1 step 1: extracted from the duplicated inline <style> blocks in
 * the seven v0 pages. Canonical values are the majority across those
 * pages; the two divergent rules (html/body line-height on index,
 * awakenings, strength-index; .logo-text font-size on quantum) are kept
 * as one-line overrides in those pages' inline <style> blocks so v0
 * rendering is preserved exactly.
 */

:root {
  --bg: #050807;
  --bg-card: #0a120e;
  --bg-card-hover: #0d1812;
  --bg-input: #050907;
  --border: #1a3a26;
  --border-bright: #2e5a3e;
  --grid: #112016;
  --green: #4ade80;
  --green-bright: #86efac;
  --green-dim: #15803d;
  --green-mute: #166534;
  --text: #d1fae5;
  --text-mute: #6ee7b7;
  --text-faint: #5fc26a;
  --warn: #fbbf24;
  --warn-dim: #92400e;
  --danger: #ef4444;

  /* Archive accent system: data = Archivist domain (Trazyn —
     collecting, measuring, presenting), interp = Editor domain
     (Orikan — interpreting, judging). Used sparingly alongside the
     dominant phosphor green to add visual hierarchy without breaking
     the data-terminal identity. */
  --data: #a78bfa;          /* soft violet — primary data accent */
  --data-bright: #c4b5fd;   /* highlight variant */
  --data-dim: #6d28d9;      /* dim / border variant */

  --interp: #fbbf24;        /* warm gold — Editor's interpretation accent.
                               Same color family as --warn but semantically
                               distinct: use --warn for true warnings,
                               --interp for editorial accents. */
  --interp-bright: #fde68a; /* highlight variant */
  --interp-dim: #92400e;    /* dim / border variant */

  /* Third accent — user agency / interaction. Phase 6.1 introduced this
     for the dossier list-builder: checkboxes, selection counter, the
     user-list radar overlay polygon, toasts. Cyan keeps it distinct
     from --data (violet, measurement) and --interp (gold, editorial)
     while remaining inside the cool, saturated palette family. */
  --user-selection: #22d3ee;        /* cyan-400 - primary user-interaction accent */
  --user-selection-bright: #67e8f9; /* cyan-300 - highlight variant */
  --user-selection-faint: rgba(34, 211, 238, 0.18);  /* polygon fill / row tint */
  --user-selection-dim: #0e7490;    /* cyan-700 - dim / border variant */

  /* Captain Decision Archive team accents (Phase 1 polish). Two per-team
     accent slots so first-person captain voices are visually distinguishable
     at a glance, with the specific team→colour assignment editorial per
     entry. Warm is amber-700 (distinct from --warn / --interp gold so it
     never reads as a methodological-caution flag). Cool is sky-500
     (distinct from --user-selection cyan and from the --green family so it
     never reads as a UI-affordance signal). */
  --accent-warm:      #d97706;
  --accent-warm-bg:   rgba(217, 119, 6, 0.06);
  --accent-warm-mute: rgba(217, 119, 6, 0.55);
  --accent-cool:      #0ea5e9;
  --accent-cool-bg:   rgba(14, 165, 233, 0.06);
  --accent-cool-mute: rgba(14, 165, 233, 0.55);

  /* Theme-aware overlay rgba values. The body background-image and a
     handful of band/legend/tint blocks reach for green-tinted rgba()
     directly; centralising the "low-opacity faction green" wash here
     so the light-mode override doesn't need to chase the rule. Used
     in `body { background-image: ... }`, in the scanline overlay,
     and in the page-local soft-tint blocks that share the same wash. */
  --bg-radial-tint:   rgba(34, 197, 94, 0.06);
  --bg-gradient-end:  #030604;
  --header-bg:        rgba(5, 8, 7, 0.9);
  --scanline-tint:    rgba(74, 222, 128, 0.018);
  --logo-shadow:      rgba(74, 222, 128, 0.32);
  --logo-face-top:    rgba(134, 239, 172, 0.28);
  --logo-face-right:  rgba(74, 222, 128, 0.14);
  --logo-face-left:   rgba(22, 101, 52, 0.18);
}

/* ===========================================================================
   Light-mode theme. Opt-in via `<html data-theme="light">` (set by the
   inline initial-theme script in base.njk; persisted in localStorage by
   the toggle handler). Dark mode stays the default brand identity; light
   mode is the alternative for users who prefer it or whose environment
   demands it. Tokens here override every dark-mode color slot; the rest
   of the stylesheet flows through these vars unchanged.

   Notes on color choices:
   - Greens are darker on light backgrounds so they read as text/border
     accent rather than glow.
   - The `--data` violet drops to violet-700/violet-900 family for AA
     contrast on white.
   - The `--interp` and `--warn` golds shift to amber-700/amber-900 so
     the gold tone survives the light-mode background.
   - Scanline overlay is disabled (the CRT effect breaks visually on a
     light background; the dark-mode look is a "phosphor terminal"
     metaphor that doesn't transfer).
   - Logo SVG faces shift to subtle gray-on-white tints so the cube
     still reads as a 3D form but doesn't fight the rest of the page.
   =========================================================================== */
[data-theme="light"] {
  --bg:             #f5f5ef;  /* warm off-white */
  --bg-card:        #ffffff;
  --bg-card-hover:  #f9f9f3;
  --bg-input:       #ffffff;

  --border:         #d4d4d4;
  --border-bright:  #a3a3a3;
  --grid:           #e5e5e5;

  --green:          #15803d;
  --green-bright:   #166534;
  --green-dim:      #166534;
  --green-mute:     #86efac;

  --text:           #1a1a1a;
  --text-mute:      #404040;
  --text-faint:     #707070;

  --warn:           #b45309;
  --warn-dim:       #fde68a;
  --danger:         #b91c1c;

  --data:           #6d28d9;
  --data-bright:    #4c1d95;
  --data-dim:       #c4b5fd;

  --interp:         #b45309;
  --interp-bright:  #92400e;
  --interp-dim:     #fde68a;

  --user-selection:        #0891b2;
  --user-selection-bright: #0e7490;
  --user-selection-faint:  rgba(8, 145, 178, 0.12);
  --user-selection-dim:    #67e8f9;

  --accent-warm:      #ea580c;
  --accent-warm-bg:   rgba(234, 88, 12, 0.08);
  --accent-warm-mute: rgba(234, 88, 12, 0.65);
  --accent-cool:      #0284c7;
  --accent-cool-bg:   rgba(2, 132, 199, 0.08);
  --accent-cool-mute: rgba(2, 132, 199, 0.65);

  /* Theme-aware overlays — light-mode equivalents. The scanline
     overlay is intentionally transparent (effectively disabled; the
     pseudo-element is suppressed below too, but the var keeps any
     cell that reads it explicitly from blowing up). The body gradient
     ends in the same off-white as --bg so the page reads as a
     uniform warm field instead of a fading terminal screen. */
  --bg-radial-tint:   rgba(21, 128, 61, 0.04);
  --bg-gradient-end:  #efefea;
  --header-bg:        rgba(245, 245, 239, 0.92);
  --scanline-tint:    transparent;
  --logo-shadow:      rgba(21, 128, 61, 0.18);
  --logo-face-top:    rgba(21, 128, 61, 0.14);
  --logo-face-right:  rgba(21, 128, 61, 0.07);
  --logo-face-left:   rgba(21, 128, 61, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', 'JetBrains Mono', monospace;
  font-size: 15.5px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(ellipse at top, var(--bg-radial-tint) 0%, transparent 50%),
    linear-gradient(to bottom, var(--bg) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    var(--scanline-tint) 2px,
    var(--scanline-tint) 3px
  );
  z-index: 1;
  mix-blend-mode: screen;
}
/* Light-mode: suppress the scanline pseudo-element entirely (the CRT
   metaphor doesn't transfer). The var fallback above already makes the
   gradient transparent; this is the belt-and-braces guard. */
[data-theme="light"] body::before { display: none; }

header {
  position: relative; z-index: 10;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; align-items: center; gap: 32px;
  background: var(--header-bg);
  backdrop-filter: blur(4px);
}

.logo { display: flex; align-items: center; gap: 14px; }
a.logo { text-decoration: none; }
.logo svg { width: 46px; height: 46px; filter: drop-shadow(0 0 5px var(--logo-shadow)); }
.logo-text {
  font-size: 18px;
  letter-spacing: 0.32em;
  color: var(--green);
  font-weight: 600;
  line-height: 1.2;
}
.logo-sub {
  display: block;
  font-size: 10px;
  letter-spacing: 0.45em;
  color: var(--text-faint);
  margin-top: 3px;
}

nav { display: flex; gap: 22px; flex: 1; }
nav a {
  display: flex; flex-direction: column; gap: 2px;
  color: var(--text-faint);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
nav a .nav-name { font-size: 12px; letter-spacing: 0.2em; }
nav a .nav-desc { font-size: 8.5px; letter-spacing: 0.16em; opacity: 0.6; }
nav a.active { color: var(--green); border-bottom-color: var(--green); }
nav a:hover { color: var(--green-bright); }
nav a.active .nav-desc, nav a:hover .nav-desc { opacity: 0.95; }

/* Light/dark theme toggle button. Sits at the right end of the header
   nav line; the visible label is always the OPPOSITE-mode label, i.e.
   it tells the reader where the click will take them. In dark mode the
   button reads "LIGHT"; in light mode it reads "DARK". */
.theme-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--green-mute);
  color: var(--green-bright);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.22em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.theme-toggle:hover {
  background: rgba(74, 222, 128, 0.06);
  border-color: var(--green);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 2px;
}
.theme-toggle-label-light { display: none; }
.theme-toggle-label-dark  { display: inline; }
[data-theme="light"] .theme-toggle-label-light { display: inline; }
[data-theme="light"] .theme-toggle-label-dark  { display: none; }
[data-theme="light"] .theme-toggle:hover {
  background: rgba(21, 128, 61, 0.06);
}
/* When the header carries a search affordance + toggle, push the
   toggle past the search box (the search uses margin-left:auto today
   for the same purpose; we let the search keep that slot and rely on
   natural flow). */
header .search + .theme-toggle { margin-left: 14px; }

/* ===========================================================================
   Section bands
   The labelled, max-width content band used across the landing page and the
   section landings (Protocol, Chronicle, Dossiers, Matrix). Each band is a
   <section class="band"> with an optional .band-head label and .band-rule
   separator. Centralised here in Phase 1 step 4 so the new section landings
   compose against the same chrome as index.html without re-declaring it.
   =========================================================================== */
section.band {
  position: relative; z-index: 5;
  padding: 40px 32px;
  max-width: 1320px; margin: 0 auto;
}
.band-head {
  font-size: 12px; letter-spacing: 0.4em; color: var(--green);
  margin-bottom: 6px; font-weight: 500;
}
.band-rule { height: 1px; background: var(--border); margin-bottom: 24px; }

/* ===========================================================================
   Section landing pages (Protocol, Chronicle, Dossiers, Matrix)
   A common structural skeleton: title-hero, Archivist intro paragraph,
   "What's here now" / "Coming" list-grids, closing line. The four pages
   share these classes; their own pageStyle blocks stay empty.
   =========================================================================== */

/* Title hero — section name + functional descriptor + tagline. */
.section-hero {
  position: relative; z-index: 5;
  padding: 56px 32px 32px;
  max-width: 1320px; margin: 0 auto;
}
.section-hero .descriptor {
  font-size: 12px; letter-spacing: 0.4em; color: var(--green);
  margin-bottom: 8px; font-weight: 500;
}
.section-hero .title {
  font-size: 52px; letter-spacing: 0.1em; color: var(--green-bright);
  line-height: 1.04; margin-bottom: 14px;
}
.section-hero .tagline {
  font-size: 18px; color: var(--text-mute); line-height: 1.55;
  max-width: 760px;
}

/* Archivist-voice intro paragraph, left-border accented to echo the hero
   motto on the landing page (signals "this is the voice of the section"). */
.section-intro {
  position: relative; z-index: 5;
  padding: 8px 32px 24px;
  max-width: 1320px; margin: 0 auto;
}
.section-intro p {
  font-size: 16px; line-height: 1.85; color: var(--text-mute);
  max-width: 880px;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--green);
}

/* List grids for "What's here now" and "Coming" items.
   list-block: a card with a name (green-bright), a description (muted),
   and an optional .go link to the existing tool page.
   list-empty: a dashed-border placeholder for sections that have no
   live items yet (Protocol, Chronicle). */
.list-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}
.list-block {
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 16px 18px; position: relative;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.2s, background 0.2s;
}
.list-block.live:hover { border-color: var(--green); background: var(--bg-card-hover); }
.list-block .name {
  font-size: 15px; color: var(--green-bright); letter-spacing: 0.03em;
  font-weight: 500;
}
.list-block .desc {
  font-size: 13px; color: var(--text-mute); line-height: 1.65;
}
.list-block a.go {
  display: inline-block; margin-top: 8px;
  color: var(--green); font-size: 11px; letter-spacing: 0.22em;
  text-decoration: none; border-bottom: 1px dashed currentColor;
  align-self: flex-start;
}
.list-block a.go:hover { color: var(--green-bright); }
.list-block.live { cursor: pointer; }
.list-empty {
  border: 1px dashed var(--border-bright);
  background: rgba(74,222,128,0.025);
  padding: 18px 20px;
  font-size: 14px; color: var(--text-faint); line-height: 1.75;
  max-width: 880px;
}

/* Closing line — a measured sign-off, separated by a faint top rule. */
.section-closing {
  position: relative; z-index: 5;
  padding: 4px 32px 48px;
  max-width: 1320px; margin: 0 auto;
}
.section-closing p {
  font-size: 14.5px; line-height: 1.8; color: var(--text-faint);
  max-width: 820px;
  padding-top: 22px; border-top: 1px solid var(--grid);
  letter-spacing: 0.015em;
}
.section-closing p strong { color: var(--green-bright); font-weight: 500; }

@media (max-width: 880px) {
  .section-hero { padding: 36px 32px 24px; }
  .section-hero .title { font-size: 38px; }
}

/* ===========================================================================
   Footer meta strip — site-wide reference links rendered below each page's
   per-page <footer> content. Width: 100% forces it onto its own line inside
   the flex-wrap footer, regardless of how the surrounding page styles the
   footer element itself.
   =========================================================================== */
.footer-meta {
  width: 100%;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid var(--grid);
  font-size: 10.5px;
  letter-spacing: 0.22em;
}
.footer-meta a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.footer-meta a:hover { color: var(--green-bright); }

/* ===========================================================================
   Mockup banner — small gold strip used to label a card whose content is
   indicative / pre-launch rather than driven by a real pipeline. Pulls to
   the card edges via negative margins so it spans full-width inside a
   standard card with 20px horizontal / 18px top padding. Used on Quantum's
   Faction Attention cards while the R001 pipeline (Reddit + Trends +
   YouTube) is still Phase 4+ work.
   =========================================================================== */
.mockup-banner {
  display: block;
  background: rgba(251, 191, 36, 0.08);
  border-bottom: 1px solid var(--interp-dim);
  color: var(--interp);
  font-size: 10.5px;
  letter-spacing: 0.28em;
  padding: 6px 12px;
  margin: -18px -20px 12px;
  font-weight: 500;
}
.mockup-caption {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.55;
  letter-spacing: 0.04em;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid var(--grid);
}

/* ===========================================================================
   Long-form article layout — Phase 2 methodology articles.

   The Protocol section's existing pages are interactive tools (CI Explorer,
   Two-Proportion Test, etc.). The four methodology articles (Big Soup,
   Six Bins, Swiss Isn't Random, On Average) are long-form prose — a page
   type the site does not yet have. This block defines the shared treatment
   so all four pages are visually identical and so a future fifth article
   can extend the same layout by adding `class="article-page"` to its body.

   Conventions:
   - `.article-body` carries the readable column (max 720px) and the body
     prose rhythm. The header descriptor + title + tagline reuse the existing
     `.section-hero` (.descriptor uses ARTICLE in place of DASHBOARD / etc.).
   - `.article-lead` renders the lead blockquote as a gold-accented pulled
     quote — gold is the editorial/Methodology Library "interp" colour
     (matches the ARTICLES band on `/methodology-library.html`).
   - `.article-sidebar` is a set-off aside (left-border accented, slightly
     inset), distinct from body prose.
   - `.article-footnote` is a smaller, top-bordered note near the foot.
   - `.article-related` is the cross-link grid at the article foot. Reuses
     `.list-block.live` semantics so the cards match the Methodology
     Library directory.
   - Every rule uses design tokens that flip cleanly under
     `[data-theme="light"]`; the only theme-specific surface here is the
     lead-quote background tint (8%/4% gold) and the sidebar tint (4%/2%
     gold) — both are overridden in the light-mode block below.
   =========================================================================== */
.article-body {
  position: relative; z-index: 5;
  padding: 4px 32px 48px;
  max-width: 760px;
  margin: 0 auto;
}
.article-body p,
.article-body ul,
.article-body ol {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text-mute);
  letter-spacing: 0.005em;
  margin-bottom: 18px;
}
.article-body p:last-child { margin-bottom: 0; }
.article-body ul,
.article-body ol {
  padding-left: 22px;
}
.article-body li {
  margin-bottom: 8px;
}
.article-body strong {
  color: var(--text); font-weight: 500;
}
.article-body em { color: var(--text); font-style: italic; }
.article-body a {
  color: var(--green); text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
.article-body a:hover { color: var(--green-bright); }
.article-body h3 {
  font-size: 18px; letter-spacing: 0.06em;
  color: var(--green-bright);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--grid);
  font-weight: 500;
}
.article-body h3:first-child { margin-top: 12px; }

/* Lead blockquote — the pulled quote at the top of each article. Gold
   accent matches the Methodology Library ARTICLES band. Sits inside
   .article-body so it inherits the same readable measure. */
.article-lead {
  font-size: 18px; line-height: 1.7;
  color: var(--text);
  font-style: italic;
  background: rgba(251, 191, 36, 0.06);
  border-left: 3px solid var(--interp);
  padding: 18px 22px;
  margin: 0 0 32px;
  letter-spacing: 0.01em;
}
.article-lead p { margin: 0; color: var(--text); font-size: inherit; }
.article-lead p + p { margin-top: 10px; }

/* Tables — used for weapon-profile stat-lines and the small outcome /
   threshold tables in the articles. Tight, monospaced, terminal-styled. */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 22px;
  font-size: 13.5px;
  color: var(--text-mute);
}
.article-body th,
.article-body td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--grid);
}
.article-body th {
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.12em;
  font-size: 11.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.article-body tr:last-child td { border-bottom: 1px solid var(--border); }
.article-body td strong { color: var(--green-bright); }

/* Sidebars — "Sidebar — the machinery" sections. Gold-accented, set off
   from body prose by an inset background and left border. The `<h3>` style
   inside the sidebar is intentionally smaller and unbordered so the
   sidebar reads as a single block, not a continuation of the article. */
.article-sidebar {
  background: rgba(251, 191, 36, 0.04);
  border-left: 3px solid var(--interp-dim);
  padding: 20px 24px 22px;
  margin: 32px 0;
}
.article-sidebar h3 {
  font-size: 13.5px; letter-spacing: 0.22em;
  color: var(--interp);
  margin: 0 0 12px;
  padding-bottom: 0;
  border-bottom: none;
  text-transform: uppercase;
  font-weight: 500;
}
.article-sidebar p,
.article-sidebar ul,
.article-sidebar li {
  font-size: 14px; line-height: 1.75;
}
.article-sidebar ul { padding-left: 18px; }
.article-sidebar li { margin-bottom: 10px; }

/* Footnotes — smaller, top-bordered note near the foot of the article.
   Slightly muted so they read as supplementary. */
.article-footnote {
  margin: 28px 0;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  color: var(--text-faint);
  font-size: 13.5px;
  line-height: 1.75;
}
.article-footnote h3 {
  font-size: 12px; letter-spacing: 0.24em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin: 0 0 10px;
  padding-bottom: 0;
  border-bottom: none;
  font-weight: 500;
}
.article-footnote p { font-size: inherit; color: inherit; margin-bottom: 12px; }
.article-footnote em { color: var(--text-mute); }

/* Related footer at the article foot — links the sibling articles and
   the relevant tools. Reuses the directory's `.list-block.live` look so
   cards match the Methodology Library. The grid is constrained to a
   single 760px column so it doesn't break the article's reading rhythm.

   `.article-related-band` reuses the `.band-head--interp` token from the
   Library page; if the Library page is later refactored, this rule can
   inline the same `color: var(--interp-bright)` directly. */
.article-related {
  position: relative; z-index: 5;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}
.article-related-band {
  font-size: 11.5px; letter-spacing: 0.28em;
  color: var(--interp-bright);
  margin-bottom: 6px;
  font-weight: 500;
}
.article-related-rule {
  height: 1px;
  background: var(--interp);
  margin-bottom: 18px;
}
.article-related .list-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.article-related .list-block .name { font-size: 14px; }
.article-related .list-block .desc { font-size: 12.5px; }

/* Forward-reference text — a "planned" link that is rendered as plain
   text rather than an <a>, with a small muted suffix so readers see the
   distinction. Used for references to the Damage Distribution calculator
   and "Player or Army?" which do not yet have pages. */
.article-body .forward-ref {
  color: var(--text);
  font-style: italic;
}
.article-body .forward-ref::after {
  content: ' (planned)';
  color: var(--text-faint);
  font-style: normal;
  font-size: 0.9em;
  letter-spacing: 0.02em;
}

/* Chart container — both Six Bins and On Average embed a Chart.js bar
   chart inside an `.article-chart`. The Chart.js canvas MUST sit in its
   own dedicated, fixed-height, relatively-positioned parent
   (`.article-chart-canvas`): a responsive Chart.js canvas sizes itself
   to its parent, so if that parent is auto-height — as `.article-chart`
   is, since it also holds the legend and caption — the canvas grows
   without bound. Keep the canvas alone inside `.article-chart-canvas`. */
.article-chart {
  margin: 14px 0 28px;
  padding: 18px 18px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.article-chart-canvas {
  position: relative; height: 320px; width: 100%;
}
.article-chart canvas {
  display: block;
}
.article-chart-caption {
  font-size: 12.5px; line-height: 1.65;
  color: var(--text-faint);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--grid);
  letter-spacing: 0.015em;
}
.article-chart-caption .marker-swatch {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 4px;
  vertical-align: middle;
  border: 1px solid currentColor;
}
.article-chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 8px;
  font-size: 12px; color: var(--text-faint);
}
.article-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Light-mode tweaks: gold-tinted backgrounds get a stronger paper-on-white
   feel rather than the dark-mode glow. */
[data-theme="light"] .article-lead {
  background: rgba(180, 83, 9, 0.05);
}
[data-theme="light"] .article-sidebar {
  background: rgba(180, 83, 9, 0.03);
}

@media (max-width: 880px) {
  .article-body { padding: 4px 22px 40px; }
  .article-body h3 { font-size: 16.5px; }
  .article-lead { font-size: 16px; padding: 14px 16px; }
  .article-related { padding: 18px 22px 40px; }
}

/* ===========================================================================
   Captain Decision Archive — entry-walkthrough layout (shared across all
   five CHTT 2026 standalone entry pages).

   Previously inlined in `src/captain-decisions.html`'s pageStyle block,
   moved here when the Round 5 spotlight was promoted into its own page
   and Rounds 1-4 shipped as siblings — five pages now share the same
   walkthrough chrome, so the styling is genuinely reusable.

   The hub-only chrome (filters, the .decision-card index grid, the
   .crumb breadcrumb) stays inline on the hub itself.
   =========================================================================== */

/* ----- Arc rail ----- Cross-page navigation between the five CHTT round
   entry pages. Sits below the breadcrumb on each entry. Active round is
   marked; clicking any other round links to its page; "← BACK TO ARCHIVE"
   links to the hub. */
.arc-rail {
  position: relative; z-index: 5;
  padding: 8px 32px 16px;
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: center;
  font-size: 11.5px; letter-spacing: 0.22em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.arc-rail .arc-label {
  color: var(--text-faint);
  font-size: 10.5px; letter-spacing: 0.32em;
}
.arc-rail .arc-link {
  color: var(--text-mute);
  text-decoration: none;
  padding: 4px 9px;
  border: 1px solid var(--border);
  letter-spacing: 0.2em;
  font-size: 11px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.arc-rail .arc-link:hover {
  color: var(--green-bright);
  border-color: var(--green);
  background: var(--bg-card-hover);
}
.arc-rail .arc-link.active {
  color: var(--green-bright);
  border-color: var(--green);
  background: rgba(74, 222, 128, 0.08);
}
.arc-rail .arc-back {
  margin-left: auto;
  color: var(--text-faint);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  font-size: 11px;
}
.arc-rail .arc-back:hover { color: var(--green-bright); }
@media (max-width: 720px) {
  .arc-rail { padding: 8px 22px 14px; gap: 8px; }
  .arc-rail .arc-back { margin-left: 0; width: 100%; padding-top: 4px; }
}

/* ----- Entry container ----- Replaces the old `.spotlight` wrapper from
   when Round 5 was embedded inside the hub. Now: top-level on each entry
   page, framed border, holds the entry banner + context strip + tabs +
   references footer. */
.entry-card {
  margin: 0 32px 32px;
  border: 1px solid var(--border-bright);
  background: var(--bg-card);
  position: relative;
}
.entry-banner {
  background: linear-gradient(to right, rgba(74,222,128,0.08), transparent);
  border-bottom: 1px solid var(--border);
  padding: 22px 28px;
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 18px;
}
.entry-banner .eb-info { flex: 1; min-width: 280px; }
.entry-banner .eb-tag {
  font-size: 11px; letter-spacing: 0.3em;
  color: var(--green); margin-bottom: 6px;
}
.entry-banner .eb-title {
  font-size: 28px; letter-spacing: 0.04em;
  color: var(--green-bright); line-height: 1.2;
}
.entry-banner .eb-meta {
  font-size: 12.5px; color: var(--text-faint);
  letter-spacing: 0.12em; margin-top: 6px;
}
.entry-banner .eb-stakes {
  text-align: right;
  border-left: 1px solid var(--border);
  padding-left: 22px;
}
.entry-banner .eb-stakes .lbl {
  font-size: 10.5px; letter-spacing: 0.22em; color: var(--text-faint);
}
.entry-banner .eb-stakes .val {
  font-size: 16px; color: var(--green-bright); margin-top: 4px;
}
.entry-banner .eb-stakes .sub {
  font-size: 12px; color: var(--text-faint);
  margin-top: 2px; letter-spacing: 0.06em;
}

/* ----- Provenance + Editor disclosure banners ----- Sit ABOVE the
   entry-banner. Provenance (.single-captain-banner / .dual-captain-banner)
   flags how the entry was sourced; Editor-disclosure (.editor-disclosure)
   flags Editor-of-record COI when one applies. */
.single-captain-banner,
.dual-captain-banner {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid var(--green-mute);
  border-left: 3px solid var(--green);
  padding: 14px 22px;
  margin: 0 0 14px;
}
.single-captain-banner .dc-eyebrow,
.dual-captain-banner .dc-eyebrow {
  font-size: 10.5px; letter-spacing: 0.32em;
  color: var(--green); margin-bottom: 8px; font-weight: 500;
}
.single-captain-banner p,
.dual-captain-banner p {
  color: var(--text); font-size: 14px; line-height: 1.7; margin: 0;
}
.single-captain-banner p strong,
.dual-captain-banner p strong { color: var(--data); font-weight: 500; }
.single-captain-banner p + p,
.dual-captain-banner p + p { margin-top: 10px; }

.editor-disclosure {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid var(--warn);
  border-left: 3px solid var(--warn);
  padding: 14px 22px;
  margin: 0 0 18px;
}
.editor-disclosure .ed-eyebrow {
  font-size: 10.5px; letter-spacing: 0.32em;
  color: var(--warn); margin-bottom: 8px; font-weight: 500;
}
.editor-disclosure p {
  color: var(--text); font-size: 14px; line-height: 1.7; margin: 0;
}
.editor-disclosure p strong { color: var(--warn); font-weight: 500; }

/* Companion-entry note — Round 4 uses this to flag its tie to Round 5. */
.companion-entry-banner {
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid var(--data-dim);
  border-left: 3px solid var(--data);
  padding: 14px 22px;
  margin: 0 0 18px;
}
.companion-entry-banner .ce-eyebrow {
  font-size: 10.5px; letter-spacing: 0.32em;
  color: var(--data); margin-bottom: 8px; font-weight: 500;
}
.companion-entry-banner p {
  color: var(--text); font-size: 14px; line-height: 1.7; margin: 0;
}
.companion-entry-banner p strong { color: var(--data-bright); font-weight: 500; }
.companion-entry-banner p a {
  color: var(--data-bright); border-bottom: 1px dashed currentColor;
  text-decoration: none;
}

/* ----- Top context strip ----- Three-cell strip between the entry-banner
   and the tab nav: FINAL SCORE / KEY PLAYS / pinned captain quote. */
.context-strip {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.5fr;
  gap: 18px;
  padding: 20px 28px;
  background: rgba(74, 222, 128, 0.025);
  border-bottom: 1px solid var(--border);
}
.context-strip .cs-block .lbl {
  font-size: 10.5px; letter-spacing: 0.28em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.context-strip .cs-final .val {
  color: var(--green-bright); font-size: 22px;
  font-weight: 500; letter-spacing: 0.02em;
}
.context-strip .cs-final .sub {
  font-size: 12px; color: var(--text-faint);
  line-height: 1.55; margin-top: 4px;
}
.context-strip .cs-plays .plays-rows {
  font-size: 12.5px; line-height: 1.8; color: var(--text-mute);
}
.context-strip .cs-plays .plays-rows div { padding: 1px 0; }
.context-strip .cs-plays .team-bft { color: var(--accent-warm); font-weight: 500; }
.context-strip .cs-plays .team-rld { color: var(--accent-cool); font-weight: 500; }
.context-strip .cs-quote { align-self: stretch; }
.context-strip .cs-quote .captain-quote {
  margin: 0; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
}
@media (max-width: 1024px) {
  .context-strip { grid-template-columns: 1fr; }
}

/* ----- Tab nav (WAI-ARIA Tabs pattern) ----- Four-tab walkthrough below
   the context strip. Same shape across all five entries. Tab controller
   script lives in `src/_includes/captain-decision-tab-script.njk`. */
.entry-tabs { /* no chrome; lives inside .entry-card */ }
.tab-nav {
  display: flex; gap: 0;
  padding: 0 28px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab-nav button[role="tab"] {
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-faint);
  font-family: inherit; font-size: 11.5px;
  letter-spacing: 0.28em;
  padding: 14px 18px;
  cursor: pointer; white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.tab-nav button[role="tab"]:hover {
  color: var(--green);
  background: rgba(74, 222, 128, 0.04);
}
.tab-nav button[role="tab"][aria-selected="true"] {
  color: var(--green-bright);
  border-bottom-color: var(--green-bright);
  background: rgba(74, 222, 128, 0.04);
}
.tab-nav button[role="tab"]:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: -2px;
}
.tab-panels { padding: 24px 28px; }
.tab-panels [role="tabpanel"][hidden] { display: none; }

/* ----- Section blocks inside tab panels ----- */
.section-block { margin-bottom: 28px; }
.section-block h4 {
  font-size: 12px; letter-spacing: 0.3em;
  color: var(--green);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--grid);
  font-weight: 500;
}
.section-block p {
  color: var(--text-mute);
  font-size: 14px; line-height: 1.75;
  margin-bottom: 10px;
}
.section-block p strong { color: var(--data); font-weight: 500; }
.section-block ul {
  color: var(--text-mute);
  font-size: 13.5px; line-height: 1.7;
  margin: 6px 0 12px 18px;
}
.section-block ul li { margin-bottom: 4px; }

/* ----- Roster lists (THE TEAMS section) ----- */
.roster-list {
  list-style: none; padding: 0; margin: 6px 0 12px;
}
.roster-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--grid);
  font-size: 13.5px; color: var(--text-mute); line-height: 1.55;
}
.roster-list li:last-child { border-bottom: none; }
.roster-list .roster-faction {
  color: var(--green-bright); font-weight: 500; letter-spacing: 0.02em;
}
.roster-list .roster-detachment { color: var(--text); }
.roster-list .roster-arch {
  display: block; color: var(--text-mute);
  font-size: 12.5px; margin-top: 2px;
}

/* ----- Captain quotes ----- Default = green Editor-voice; team modifiers
   override the border + background colour so BFT vs RLD voices are
   distinguishable at a glance (R5's dual-captain pattern). */
.captain-quote {
  border-left: 3px solid var(--green);
  padding: 12px 16px;
  background: rgba(74, 222, 128, 0.04);
  margin: 14px 0;
}
.captain-quote .text {
  font-size: 14px; color: var(--text); line-height: 1.7;
}
.captain-quote .attr {
  font-size: 11.5px; letter-spacing: 0.22em;
  color: var(--text-faint); margin-top: 8px;
}
.captain-quote.bft {
  border-left-color: var(--accent-warm);
  background: var(--accent-warm-bg);
}
.captain-quote.bft .attr { color: var(--accent-warm-mute); }
.captain-quote.rld {
  border-left-color: var(--accent-cool);
  background: var(--accent-cool-bg);
}
.captain-quote.rld .attr { color: var(--accent-cool-mute); }

/* ----- Pre-round matrix view ----- Full 8×8 grid. Each cell carries one
   of five matrix-* tint classes (matrix-vbad through matrix-vgood),
   matching the WTC −2…+2 colour scheme. The 8 realized matchups carry
   a .played modifier with a ◆ marker in the cell corner. */
.matrix-view { margin-top: 28px; }
.matrix-grid {
  display: grid;
  grid-template-columns: 90px repeat(8, 1fr);
  gap: 2px;
  margin: 12px 0;
}
.matrix-corner { background: transparent; }
.matrix-col-header,
.matrix-row-header {
  font-size: 10.5px; letter-spacing: 0.05em;
  color: var(--text-mute);
  padding: 6px 3px;
  text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--grid);
  line-height: 1.25;
}
.matrix-col-header .m-faction,
.matrix-row-header .m-faction {
  display: block; font-size: 9.5px;
  color: var(--text-faint);
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-top: 2px;
}
.matrix-row-header { text-align: right; padding-right: 8px; }
.matrix-cell {
  padding: 10px 4px;
  text-align: center;
  border: 1px solid var(--grid);
  font-size: 13.5px;
}
.matrix-cell.empty {
  background: rgba(255, 255, 255, 0.015);
  color: transparent;
}
.matrix-cell.filled {
  background: var(--bg-card);
  font-weight: 500;
}
.matrix-cell.matrix-vgood {
  background: rgba(74, 222, 128, 0.20);
  border-color: var(--green);
  color: var(--green-bright);
  font-weight: 500;
}
.matrix-cell.matrix-good {
  background: rgba(74, 222, 128, 0.10);
  border-color: var(--green-mute);
  color: var(--green-bright);
}
.matrix-cell.matrix-even {
  background: var(--bg-card);
  color: var(--text);
}
.matrix-cell.matrix-bad {
  background: rgba(239, 68, 68, 0.06);
  border-color: #7f1d1d;
  color: var(--danger);
}
.matrix-cell.matrix-vbad {
  background: rgba(239, 68, 68, 0.14);
  border-color: #7f1d1d;
  color: var(--danger);
}
.matrix-cell.played {
  position: relative;
  border-width: 2px;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.45);
}
.matrix-cell.played::after {
  content: '\025C6';
  position: absolute;
  top: 2px; right: 4px;
  font-size: 9px;
  color: var(--green-bright);
  pointer-events: none;
}
.legend-row {
  display: flex; gap: 18px;
  font-size: 11.5px; color: var(--text-faint);
  letter-spacing: 0.12em;
  margin-top: 6px;
  flex-wrap: wrap;
}
.legend-row .swatch {
  display: inline-block; padding: 2px 6px;
  margin-right: 4px;
  border: 1px solid;
}
.legend-row .swatch.matrix-vbad  { background: rgba(239, 68, 68, 0.14); border-color: #7f1d1d; color: var(--danger); }
.legend-row .swatch.matrix-bad   { background: rgba(239, 68, 68, 0.06); border-color: #7f1d1d; color: var(--danger); }
.legend-row .swatch.matrix-even  { background: var(--bg-card); color: var(--text); border-color: var(--grid); }
.legend-row .swatch.matrix-good  { background: rgba(74, 222, 128, 0.10); border-color: var(--green-mute); color: var(--green-bright); }
.legend-row .swatch.matrix-vgood { background: rgba(74, 222, 128, 0.20); border-color: var(--green); color: var(--green-bright); }
.legend-row .empty-note {
  font-size: 10.5px; font-style: italic;
  color: var(--text-faint);
}
@media (max-width: 768px) {
  .matrix-grid {
    grid-template-columns: 70px repeat(8, 1fr);
    font-size: 11px;
  }
  .matrix-cell { padding: 6px 2px; }
  .matrix-col-header,
  .matrix-row-header { font-size: 9.5px; padding: 4px 2px; }
}

/* ----- Outcome / result tables ----- Per-game result table; rendered on
   every entry's "Result + Lessons" tab. The .matrix-good etc. tints are
   reused on the matrix-view column. */
.outcome-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  margin: 8px 0;
}
.outcome-table th {
  font-size: 11px; letter-spacing: 0.2em;
  color: var(--text-faint);
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.outcome-table td {
  padding: 8px 6px;
  color: var(--text-mute);
  border-bottom: 1px solid var(--grid);
}
.outcome-table tr:last-child td { border-bottom: none; }
.outcome-table .result {
  font-size: 10.5px; letter-spacing: 0.18em;
  padding: 2px 7px;
  border: 1px solid;
}
.outcome-table .result.W { color: var(--green); border-color: var(--green-mute); background: rgba(74,222,128,0.08); }
.outcome-table .result.L { color: var(--danger); border-color: #7f1d1d; background: rgba(239,68,68,0.06); }
.outcome-table .result.D { color: var(--interp); border-color: var(--interp-dim); background: rgba(251,191,36,0.06); }
.outcome-table .final-row td {
  border-top: 1px solid var(--green-mute);
  padding-top: 10px;
  color: var(--green-bright);
  font-size: 14.5px;
}
.outcome-table .matrix-good { color: var(--green-bright); }
.outcome-table .matrix-vgood{ color: var(--green-bright); }
.outcome-table .matrix-even { color: var(--text); }
.outcome-table .matrix-bad  { color: var(--danger); }
.outcome-table .matrix-vbad { color: var(--danger); }

/* ----- Riley's per-game one-liners list ----- */
.one-liners {
  list-style: none;
  padding: 0; margin: 12px 0 0;
}
.one-liners li {
  padding: 8px 0;
  border-bottom: 1px solid var(--grid);
  font-size: 13.5px; color: var(--text-mute); line-height: 1.6;
}
.one-liners li:last-child { border-bottom: none; }
.one-liners .pairing {
  color: var(--green);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-right: 6px;
}

/* ----- Sub-section dividers ----- */
.beat-divider {
  border: none;
  border-top: 1px solid var(--grid);
  margin: 18px 0 14px;
}

/* ----- Bottom references section ----- Tags + Sources + Related on every
   entry. Three-column grid; stacks vertically on narrow viewports. */
.entry-references {
  display: grid;
  grid-template-columns: 1fr 2fr 1.5fr;
  gap: 16px;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  background: rgba(74, 222, 128, 0.015);
}
.entry-references .aside-block { margin-bottom: 0; }
@media (max-width: 1024px) {
  .entry-references { grid-template-columns: 1fr; }
}

/* ----- Aside blocks (used inside entry-references) ----- */
.aside-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.aside-block .lbl {
  font-size: 10.5px; letter-spacing: 0.28em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.aside-block .val {
  color: var(--green-bright);
  font-size: 20px; font-weight: 500;
}
.aside-block .val.warn { color: var(--warn); }
.aside-block .desc {
  font-size: 12px; color: var(--text-faint);
  margin-top: 4px; line-height: 1.55;
}

/* ----- Tag strip / source list / related list ----- */
.tag-strip {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.tag-strip .tag {
  font-size: 11px; letter-spacing: 0.18em;
  color: var(--green);
  border: 1px solid var(--green-mute);
  padding: 3px 9px;
}
.source-list {
  font-size: 13px; line-height: 1.85;
}
.source-list a {
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
}
.source-list a:hover { border-bottom-color: var(--green); }
.source-list .role {
  color: var(--text-faint);
  font-size: 11.5px; letter-spacing: 0.1em;
  margin-left: 6px;
}
.related { font-size: 13px; color: var(--text-mute); line-height: 1.7; }
.related a {
  color: var(--green);
  text-decoration: none;
  display: block;
  padding: 5px 0;
  border-bottom: 1px solid var(--grid);
}
.related a:last-child { border-bottom: none; }
.related .planned {
  display: block;
  padding: 5px 0;
  border-bottom: 1px solid var(--grid);
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.related .planned:last-child { border-bottom: none; }
.related .planned .pending {
  color: var(--warn);
  font-size: 11px; letter-spacing: 0.22em;
  margin-left: 4px;
}

@media (max-width: 768px) {
  .entry-card { margin: 0 22px 28px; }
  .entry-banner { padding: 18px 22px; }
  .entry-banner .eb-stakes { border-left: none; padding-left: 0; text-align: left; }
  .tab-nav { padding: 0 22px; }
  .tab-panels { padding: 20px 22px; }
  .entry-references { padding: 18px 22px; }
}

/* ────────────────────────────────────────────────────────────────────────
   Quantum dashboard — Theory tab (Strength Index bucket view + faction
   signal-breakdown selector). Light-mode-aware via the existing tokens.
   ──────────────────────────────────────────────────────────────────── */

.si-buckets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.si-bucket {
  background: rgba(74, 222, 128, 0.03);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.si-bucket--stronger { border-top: 2px solid var(--green); }
.si-bucket--average  { border-top: 2px solid var(--text-mute); }
.si-bucket--weaker   { border-top: 2px solid var(--warn); }
.si-bucket-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--grid);
  margin-bottom: 6px;
}
.si-bucket-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text);
}
.si-bucket--stronger .si-bucket-label { color: var(--green); }
.si-bucket--weaker   .si-bucket-label { color: var(--warn); }
.si-bucket-count {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}
.si-bucket-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  font-size: 12.5px;
  border-bottom: 1px dotted var(--grid);
}
.si-bucket-row:last-child { border-bottom: none; }
.si-bucket-row .rk {
  color: var(--text-faint);
  font-size: 11px;
  text-align: right;
  letter-spacing: 0.05em;
}
.si-bucket-row .faction { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-bucket-row .faction a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--green-dim); }
.si-bucket-row .faction a:hover { color: var(--green-bright); border-bottom-color: var(--green); }
.si-bucket-row .z {
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}
.si-bucket-empty {
  color: var(--text-faint);
  font-size: 12px;
  font-style: italic;
  padding: 4px 0;
}

/* Faction signal-breakdown selector */
.composite-breakdown-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}
.cb-label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}
.cb-select {
  flex: 1;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.cb-select:focus { outline: none; border-color: var(--border-bright); }
.composite-breakdown-host {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cb-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--grid);
}
.cb-faction-name {
  font-size: 14px;
  color: var(--text);
  letter-spacing: 0.04em;
}
.cb-composite {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
}
.cb-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cb-row {
  display: grid;
  grid-template-columns: 110px 50px 1fr 64px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px dotted var(--grid);
}
.cb-row:last-child { border-bottom: none; }
.cb-label-cell {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}
.cb-weight {
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-align: right;
}
.cb-bar-cell {
  position: relative;
  height: 16px;
  background: rgba(74, 222, 128, 0.04);
  border-radius: 2px;
  overflow: hidden;
}
.cb-bar-axis {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border-bright);
}
.cb-bar {
  position: absolute;
  top: 2px;
  bottom: 2px;
  height: 12px;
  border-radius: 2px;
}
.cb-bar--pos {
  left: 50%;
  background: var(--green);
}
.cb-bar--neg {
  right: 50%;
  background: var(--warn);
}
.cb-z {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text);
  text-align: right;
  letter-spacing: 0.04em;
}
.cb-z--nodata {
  color: var(--text-faint);
  font-style: italic;
  font-size: 11px;
}
.cb-row--nodata .cb-bar-cell { opacity: 0.4; }
.cb-footer {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding-top: 4px;
}
.cb-empty {
  color: var(--text-faint);
  font-style: italic;
  font-size: 12.5px;
  padding: 12px 0;
}

@media (max-width: 768px) {
  .si-buckets { grid-template-columns: 1fr; }
  .cb-row { grid-template-columns: 90px 44px 1fr 56px; }
}

/* ────────────────────────────────────────────────────────────────────────
   Quantum dashboard — ELO tab roster search. Sits between the
   leaderboard head and the leaderboard scroll. Light-mode-aware via
   the existing tokens.
   ──────────────────────────────────────────────────────────────────── */
.elo-leaderboard-search {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 6px 10px;
  align-items: center;
  margin: 10px 0 14px;
  padding: 8px 12px;
  background: rgba(74, 222, 128, 0.03);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.elo-search-label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  grid-row: 1;
  grid-column: 1;
}
.elo-search-input {
  grid-row: 1;
  grid-column: 2;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
  min-width: 0;
}
.elo-search-input::placeholder {
  color: var(--text-faint);
  opacity: 0.7;
  font-style: italic;
}
.elo-search-input:focus { outline: none; border-color: var(--border-bright); }
.elo-search-clear {
  grid-row: 1;
  grid-column: 3;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 14px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  line-height: 1;
}
.elo-search-clear:hover { color: var(--green); border-color: var(--border-bright); }
.elo-search-status {
  grid-row: 2;
  grid-column: 1 / -1;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  min-height: 14px;
}
.elo-search-status.hit   { color: var(--text-mute); }
.elo-search-status.empty { color: var(--warn); }

/* ────────────────────────────────────────────────────────────────────────
   Quantum dashboard — Performance tab faction snapshot table. All
   factions in one sortable table; default sort is Real WR desc. Thin-
   sample rows get a muted treatment.
   ──────────────────────────────────────────────────────────────────── */
.faction-snapshot {
  margin: 20px 0 8px;
}
.faction-snapshot-head {
  margin-bottom: 8px;
}
.faction-snapshot-head h3 {
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--data);
  margin: 0 0 4px 0;
}
.faction-snapshot-sub {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.faction-snapshot-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
}
.faction-snapshot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.faction-snapshot-table th {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  color: var(--text-mute);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.faction-snapshot-table th.th-sortable {
  cursor: pointer;
  user-select: none;
}
.faction-snapshot-table th.th-sortable:hover { color: var(--green-bright); }
.faction-snapshot-table th.th-sortable[aria-sort="ascending"],
.faction-snapshot-table th.th-sortable[aria-sort="descending"] {
  color: var(--green);
}
.faction-snapshot-table th .sort-arrow {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
}
.faction-snapshot-table td {
  padding: 6px 10px;
  border-bottom: 1px dotted var(--grid);
  color: var(--text);
  text-align: center;
}
.faction-snapshot-table tbody tr:last-child td { border-bottom: none; }
.faction-snapshot-table tbody tr:hover { background: rgba(74, 222, 128, 0.04); }
.faction-snapshot-table td.td-faction {
  color: var(--text);
  white-space: nowrap;
}
.faction-snapshot-table td.td-faction a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--data-dim);
}
.faction-snapshot-table td.td-faction a:hover {
  color: var(--data-bright);
  border-bottom-color: var(--data-bright);
}
.faction-snapshot-table td.td-num {
  white-space: nowrap;
}
.faction-snapshot-table td.td-nodata {
  color: var(--text-faint);
  font-style: italic;
}

/* Visual Wilson 95% CI cell — a compact forest-plot row inside one
   table cell. Scale: 0.30 WR → 0%, 0.50 → 50%, 0.70 → 100%. */
.faction-snapshot-table th.th-wr,
.faction-snapshot-table td.td-wr {
  min-width: 130px;
  padding-left: 12px;
  padding-right: 12px;
}
.wr-ci-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.wr-ci-track {
  position: relative;
  height: 10px;
  background: rgba(74, 222, 128, 0.05);
  border-radius: 2px;
  overflow: hidden;
}
.wr-ci-ref {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 50%;
  width: 1px;
  background: var(--text-faint);
  opacity: 0.55;
}
.wr-ci-band {
  position: absolute;
  top: 3px;
  bottom: 3px;
  background: var(--data);
  opacity: 0.6;
  border-radius: 1px;
}
.wr-ci-point {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 2px;
  margin-left: -1px;
  background: var(--data-bright);
}
.wr-ci-label {
  font-size: 11px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.wr-ci-meta {
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.04em;
  margin-left: 3px;
}
.faction-snapshot-table tbody tr.small-n .wr-ci-band { opacity: 0.35; }
.faction-snapshot-table tbody tr.small-n .wr-ci-point { background: var(--text-mute); }
.faction-snapshot-table tbody tr.small-n td { color: var(--text-faint); }
.faction-snapshot-table tbody tr.small-n td.td-faction a { color: var(--text-faint); }
.td-small-n-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid var(--warn-dim);
  color: var(--warn);
  font-size: 9px;
  letter-spacing: 0.14em;
  border-radius: 2px;
  vertical-align: middle;
}
.faction-snapshot-foot {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
.faction-snapshot-foot .legend {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid var(--warn-dim);
  color: var(--warn);
  font-size: 9px;
  letter-spacing: 0.14em;
  border-radius: 2px;
}
.faction-snapshot-foot a {
  color: var(--text-mute);
  text-decoration: none;
  border-bottom: 1px dashed var(--data-dim);
}
.faction-snapshot-foot a:hover { color: var(--green-bright); border-bottom-color: var(--green); }

/* ────────────────────────────────────────────────────────────────────────
   Typed-content step 2 — dispatch body shared styles. The dispatch body
   include lives at src/_includes/dispatch-001-body.njk and is rendered
   both on its standalone page and inside Awakenings; the rules below
   target the wrapper so the prose looks identical in both surfaces.
   ──────────────────────────────────────────────────────────────────── */

/* The body itself reuses .article-body (set elsewhere) for type-scale,
   line-height, paragraph spacing, etc. We add only the dispatch-
   specific touches here. */
.dispatch-body {
  /* Dispatch is centred under whichever hero its parent renders. The
     standalone page wraps it in a max-width hero already; Awakenings
     ships its own .aw-feed-wrap below. The article-body max-width
     (760px, set elsewhere) keeps the reading measure consistent. */
}

/* Shared figure + sign-off rules for Editor-voice long-form content
   — used by both the Awakenings dispatch include and the Protocol
   feature long-reads (e.g. /where-cover-lives.html). The class
   names are aliased rather than renamed so existing surfaces stay
   bytewise unchanged. Both treatments centre the figure inside the
   article-body's 760px reading measure with a token-themed border
   + bg; the caption picks up the muted text colour and tightens its
   own measure for visual rhythm. */
.dispatch-figure,
.article-figure {
  margin: 28px 0;
  text-align: center;
}
.dispatch-figure img,
.article-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
}
.dispatch-figure figcaption,
.article-figure figcaption {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  line-height: 1.6;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.dispatch-signoff,
.article-signoff {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--grid);
  color: var(--interp);
  letter-spacing: 0.06em;
  font-size: 14px;
  font-style: italic;
}

@media (max-width: 700px) {
  .dispatch-figure,
  .article-figure { margin: 20px 0; }
  .dispatch-figure figcaption,
  .article-figure figcaption { font-size: 12px; }
}
