/* ==========================================================================
   Vigil — showcase
   System type stacks only: nothing here fetches a font, and .term says so.
   Dark, restrained, technical. One accent (brass); green and red are reserved
   for chain verdicts and are never the only signal.
   ========================================================================== */

:root {
  --bg: #0b0d10;
  --bg-2: #0d1015;
  --panel: #101419;
  --panel-2: #141922;
  --line: #1d232b;
  --line-2: #272f3a;
  --text: #e7eaf0;
  --muted: #9aa4b3;
  --faint: #6d7886;
  --accent: #d7a45c;
  --accent-soft: rgba(215, 164, 92, 0.13);
  --accent-line: rgba(215, 164, 92, 0.38);
  --ok: #5ec08c;
  --ok-soft: rgba(94, 192, 140, 0.1);
  --bad: #e0705f;
  --bad-soft: rgba(224, 112, 95, 0.11);

  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-display: clamp(2.15rem, 1.15rem + 3.9vw, 4.05rem);
  --fs-h2: clamp(1.55rem, 1.12rem + 1.75vw, 2.35rem);
  --fs-h3: clamp(1.08rem, 1.01rem + 0.42vw, 1.3rem);
  --fs-body: clamp(0.975rem, 0.955rem + 0.12vw, 1.045rem);
  --fs-prose: clamp(0.975rem, 0.95rem + 0.18vw, 1.09rem);
  --fs-small: 0.8125rem;
  --fs-micro: 0.6875rem;
  --fs-mono: 0.78rem;

  --measure: 68ch;
  --width: 74rem;
  --gutter: clamp(1.05rem, 4.2vw, 3.25rem);
  --section-y: clamp(3.6rem, 7.5vw, 7.25rem);

  --radius: 5px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.62;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A very faint vignette, not a gradient mesh: one accent, used sparingly. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 460px at 78% -12%, rgba(215, 164, 92, 0.05), transparent 70%),
    radial-gradient(700px 420px at 8% 2%, rgba(94, 192, 140, 0.028), transparent 72%);
}

main, .topbar, .footer { position: relative; z-index: 1; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-family: var(--font-serif); font-size: var(--fs-display); font-weight: 500; letter-spacing: -0.028em; }
h2 { font-family: var(--font-serif); font-size: var(--fs-h2); font-weight: 500; letter-spacing: -0.024em; }
h3 { font-size: var(--fs-h3); letter-spacing: -0.012em; }
h4 { font-size: var(--fs-small); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

p { margin: 0 0 1.05em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--text);
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.16s var(--ease), text-decoration-color 0.16s var(--ease);
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

strong { font-weight: 600; color: #f2f4f8; }
em { font-style: italic; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-variant-ligatures: none;
}

/* Inline code: a quiet tag, not a highlighter smear. */
:not(pre) > code {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.06em 0.34em;
  font-size: 0.86em;
  color: #cfd6e2;
  white-space: nowrap;
}

hr { border: 0; border-top: 1px solid var(--line); }

.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.faint { color: var(--faint); }

/* Accessible, visible, never removed ------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 40;
  background: var(--accent);
  color: #14100a;
  padding: 0.55rem 0.9rem;
  border-radius: 3px;
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s var(--ease);
}
.skip:focus { top: 0.75rem; color: #14100a; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem var(--gutter);
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(12px) saturate(120%);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}
.wordmark svg { color: var(--accent); flex: none; }
.wordmark:hover { color: var(--accent); }

.topbar nav {
  display: flex;
  gap: clamp(0.7rem, 1.6vw, 1.5rem);
  overflow-x: auto;
  scrollbar-width: none;
  font-size: var(--fs-small);
}
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding-block: 0.2rem;
  border-bottom: 1px solid transparent;
}
.topbar nav a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ==========================================================================
   Layout
   ========================================================================== */
.hero, .section, .footer > * {
  max-width: var(--width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
  border-top: 1px solid var(--line);
}

.section-head { margin-bottom: clamp(1.8rem, 3.4vw, 3rem); }

.section-index {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 0.85rem;
}

.section-head h2 { max-width: 24ch; margin-bottom: 1rem; }

.section-lede {
  max-width: var(--measure);
  color: var(--muted);
  font-size: var(--fs-prose);
}

.prose { max-width: var(--measure); color: #c8cfda; }

.sub-head {
  margin-top: clamp(2.4rem, 5vw, 3.6rem);
  margin-bottom: 0.9rem;
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 500;
}

.grid-2 { display: grid; gap: clamp(1rem, 2.4vw, 1.8rem); grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: clamp(1rem, 2.2vw, 1.4rem); grid-template-columns: 1fr; }

@media (min-width: 56rem) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-block: clamp(3rem, 7vw, 6.5rem) clamp(2.6rem, 5vw, 4.5rem);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 clamp(1.1rem, 2.4vw, 1.7rem);
}

.hero h1 { max-width: 21ch; margin-bottom: clamp(1.1rem, 2.2vw, 1.6rem); }

.lede {
  max-width: 60ch;
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.6;
  color: #c2cad6;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: clamp(2rem, 4.2vw, 3.2rem) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-2);
}
@media (min-width: 46rem) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 1.15rem 0 1.25rem;
  border-bottom: 1px solid var(--line-2);
}
@media (min-width: 46rem) {
  .stat {
    padding: 1.3rem 1.4rem 1.4rem 0;
    border-bottom: 0;
    border-left: 1px solid var(--line-2);
    padding-left: 1.4rem;
  }
  .stat:first-child { border-left: 0; padding-left: 0; }
}

.stat-value {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 1.4rem + 1.7vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}
.stat-value small { font-size: 0.45em; color: var(--faint); letter-spacing: 0; }
.stat-label {
  font-size: var(--fs-small);
  color: var(--text);
  font-weight: 500;
}
.stat-qual {
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.45;
}
.stat-qual code { font-size: 0.92em; }
.stat-cmd {
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: var(--faint);
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.1rem;
  margin-top: clamp(1.9rem, 3.6vw, 2.6rem);
}
.btn-note { font-size: var(--fs-small); color: var(--faint); }

.hero-links {
  margin-top: 1.2rem;
  font-size: var(--fs-small);
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: clamp(1.9rem, 3.6vw, 2.6rem) 0 0;
}
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 100px;
  padding: 0.28rem 0.68rem;
  background: var(--bg-2);
}
.chips code { background: none; border: 0; padding: 0; font-size: 1em; color: var(--muted); }
.chip-key { color: var(--faint); text-transform: uppercase; letter-spacing: 0.09em; }
.chip-warn { border-color: rgba(224, 112, 95, 0.4); color: #e8b3aa; }
.chip-warn strong { color: #f0c3bb; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease),
    transform 0.16s var(--ease);
}
.btn:hover { border-color: var(--accent-line); color: var(--text); background: #1a2028; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: progress; }
.btn code { background: none; border: 0; padding: 0; color: inherit; font-size: 0.95em; }
.btn-small { color: var(--faint); font-weight: 400; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #17120a;
  font-weight: 600;
  padding: 0.62rem 1.05rem;
  font-size: 0.875rem;
}
.btn-primary code { color: #17120a; }
.btn-primary:hover { background: #e5b573; border-color: #e5b573; color: #17120a; }

.btn-quiet { background: transparent; }

/* ==========================================================================
   Terminal panels and figures
   ========================================================================== */
.term {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 22rem;
  color: #cbd4e0;
  line-height: 1.6;
  font-size: var(--fs-mono);
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.term code { font-size: inherit; white-space: pre; display: block; }
.term-short { max-height: 9.5rem; }
.term-tall { max-height: 30rem; }
.term::-webkit-scrollbar { height: 8px; width: 8px; }
.term::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

/* very light syntax tinting applied by app.js to captured command output */
.term .t-ok { color: var(--ok); }
.term .t-bad { color: var(--bad); }
.term .t-dim { color: var(--faint); }
.term .t-key { color: #cfd6e2; }
.term .t-num { color: var(--accent); }
.term .t-strong { color: #f0f3f8; font-weight: 600; }

.figure { margin: 0; }
.figure figcaption {
  margin-top: 0.7rem;
  font-size: var(--fs-small);
  color: var(--faint);
}

.diagram {
  width: 100%;
  height: auto;
  display: block;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.5rem;
}
.diagram text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: #c2cad6;
  letter-spacing: 0.01em;
}
.diagram .d-mono { font-size: 10px; fill: #98a4b4; }
.diagram .d-faint { font-size: 9px; fill: var(--faint); }
.diagram .d-box rect { fill: var(--panel); stroke: var(--line-2); stroke-width: 1; }
.diagram .d-box-accent rect { fill: var(--accent-soft); stroke: var(--accent-line); }
.diagram .d-box-ok rect { fill: var(--ok-soft); stroke: rgba(94, 192, 140, 0.34); }
.diagram .d-box-ok text { fill: #a9dfc4; }
.diagram .d-box-bad rect { fill: var(--bad-soft); stroke: rgba(224, 112, 95, 0.32); }
.diagram .d-box-bad text { fill: #edb7ad; }
.diagram .d-line { stroke: var(--line-2); stroke-width: 1; color: var(--line-2); }
.diagram-chain { max-width: 30rem; }

/* ==========================================================================
   Steps
   ========================================================================== */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }

.step {
  display: grid;
  gap: 0.6rem 1.6rem;
  padding-block: clamp(1.3rem, 2.6vw, 1.9rem);
  border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; padding-top: 0; }

@media (min-width: 60rem) {
  .step { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); }
  .step-head { grid-column: 1; }
  .step > p { grid-column: 1; max-width: 52ch; color: #c3cbd7; }
  .step > .term { grid-column: 2; grid-row: 1 / span 3; align-self: start; max-height: 13rem; }
}

.step-head { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; }
.step-n {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  width: 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  align-self: center;
}
.step-head h3 { margin: 0; }
.step-seq {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--faint);
  letter-spacing: 0.04em;
  margin-left: auto;
}

.step > p { margin: 0; font-size: var(--fs-body); }

/* ==========================================================================
   Review demo
   ========================================================================== */
.review-demo {
  margin-top: clamp(2.4rem, 5vw, 4rem);
  padding-top: clamp(1.6rem, 3vw, 2.4rem);
  border-top: 1px solid var(--line);
}
.review-demo > h3 { font-family: var(--font-serif); font-weight: 500; margin-bottom: 0.6rem; }
.review-demo > p { max-width: var(--measure); color: var(--muted); margin-bottom: 1.4rem; }

.review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  font-size: var(--fs-small);
  line-height: 1.62;
  color: #c3cbd7;
}
.review-card p { margin-bottom: 0.6rem; }
.review-meta, .review-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--faint);
  overflow-wrap: anywhere;
}
.review-count { color: var(--text); }
.review-findings { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 0.4rem; }
.review-findings li { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: baseline; }
.review-findings code { font-size: 0.9em; }
.review-sub { font-family: var(--font-mono); color: var(--text); margin-top: 0.9rem; }
.review-foot {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  color: var(--faint);
  font-size: 0.75rem;
}

.sev {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.05rem 0.36rem;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}
.sev-critical { color: #f0b4a8; border-color: rgba(224, 112, 95, 0.45); background: var(--bad-soft); }
.sev-high { color: #ecc794; border-color: rgba(215, 164, 92, 0.42); background: var(--accent-soft); }
.sev-low { color: var(--muted); border-color: var(--line-2); background: var(--panel-2); }

/* ==========================================================================
   Gate
   ========================================================================== */
.gate-figure { margin-bottom: clamp(1.5rem, 3vw, 2.2rem); }

.gate-panel {
  display: grid;
  gap: clamp(1rem, 2.4vw, 2rem);
  align-items: start;
}
@media (min-width: 60rem) {
  .gate-panel { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .gate-panel > .term { max-height: 17rem; }
}
.gate-truth { display: grid; gap: 0.8rem; }
.gate-quote-label { font-size: var(--fs-small); color: var(--muted); margin: 0; }
.gate-truth .term { max-height: 6rem; }

/* the limit line, same size as the claim it belongs to */
.limit-inline {
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: 1.6;
  border-left: 2px solid var(--line-2);
  padding-left: 0.9rem;
  margin: 1.2rem 0 0;
  max-width: var(--measure);
}
.limit-key {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-right: 0.5rem;
}

.checkline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--fs-small);
  color: var(--muted);
  margin: 0.4rem 0 0;
}
.check-key {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ==========================================================================
   The tamper demo
   ========================================================================== */
.formula {
  margin: 0 0 clamp(1.4rem, 3vw, 2rem);
  padding: 0.85rem 1rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.82rem;
  color: #cfd6e2;
  white-space: pre;
}
.formula sub { font-size: 0.72em; }
.f-op { color: var(--accent); }
.f-cmt { color: var(--faint); }

.demo {
  border: 1px solid var(--line-2);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, #0f1319, #0c0f13);
  overflow: hidden;
}

.demo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.demo-head h3 { font-size: 0.95rem; letter-spacing: 0.01em; }
.demo-source {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--faint);
  margin: 0;
  overflow-wrap: anywhere;
}

.verdict {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-left: 3px solid var(--line-2);
  background: var(--panel);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.verdict[data-state="ok"] { border-left-color: var(--ok); background: #0d1512; }
.verdict[data-state="bad"] { border-left-color: var(--bad); background: #170f0e; }
.verdict[data-state="busy"] { border-left-color: var(--accent); }

.verdict-state {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  text-transform: uppercase;
}
.verdict[data-state="ok"] .verdict-state { color: var(--ok); }
.verdict[data-state="bad"] .verdict-state { color: var(--bad); }
.verdict[data-state="busy"] .verdict-state { color: var(--accent); }

.verdict-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.3rem 1.2rem;
  margin: 0;
  font-size: var(--fs-small);
}
.verdict-facts div { display: flex; gap: 0.5rem; align-items: baseline; min-width: 0; }
.verdict-facts dt {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  flex: none;
}
.verdict-facts dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #c8d0dc;
  overflow-wrap: anywhere;
}

.verdict-reason {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #f0b4a8;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(224, 112, 95, 0.28);
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.demo-controls .btn { flex: 1 1 auto; justify-content: center; min-width: 10rem; }

.demo-note {
  margin: 0;
  padding: 0.7rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--muted);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  min-height: 2.4rem;
  overflow-wrap: anywhere;
}
.demo-note b { color: var(--text); font-weight: 600; }

.demo-body { display: grid; gap: 0; }
@media (min-width: 64rem) {
  .demo-body { grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.72fr); }
}

.timeline-wrap { border-right: 0; min-width: 0; }
@media (min-width: 64rem) {
  .timeline-wrap { border-right: 1px solid var(--line); }
}

.col-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.6rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.col-hint { letter-spacing: 0.04em; text-transform: none; color: var(--faint); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
  max-height: 26rem;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.735rem;
  line-height: 1.5;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  scroll-behavior: smooth;
}
.timeline::-webkit-scrollbar { width: 8px; }
.timeline::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.timeline li {
  display: grid;
  grid-template-columns: 2.6rem 1fr auto;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.16rem 1rem;
  color: #aab4c2;
  border-left: 2px solid transparent;
}
@media (max-width: 30rem) {
  .timeline li { grid-template-columns: 2.3rem 1fr; }
  .timeline .tl-hash { display: none; }
}
.timeline li:nth-child(odd) { background: rgba(255, 255, 255, 0.012); }
.timeline .tl-seq { color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.timeline .tl-body { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline .tl-kind { color: #d3dae5; }
.timeline .tl-phase { color: var(--faint); }
.timeline .tl-hash { color: #5f6b79; font-size: 0.95em; }
.timeline li.tl-seal { border-left-color: var(--accent-line); background: var(--accent-soft); }
.timeline li.tl-bad { border-left-color: var(--bad); background: var(--bad-soft); color: #f0c0b6; }
.timeline li.tl-bad .tl-kind { color: #f5cabf; }
.timeline li.tl-bad .tl-hash { color: #d99a8e; }
.timeline li.tl-after { opacity: 0.42; }
.timeline li.tl-added { border-left-color: var(--accent); background: var(--accent-soft); }
.tl-flag {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0 0.32rem;
  border-radius: 2px;
  font-size: 0.9em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.tl-bad .tl-flag { color: var(--bad); }
.tl-added .tl-flag { color: var(--accent); }

.seal-box {
  padding: 1rem;
  min-width: 0;
  display: grid;
  gap: 0.6rem;
  align-content: start;
}
.seal-box h4 { margin: 0.5rem 0 0; font-size: var(--fs-micro); letter-spacing: 0.13em; }
.seal-box h4:first-child { margin-top: 0; }
.seal-box .seal-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.24rem 0;
  border-bottom: 1px dotted var(--line);
  overflow-wrap: anywhere;
}
.seal-box .seal-row span:first-child { color: var(--faint); flex: none; }
.seal-box .seal-row span:last-child { color: #c8d0dc; text-align: right; }
.seal-flag {
  margin: 0.35rem 0 0;
  font-size: var(--fs-small);
  line-height: 1.5;
  padding: 0.45rem 0.6rem;
  border-radius: 3px;
  border: 1px solid;
}
.seal-flag.ok { color: #a9dfc4; border-color: rgba(94, 192, 140, 0.3); background: var(--ok-soft); }
.seal-flag.bad { color: #edb7ad; border-color: rgba(224, 112, 95, 0.32); background: var(--bad-soft); }
.seal-flag.note { color: var(--muted); border-color: var(--line-2); background: var(--panel); }

/* ==========================================================================
   Notes / cards
   ========================================================================== */
.findings { margin-top: clamp(1.4rem, 3vw, 2.2rem); }
.note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  display: grid;
  gap: 0.6rem;
  align-content: start;
}
.note h3 { font-size: 0.95rem; }
.note p { font-size: var(--fs-small); color: var(--muted); margin: 0; }
.note .term { max-height: 8rem; font-size: 0.72rem; }
.note-warn { border-color: rgba(215, 164, 92, 0.28); }
.note-warn h3 { color: #e8c391; }

/* ==========================================================================
   Corpus picker
   ========================================================================== */
.picker { display: grid; gap: clamp(1rem, 2.4vw, 1.6rem); }
@media (min-width: 62rem) {
  .picker { grid-template-columns: 15.5rem minmax(0, 1fr); align-items: start; }
}

.picker-list-wrap { display: grid; gap: 0.5rem; align-content: start; }
.picker-list { display: grid; gap: 2px; }

.fx {
  display: grid;
  grid-template-columns: 3.1rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.735rem;
  padding: 0.42rem 0.55rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease);
}
.fx:hover { background: var(--panel-2); color: var(--text); }
.fx[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--text);
}
.fx .fx-name { font-weight: 600; letter-spacing: 0.02em; }
.fx .fx-label { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx[aria-pressed="true"] .fx-label { color: #d8c19b; }
.fx .fx-badge {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0 0.24rem;
  color: var(--faint);
}
.fx-clean .fx-badge { color: var(--ok); }
.fx-clean .fx-label { color: #7f9a8c; }

.legend-add, .legend-expect, .legend-clean {
  display: inline-block;
  margin-right: 0.8rem;
  padding-left: 0.9rem;
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--faint);
}
.legend-add::before, .legend-expect::before, .legend-clean::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 1px;
}
.legend-add::before { background: rgba(94, 192, 140, 0.5); }
.legend-expect::before { background: var(--accent); }
.legend-clean::before { background: var(--ok); }

.picker-view {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  min-width: 0;
}
.pick-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.pick-head h3 { font-family: var(--font-mono); font-size: 0.86rem; font-weight: 600; letter-spacing: 0; }
.pick-meta { margin: 0; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--faint); }

.pick-label {
  margin: 0;
  padding: 0.55rem 0.9rem;
  font-size: var(--fs-small);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
}
.pick-label .rule-chip {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: #17120a;
  background: var(--accent);
  border-radius: 2px;
  padding: 0.06rem 0.36rem;
  font-weight: 600;
}
.pick-label .clean-chip {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--ok);
  border: 1px solid rgba(94, 192, 140, 0.4);
  border-radius: 2px;
  padding: 0.06rem 0.36rem;
}

.diff {
  font-family: var(--font-mono);
  font-size: 0.735rem;
  line-height: 1.65;
  overflow: auto;
  max-height: 27rem;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.diff::-webkit-scrollbar { width: 8px; height: 8px; }
.diff::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.diff-file {
  padding: 0.3rem 0.9rem;
  color: var(--faint);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  margin: 0.35rem 0;
  overflow-wrap: anywhere;
}
.diff-hunk {
  padding: 0.15rem 0.9rem;
  color: #7f8b9b;
  background: rgba(255, 255, 255, 0.016);
  margin-top: 0.2rem;
}
.diff-line {
  display: grid;
  grid-template-columns: 2.7rem 2.7rem 1.1rem minmax(max-content, 1fr);
  gap: 0.15rem;
  padding: 0 0.9rem 0 0.2rem;
  white-space: pre;
}
.diff-line .ln { color: #4f5a68; text-align: right; font-variant-numeric: tabular-nums; user-select: none; }
.diff-line .sign { color: #5c6775; text-align: center; user-select: none; }
.diff-line .txt { color: #b6bfcc; }
.diff-line.add { background: rgba(94, 192, 140, 0.055); }
.diff-line.add .sign { color: var(--ok); }
.diff-line.add .txt { color: #c6e2d3; }
.diff-line.del { background: rgba(224, 112, 95, 0.05); }
.diff-line.del .sign { color: #b9776c; }
.diff-line.del .txt { color: #a5aebb; }
.diff-line.expect {
  background: rgba(215, 164, 92, 0.11);
  box-shadow: inset 3px 0 0 var(--accent);
}
.diff-line.expect .txt { color: #f0d9b4; }
.diff-line .txt mark {
  background: none;
  color: var(--accent);
  font-weight: 600;
}

.pick-foot {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0.9rem;
  display: grid;
  gap: 0.5rem;
  font-size: var(--fs-small);
  color: var(--muted);
  background: var(--bg-2);
}
.pick-foot .observed {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #b8c1ce;
}
.pick-foot .observed .ok { color: var(--ok); }
.pick-foot .observed .bad { color: var(--bad); }
.pick-foot code { font-size: 0.92em; }

/* ==========================================================================
   Numbers
   ========================================================================== */
.stat-grid {
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr;
  background: var(--line);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 40rem) { .stat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 68rem) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }

.mstat {
  background: var(--panel);
  padding: 1.05rem 1.1rem 1.15rem;
  display: grid;
  gap: 0.3rem;
  align-content: start;
}
.mstat .m-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
}
.mstat .m-value {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1.15rem + 0.75vw, 1.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text);
  overflow-wrap: anywhere;
}
.mstat .m-n {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.mstat .m-cmd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--faint);
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}

.explainer {
  margin-top: clamp(1.8rem, 3.6vw, 2.8rem);
  padding: clamp(1rem, 2.2vw, 1.5rem);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.explainer h3 { font-family: var(--font-serif); font-weight: 500; font-size: var(--fs-h3); margin-bottom: 0.8rem; }
.explainer > p { max-width: var(--measure); color: #c2cad6; }

.interval { margin: 1.4rem 0 0.6rem; }
.interval-bar {
  position: relative;
  height: 1.35rem;
  border-radius: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.045) 0 1px,
    transparent 1px 10%
  ), var(--panel);
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.interval-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--from);
  width: calc(var(--to) - var(--from));
  background: linear-gradient(90deg, rgba(215, 164, 92, 0.14), rgba(215, 164, 92, 0.3));
  border-left: 1px solid var(--accent);
  border-right: 1px solid var(--accent);
}
.interval-point {
  position: absolute;
  top: -0.15rem;
  bottom: -0.15rem;
  left: var(--at);
  width: 2px;
  background: var(--accent);
  transform: translateX(-1px);
}
.interval-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--faint);
}
.interval-caption { margin-top: 0.6rem; font-size: var(--fs-small); color: var(--muted); max-width: var(--measure); }

.table-wrap { overflow-x: auto; margin-top: 1.2rem; border: 1px solid var(--line-2); border-radius: var(--radius); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  min-width: 34rem;
}
table.data caption {
  caption-side: top;
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: var(--fs-micro);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
table.data th, table.data td {
  text-align: left;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: baseline;
}
table.data thead th {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  background: var(--panel);
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td { color: #c3cbd7; }
table.data td code { font-size: 0.86em; }
table.data .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tr.is-baseline td { background: rgba(215, 164, 92, 0.045); }
table.data tr.is-bad-arm td { background: rgba(224, 112, 95, 0.055); }

.trap-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 7.5rem;
}
.trap-bar .bar {
  flex: 1;
  height: 0.42rem;
  border-radius: 100px;
  background: var(--line-2);
  overflow: hidden;
  min-width: 3rem;
}
.trap-bar .bar span {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--accent);
  border-radius: 100px;
}
.trap-bar .bar.bar-bad span { background: var(--bad); }
.trap-bar .bar-n {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #c3cbd7;
  white-space: nowrap;
}
.trap-bar .bar-n.bad { color: #edb7ad; }

.ablation-callout {
  margin-top: 1.2rem;
  padding: 0.9rem 1.05rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: var(--measure);
  font-size: var(--fs-body);
}

/* ==========================================================================
   Refusals
   ========================================================================== */
.refusals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 58rem) { .refusals { grid-template-columns: repeat(3, 1fr); } }

.refusals li { background: var(--panel); padding: 1.1rem 1.15rem; display: grid; gap: 0.6rem; align-content: start; }
.refusals h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.14rem; }
.refusals p { font-size: var(--fs-small); color: var(--muted); margin: 0; }
.refusals .term { max-height: 7.5rem; font-size: 0.7rem; background: var(--bg-2); }
.refusals .term code { white-space: pre-wrap; }

.policy {
  margin-top: 1rem;
  display: grid;
  gap: 1px;
  grid-template-columns: 1fr;
  background: var(--line);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}
@media (min-width: 40rem) { .policy { grid-template-columns: 1fr 1fr; } }
@media (min-width: 62rem) { .policy { grid-template-columns: repeat(4, 1fr); } }
.policy .p-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.36rem 0.7rem;
  background: var(--panel);
}
.policy .p-order { color: var(--faint); min-width: 1.7rem; text-align: right; }
.policy .p-rule { color: #c3cbd7; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.policy .p-dec { font-size: var(--fs-micro); letter-spacing: 0.06em; }
.policy .allow .p-dec { color: var(--ok); }
.policy .deny .p-dec { color: #b9776c; }

/* ==========================================================================
   Check it yourself
   ========================================================================== */
.check-block {
  border-top: 1px solid var(--line);
  padding-top: clamp(1.2rem, 2.6vw, 1.8rem);
  margin-top: clamp(1.2rem, 2.6vw, 1.8rem);
  display: grid;
  gap: 0.8rem;
}
.check-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.check-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; }
.check-head h3 { font-family: var(--font-mono); font-size: 0.92rem; font-weight: 600; letter-spacing: 0; }
.check-head h3 code { background: none; border: 0; padding: 0; font-size: 1em; color: var(--text); }
.check-meta { margin: 0; font-size: var(--fs-small); color: var(--faint); }
.check-block .term { max-height: 26rem; }
.check-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.check-label-bad { color: #c98c81; }
.check-label-ok { color: #8fc7a8; }
.check-verdict {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--ok);
  margin: 0;
}
.check-verdict.bad { color: var(--bad); }

.details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.6rem 0.9rem;
}
.details summary {
  cursor: pointer;
  font-size: var(--fs-small);
  color: var(--muted);
  list-style-position: outside;
}
.details summary:hover { color: var(--text); }
.details ul { margin: 0.7rem 0 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.details li { font-size: var(--fs-small); color: var(--muted); }
.details code { font-size: 0.9em; }

/* ==========================================================================
   Limits
   ========================================================================== */
.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
@media (min-width: 52rem) { .limits { grid-template-columns: 1fr 1fr; gap: 0 clamp(1.5rem, 4vw, 3rem); } }
.limits li {
  border-top: 1px solid var(--line);
  padding-block: 1.1rem;
  display: grid;
  gap: 0.4rem;
}
.limits h3 { font-size: 1rem; }
.limits p { font-size: var(--fs-small); color: var(--muted); margin: 0; max-width: 52ch; }

.observations {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.75rem;
  max-width: var(--measure);
}
.observations li { font-size: var(--fs-small); color: var(--muted); line-height: 1.62; }
.observations strong { color: #dfe4ec; }

.provenance {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1rem, 2.2vw, 1.4rem);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.provenance h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.05rem; margin-bottom: 0.6rem; }
.provenance p { max-width: var(--measure); font-size: var(--fs-small); color: var(--muted); }
.provenance code { font-size: 0.9em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.2rem, 4.5vw, 3.4rem) 2rem;
  background: linear-gradient(180deg, transparent, rgba(215, 164, 92, 0.018));
}
.footer-grid {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.4rem);
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer h4 { margin-bottom: 0.55rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.32rem; }
.footer li { font-size: var(--fs-small); color: var(--muted); }
.footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.wordmark-footer {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.01em;
}
.footer-note {
  max-width: var(--measure);
  margin: clamp(1.8rem, 3.5vw, 2.6rem) 0 0;
  font-size: var(--fs-micro);
  color: var(--faint);
  line-height: 1.7;
}

/* ==========================================================================
   Live analyzer playground
   Same surface system as the trace and corpus panels, with a clear
   input → run → result hierarchy so the visitor can use it before reading
   anything else on the page.
   ========================================================================== */
.playground-panel {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.4vw, 1.6rem);
}

.playground-controls {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1fr) auto auto;
  gap: 0.6rem;
  align-items: center;
}

.playground-controls label,
.play-input-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.playground-controls select {
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-small);
  padding: 0.6rem 0.7rem;
}

.playground-controls select:focus-visible,
.play-diff-input:focus-visible {
  outline: 2px solid var(--accent-line);
  outline-offset: 1px;
}

.btn-quiet {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-2);
}

.btn-quiet:hover { color: var(--text); border-color: var(--accent-line); }

.play-status {
  grid-column: 1 / -1;
  min-height: 1.3em;
  color: var(--muted);
  font-size: var(--fs-small);
}

.play-diff-input {
  width: 100%;
  min-height: 17rem;
  resize: vertical;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #090c10;
  color: #c6d0dc;
  padding: 0.95rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  line-height: 1.6;
  tab-size: 4;
}

.play-results {
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.play-results-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.play-results-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--fs-h3);
  font-weight: 500;
}

.play-count,
.play-rule,
.play-anchor,
.play-python code {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
  color: var(--faint);
}

.play-findings { display: grid; gap: 0.55rem; }

.play-result {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.75rem 0.9rem;
}

.play-result-top { display: flex; align-items: baseline; gap: 0.6rem; }
.play-rule { color: var(--accent); }
.play-severity {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.play-title { font-size: 0.95rem; font-weight: 600; grid-column: 1; }
.play-anchor { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.play-why {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--fs-small);
  color: var(--muted);
}

.play-sev-critical, .play-sev-high { border-left-color: var(--bad); }
.play-sev-medium { border-left-color: var(--accent); }
.play-sev-low { border-left-color: var(--ok); }

.play-result-empty,
.play-expect-clean {
  font-size: var(--fs-small);
  color: var(--ok);
  border-left: 2px solid var(--ok);
  background: var(--ok-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.6rem 0.75rem;
}

.play-expectation { font-size: var(--fs-small); color: var(--muted); }
.play-expect-item { padding: 0.3rem 0; border-left: 2px solid var(--line-2); padding-left: 0.7rem; }

.play-parity {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
}
.play-parity.is-match { color: var(--ok); border-color: rgba(94, 192, 140, 0.4); background: var(--ok-soft); }
.play-parity.is-drift { color: var(--bad); border-color: rgba(224, 112, 95, 0.45); background: var(--bad-soft); }

.play-python {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  font-size: var(--fs-small);
  color: var(--muted);
}
.play-python-label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (max-width: 640px) {
  .playground-controls { grid-template-columns: 1fr 1fr; }
  .playground-controls label,
  .playground-controls select,
  .play-status { grid-column: 1 / -1; }
  .play-title { grid-column: 1 / -1; }
  .play-anchor { grid-column: 1 / -1; grid-row: auto; }
}

@media print {
  .playground-panel { border-color: #bbb; background: #fff; color: #111; }
  .play-diff-input { display: none; }
}
/* ==========================================================================
   Entry motion — one fade/slide, nothing else
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* Print: the numbers should survive a PDF. */
@media print {
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .topbar, .demo-controls, .skip { display: none; }
  .term, .review-card, .demo, .picker-view { border-color: #bbb; background: #fff; color: #111; }
  a { color: #111; }
}
/* The review section: the heading is a heading, the notice is a list, and the cost sits on its own line
   rather than pretending to be a finding. */
.review-sub {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin: 1.15rem 0 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.review-cost {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.review-cost strong { color: var(--muted); font-weight: 600; }

/* Two or three lines of real output, not a scroll box. */
.term-short { max-height: none; }
.term-short code { display: block; white-space: pre; }

/* One document, with a consistent vertical rhythm. */
.review-card { display: grid; }
.review-card .review-meta { margin-bottom: 0.35rem; }

/* --------------------------------------------------------------------------
   Layout corrections found by looking at the rendered page.

   1. A grid column of `1fr` has an implicit `min-width: auto`, so a child that
      refuses to shrink -- a `<pre>` of fixed-width output -- steals width from
      its sibling. The review card was squeezed to ~230px while the terminal took
      the rest. `minmax(0, 1fr)` lets both columns shrink and share.
   2. The global `h4` is a micro-label (uppercase, wide tracking). A section
      sub-heading is not a micro-label, so `.review-sub` opts out of it.
   -------------------------------------------------------------------------- */
@media (min-width: 56rem) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.grid-2 > *, .grid-3 > * { min-width: 0; }
.review-card { min-width: 0; }
.review-card .review-findings li { align-items: baseline; }

.review-sub {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  margin: 1.15rem 0 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

/* Long identifiers must wrap inside their own box rather than run past its edge. A flex child needs
   min-width:0 before overflow-wrap can do anything, which is why the seal rows clipped. */
.seal-box .seal-row { align-items: baseline; }
.seal-box .seal-row span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.seal-flag {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  line-height: 1.55;
}
.verdict-reason { word-break: break-word; }
.seal-box { overflow: hidden; }
.limit-inline { overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   Footer corrections.

   * `1fr` is shorthand for `minmax(auto, 1fr)`, so a long unbreakable token --
     `github.com/pal-123456789/vigil`, `data/measurements.json` -- raises the
     column's minimum and steals width from its siblings. `minmax(0, ...)` plus
     `overflow-wrap` keeps the four columns the size they were designed to be.
   * The first column has no `h4`, so its serif wordmark sat on a different line
     from the uppercase labels beside it. Matching the line box fixes the row.
   * The note was a short paragraph floating in a wide empty band. A hairline
     across the full width makes that space read as deliberate rather than left
     over.
   -------------------------------------------------------------------------- */
@media (min-width: 68rem) {
  .footer-grid { grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); }
}
.footer-grid > * { min-width: 0; }
.footer li, .footer a, .wordmark-footer { overflow-wrap: anywhere; }

.wordmark-footer {
  font-size: 1.05rem;
  line-height: 1.16;
  margin: 0 0 0.55rem;
}
.footer-tagline {
  font-size: var(--fs-small);
  color: var(--muted);
  max-width: 26ch;
  margin: 0;
}

.footer-note {
  max-width: none;
  padding-top: clamp(1.2rem, 2.6vw, 1.8rem);
  border-top: 1px solid var(--line);
  text-wrap: pretty;
}
@media (min-width: 68rem) {
  .footer-note { max-width: 62ch; }
}

/* The seal box must not clip its own contents. `overflow: hidden` was added here while chasing the hash
   wrapping and it was the wrong instrument: the clipping that mattered was the SVG's own viewBox, and this
   rule only hid the symptom on one element while risking new cuts elsewhere. The wrap rules below do the
   job without hiding anything. */
.seal-box { overflow: visible; }
.diagram { overflow: visible; }

/* ==========================================================================
   29 Nov: the kill switch, and a real pull request
   ========================================================================== */
.fineprint {
  font-size: var(--fs-small);
  color: var(--faint);
  border-left: 2px solid var(--line-2);
  padding-left: 0.8rem;
  margin: 0.4rem 0 0;
  max-width: 60ch;
}
.channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 44rem) { .channels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 70rem) { .channels { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.channels li { background: var(--panel); padding: 1rem 1.1rem 1.1rem; display: grid; gap: 0.45rem; align-content: start; min-width: 0; }
.channels .ch-name { font-family: var(--font-mono); font-size: var(--fs-mono); color: var(--accent); letter-spacing: 0.02em; }
.channels h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.08rem; margin: 0; }
.channels p { margin: 0; font-size: var(--fs-small); color: var(--muted); }
.channels code { overflow-wrap: anywhere; }

.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: flow; }
.flow li {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0 0.9rem;
  padding: 0 0 1.05rem;
  counter-increment: flow;
}
.flow li::before {
  content: counter(flow);
  grid-row: 1 / span 2;
  width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--accent);
  background: var(--bg);
  position: relative; z-index: 1;
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute; left: 1.1rem; top: 2.2rem; bottom: 0;
  width: 1px; background: var(--line-2);
}
.flow li.flow-stop::before { border-color: rgba(224, 112, 95, 0.55); color: var(--bad); }
.flow li.flow-done::before { border-color: rgba(94, 192, 140, 0.55); color: var(--ok); }
.flow h3 { margin: 0.35rem 0 0.2rem; font-size: 1rem; font-family: var(--font-sans); font-weight: 600; }
.flow p { margin: 0; font-size: var(--fs-small); color: var(--muted); max-width: 58ch; }

.kill-grid { display: grid; gap: clamp(1.2rem, 3vw, 2rem); }
@media (min-width: 62rem) { .kill-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; } }
.kill-grid .term { font-size: 0.7rem; }
.kill-grid .term code { white-space: pre; }
.outcomes { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.outcomes li { font-size: var(--fs-small); color: var(--muted); display: flex; gap: 0.55rem; align-items: baseline; }
.outcomes .o-key { font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); min-width: 4.6rem; }

.real-grid { display: grid; gap: clamp(1.2rem, 3vw, 2rem); }
@media (min-width: 62rem) { .real-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.real-grid .term { font-size: 0.7rem; }
.real-grid .term code { white-space: pre; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.2rem 0 0; padding: 0; list-style: none; }
.badge-row li { font-family: var(--font-mono); font-size: var(--fs-micro); border: 1px solid var(--line-2); border-radius: 999px; padding: 0.22rem 0.6rem; color: var(--muted); }
.badge-row li.b-ok { border-color: rgba(94, 192, 140, 0.45); color: var(--ok); }
.badge-row li.b-no { border-color: rgba(224, 112, 95, 0.45); color: var(--bad); }
/* A grid track sized "auto" grows to the widest <pre> inside it, which widened the whole page on a phone. */
.kill-grid, .real-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 62rem) {
  .kill-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .real-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.kill-grid > *, .real-grid > *, .channels > * { min-width: 0; }
.outcomes li { flex-wrap: wrap; min-width: 0; }
.outcomes code { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
/* Inline code inside running text must wrap on a phone: a nowrap command line under the review demo was
   515px wide in a 342px column and, with the body clipping horizontal overflow, was simply cut off. */
.section p code, .section li > code, .limit-inline code { white-space: normal; overflow-wrap: anywhere; }
