/* CIPHER site stylesheet. Plain CSS, no build step. */

:root {
  color-scheme: light;

  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #1b2227;
  --text-muted: #55606a;
  --border: #dedad0;
  --border-strong: #bdb8ab;

  --accent: #0e6470;
  --accent-strong: #0a4a53;
  --accent-soft: #e2eff0;
  --accent-line: #8fc1c7;

  --neutral-badge: #2c353b;
  --neutral-badge-text: #ffffff;

  --warn: #8a4600;
  --warn-soft: #fcf1e2;
  --warn-line: #d9a35f;

  --ok: #1d6b3a;
  --ok-soft: #e6f3ea;

  --code-bg: #151a1e;
  --code-surface: #1c2328;
  --code-text: #e3e7ea;
  --code-muted: #8e99a3;
  --code-hl: rgba(110, 201, 211, 0.16);
  --code-hl-edge: #6ec9d3;

  --focus: #0b57d0;
  --focus-on-dark: #9cc8ff;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --container: 1160px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

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

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; }
h2 { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--accent-strong);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--accent-strong); text-decoration: none; }
.site-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.site-nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--accent-strong); background: var(--accent-soft); }
.site-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.ext::after { content: " \2197"; font-size: 0.85em; }

/* ---------- Sections ---------- */

main { display: block; }
.section { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 72ch; margin-bottom: 28px; }
.section-head p { color: var(--text-muted); }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

/* ---------- Hero ---------- */

.hero { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(36px, 6vw, 64px); }
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(3rem, 2rem + 5vw, 5.25rem);
  letter-spacing: 0.06em;
  line-height: 1;
  margin: 0 0 12px;
}
.expansion {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.55rem);
  line-height: 1.35;
  color: var(--accent-strong);
  max-width: 40ch;
  margin: 0 0 24px;
}
.lede { font-size: 1.08rem; max-width: 68ch; }
.byline { color: var(--text-muted); font-size: 0.95rem; margin-top: 4px; }

.status-box {
  margin: 28px 0 28px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  max-width: 72ch;
}
.status-box p { margin: 0; }
.status-label { font-weight: 600; }
.status-meta { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px !important; }

.link-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 56px;
  align-items: center;
}
@media (min-width: 1040px) {
  .hero-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
}
.hero-figure { margin: 0; }
.hero-figure .evidence { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04); }
.hero-figure .q-block { padding: 12px 14px 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.hero-figure .q-block:first-of-type { border-top: 0; }
.hero-figure .q-path { font-family: var(--font-mono); font-size: 0.78rem; color: var(--code-muted); display: block; margin-bottom: 4px; }
.hero-figure .q-text { font-family: var(--font-mono); font-size: 0.86rem; color: var(--code-text); }
.hero-figure figcaption { margin-top: 12px; font-size: 0.92rem; color: var(--text-muted); }
.hero-figure figcaption strong { color: var(--text); font-weight: 600; }

/* ---------- Cards / panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}
.panel > h3, .panel-title {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.note { color: var(--text-muted); font-size: 0.92rem; }
.small { font-size: 0.88rem; }

.outputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.output-card { display: flex; flex-direction: column; gap: 8px; }
.output-card h3 { font-size: 1.1rem; margin: 0; }
.output-card p { margin: 0; }
.output-card .availability { font-size: 0.9rem; color: var(--text-muted); }
.output-card .card-link { margin-top: auto; padding-top: 8px; font-weight: 500; }

.prose { max-width: 72ch; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.45em; }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px 40px;
}

.labels-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.labels-list li { padding-left: 14px; border-left: 3px solid var(--accent-line); }
.labels-list strong { display: block; }

.code-inline {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}
pre.command {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
  margin: 0 0 1em;
}

/* ---------- Case Lab ---------- */

.lab-disclaimer {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin: 0 0 14px;
}

.lab-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.rule-card {
  margin: 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.rule-card .rule-id { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); display: block; }
.rule-card q { font-family: var(--font-mono); font-size: 0.92rem; quotes: "\201C" "\201D"; }
.rule-card .rule-fixed { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.lab-top {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 20px;
  align-items: start;
}
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.lab-spans {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}
@media (max-width: 1040px) {
  .lab-top { grid-template-columns: minmax(0, 1fr); }
  .lab-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lab-grid > .panel:first-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .lab-grid, .lab-spans { grid-template-columns: minmax(0, 1fr); }
}

.controls fieldset {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
  min-width: 0;
}
.controls fieldset:last-child { margin-bottom: 0; }
.controls legend {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0;
  margin-bottom: 8px;
}
.choice-list { display: grid; gap: 8px; }
.choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}
.choice:hover { border-color: var(--accent-line); }
.choice input {
  margin: 3px 0 0;
  width: 18px; height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent);
}
.choice input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.25); }
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.choice-text .mono { font-weight: 500; overflow-wrap: anywhere; }
.choice-text .choice-hint { font-size: 0.84rem; color: var(--text-muted); }

.result-card { border-color: var(--accent-line); }
.result-label-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 10px; }
.result-label {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  font-weight: 600;
  color: var(--accent-strong);
  line-height: 1.15;
  margin: 0;
}
.result-context { font-size: 0.9rem; color: var(--text-muted); }
.result-explanation { margin-bottom: 12px; }
.effective {
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.effective strong { font-weight: 600; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  grid-row: 1 / span 2;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
}
.step-title { font-weight: 600; font-size: 0.92rem; }
.step-detail { font-size: 0.88rem; color: var(--text-muted); grid-column: 2; }
.step-status { font-weight: 500; font-size: 0.8rem; margin-left: 6px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.step.is-pass .step-status { background: var(--surface-2); color: var(--text); }
.step.is-pass::before { background: var(--accent-soft); color: var(--accent-strong); }
.step.is-stop { border-color: var(--accent); background: var(--accent-soft); }
.step.is-stop::before { background: var(--accent); color: #fff; }
.step.is-stop .step-status { background: var(--accent); color: #fff; }
.step.is-skip { opacity: 0.72; border-style: dashed; }
.step.is-skip .step-status { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-muted); }

/* Repository tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 10px; padding-left: 12px; border-left: 1px solid var(--border); }
.tree li { margin: 2px 0; }
.tree-node {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.tree-node .glyph { color: var(--text-muted); width: 1.1em; display: inline-block; text-align: center; }
.tree-node.on-chain { background: var(--accent-soft); }
.tree-node.is-target { background: var(--accent); color: #fff; }
.tree-node.is-target .glyph { color: #fff; }
.tree-node.ctx-loaded { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-soft); }
.tree-node.ctx-unloaded { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.tag {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.tree-node .tag { text-decoration: none; }
.legend { margin-top: 14px; font-size: 0.82rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .lg-chain::before { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.legend .lg-target::before { background: var(--accent); }
.legend .lg-loaded::before { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }

/* Definition-style rows */
.facts { margin: 0; display: grid; gap: 12px; }
.facts > div { min-width: 0; }
.facts dt { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 0.94rem; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 0.86rem; }
.chain .sep { color: var(--text-muted); }
.mono-list { list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 0.86rem; }
.mono-list li { overflow-wrap: anywhere; }
.state { font-weight: 600; }
.state-on { color: var(--accent-strong); }
.state-off { color: var(--text-muted); }
.verdict {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.94rem;
}
.verdict.strong { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.depth-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.92rem; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.depth-row:last-of-type { border-bottom: 0; }

/* Dark evidence/code panels */
.evidence {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.evidence-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 10px 14px;
  background: var(--code-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.85rem;
}
.evidence-head .who { font-weight: 600; color: #fff; margin-right: 8px; }
.evidence-head .where { font-family: var(--font-mono); color: var(--code-text); overflow-wrap: anywhere; }
.evidence-head .meta { color: var(--code-muted); font-size: 0.8rem; }
.evidence a { color: #9fdbe2; }
.evidence a:focus-visible, .evidence button:focus-visible { outline-color: var(--focus-on-dark); }
.code {
  margin: 0;
  padding: 10px 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  tab-size: 4;
}
.code:focus-visible { outline: 3px solid var(--focus-on-dark); outline-offset: -3px; }
.code .line { display: flex; min-width: max-content; padding-right: 14px; }
.code .ln {
  flex: 0 0 auto;
  width: 3.4em;
  padding-right: 1em;
  text-align: right;
  color: var(--code-muted);
  user-select: none;
}
.code .tx { white-space: pre; }
.code .line.hl { background: var(--code-hl); box-shadow: inset 3px 0 0 var(--code-hl-edge); }
.code .line.hl .ln { color: var(--code-text); }
.code.wrap .line { min-width: 0; }
.code.wrap .tx { white-space: pre-wrap; overflow-wrap: anywhere; }
.span-status { font-family: var(--font-sans); font-size: 0.75rem; padding: 1px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25); color: var(--code-text); }
.span-status.on { border-color: var(--code-hl-edge); color: #bfeef3; }

/* ---------- Data pages (results, cases) ---------- */

.page-head { padding-top: clamp(32px, 5vw, 56px); padding-bottom: 8px; }
.page-head h1 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
  margin: 0 0 10px;
}
.page-head .lede { color: var(--text-muted); }
.provenance {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-left: 3px solid var(--accent-line);
  padding-left: 12px;
  max-width: 72ch;
}

.message {
  max-width: 72ch;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.message h2 { font-family: var(--font-sans); font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.message p:last-child { margin-bottom: 0; }
.message.is-error { border-color: var(--warn-line); background: var(--warn-soft); }
.message .reason { font-style: normal; }

.table-block { margin: 0 0 40px; }
.table-block h2 { font-size: 1.3rem; margin-bottom: 4px; }
.table-block .caption { color: var(--text-muted); max-width: 80ch; margin-bottom: 12px; }
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  max-width: 100%;
}
.table-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.data-table caption { text-align: left; }
.data-table th, .data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.data-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.85rem;
  position: sticky;
  top: 0;
}
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .num { text-align: right; }
.data-table .undef { color: var(--text-muted); cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.table-notes { font-size: 0.88rem; color: var(--text-muted); margin-top: 8px; max-width: 80ch; }
.scroll-hint { font-size: 0.8rem; color: var(--text-muted); margin: 6px 0 0; }

.figure-block { margin: 0 0 40px; }
.figure-block figure { margin: 0; }
.figure-frame { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; }
.figure-frame img { display: block; margin: 0 auto; }
.figure-block figcaption { font-size: 0.92rem; color: var(--text-muted); margin-top: 8px; max-width: 80ch; }

/* Cases */
.cases-layout {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .cases-layout { grid-template-columns: minmax(0, 1fr); }
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 150px; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field select {
  font: inherit;
  font-size: 0.93rem;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  min-height: 42px;
  max-width: 100%;
}
.count-line { font-size: 0.88rem; color: var(--text-muted); margin: 0 0 10px; }
.case-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 901px) {
  .case-list { max-height: 70vh; overflow-y: auto; padding: 2px 4px 2px 2px; }
}
.case-link {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.case-link:hover { border-color: var(--accent-line); color: var(--text); text-decoration: none; }
.case-link[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.case-link .cid { font-family: var(--font-mono); font-weight: 600; font-size: 0.9rem; }
.case-link .ctarget { display: block; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); overflow-wrap: anywhere; }
.case-link .crow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }

.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: normal;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}
.badge-ref { background: var(--neutral-badge); color: var(--neutral-badge-text); border: 1px solid var(--neutral-badge); }
.badge-ref.is-pending { background: var(--surface-2); color: var(--text-muted); border: 1px dashed var(--border-strong); }
.badge-pred { background: transparent; border: 1.5px solid var(--border-strong); color: var(--text); }
.badge-pred .method { font-family: var(--font-mono); font-size: 0.78rem; padding-right: 6px; border-right: 1px solid currentColor; opacity: 0.85; }
.badge-pred.is-match { border-color: var(--accent); }
.badge-pred.is-mismatch { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.badge-pred.is-missing { border-style: dashed; color: var(--text-muted); font-weight: 500; }
.badge-sm { font-size: 0.75rem; padding: 1px 7px; }
.cmp { font-size: 0.82rem; font-weight: 600; }
.cmp.is-match { color: var(--accent-strong); }
.cmp.is-mismatch { color: var(--warn); }

.detail { min-width: 0; }
.detail-head h2 { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; margin: 0 0 6px; overflow-wrap: anywhere; }
.detail-head:focus { outline: none; }
.detail-head h2:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.detail section { margin-top: 22px; }
.detail h3 { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 0.94rem; }
.kv dt { color: var(--text-muted); font-weight: 500; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: 8px; }
}
.span-stack { display: grid; gap: 14px; }
.judgements { display: grid; gap: 12px; }
.judgement {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.judgement.reference { border-left: 4px solid var(--neutral-badge); }
.judgement .jhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.judgement .jbody { margin-top: 10px; font-size: 0.92rem; }
.judgement .jbody p { margin: 0 0 6px; }
.judgement .jbody ul { margin: 4px 0 0; padding-left: 1.2em; }
.disagree {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  color: var(--text);
  font-size: 0.9rem;
}
.notice {
  font-size: 0.92rem;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--neutral-badge);
  max-width: 72ch;
  margin: 0 0 20px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0 36px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.site-footer p { margin: 0 0 6px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }

@media print {
  .site-header, .skip-link, .site-footer, .controls { display: none; }
  body { background: #fff; }
}

.rule-card blockquote { margin: 0; }
.spaced { margin-top: 28px; }
.task-line { margin: 14px 0 0; }

/* Compact echo of the label under the controls, for narrow screens where the result card is below. */
.lab-mini { display: none; margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 0.92rem; }
.lab-mini strong { color: var(--accent-strong); }
@media (max-width: 1040px) { .lab-mini:not(:empty) { display: block; } }

@media (max-width: 700px) {
  .site-nav ul { margin-left: -10px; }
}

/* Keep the row-label column visible while a wide table scrolls sideways. */
.data-table tbody th[scope="row"] { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: inset -1px 0 0 var(--border); }
.data-table thead th:first-child { position: sticky; left: 0; z-index: 2; box-shadow: inset -1px 0 0 var(--border); }

.evidence-sub {
  padding: 6px 14px;
  background: var(--code-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.8rem;
  color: var(--code-muted);
}
.evidence-sub .where { font-family: var(--font-mono); color: var(--code-text); margin-left: 4px; overflow-wrap: anywhere; }
.filters .field { flex: 1 1 100%; }
@media (max-width: 900px) and (min-width: 560px) { .filters .field { flex: 1 1 220px; } }
