/* ── FLARE project page ────────────────────────────────────────────────────
   Editorial / low-contrast palette: an academic project-page aesthetic with
   warm paper bg, near-black text, deep forest accent, muted support hues.
   No saturated blues or purples. Light-mode only.
   ──────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: only light;

  --bg:         #f5f3ee;
  --bg-soft:    #ede9e0;
  --surface:    #ffffff;
  --surface-2:  #faf8f3;
  --border:     #e3dfd5;
  --border-2:   #cfc9b9;

  --text:       #1a1a18;
  --text-2:     #5b5b56;
  --text-3:     #6f6c64;
  --muted:      #8a8579;

  /* Accent: deep muted forest (the only chromatic accent) */
  --accent:     #3f5b54;
  --accent-2:   #5a7a72;
  --accent-bg:  #eaedea;

  /* Two-mode hues — AR (forest) vs Diffusion (warm ochre), desaturated */
  --ar:         #3f5b54;
  --ar-bg:      #eaedea;
  --diff:       #a07a49;
  --diff-bg:    #f1ebe1;

  /* Delta / status */
  --good:        #5a7a52;
  --good-bg:     #ecf0e7;
  --mid:         #9a7a42;
  --mid-bg:      #f1ebde;
  --bad:         #9a5a52;
  --bad-bg:      #efe5e2;

  --shadow-sm: 0 1px 2px rgba(26,26,24,0.04);
  --shadow-md: 0 6px 18px -10px rgba(26,26,24,0.18);
  --shadow-lg: 0 24px 50px -30px rgba(26,26,24,0.28);
}

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

html, body { background: var(--bg); color: var(--text); }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; text-align: left;
}
a { color: inherit; }

/* ── Floating nav ──────────────────────────────────────────────────────── */
.floating-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: none; justify-content: center; gap: 4px;
  padding: 10px 20px;
  background: rgba(245,243,238,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.floating-nav.visible { display: flex; transform: translateY(0); opacity: 1; }
.floating-nav-link {
  color: var(--text-2); text-decoration: none;
  font-size: 0.8rem; font-weight: 500;
  padding: 6px 14px; border-radius: 16px;
  transition: color 0.18s, background-color 0.18s; white-space: nowrap;
}
.floating-nav-link:hover { color: var(--text); background: var(--bg-soft); }
.floating-nav-link.active { color: var(--surface); background: var(--text); }
@media (max-width: 900px) { .floating-nav { display: none !important; } }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.header-wrapper {
  background: linear-gradient(180deg, #f0ede5 0%, #ebe7dc 60%, #e7e2d4 100%);
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--border);
}
/* paper-grain dot lattice */
.header-wrapper::after {
  content: '';
  position: absolute; inset: 0; z-index: 2;
  background-image: radial-gradient(rgba(26,26,24,0.05) 1px, transparent 1.2px);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.55;
}

.header-container {
  position: relative; z-index: 3;
  display: flex; justify-content: center; align-items: center;
  padding: 96px 50px 80px;
}
.header-content {
  color: var(--text); text-align: left; max-width: 920px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 42px 46px;
  box-shadow: var(--shadow-lg);
}

.header-eyebrow {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px;
}
.pill {
  font-size: 0.7rem; font-weight: 500;
  color: var(--text-2);
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border);
  padding: 3px 11px; border-radius: 20px;
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}

.header-content h1 {
  font-weight: 700;
  line-height: 1.05; margin-bottom: 0.6em; color: var(--text);
  display: flex; flex-direction: column; gap: 0.18em;
}
.title-acronym {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 3.0em; font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  font-style: normal;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  display: inline-flex; align-items: center; gap: 0.32em;
  line-height: 1;
}
.title-acronym .flame { color: var(--diff); font-style: italic; }
.title-subtitle {
  font-size: 1.15em; font-weight: 500; color: var(--text);
  line-height: 1.35;
  max-width: 42ch;
}

/* In-card author byline */
.header-byline {
  margin: 0 0 22px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.hb-authors {
  font-size: 0.98em; line-height: 1.7; color: var(--text);
  margin-bottom: 8px;
}
.hb-authors .author {
  white-space: nowrap;
}
.hb-authors .author-link {
  color: var(--accent); text-decoration: none; white-space: nowrap;
  font-weight: 500;
}
.hb-authors .author-link:hover {
  text-decoration: underline; text-underline-offset: 3px;
}
.hb-authors sup { color: var(--text-3); font-size: 0.7em; }
.hb-meta {
  font-size: 0.82em; color: var(--text-3);
  display: flex; flex-wrap: wrap; gap: 0 8px; align-items: baseline;
}
.hb-affiliation { color: var(--text-2); font-weight: 500; }
.hb-sep { color: var(--muted); }
.hb-foot { color: var(--text-3); }

.header-content .header-description {
  font-size: 1.0em; line-height: 1.7; color: var(--text-2);
  margin-bottom: 1.6em; max-width: 60ch;
  text-align: left;
}
.header-content .header-description strong { color: var(--text); font-weight: 600; }
.header-content .header-description em {
  color: var(--accent); font-style: italic; font-weight: 500;
}

.header-links { display: flex; flex-wrap: wrap; gap: 7px; }
.header-links a.button {
  font-size: 0.85em; font-weight: 500;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-2); border-radius: 2px;
  padding: 8px 16px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all 0.18s ease;
}
.header-links a.button:hover {
  border-color: var(--text); color: var(--text);
  background: var(--surface);
  transform: translateY(-1px);
}
.header-links a.button.primary {
  background: var(--text); color: var(--surface);
  border-color: var(--text);
}
.header-links a.button.primary:hover {
  background: #000; border-color: #000; color: var(--surface);
}
.header-links a.button.disabled {
  opacity: 0.45; pointer-events: none; cursor: default;
}
.header-links .icon { display: inline-flex; align-items: center; }
.btn-logo {
  height: 16px; width: auto; display: inline-block; vertical-align: middle;
}
.cta-banner .button .btn-logo { filter: invert(1) brightness(1.05); }

/* TL;DR ribbon */
.tldr-ribbon {
  margin-top: 28px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  padding-top: 22px; border-top: 1px solid var(--border);
}
.tldr-item { text-align: left; }
.tldr-num {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600; font-size: 1.9em;
  color: var(--text);
  line-height: 1.0;
  letter-spacing: -0.02em;
}
.tldr-num .unit { font-size: 0.5em; color: var(--text-3); font-weight: 500; }
.tldr-label {
  font-size: 0.7rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3); margin-top: 6px;
}

@media (max-width: 767px) {
  .header-container { padding: 56px 18px 50px; }
  .header-content { padding: 26px 22px; }
  .title-acronym { font-size: 2.2em; }
  .title-subtitle { font-size: 1.0em; }
  .tldr-ribbon { grid-template-columns: repeat(2, 1fr); }
}

/* ── Content layout ────────────────────────────────────────────────────── */
.content-section {
  grid-column: screen !important;
  max-width: 1120px; width: 100%;
  margin: 0 auto; padding: 56px 50px;
}
@media (max-width: 480px) { .content-section { padding: 40px 22px; } }
.content-section .text { width: 100%; margin: 0; }

.section-header { margin-bottom: 1.1em; }
.section-kicker {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  color: var(--accent); letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 10px;
}

/* ── Typography ────────────────────────────────────────────────────────── */
.text {
  width: 100%; margin: 0;
  font-size: 1.0rem; line-height: 1.7; color: var(--text-2);
  text-align: left;
}
h2.text {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.0em; font-weight: 600; color: var(--text);
  letter-spacing: -0.015em; line-height: 1.15;
  font-variation-settings: "opsz" 144, "SOFT" 40;
}
h3.text { font-size: 1.05em; color: var(--text); font-weight: 600; margin: 1.5em 0 0.5em; }
.section-lead {
  font-size: 1.02em; max-width: 72ch; color: var(--text-2);
}
.section-lead strong { color: var(--text); font-weight: 600; }
.section-lead em { color: var(--accent); font-style: italic; font-weight: 500; }
p.text + p.text { margin-top: 1em; }

.caption-text {
  font-size: 0.85rem; color: var(--text-3); margin-top: 0.8em;
}
.subsection-title {
  margin: 2.2em 0 0.7em !important;
  font-size: 0.78rem !important;
  color: var(--text-3) !important; font-weight: 600 !important;
  text-transform: uppercase; letter-spacing: 0.16em;
  border-top: 1px solid var(--border); padding-top: 1.2em !important;
}
figcaption { font-size: 0.88em; margin-top: 0.6em; text-align: center; color: var(--text-3); }

/* ── Abstract highlight box ────────────────────────────────────────────── */
.highlight-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem; line-height: 1.75;
  text-align: left; margin: 14px 0 0;
  padding: 28px 32px;
  color: var(--text);
}
.highlight-box strong { color: var(--text); font-weight: 600; }
.highlight-box em { color: var(--accent); font-style: italic; font-weight: 500; }

/* ── Promo video ───────────────────────────────────────────────────────── */
.promo-figure { padding: 12px 12px 10px; margin: 0 0 32px; }
.promo-video {
  width: 100%; height: auto; display: block; border-radius: 3px;
  background: var(--bg-soft); border: 1px solid var(--border);
}
.promo-figure figcaption {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  font-family: 'Fraunces', Georgia, serif; font-style: italic;
  color: var(--text-2); font-size: 0.92rem;
}

/* ── Teaser figure ─────────────────────────────────────────────────────── */
.teaser-figure {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px 24px 14px;
  text-align: center;
  margin: 0 0 32px;
}
.teaser-figure img { max-width: 100%; max-height: 540px; width: auto; height: auto; display: block; margin: 0 auto; }
.teaser-figure figcaption {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-family: 'Fraunces', Georgia, serif;
  color: var(--text-2); font-size: 0.92rem; line-height: 1.6;
  max-width: 78ch; margin-left: auto; margin-right: auto;
  font-style: italic;
}

/* ── Two-mode / two-question cards ─────────────────────────────────────── */
.two-questions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 18px; margin: 24px 0 8px;
}
.qcard {
  display: grid; grid-template-columns: 64px 1fr;
  gap: 18px; align-items: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 22px 24px;
}
.qcard.qcard-diff { border-left-color: var(--diff); }
.qcard .q-num {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.5em; font-weight: 600;
  color: var(--accent);
  line-height: 1.05; letter-spacing: -0.01em;
}
.qcard.qcard-diff .q-num { color: var(--diff); }
.qcard h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.18em; font-weight: 600;
  color: var(--text); line-height: 1.3;
  margin-bottom: 10px;
}
.qcard h3 em { color: var(--accent); font-style: italic; font-weight: 600; }
.qcard p { font-size: 0.93rem; line-height: 1.7; color: var(--text-2); }
.qcard p strong { color: var(--text); font-weight: 600; }
.qcard p em { color: var(--accent); font-style: italic; font-weight: 500; }
@media (max-width: 800px) { .two-questions { grid-template-columns: 1fr; } }

/* ── Jump row ──────────────────────────────────────────────────────────── */
.section-jump-label {
  text-align: center !important;
  color: var(--text-3) !important;
  font-size: 0.74rem !important; font-weight: 600;
  letter-spacing: 0.18em; margin: 2.4em 0 1em !important;
  text-transform: uppercase;
}
.icon-row {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px; width: 100%; padding: 4px 0;
}
.icon-link {
  display: flex; flex-direction: column; align-items: flex-start;
  text-align: left; color: var(--text-2);
  padding: 14px 16px; gap: 4px;
  border: 1px solid var(--border);
  background: var(--surface); text-decoration: none;
  font-size: 0.78rem; line-height: 1.3;
  transition: all 0.18s ease;
}
.icon-link span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.icon-link b { color: var(--text); font-weight: 600; font-size: 0.92rem; }
.icon-link:hover { border-color: var(--text); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-md); }
@media (max-width: 700px) { .icon-row { grid-template-columns: repeat(2, 1fr); } }

/* ── Inline atoms ──────────────────────────────────────────────────────── */
.kbd {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace; font-size: 0.82em;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0px 6px; margin: 0 1px;
  white-space: nowrap;
}

/* ── Standalone figure block (plots / diagrams) ────────────────────────── */
.fig-figure {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 28px 30px 16px;
  text-align: center;
  margin: 22px auto 6px;
  max-width: 900px;
}
.fig-figure.narrow { max-width: 700px; }
.fig-figure.wide   { max-width: 1060px; }
.fig-figure img { max-width: 100%; max-height: 520px; width: auto; height: auto; display: block; margin: 0 auto; }
.fig-figure.wide img { max-height: 600px; }
.fig-figure figcaption {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-3); font-size: 0.85rem; line-height: 1.55;
  max-width: 80ch; margin-left: auto; margin-right: auto;
}
.fig-figure figcaption b { color: var(--text-2); font-weight: 600; }

/* ── Delta tokens ──────────────────────────────────────────────────────── */
.delta {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace; font-size: 0.78em;
  padding: 1px 7px; border-radius: 3px;
  font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.delta-good { background: var(--good-bg); color: var(--good); }
.delta-mid  { background: var(--mid-bg);  color: var(--mid); }
.delta-bad  { background: var(--bad-bg);  color: var(--bad); }

/* ── Metric table ──────────────────────────────────────────────────────── */
.metric-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 22px;
  overflow-x: auto;
  margin-top: 6px;
}
.metric-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.88rem;
}
.metric-table th, .metric-table td {
  padding: 9px 10px; text-align: center; color: var(--text-2);
  white-space: nowrap;
}
.metric-table thead th {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-3); border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.metric-table tbody tr { border-bottom: 1px solid var(--border); }
.metric-table tbody tr:last-child { border-bottom: none; }
.metric-table tbody td { font-family: 'JetBrains Mono', monospace; font-size: 0.84em; font-variant-numeric: tabular-nums; }
.metric-table tbody td.model-name {
  font-family: 'Inter', sans-serif;
  font-weight: 500; color: var(--text); text-align: left;
  font-size: 0.9em;
}
.metric-table tbody td.model-name small { color: var(--text-3); font-weight: 400; }
.metric-table tbody tr.row-flare td { background: var(--accent-bg); }
.metric-table tbody tr.row-flare td.model-name { color: var(--accent); font-weight: 600; }
.metric-table tbody td b { color: var(--text); }
.metric-table .grp-a { border-bottom: 2px solid var(--accent) !important; color: var(--text) !important; }
.metric-table .grp-b { border-bottom: 2px solid var(--diff) !important; color: var(--text) !important; }
.table-note { font-size: 0.8rem; color: var(--text-3); margin-top: 0.9em; }

/* ── Ablation cards ────────────────────────────────────────────────────── */
.abl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 26px 28px;
  margin: 14px 0;
}
.abl-card header { margin-bottom: 14px; }
.abl-tag {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  color: var(--accent); background: var(--accent-bg);
  padding: 3px 10px; border-radius: 2px; margin-bottom: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.abl-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.35em; font-weight: 600; color: var(--text);
  line-height: 1.25;
}
.abl-card p {
  font-size: 0.95rem; color: var(--text-2); line-height: 1.7;
  margin: 0 0 18px;
}
.abl-card p strong { color: var(--text); font-weight: 600; }
.abl-card p em { color: var(--accent); font-style: italic; font-weight: 500; }

.mini-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
.mini-table th, .mini-table td { padding: 8px 10px; text-align: left; }
.mini-table thead th {
  font-size: 0.7rem; color: var(--text-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}
.mini-table tbody td {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85em;
  color: var(--text-2); border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.mini-table tbody td:first-child {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500; color: var(--text); font-size: 0.95em;
}
.mini-table tbody tr:last-child td { border-bottom: none; }
.mini-table .row-best td { background: var(--accent-bg); }
.mini-table .row-best td:first-child { color: var(--accent); }
.mini-table td b { color: var(--text); }

/* ── Findings list ─────────────────────────────────────────────────────── */
.finding-list { list-style: none; border-top: 1px solid var(--border); margin: 12px 0 30px; }
.finding-list > li {
  display: grid; grid-template-columns: 70px 1fr; gap: 18px;
  padding: 24px 0; border-bottom: 1px solid var(--border); align-items: start;
}
.finding-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.2em; font-weight: 500; color: var(--text-3);
  letter-spacing: -0.02em; line-height: 1;
}
.finding-list h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2em; font-weight: 600; color: var(--text);
  margin-bottom: 8px; line-height: 1.3;
}
.finding-list h4 em { color: var(--accent); font-style: italic; font-weight: 500; }
.finding-list p { font-size: 0.94rem; color: var(--text-2); line-height: 1.7; }
.finding-list p strong { color: var(--text); font-weight: 600; }
.finding-list p em { color: var(--accent); font-style: italic; }

/* ── Scope / limitations note ──────────────────────────────────────────── */
.scope-note {
  border-left: 3px solid var(--border-2);
  background: var(--surface-2);
  padding: 16px 20px; margin: 6px 0 0;
  font-size: 0.9rem; line-height: 1.65; color: var(--text-2);
}
.scope-note strong { color: var(--text); font-weight: 600; }

/* ── CTA banner ────────────────────────────────────────────────────────── */
.cta-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 22px;
  background: var(--text); color: var(--surface);
  padding: 30px 34px; margin-top: 22px;
}
.cta-banner h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.3em; font-weight: 600; color: var(--surface); margin-bottom: 6px;
}
.cta-banner p { font-size: 0.92rem; color: rgba(255,255,255,0.85); max-width: 560px; line-height: 1.6; }
.cta-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.cta-banner .button {
  background: transparent; color: var(--surface);
  border: 1px solid rgba(255,255,255,0.3); border-radius: 2px;
  padding: 9px 18px; font-size: 0.88em; font-weight: 500;
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
  transition: all 0.18s ease;
}
.cta-banner .button:hover { border-color: rgba(255,255,255,0.7); }
.cta-banner .button.primary { background: var(--surface); color: var(--text); border-color: var(--surface); }
.cta-banner .button.primary:hover { background: #f0eee8; color: var(--text); }
.cta-banner .button.disabled { opacity: 0.4; pointer-events: none; }

/* ── BibTeX ────────────────────────────────────────────────────────────── */
.bibtex-container {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px 24px; margin: 14px 0; position: relative;
}
.bibtex-container pre {
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem;
  line-height: 1.7; color: var(--text-2);
  white-space: pre-wrap; overflow-x: auto;
}
.copy-btn {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg-soft); border: 1px solid var(--border-2);
  font-size: 0.74rem; font-weight: 500;
  padding: 5px 12px; cursor: pointer; color: var(--text-2);
  transition: all 0.18s;
}
.copy-btn:hover { background: var(--text); color: var(--surface); border-color: var(--text); }

/* ── Footer ────────────────────────────────────────────────────────────── */
footer {
  margin-top: 0; padding: 30px 20px; text-align: center;
  font-size: 0.78rem; color: var(--text-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Equation block (KaTeX) ────────────────────────────────────────────── */
.eq-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 18px 22px; margin: 18px 0 6px;
  overflow-x: auto; text-align: center;
}

/* ── Figure tall variant ───────────────────────────────────────────────── */
.fig-figure.tall img { max-height: 760px; }

/* ── Side-by-side figure pair ──────────────────────────────────────────── */
.fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; margin: 18px 0 4px; }
.fig-pair .fig-figure { margin: 0; max-width: none; display: flex; flex-direction: column; justify-content: center; }
.fig-pair .fig-figure img { max-height: 320px; }
@media (max-width: 760px) { .fig-pair { grid-template-columns: 1fr; } }

/* inline emphasis tied to the clean/noisy streams */
.ar-em   { color: var(--ar);   font-style: italic; font-weight: 600; }
.diff-em { color: var(--diff); font-style: italic; font-weight: 600; }

/* ── Two-stream objective schematic (HTML) ─────────────────────────────── */
.twostream { text-align: left; padding: 6px 2px 2px; }
.ts-head { font-size: 0.7rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 16px; }
.ts-line { display: flex; align-items: center; gap: 10px; }
.ts-name { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; width: 42px; flex-shrink: 0; }
.ts-name.clean { color: var(--ar); }
.ts-name.noisy { color: var(--diff); }
.ts-seq { display: flex; gap: 5px; flex-wrap: wrap; }
.tok { font-family: 'JetBrains Mono', monospace; font-size: 0.62rem; min-width: 26px; height: 26px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 3px;
  border: 1px solid var(--border-2); color: var(--text-2); background: var(--surface); }
.tok.c { background: var(--ar-bg);   border-color: var(--ar);   color: var(--ar); }
.tok.n { background: var(--surface); color: var(--text-2); }
.tok.m { background: var(--diff-bg); border: 1px dashed var(--diff); color: var(--diff); }
.ts-cap { font-size: 0.74rem; color: var(--text-3); margin: 7px 0 16px 52px; }
.ts-loss { font-weight: 600; }
.ts-loss.clean { color: var(--ar); }
.ts-loss.noisy { color: var(--diff); }
.ts-foot { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-2); }
.ts-foot b { color: var(--accent); }

/* ── Decoding illustrations (on-page animations) ───────────────────────── */
.decode-anim { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; text-align: left; margin: 4px 0 2px; }
@media (max-width: 760px) { .decode-anim { grid-template-columns: 1fr; } }
.da-panel { border: 1px solid var(--border); background: var(--surface-2); padding: 18px 18px 16px; border-radius: 2px; }
.da-title { font-size: 0.82rem; color: var(--text-2); font-weight: 500; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.da-badge { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 2px; }
.da-badge.ar { background: var(--ar-bg); color: var(--ar); }
.da-badge.diff { background: var(--diff-bg); color: var(--diff); }
.da-stage { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 66px; }
.da-gap { width: 1px; height: 26px; background: var(--border-2); margin: 0 5px; opacity: 0.7; }
.da-tok {
  font-family: 'JetBrains Mono', monospace; font-size: 0.7rem;
  min-width: 30px; height: 30px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2); position: relative;
  transition: background .35s ease, color .35s ease, border-color .35s ease, opacity .35s ease, transform .35s ease, box-shadow .2s ease;
}
.da-tok.committed { background: var(--ar-bg); border-color: var(--ar); color: var(--ar); }
.da-tok.draft { background: var(--diff-bg); border: 1px dashed var(--diff); color: var(--diff); opacity: 0.9; }
.da-tok.verifying { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); transform: translateY(-2px); }
.da-tok.accept { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.da-tok.correct { background: var(--good-bg); border-color: var(--good); color: var(--good); }
.da-tok.accept::after, .da-tok.correct::after {
  content: '\2713'; position: absolute; top: -7px; right: -6px;
  font-size: 0.58rem; width: 14px; height: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--good); background: var(--surface); border: 1px solid var(--good); border-radius: 50%;
}
.da-tok.reject { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.da-tok.discard { opacity: 0.22; transform: scale(0.8); text-decoration: line-through; }
.da-tok.masked { background: var(--diff-bg); border: 1px dashed var(--diff); color: var(--diff); }
.da-tok.resolving { background: var(--mid-bg); border-color: var(--mid); color: var(--mid); box-shadow: 0 0 0 3px var(--mid-bg); transform: scale(1.08); }
.da-tok.resolved { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.da-status {
  margin-top: 14px; font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem; color: var(--text-3); min-height: 1.2em;
}

/* ── HTML bar charts ───────────────────────────────────────────────────── */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px 28px 18px;
  margin: 14px 0 6px;
}
.chart-cap {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem; line-height: 1.6; color: var(--text-3);
}
.chart-cap b { color: var(--text-2); font-weight: 600; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbars.compact { gap: 7px; }
.hbar { display: grid; grid-template-columns: 132px 1fr 66px; align-items: center; gap: 12px; }
.hbar-label { font-size: 0.82rem; color: var(--text-2); text-align: right; white-space: nowrap; }
.hbar.is-flare .hbar-label { color: var(--accent); font-weight: 600; }
.hbar.is-ref .hbar-label { color: var(--text-3); font-style: italic; }
.hbar-track { background: var(--bg-soft); border-radius: 2px; height: 22px; position: relative; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.hbar-fill.base { background: var(--border-2); }
.hbar-fill.ref {
  background: repeating-linear-gradient(45deg, var(--accent-2), var(--accent-2) 4px, #7f9b93 4px, #7f9b93 8px);
}
.hbar-val { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--text); text-align: left; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .hbar { grid-template-columns: 92px 1fr 54px; gap: 8px; } .hbar-label { font-size: 0.72rem; } }

.route-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.route-metric-title { font-size: 0.76rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.route-metric-title span { text-transform: none; letter-spacing: 0; color: var(--text-3); font-weight: 400; }
@media (max-width: 700px) { .route-compare { grid-template-columns: 1fr; gap: 20px; } }

/* ── Finding subsections (ablations) ───────────────────────────────────── */
.finding { border-top: 1px solid var(--border); padding-top: 28px; margin-top: 28px; }
.finding:first-of-type { border-top: none; padding-top: 4px; margin-top: 8px; }
.finding-kicker {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  color: var(--accent); background: var(--accent-bg);
  padding: 3px 10px; border-radius: 2px;
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px;
}
h3.finding-h {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5em !important; font-weight: 600; color: var(--text);
  margin: 0 0 0.55em !important; line-height: 1.2;
}
.finding .mini-table { margin-top: 6px; }

/* ── Dual-mode note ────────────────────────────────────────────────────── */
.modes-note {
  border-left: 3px solid var(--diff);
  background: var(--diff-bg);
  padding: 16px 20px; margin: 16px 0 0;
  font-size: 0.9rem; line-height: 1.65; color: var(--text-2);
}
.modes-note strong { color: var(--text); font-weight: 600; }

/* ── Metric table: group rows, subheads, FLARE column shade ────────────── */
.metric-table tr.subhead th {
  font-size: 0.64rem; color: var(--text-3); font-weight: 500; font-style: italic;
  padding-top: 0; padding-bottom: 8px; text-transform: none; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}
.metric-table tr.grouprow td {
  text-align: left; font-family: 'Inter', sans-serif;
  font-weight: 600; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); background: var(--surface-2); padding: 8px 10px;
}
.metric-table td.fc { background: var(--accent-bg); }
.metric-table tbody tr:hover td:not(.fc):not(.model-name) { background: var(--surface-2); }
