:root {
  --ink: #17243a;
  --text: #28364a;
  --muted: #667386;
  --accent: #16837e;
  --accent-soft: #edf8f6;
  --blue: #376da3;
  --blue-dark: #244e79;
  --blue-soft: #eef4fb;
  --green: #2f8968;
  --green-soft: #eef8f3;
  --orange: #c77a31;
  --orange-soft: #fff5e9;
  --red: #b6535b;
  --red-soft: #fdf0f1;
  --diagram-navy: #2f5f90;
  --diagram-teal: var(--accent);
  --diagram-teal-soft: var(--accent-soft);
  --diagram-orange: var(--orange);
  --diagram-orange-soft: var(--orange-soft);
  --diagram-purple: #755aa5;
  --diagram-purple-soft: #f4effa;
  --line: #d8e0eb;
  --line-dark: #a8b6c9;
  --paper: #ffffff;
  --page: #fbfcfe;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font: 17px/1.7 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; }
button, audio { font: inherit; }
.content-wrapper { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.skip-link { position: fixed; top: -80px; left: 1rem; z-index: 10; padding: .55rem .8rem; color: white; background: var(--ink); }
.skip-link:focus { top: 1rem; }

.paper-header { padding: 4rem 0 1.2rem; text-align: center; }
.venue { margin: 0 0 .55rem; color: var(--blue); font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
h1 {
  max-width: 1080px;
  margin: 0 auto;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 2.65rem);
  font-weight: 650;
  line-height: 1.28;
  letter-spacing: -.02em;
}
.tagline { margin: 1rem auto 0; color: #555; font-size: 1.08rem; font-style: italic; }
.paper-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; margin-top: 1.35rem; }
.paper-links a {
  display: inline-block;
  padding: .43rem 1.05rem;
  border-radius: 6px;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: white;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.paper-links a:hover { color: white; background: var(--ink); }
.paper-header hr { width: 70%; height: 4px; margin: 1.7rem auto 1.1rem; border: 0; background: linear-gradient(90deg, var(--blue), var(--accent), var(--diagram-purple)); }
.status { display: flex; justify-content: center; align-items: center; gap: .45rem; margin: 0; color: var(--muted); font-size: .82rem; }
.status span { width: 8px; height: 8px; border-radius: 50%; background: #c98621; }
.status.complete span { background: var(--green); }

section { padding: 1.6rem 0 1.2rem; }
h2, h3, h4 { color: var(--ink); }
h2 { margin: 1.8rem 0 .8rem; font-size: 1.8rem; font-weight: 650; line-height: 1.3; }
h3 { margin: 2rem 0 .55rem; font-size: 1.25rem; font-weight: 650; line-height: 1.35; }
h4 { margin: .6rem 0 .45rem; font-size: 1.02rem; line-height: 1.35; }
p { margin: .65rem 0 1rem; }
section > p { max-width: 1080px; }

.explanation-box {
  margin: 1.2rem 0;
  padding: 1rem 1.3rem;
  border-left: 3px solid var(--ink);
  border-radius: 0;
  background: #f6f6f6;
  font-size: .97rem;
}

figure { margin: 1.4rem auto; }
.figure-card, .plain-figure { max-width: 1080px; }
.figure-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
figcaption { margin-top: .65rem; color: #666; font-size: .86rem; line-height: 1.5; text-align: center; }

.figure-sequence { display: grid; gap: clamp(1.7rem, 4vw, 2.8rem); margin: 1.65rem 0 2.2rem; }
.academic-diagram {
  --diagram-width: min(1360px, calc(100vw - 24px));
  width: var(--diagram-width);
  max-width: none;
  margin: 0 0 0 calc((100% - var(--diagram-width)) / 2);
  padding: clamp(.65rem, 1.2vw, 1rem);
  border-color: var(--line);
  border-radius: 3px;
  background: white;
  box-shadow: none;
}
.academic-diagram figcaption { max-width: 1100px; margin: .8rem auto .05rem; }
.diagram-heading { display: flex; align-items: baseline; gap: .65rem; margin: 0 0 .8rem; padding: 0 .15rem .6rem; border-bottom: 1px solid var(--line); }
.diagram-heading span { color: var(--diagram-teal); font-size: .63rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; }
.diagram-heading strong { color: var(--ink); font-size: 1.05rem; letter-spacing: -.012em; }
.diagram-panel { min-width: 0; color: var(--ink); }
.diagram-panel h3 { margin: 0 0 .75rem; color: var(--diagram-navy); font-size: .88rem; line-height: 1.28; text-align: center; }
.diagram-panel h3 span { color: var(--diagram-teal); }
.problem-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.problem-panel { display: flex; flex-direction: column; gap: .52rem; min-height: 370px; padding: .82rem; border: 1px solid var(--line); border-top: 2px solid var(--line-dark); border-radius: 3px; background: white; }
.problem-panel.generative-problem { border-top-color: var(--line-dark); }
.problem-panel.anchor-problem { border-style: solid; border-top-style: dashed; border-top-color: var(--ink); background: white; }
.problem-panel.solution-problem { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(300px, 1.45fr) minmax(230px, 1fr) minmax(180px, .7fr); gap: .7rem; align-items: center; min-height: 0; border-color: var(--accent); border-top-color: var(--accent); background: white; }
.solution-problem h3 { grid-column: 1 / -1; margin-bottom: .05rem; }
.input-pair { display: grid; gap: .38rem; }
.signal-node { padding: .38rem .48rem; border: 1px solid var(--line); border-radius: 3px; background: white; }
.signal-node small, .enrolment-node small { display: block; color: var(--muted); font-size: .66rem; line-height: 1.35; text-align: center; }
.condition-chip, .condition-row > span, .repaired-chip { padding: .3rem .42rem; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: white; font-size: .68rem; line-height: 1.35; text-align: center; }
.signal-wave { display: block; width: 100%; height: 40px; object-fit: fill; object-position: center; overflow: hidden; }
.compact-wave { height: 24px; }
.distorted-wave { opacity: .62; }
.diagram-block { padding: .5rem .48rem; border: 1.4px solid var(--ink); border-radius: 3px; color: var(--ink); background: white; font-size: .74rem; font-weight: 650; line-height: 1.35; text-align: center; }
.diagram-block small { display: block; margin-top: .16rem; color: var(--muted); font-size: .62rem; font-style: italic; font-weight: 500; }
.compact-block { padding: .35rem .4rem; font-size: .58rem; }
.purple-block { border-color: var(--ink); color: var(--ink); background: white; }
.flow-down { display: block; height: .7rem; color: var(--diagram-navy); font-size: 1rem; line-height: .7; text-align: center; }
.purple-arrow { color: var(--diagram-purple); }
.outcome-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .38rem; }
.outcome-card, .generated-output { min-width: 0; padding: .4rem; border: 1px solid var(--line); border-radius: 3px; background: white; text-align: center; }
.outcome-card strong, .generated-output strong { display: block; color: var(--ink); font-size: .64rem; line-height: 1.3; }
.failure-outcome, .failure-output { border-color: var(--line-dark); border-style: dashed; background: white; }
.failure-outcome strong, .failure-output strong { color: var(--ink); }
.positive-note, .warning-note, .neutral-note { margin: 0; padding: .33rem .42rem; border-top: 1px solid var(--line); border-radius: 0; color: var(--ink); background: transparent; font-size: .65rem; line-height: 1.38; text-align: center; }
.positive-note { margin-top: auto; }
.purple-note { color: var(--ink); background: transparent; }
.warning-note { color: var(--ink); background: transparent; }
.strong-warning { margin-top: auto; font-weight: 700; }
.neutral-note { color: var(--muted); background: transparent; }
.condition-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.generated-output { background: white; border-color: var(--line); }
.generated-output strong { color: var(--ink); }
.bad-anchor-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto 36px auto minmax(62px, .75fr); gap: .25rem; align-items: center; color: var(--ink); font-size: .7rem; text-align: center; }
.bad-anchor-flow small { display: block; font-size: .6rem; line-height: 1.25; }
.token-mini { display: grid; height: 34px; place-items: center; border: 1px solid var(--line-dark); border-radius: 3px; font-size: .7rem; font-weight: 700; }
.orange-token { color: var(--ink); background: white; }
.solution-flow { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto auto minmax(180px, 1.2fr); gap: .4rem; align-items: center; padding: .58rem; border: 1px solid var(--line); border-radius: 3px; background: white; font-size: .68rem; line-height: 1.3; text-align: center; }
.solution-flow > strong { color: var(--accent); font-size: .8rem; }
.solution-flow > b { color: var(--diagram-teal); line-height: .8; }
.repaired-chip { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); font-weight: 650; }
.endpoint-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .36rem; }
.endpoint-mini-grid div { padding: .44rem .32rem; border: 1px solid var(--line); border-radius: 3px; background: white; text-align: center; }
.endpoint-mini-grid div:last-child { border-color: var(--accent); background: var(--accent-soft); }
.endpoint-mini-grid strong { display: block; color: var(--ink); font-size: .66rem; line-height: 1.25; }
.endpoint-mini-grid div:last-child strong { color: var(--ink); }
.endpoint-mini-grid small { display: block; margin-top: .15rem; color: #6d7886; font-size: .5rem; line-height: 1.25; }
.design-rule { margin: 0; padding: .46rem; border-left: 2px solid var(--accent); color: var(--ink); font-size: .76rem; line-height: 1.45; text-align: center; }
.figure-bridge { max-width: 860px; margin: -.55rem auto -.6rem; color: var(--ink); font-size: .9rem; font-weight: 650; text-align: center; }
.figure-bridge span { display: inline-block; margin-right: .35rem; padding: .12rem .45rem; border-radius: 999px; color: var(--accent); background: var(--diagram-teal-soft); font-size: .61rem; letter-spacing: .055em; text-transform: uppercase; }

.method-overview-figure { --diagram-width: min(1420px, calc(100vw - 20px)); }
.method-diagram { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.12fr) minmax(220px, .72fr); color: var(--ink); }
.method-panel { min-width: 0; padding: .25rem .8rem .4rem; }
.method-panel + .method-panel { border-left: 1px solid var(--line); }
.method-panel h3 { min-height: 2.25rem; margin-bottom: .65rem; font-size: .92rem; }
.repair-flow { display: grid; grid-template-columns: minmax(80px, 1fr) auto minmax(86px, .95fr) auto minmax(92px, 1.05fr) auto minmax(105px, 1fr); gap: .25rem; align-items: center; }
.repair-inputs, .expert-stack, .candidate-stack, .selector-stage { display: grid; gap: .38rem; min-width: 0; }
.enrolment-node { padding: .4rem; border: 1px solid var(--line); border-radius: 3px; background: white; text-align: center; }
.enrolment-node strong { display: block; color: var(--ink); font-size: .66rem; line-height: 1.25; }
.view-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .17rem; margin: .3rem 0 .18rem; }
.view-chips span { padding: .12rem .08rem; border: 1px dashed var(--line-dark); border-radius: 2px; color: var(--ink); background: white; font-size: .56rem; }
.flow-across { color: var(--diagram-navy); font-size: 1rem; font-weight: 700; }
.candidate-stack > div { display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-areas: "label wave" "label meta"; column-gap: .25rem; align-items: center; padding: .18rem .24rem; border: 1px solid var(--line); border-radius: 2px; background: white; }
.candidate-stack b { grid-area: label; color: var(--ink); font-size: .65rem; }
.candidate-stack .candidate-wave { grid-area: wave; height: 13px; }
.candidate-stack small { grid-area: meta; color: var(--muted); font-size: .54rem; line-height: 1; text-align: right; }
.candidate-stack > div:nth-child(3) { border-color: var(--accent); background: var(--accent-soft); }
.candidate-stack > div:last-child { border-color: var(--line-dark); }
.selector-block { border-color: var(--accent); color: var(--ink); }
.selector-stage .compact-math { display: block; overflow-wrap: anywhere; padding: .22rem; border-radius: 2px; color: var(--ink); background: #f5f5f5; font-size: .58rem; line-height: 1.35; text-align: center; }
.selected-evidence { display: grid; grid-template-columns: auto minmax(70px, 150px) auto; gap: .5rem; align-items: center; width: min(440px, 76%); margin: .65rem 0 0 auto; padding: .35rem .45rem; border: 1.5px solid var(--accent); border-radius: 3px; color: var(--ink); background: var(--accent-soft); }
.selected-evidence > span:first-child { text-align: right; }
.selected-evidence b { display: block; font-size: .7rem; line-height: 1.25; }
.selected-evidence small { display: block; color: var(--muted); font-size: .58rem; }
.selected-evidence .signal-wave { height: 24px; }
.continues-arrow { color: var(--diagram-teal); font-size: 1.1rem; }
.method-footnote { margin: .5rem 0 0; color: var(--muted); font-size: .6rem; line-height: 1.35; text-align: center; }
.conditioning-paths { display: grid; gap: .28rem; }
.conditioning-path { display: grid; grid-template-columns: minmax(54px, .78fr) auto minmax(72px, .92fr) auto minmax(70px, 1fr); grid-template-areas: "source a module b output" ". . . . label"; gap: .18rem; align-items: center; padding: .3rem; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--ink); font-size: .61rem; text-align: center; }
.conditioning-path > span:first-child { grid-area: source; }
.conditioning-path > b:nth-of-type(1) { grid-area: a; }
.conditioning-path > .compact-module { grid-area: module; }
.conditioning-path > b:nth-of-type(2) { grid-area: b; }
.conditioning-path > .token-row, .conditioning-path > .feature-row { grid-area: output; }
.conditioning-path > small { grid-area: label; color: var(--muted); font-size: .55rem; text-align: center; }
.evidence-path { border-color: var(--accent); background: var(--accent-soft); }
.compact-module { padding: .22rem .18rem; border: 1px solid var(--ink); border-radius: 2px; color: var(--ink); background: white; font-size: .57rem; line-height: 1.3; }
.compact-module i { color: var(--muted); }
.token-row, .feature-row { display: flex; justify-content: center; gap: .13rem; min-width: 0; }
.token-row i { display: grid; min-width: 18px; height: 20px; place-items: center; padding: 0 .15rem; border: 1px solid var(--line-dark); border-radius: 2px; color: var(--ink); background: white; font: normal 600 .54rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.teal-tokens i { border-color: var(--accent); color: var(--ink); background: white; }
.purple-tokens i { border-color: var(--line-dark); color: var(--ink); background: white; }
.feature-row i { width: 10px; height: 15px; border-radius: 1px; background: #8f8f8f; }
.condition-merge { display: flex; justify-content: center; align-items: center; gap: .25rem; height: 34px; color: var(--ink); font-size: .62rem; }
.condition-merge > span { display: grid; width: 26px; height: 22px; place-items: center; border: 1px solid var(--line-dark); border-radius: 2px; background: white; }
.condition-merge b { margin-left: .15rem; color: var(--diagram-navy); font-size: .9rem; }
.qwen-block { width: 76%; margin: 0 auto; border-color: var(--ink); background: white; }
.qwen-block strong { font-size: .78rem; }
.logit-stage, .grounded-token-stage { display: grid; justify-items: center; gap: .2rem; }
.logit-stage small { color: var(--muted); font-size: .58rem; }
.csg-block { width: 92%; margin: 0 auto; border-color: var(--accent); color: var(--ink); background: white; }
.csg-block strong { display: block; font-size: .78rem; }
.csg-block .compact-equation { display: block; margin: .3rem 0 .24rem; padding: .28rem; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); background: #f7f7f7; font-size: .66rem; line-height: 1.45; }
.csg-block em { display: block; color: var(--muted); font-size: .55rem; font-weight: 500; }
.csg-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .28rem; margin: .3rem 0; }
.csg-modes > span { display: grid; gap: .08rem; padding: .28rem .2rem; border: 1px solid var(--line); border-radius: 2px; background: white; }
.csg-modes > span:last-child { border-color: #b8add1; background: var(--diagram-purple-soft); }
.csg-modes b { color: var(--ink); font-size: .6rem; }
.csg-modes i { color: var(--muted); font-size: .55rem; font-style: normal; font-weight: 500; }
.adaptive-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.25fr); gap: .16rem; align-items: center; margin: .3rem 0; padding: .3rem; border: 1px dashed #a99bc8; border-radius: 2px; color: var(--ink); background: var(--diagram-purple-soft); font-size: .52rem; line-height: 1.25; }
.adaptive-route > b { color: var(--diagram-purple); }
.adaptive-route > small { grid-column: 1 / -1; margin-top: .08rem; color: var(--muted); font-size: .49rem; font-style: normal; text-align: center; }
.grounded-token-stage strong { color: var(--ink); font-size: .64rem; }
.endpoint-method { display: flex; flex-direction: column; }
.endpoint-card { display: grid; justify-items: center; gap: .35rem; padding: .7rem .55rem; border: 1px solid var(--line); border-radius: 3px; background: white; text-align: center; }
.endpoint-card.generated-endpoint { border-color: var(--accent); background: var(--accent-soft); }
.endpoint-source { margin: 0; color: var(--muted); font-size: .62rem; line-height: 1.35; }
.endpoint-card .output-wave { width: 92%; height: 38px; }
.endpoint-card > strong { color: var(--ink); font-size: .78rem; line-height: 1.25; }
.endpoint-card.generated-endpoint > strong { color: var(--ink); }
.endpoint-card > small { color: var(--muted); font-size: .62rem; line-height: 1.4; }
.endpoint-modes { display: grid; width: 100%; gap: .24rem; }
.endpoint-modes > span { display: grid; justify-items: center; gap: .12rem; padding: .3rem .38rem; border: 1px solid var(--line); border-radius: 2px; color: var(--ink); background: white; font-size: .57rem; text-align: center; }
.endpoint-modes > span:last-child { border-color: #b8add1; background: var(--diagram-purple-soft); }
.endpoint-modes b { font-size: .57rem; overflow-wrap: anywhere; }
.endpoint-modes small { color: var(--muted); font-size: .52rem; white-space: nowrap; }
.endpoint-divider { position: relative; height: 2.1rem; display: grid; place-items: center; }
.endpoint-divider::before { position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: #d8dfe7; content: ""; }
.endpoint-divider span { position: relative; padding: 0 .4rem; color: #84909f; background: white; font-size: .5rem; text-transform: uppercase; }
.ablation-note { margin: auto 0 0; padding-top: .5rem; color: var(--muted); font-size: .6rem; line-height: 1.4; text-align: center; }

.grounding-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.grounding-step { position: relative; min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: #fcfcfc; }
.grounding-step.emphasis-step { border-color: #a9c0df; background: var(--blue-soft); }
.step-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-size: .78rem; font-weight: 700; }
.grounding-step p { min-height: 86px; margin: 0 0 .8rem; color: #555; font-size: .82rem; line-height: 1.55; }
.token-labels { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .3rem; color: var(--muted); font-size: .63rem; text-align: center; }
.token-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.trit-row { display: grid; grid-template-columns: repeat(4, minmax(20px, 1fr)); gap: .18rem; }
.trit-row span { min-height: 26px; display: grid; place-items: center; border: 1px solid #c8d9ee; background: white; color: #17457e; font-size: .64rem; }
.proposal-row span { border-color: #ead4bf; color: #7a3b00; }
.proposal-row span.changed { border-bottom: 3px solid var(--orange); background: var(--orange-soft); }
.equation { min-height: 96px; display: grid; place-items: center; padding: .65rem; border: 1px solid #c8d9ee; border-radius: 5px; background: white; color: #364152; font: .68rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-align: center; overflow-wrap: anywhere; }
.distance-key { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .65rem; color: var(--muted); font-size: .62rem; }
.distance-key span { display: inline-flex; align-items: center; gap: .3rem; }
.distance-key i { width: 9px; height: 9px; border-radius: 50%; }
.distance-key .near { background: var(--green); }
.distance-key .far { background: var(--orange); }
.mode-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .42rem; margin-top: .62rem; }
.mode-compare > span { display: grid; gap: .08rem; padding: .42rem .35rem; border: 1px solid #a9c0df; border-radius: 4px; background: white; text-align: center; }
.mode-compare > span:last-child { border-color: #b8add1; background: var(--diagram-purple-soft); }
.mode-compare b { color: var(--ink); font-size: .68rem; }
.mode-compare small { color: var(--muted); font-size: .61rem; }
.grounding-step.adaptive-step { border-color: #b8add1; background: var(--diagram-purple-soft); }
.grounding-step.adaptive-step .step-number { background: var(--diagram-purple); }
.difficulty-formula { min-height: 72px; display: grid; place-items: center; padding: .55rem; border: 1px solid #c9bfdf; border-radius: 5px; color: var(--ink); background: white; font-size: .64rem; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.difficulty-map { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: .35rem; align-items: center; margin-top: .6rem; }
.difficulty-map > span { display: grid; gap: .08rem; padding: .4rem .3rem; border: 1px solid #c9bfdf; border-radius: 4px; background: white; text-align: center; }
.difficulty-map > span:first-child { border-bottom: 3px solid var(--diagram-purple); }
.difficulty-map > span:last-child { border-bottom: 3px solid #9aacc3; }
.difficulty-map small { color: var(--muted); font-size: .56rem; }
.difficulty-map b { color: var(--ink); font-size: .61rem; line-height: 1.25; }
.difficulty-map > i { color: var(--diagram-purple); font-style: normal; font-weight: 700; }
.neighbor-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .28rem; }
.neighbor-row > span { min-height: 58px; display: grid; place-content: center; padding: .35rem; border: 1px solid var(--line); border-radius: 5px; background: white; color: #555; font-size: .66rem; text-align: center; }
.neighbor-row small { font-size: .58rem; }
.neighbor-row .anchor-choice { border-color: #a9c0df; background: var(--blue-soft); }
.neighbor-row .accepted-choice { border-color: #9ac69d; background: var(--green-soft); color: #1b5e20; }
.neighbor-row .rejected-choice { border-color: #e8c4bf; background: var(--red-soft); opacity: .72; }
.no-feedback { display: block; margin-top: .65rem; color: var(--muted); font-size: .62rem; text-align: center; }

.listen-box { margin-bottom: .9rem; }
.adaptive-audio-link { margin: -.25rem 0 .9rem; font-size: .78rem; }
.adaptive-audio-link a { color: var(--accent); font-weight: 600; text-decoration: none; }
.adaptive-audio-link a:hover { text-decoration: underline; }
.case-navigation { display: flex; justify-content: center; align-items: center; gap: .9rem; margin: 1.1rem auto .35rem; }
.case-navigation button {
  width: 42px;
  height: 38px;
  border: 0;
  border-radius: 5px;
  color: white;
  background: var(--blue);
  font-size: 1rem;
  cursor: pointer;
}
.case-navigation button:hover { background: var(--blue-dark); }
.case-navigation button:focus-visible, .paper-links a:focus-visible, summary:focus-visible { outline: 3px solid rgba(66, 106, 160, .35); outline-offset: 2px; }
#case-count { min-width: 120px; font-size: .86rem; font-weight: 650; text-align: center; }
.audio-case {
  padding: 1rem 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.audio-case[hidden] { display: none; }
.audio-case h3 { margin-top: 0; text-align: center; }
.audio-case > p { max-width: 950px; margin-left: auto; margin-right: auto; text-align: center; }
.input-details { max-width: 440px; margin: .65rem auto; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 6px; background: #fafafa; }
.input-details.wide-inputs { max-width: 760px; }
.input-details audio { width: 100%; height: 34px; margin-top: .4rem; }
summary { color: #275ba0; font-size: .82rem; font-weight: 600; cursor: pointer; }
.audio-grid { display: grid; gap: .65rem; margin-top: .9rem; }
.audio-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.audio-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.audio-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.audio-cell { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: white; text-align: center; }
.audio-cell > strong { display: block; padding: .45rem .35rem .05rem; color: #444; font-size: .76rem; }
.audio-cell > small { display: block; min-height: 1.4rem; padding: 0 .35rem; color: var(--muted); font-size: .61rem; }
.audio-cell audio { width: calc(100% - 12px); height: 34px; margin: .35rem 6px .45rem; }
.audio-cell.reference { background: #fafafa; }
.audio-cell.wrong { border-color: #ddb3ae; }
.audio-cell.wrong > strong { color: #8d352b; }
.audio-cell.ours { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.audio-cell.ours > strong { color: #1b5e20; background: var(--green-soft); }
.transcript-panel {
  max-width: 920px;
  margin: .9rem auto 0;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfbfb;
}
.transcript-note { margin: 0 0 .55rem; color: var(--muted); font-size: .68rem; text-align: left !important; }
.transcript-panel dl { margin: 0; }
.transcript-panel dl > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: .65rem; padding: .35rem 0; border-top: 1px solid #ededed; }
.transcript-panel dt { color: #475467; font-size: .68rem; font-weight: 700; }
.transcript-panel dd { margin: 0; color: #3e4652; font: .7rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.transcript-panel .wrong-line dt { color: #943b31; }
.transcript-panel .ours-line dt { color: #1b6b20; }
.wer-tag { display: inline-block; margin-left: .35rem; padding: .03rem .3rem; border-radius: 3px; color: #475467; background: #eceff3; font: 600 .6rem/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; white-space: nowrap; }
.transcript-reading { margin: .6rem 0 0 !important; padding-top: .55rem; border-top: 1px solid var(--line); color: #475467; font-size: .72rem; line-height: 1.55; text-align: left !important; }
.spectrogram { width: min(100%, 560px); margin: .75rem auto 0; text-align: center; }
.spectrogram-frame { margin: .45rem 0 0; padding: .42rem; border: 1px solid #d9dee5; border-radius: 7px; background: white; box-shadow: 0 3px 12px rgba(27, 39, 54, .06); }
.spectrogram-frame a { display: block; overflow: hidden; border-radius: 4px; background: #f7f9fb; }
.spectrogram img { display: block; width: 100%; height: auto; margin: 0 auto; }
.spectrogram img:not([src]) { display: none; }
.spectrogram-frame figcaption { margin: .42rem .25rem 0; font-size: .67rem; line-height: 1.45; }
.pending { margin-top: .8rem; padding: .8rem 1rem; border-left: 4px solid var(--orange); border-radius: 0 7px 7px 0; background: var(--orange-soft); font-size: .84rem; }

.result-jump { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0 1.45rem; }
.result-jump a { padding: .28rem .62rem; border: 1px solid #cfd7e2; border-radius: 999px; background: white; color: #41566f; font-size: .72rem; font-weight: 650; text-decoration: none; }
.result-jump a:hover { border-color: #9bb0ca; background: var(--blue-soft); }
.metric-guide {
  margin: .4rem 0 1.2rem;
  padding: 1rem;
  scroll-margin-top: 1rem;
  border: 1px solid #cfdbea;
  border-radius: 12px;
  background: linear-gradient(180deg, #f9fbfe 0%, #f3f7fb 100%);
  box-shadow: 0 8px 24px rgba(36, 58, 83, .07);
}
.metric-intro { max-width: 910px; }
.metric-intro h3 { margin: .35rem 0 .35rem; font-size: 1.25rem; }
.metric-intro > p:last-child { margin: 0 0 .9rem; color: #4d5c6d; font-size: .88rem; }
.study-badge {
  display: inline-flex;
  margin: 0;
  padding: .18rem .55rem;
  border: 1px solid #9cb8d9;
  border-radius: 999px;
  color: #285783;
  background: #eaf2fb;
  font-size: .64rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.switch-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.switch-metric {
  min-width: 0;
  padding: .9rem;
  border: 1px solid #d9e1ea;
  border-top: 3px solid var(--blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
}
.switch-metric.acoustic-metric { border-top-color: var(--green); }
.metric-title-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; }
.metric-symbol { color: var(--ink); font-size: 1.18rem; font-weight: 760; letter-spacing: -.02em; }
.metric-direction { padding: .1rem .42rem; border-radius: 999px; color: #436246; background: var(--green-soft); font-size: .61rem; font-weight: 700; }
.switch-metric h4 { margin: .18rem 0 .3rem; font-size: .86rem; }
.switch-metric p { margin: 0 0 .65rem; color: #566477; font-size: .76rem; line-height: 1.55; }
.metric-formula {
  overflow-x: auto;
  padding: .58rem .65rem;
  border: 1px solid #dce4ed;
  border-radius: 6px;
  color: #223c5a;
  background: #f8fafc;
  font: .73rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  white-space: nowrap;
}
.formula-stack { display: grid; gap: .12rem; }
.formula-stack > span { display: block; }
.rate-formula {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .45rem .8rem;
  margin: .75rem auto .55rem;
  color: #344b63;
  font: .73rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.rate-formula .rate-expression { color: #344b63; }
.rate-formula .rate-divider { color: #8a99aa; }
.metric-caveat { margin: 0; padding-top: .55rem; border-top: 1px solid #dce4ed; color: #637083; font-size: .7rem; line-height: 1.55; }
.supporting-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; margin: 0 0 1.55rem; }
.supporting-metrics > div { min-width: 0; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: 7px; background: white; }
.supporting-metrics dt { color: #324b67; font-size: .71rem; font-weight: 750; }
.supporting-metrics dd { margin: .18rem 0 0; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.result-group { margin: 1.25rem 0 2rem; scroll-margin-top: 1rem; }
.result-group + .result-group { padding-top: 1.2rem; border-top: 1px solid var(--line); }
.result-group h3 { margin: .12rem 0 .45rem; }
.result-group h4 { margin: 1.05rem 0 .4rem; }
.split-label { display: inline-flex; margin: 0 0 .25rem; padding: .14rem .48rem; border-radius: 999px; color: #365d88; background: #edf3fa; font-size: .62rem; font-weight: 750; letter-spacing: .065em; text-transform: uppercase; }
.compact-result { margin-top: 1.7rem; }
.table-note { margin: -.25rem 0 .65rem; color: var(--muted); font-size: .82rem; }
.table-scroll { overflow-x: auto; border: 1px solid #d9dee5; border-radius: 8px; background: white; box-shadow: 0 3px 12px rgba(27, 39, 54, .035); }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
th, td { padding: .62rem .7rem; border-bottom: 1px solid #ececec; text-align: right; white-space: nowrap; }
th { color: #475467; background: #f3f4f6; font-size: .7rem; font-weight: 700; }
td { font-size: .77rem; }
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fafafa; }
.system-table { min-width: 940px; }
.system-table th:first-child, .system-table td:first-child { width: 24%; min-width: 205px; line-height: 1.35; white-space: normal; }
.system-table th:nth-child(2), .system-table td:nth-child(2) { min-width: 120px; text-align: left; }
.system-table td:first-child, .matrix-table td:first-child { color: #344054; font-weight: 630; }
.system-table td:not(:first-child):not(:nth-child(2)) { min-width: 76px; }
.matrix-table th:first-child, .matrix-table td:first-child { min-width: 205px; line-height: 1.35; white-space: normal; }
.branch-start td { border-top: 2px solid #d3dce7; }
.key-row { background: #f2f8f2 !important; }
.key-row td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.result-reading { margin: .68rem 0 .9rem; padding: .62rem .78rem; border-left: 3px solid #9fb9d7; border-radius: 0 6px 6px 0; color: #475467; background: #f7f9fc; font-size: .82rem; line-height: 1.55; }
.additional-results { margin-top: 1rem; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: 7px; background: white; }
.additional-results > summary { font-size: .9rem; }
.additional-results h3 { margin-top: 1.35rem; }

.two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 1.4rem; align-items: center; }
.plain-figure { margin: 0; }
.plain-figure img { display: block; border: 1px solid var(--line); border-radius: 8px; background: white; }
footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.2rem; padding: 1.2rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
footer p { margin: 0; }

/* Restrained academic treatment: dark type, neutral structure, semantic accents. */
.figure-card,
.spectrogram-frame,
.table-scroll,
.metric-guide { box-shadow: none; }
.figure-card,
.grounding-step,
.audio-case,
.audio-cell,
.transcript-panel,
.metric-guide,
.switch-metric,
.table-scroll,
.additional-results,
.plain-figure img { border-radius: 3px; }
.math-inline { white-space: nowrap; }
.math-display { overflow-x: auto; color: var(--ink); text-align: center; }
.math-display > .katex-display { margin: 0; padding: .08rem 0; }
.math-inline .katex,
.math-display .katex { color: var(--ink); font-size: 1em; }
.academic-diagram .katex-mathml { font-size: initial; }
.grounding-step.emphasis-step { border-color: var(--accent); background: var(--accent-soft); }
.step-number { background: var(--ink); }
.trit-row span,
.proposal-row span { border-color: var(--line); color: var(--ink); background: white; }
.proposal-row span.changed { border-bottom-color: var(--ink); background: #f2f2f2; }
.equation { border-color: var(--line); color: var(--ink); background: white; font: inherit; }
.distance-key .near { background: var(--accent); }
.distance-key .far { background: #777777; }
.neighbor-row .anchor-choice { border-color: var(--line-dark); background: #f4f4f4; }
.neighbor-row .accepted-choice { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.neighbor-row .rejected-choice { border-color: var(--line-dark); color: var(--ink); background: #f4f4f4; opacity: .72; }
.case-navigation button { background: var(--ink); }
.case-navigation button:hover { background: #000000; }
summary { color: var(--accent); }
.audio-cell.wrong { border-color: var(--line-dark); border-style: dashed; }
.audio-cell.wrong > strong,
.audio-cell.ours > strong,
.transcript-panel .wrong-line dt,
.transcript-panel .ours-line dt { color: var(--ink); }
.audio-cell.ours { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.audio-cell.ours > strong { background: var(--accent-soft); }
.pending { border-left-color: var(--line-dark); color: var(--ink); background: #f5f5f5; }
.result-jump a { border-color: var(--line); color: var(--ink); background: white; }
.result-jump a:hover { border-color: var(--line-dark); color: var(--ink); background: #f3f3f3; }
.metric-guide { border-color: var(--line); background: #fafafa; }
.metric-intro > p:last-child,
.switch-metric p,
.metric-caveat { color: var(--muted); }
.study-badge { border-color: var(--line-dark); color: var(--ink); background: white; }
.switch-metric { border-color: var(--line); border-top-color: var(--line-dark); background: white; }
.switch-metric.acoustic-metric { border-top-color: var(--accent); }
.metric-direction { border: 1px solid var(--line); color: var(--ink); background: white; }
.metric-formula { border-color: var(--line); color: var(--ink); background: #f7f7f7; font: inherit; }
.rate-formula,
.rate-formula .rate-expression { color: var(--ink); font: inherit; }
.supporting-metrics dt,
.system-table td:first-child,
.matrix-table td:first-child { color: var(--ink); }
.split-label { color: var(--ink); background: #f2f2f2; }
.key-row { background: var(--accent-soft) !important; }
.key-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.result-reading { border-left-color: var(--accent); color: var(--ink); background: #f7f7f7; }

/* Refined academic colour: blue = deterministic/context, purple = generation,
   warm tones = failure risk, teal/green = repair and proposed outputs. */
.paper-links a { border-color: var(--blue-dark); color: var(--blue-dark); }
.paper-links a:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.explanation-box { border-left-color: var(--blue); background: var(--blue-soft); }
.figure-card, .academic-diagram, .table-scroll, .audio-case, .metric-guide { background: var(--paper); }
.diagram-heading span, .diagram-panel h3 span { color: var(--accent); }

.problem-panel { border-top-color: var(--blue); background: linear-gradient(180deg, var(--blue-soft) 0, #fff 28%); }
.problem-panel.generative-problem { border-top-color: var(--diagram-purple); background: linear-gradient(180deg, var(--diagram-purple-soft) 0, #fff 28%); }
.problem-panel.anchor-problem { border-color: var(--line); border-top-color: var(--red); background: linear-gradient(180deg, var(--red-soft) 0, #fff 28%); }
.problem-panel.solution-problem { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft) 0, #fff 42%); }
.generative-problem .diagram-block, .qwen-block { border-color: var(--diagram-purple); background: var(--diagram-purple-soft); }
.generated-output { border-color: #cfc2e3; background: var(--diagram-purple-soft); }
.failure-outcome, .failure-output { border-color: #deaab0; background: var(--red-soft); }
.warning-note { border-top-color: #ebc3c7; color: #7b343b; }
.positive-note { border-top-color: #b9d6cb; color: #27664f; }
.orange-token { border-color: #dfad74; color: #7b4618; background: var(--orange-soft); }
.solution-flow, .endpoint-mini-grid div:last-child { border-color: #9ccbc2; }

.expert-stack .diagram-block:first-child { border-color: var(--blue); background: var(--blue-soft); }
.expert-stack .diagram-block:last-child { border-color: var(--diagram-purple); background: var(--diagram-purple-soft); }
.selector-stage .compact-math { background: var(--blue-soft); }
.selected-evidence, .evidence-path, .csg-block, .endpoint-card.generated-endpoint { border-color: var(--accent); background: var(--accent-soft); }
.compact-module { border-color: var(--blue-dark); }
.purple-tokens i { border-color: #a998c5; color: #513b79; background: var(--diagram-purple-soft); }
.teal-tokens i { border-color: #72b9ad; color: #155f5b; background: var(--accent-soft); }
.qwen-block strong { color: #513b79; }
.grounded-token-stage strong, .endpoint-card.generated-endpoint > strong { color: #176c67; }
.endpoint-card:not(.generated-endpoint) { border-color: #a9c2dc; background: var(--blue-soft); }

.grounding-step:nth-child(1) { border-color: #a9c2dc; background: var(--blue-soft); }
.grounding-step:nth-child(2) { border-color: #c9bce0; background: var(--diagram-purple-soft); }
.grounding-step:nth-child(3), .grounding-step.emphasis-step { border-color: #9ccbc2; background: var(--accent-soft); }
.grounding-step:nth-child(1) .step-number { background: var(--blue); }
.grounding-step:nth-child(2) .step-number { background: var(--diagram-purple); }
.grounding-step:nth-child(3) .step-number { background: var(--accent); }
.trit-row span { border-color: #b7cce1; color: var(--blue-dark); background: var(--blue-soft); }
.proposal-row span { border-color: #d0c2e3; color: #513b79; background: var(--diagram-purple-soft); }
.proposal-row span.changed { border-bottom-color: var(--orange); background: var(--orange-soft); }
.equation { border-color: #c8d6e6; background: #f8fbfe; }
.distance-key .far { background: var(--orange); }
.neighbor-row .anchor-choice { border-color: #a9c2dc; background: var(--blue-soft); }
.neighbor-row .accepted-choice { border-color: #82bea9; color: #21694f; background: var(--green-soft); }
.neighbor-row .rejected-choice { border-color: #ddaeb3; color: #7b343b; background: var(--red-soft); }

.case-navigation button { background: var(--blue-dark); }
.case-navigation button:hover { background: var(--blue); }
.audio-cell.reference { border-color: #b8cde1; background: var(--blue-soft); }
.audio-cell.wrong { border-color: #ddaeb3; background: var(--red-soft); }
.audio-cell.wrong > strong, .transcript-panel .wrong-line dt { color: #913f47; }
.audio-cell.ours { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: var(--green-soft); }
.audio-cell.ours > strong, .transcript-panel .ours-line dt { color: #256b50; background: var(--green-soft); }
.pending { border-left-color: var(--orange); background: var(--orange-soft); }
.result-jump a { border-color: #b9cbe0; color: var(--blue-dark); background: var(--blue-soft); }
.result-jump a:hover { border-color: var(--blue); color: white; background: var(--blue); }

.metric-guide { border-color: #c8d7e8; background: linear-gradient(180deg, #f7fafe, #fff); }
.study-badge { border-color: #9fbcdc; color: var(--blue-dark); background: var(--blue-soft); }
.switch-metric { border-color: var(--line); border-top-color: var(--blue); background: white; }
.switch-metric.acoustic-metric { border-top-color: var(--accent); }
.metric-direction { border-color: #9ccbb9; color: #27664f; background: var(--green-soft); }
.metric-formula { border-color: #c8d7e8; background: var(--blue-soft); }
.split-label { color: var(--blue-dark); background: var(--blue-soft); }
th { color: var(--blue-dark); background: var(--blue-soft); }
.key-row { background: var(--green-soft) !important; }
.key-row td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.result-reading { border-left-color: var(--blue); color: var(--text); background: var(--blue-soft); }

/* Natural Noisy TEST LLM-WER listening audit. Keep diagnostic categories
   distinct without implying that every high-WER example is a waveform failure. */
.failure-section-heading { max-width: 900px; margin-bottom: 1rem; }
.failure-section-heading h2 { margin: .3rem 0 .45rem; }
.failure-section-heading > p:last-child { margin: 0; color: var(--muted); }
.failure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; align-items: start; }
.failure-card {
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 4px;
  background: var(--paper);
}
.failure-card.measurement-card { border-top-color: var(--blue); }
.failure-card.repair-card { border-top-color: var(--green); }
.failure-card.regression-card { border-top-color: var(--red); }
.failure-card h3 { margin: .45rem 0 .35rem; font-size: 1.02rem; }
.failure-card > p { margin: 0; color: #526071; font-size: .77rem; line-height: 1.58; }
.failure-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .35rem; }
.failure-label span { color: #8c3f47; font-size: .61rem; font-weight: 780; letter-spacing: .08em; text-transform: uppercase; }
.failure-label strong { padding: .12rem .42rem; border-radius: 999px; color: #7b343b; background: var(--red-soft); font-size: .62rem; }
.measurement-card .failure-label span,
.measurement-card .failure-label strong { color: var(--blue-dark); }
.measurement-card .failure-label strong { background: var(--blue-soft); }
.repair-card .failure-label span,
.repair-card .failure-label strong { color: #256b50; }
.repair-card .failure-label strong { background: var(--green-soft); }
.failure-metrics { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0 .2rem; }
.failure-metrics span { padding: .2rem .42rem; border: 1px solid var(--line); border-radius: 4px; color: #4f5c6d; background: #fafafa; font-size: .63rem; }
.failure-metrics .metric-focus { border-color: #a9c2dc; color: var(--blue-dark); background: var(--blue-soft); }
.failure-metrics .metric-good { border-color: #9ccbc2; color: #256b50; background: var(--green-soft); }
.failure-metrics .metric-warn { border-color: #ddaeb3; color: #7b343b; background: var(--red-soft); }
.audio-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.failure-inputs { max-width: none; margin: .65rem 0 0; }
.failure-inputs .audio-grid { margin-top: .55rem; }
.audio-grid.five.failure-audio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .65rem; }
.audio-cell.evidence { border-color: #9ccbc2; background: var(--accent-soft); }
.audio-cell.evidence > strong { color: #256b50; }
.audio-cell.failure-output { border-color: #ddaeb3; border-style: dashed; background: var(--red-soft); }
.audio-cell.failure-output > strong { color: #913f47; }
.failure-transcripts { margin-top: .65rem; }
.failure-card .transcript-panel { margin-top: .45rem; padding: .65rem .7rem; }
.failure-card .transcript-panel dl > div { grid-template-columns: 100px minmax(0, 1fr); }
.failure-protocol { margin-top: .85rem; padding: .7rem .85rem; border-left: 3px solid var(--red); color: #536173; background: #faf7f7; font-size: .72rem; line-height: 1.58; }
.failure-protocol.audit-key { margin-top: 0; border-left-color: var(--blue); background: var(--blue-soft); }
.failure-protocol code { font-size: .68rem; }

@media (max-width: 920px) {
  .failure-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .audio-grid.five, .audio-grid.four, .audio-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .problem-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .problem-panel { min-height: 350px; }
  .solution-problem { grid-column: 1 / -1; min-height: 0; }
  .method-diagram { grid-template-columns: 1fr; }
  .method-panel { padding: .65rem .55rem; }
  .method-panel + .method-panel { border-top: 1px solid var(--line); border-left: 0; }
  .method-panel h3 { min-height: 0; }
  .endpoint-method { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .endpoint-method h3, .endpoint-method .ablation-note { grid-column: 1 / -1; }
  .endpoint-divider { display: none; }
}

@media (max-width: 760px) {
  .content-wrapper { width: min(100% - 24px, 1180px); }
  .paper-header { padding-top: 2.7rem; }
  .paper-header hr { width: 90%; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.55rem; }
  .grounding-steps, .two-column { grid-template-columns: 1fr; }
  .academic-diagram { --diagram-width: 100%; margin: 0; padding: .55rem; }
  .diagram-heading { display: grid; gap: .15rem; }
  .problem-panel { min-height: 360px; }
  .problem-panel.solution-problem { grid-template-columns: 1fr; min-height: 0; }
  .solution-problem h3 { grid-column: auto; }
  .solution-flow { grid-template-columns: 1fr; }
  .solution-flow > b { transform: rotate(0deg); }
  .design-rule { border-top: 1px solid var(--line); border-left: 0; }
  .switch-metric-grid { grid-template-columns: 1fr; }
  .supporting-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grounding-step p { min-height: 0; }
  .result-group { margin-bottom: 1.6rem; }
  .spectrogram { width: min(100%, 520px); }
  footer { flex-direction: column; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .audio-grid.five.failure-audio-grid { grid-template-columns: 1fr; }
  .problem-grid { grid-template-columns: 1fr; }
  .problem-panel { min-height: 0; }
  .repair-flow { grid-template-columns: 1fr; gap: .35rem; }
  .flow-across { display: block; height: 1rem; transform: rotate(90deg); text-align: center; }
  .selected-evidence { grid-template-columns: minmax(0, 1fr) minmax(72px, 1fr) auto; width: 100%; margin-top: .7rem; }
  .conditioning-path { grid-template-columns: minmax(45px, .72fr) auto minmax(64px, 1fr) auto minmax(66px, 1fr); }
  .endpoint-method { grid-template-columns: 1fr; }
  .endpoint-method h3, .endpoint-method .ablation-note { grid-column: auto; }
  .audio-grid.five, .audio-grid.four, .audio-grid.three, .audio-grid.two { grid-template-columns: 1fr; }
  .transcript-panel dl > div { grid-template-columns: 1fr; gap: .1rem; }
  .supporting-metrics { grid-template-columns: 1fr; }
  .formula-stack { overflow-x: visible; white-space: normal; }
  .formula-stack > span { overflow-wrap: anywhere; }
  .rate-formula { align-items: stretch; flex-direction: column; gap: .18rem; text-align: center; }
  .rate-formula .rate-divider { display: none; }
  .status { align-items: flex-start; }
  .status span { margin-top: .55rem; flex: 0 0 auto; }
  .paper-links a { padding: .42rem .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Minimal editorial refresh: a quiet single-column paper page with wider
   breakouts only where the technical diagrams need them. */
:root {
  --ink: #151515;
  --text: #303030;
  --muted: #6b6b6b;
  --accent: #2a6fba;
  --accent-soft: #f3f7fc;
  --blue: #2a6fba;
  --blue-dark: #1f5794;
  --blue-soft: #f3f7fc;
  --green: #4e8068;
  --green-soft: #f5f8f6;
  --orange: #9a6b35;
  --orange-soft: #faf7f2;
  --red: #986060;
  --red-soft: #faf5f5;
  --diagram-navy: #365f8d;
  --diagram-purple: #75668d;
  --diagram-purple-soft: #f7f5f9;
  --line: #e5e5e5;
  --line-dark: #c8c8c8;
  --paper: #ffffff;
  --page: #ffffff;
}

body {
  border-top: 4px solid #353535;
  color: var(--text);
  background: #fff;
  font: 16px/1.58 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }
a:hover { color: var(--blue-dark); }
.content-wrapper { width: min(860px, calc(100% - 48px)); }

.paper-header {
  padding: 3.1rem 0 2rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.venue {
  margin-bottom: .75rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .055em;
}
h1 {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.2rem, 5vw, 2.72rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.tagline {
  max-width: 740px;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: .97rem;
  font-style: normal;
}
.paper-links {
  justify-content: flex-start;
  gap: 0;
  margin-top: 1.1rem;
  color: var(--ink);
  font-size: .95rem;
}
.paper-links::before {
  margin-right: .45rem;
  color: var(--ink);
  font-weight: 650;
  content: "Links:";
}
.paper-links a {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  background: transparent;
  font-size: inherit;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.paper-links a + a::before {
  display: inline-block;
  margin: 0 .48rem;
  color: #a0a0a0;
  content: "·";
}
.paper-links a:hover {
  color: var(--blue-dark);
  background: transparent;
  text-decoration: underline;
}
.paper-header hr { display: none; }
.status {
  justify-content: flex-start;
  margin-top: 1rem;
  color: #787878;
  font-size: .74rem;
}
.status span { width: 6px; height: 6px; }

section {
  padding: 2.2rem 0 1.7rem;
  border-bottom: 1px solid #efefef;
}
h2, h3, h4 { color: var(--ink); }
h2 {
  margin: 0 0 .85rem;
  font-size: 1.75rem;
  font-weight: 520;
  line-height: 1.2;
  letter-spacing: -.025em;
}
h3 {
  margin: 1.75rem 0 .55rem;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.3;
}
h4 { font-weight: 600; }
p { margin: .6rem 0 1rem; }

.explanation-box,
.result-reading,
.failure-protocol,
.pending {
  padding: .78rem .95rem;
  border: 0;
  border-left: 2px solid #b8b8b8;
  border-radius: 0;
  color: #444;
  background: #fafafa;
}

/* Keep the editorial page shell minimal, but retain the original visual
   hierarchy of the paper figures. These scoped variables restore the
   pre-refresh blue/purple/teal diagram language without recolouring the
   surrounding prose, audio examples, or results tables. */
.figure-sequence,
#method > .figure-card {
  --ink: #17243a;
  --text: #28364a;
  --muted: #667386;
  --accent: #16837e;
  --accent-soft: #edf8f6;
  --blue: #376da3;
  --blue-dark: #244e79;
  --blue-soft: #eef4fb;
  --green: #2f8968;
  --green-soft: #eef8f3;
  --orange: #c77a31;
  --orange-soft: #fff5e9;
  --red: #b6535b;
  --red-soft: #fdf0f1;
  --diagram-navy: #2f5f90;
  --diagram-teal: #16837e;
  --diagram-teal-soft: #edf8f6;
  --diagram-orange: #c77a31;
  --diagram-orange-soft: #fff5e9;
  --diagram-purple: #755aa5;
  --diagram-purple-soft: #f4effa;
  --line: #d8e0eb;
  --line-dark: #a8b6c9;
  --paper: #ffffff;
}

.case-navigation {
  justify-content: flex-start;
  margin: 1rem 0 .5rem;
}
.case-navigation button {
  width: 34px;
  height: 32px;
  border: 1px solid #bdbdbd;
  border-radius: 50%;
  color: #333;
  background: #fff;
}
.case-navigation button:hover { color: #fff; background: var(--accent); }
#case-count { color: var(--muted); font-weight: 500; }
.audio-case {
  padding: 1rem 0 1.15rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}
.audio-case h3,
.audio-case > p {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}
.input-details,
.input-details.wide-inputs {
  max-width: 680px;
  margin: .7rem 0;
  border-color: var(--line);
  border-radius: 0;
  background: #fafafa;
}
summary { color: var(--accent); font-weight: 550; }
.audio-grid { gap: .5rem; }
.audio-cell,
.audio-cell.reference,
.audio-cell.wrong,
.audio-cell.ours,
.audio-cell.evidence,
.audio-cell.failure-output {
  border-color: #dfdfdf;
  border-radius: 2px;
  background: #fff;
  box-shadow: none;
}
.audio-cell.ours,
.audio-cell.evidence { border-color: #9fb5cc; background: #f8fafc; }
.audio-cell.wrong,
.audio-cell.failure-output { border-color: #cfb7b7; }
.audio-cell.ours > strong,
.audio-cell.evidence > strong,
.audio-cell.wrong > strong,
.audio-cell.failure-output > strong { color: #333; background: transparent; }
.audio-grid,
.audio-grid.two,
.audio-grid.three,
.audio-grid.four,
.audio-grid.five,
.audio-grid.five.failure-audio-grid {
  display: block;
  border-top: 1px solid var(--line);
}
.audio-cell,
.audio-cell.reference,
.audio-cell.wrong,
.audio-cell.ours,
.audio-cell.evidence,
.audio-cell.failure-output {
  display: grid;
  grid-template-columns: minmax(165px, 210px) minmax(260px, 1fr);
  grid-template-rows: auto auto;
  column-gap: 1rem;
  align-items: center;
  padding: .58rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
}
.audio-cell.ours,
.audio-cell.evidence { box-shadow: inset 2px 0 0 #9fb5cc; }
.audio-cell.wrong,
.audio-cell.failure-output { box-shadow: inset 2px 0 0 #cfb7b7; }
.audio-cell > strong {
  grid-column: 1;
  grid-row: 1;
  padding: 0 .75rem 0 .65rem;
}
.audio-cell > small {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  padding: 0 .75rem 0 .65rem;
}
.audio-cell audio {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 100%;
  height: 32px;
  margin: 0;
}
.transcript-panel {
  max-width: none;
  border-color: var(--line);
  border-radius: 0;
  background: #fafafa;
}
.spectrogram-frame {
  border-color: var(--line);
  border-radius: 2px;
  box-shadow: none;
}

.failure-section-heading { max-width: none; }
.failure-grid { grid-template-columns: 1fr; gap: 0; }
.failure-card,
.failure-card.measurement-card,
.failure-card.repair-card,
.failure-card.regression-card {
  padding: 1.05rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}
.failure-label span { color: var(--muted) !important; }
.failure-label strong,
.failure-metrics span,
.failure-metrics .metric-focus,
.failure-metrics .metric-good,
.failure-metrics .metric-warn,
.wer-tag {
  border-color: #dedede;
  border-radius: 2px;
  color: #555 !important;
  background: #f6f6f6 !important;
}

.metric-guide {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.study-badge,
.split-label {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: .62rem;
}
.switch-metric-grid { gap: .65rem; }
.switch-metric,
.switch-metric.acoustic-metric {
  padding: .82rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}
.metric-direction { color: #555; border-color: #d8d8d8; background: #fafafa; }
.metric-formula { border-color: var(--line); border-radius: 2px; background: #fafafa; }
.supporting-metrics { gap: .45rem; }
.supporting-metrics > div {
  border-color: var(--line);
  border-radius: 2px;
}
.result-jump { gap: .75rem; }
.result-jump a {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 500;
}
.result-jump a:hover { color: var(--blue-dark); background: transparent; text-decoration: underline; }
.table-scroll {
  border: 0;
  border-top: 1px solid #cfcfcf;
  border-bottom: 1px solid #cfcfcf;
  border-radius: 0;
  box-shadow: none;
}
th { color: #333; background: #fafafa; }
tbody tr:nth-child(even) { background: #fcfcfc; }
.key-row { background: #f7f9fb !important; }
.key-row td:first-child { box-shadow: inset 2px 0 0 #8ca9c7; }
.additional-results {
  border-color: var(--line);
  border-radius: 2px;
}

footer {
  margin-top: 0;
  padding: 1.4rem 0 2.5rem;
  color: #777;
  font-size: .72rem;
}

/* Paper figures, manuscript results and a compact ASR listening audit. */
[hidden] { display: none !important; }
.paper-framework-figure { width: 100%; max-width: none; padding: .8rem 0; border: 0; }
.paper-framework-figure img, .paper-snr-figure img { display: block; width: 100%; height: auto; }
.paper-snr-figure { max-width: 760px; padding: 1rem 0; border: 0; }
.paper-highlights { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: 1.35rem 0 1.7rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.paper-highlights > div { padding: 1rem .9rem; border-right: 1px solid var(--line); }
.paper-highlights > div:first-child { padding-left: 0; }
.paper-highlights > div:last-child { border-right: 0; }
.paper-highlights span, .paper-highlights small { display: block; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.paper-highlights strong { display: block; margin: .35rem 0; color: var(--ink); font-size: 1.55rem; font-weight: 600; letter-spacing: -.035em; }
.result-switch { display: flex; gap: .5rem; margin: .85rem 0; }
.result-switch button { padding: .65rem .9rem; color: var(--text); border: 1px solid var(--line); border-radius: 4px; background: white; font: inherit; font-size: .9rem; cursor: pointer; }
.result-switch button span { margin-left: .4rem; font-size: .73rem; opacity: .8; }
.result-switch button[aria-pressed="true"] { color: white; border-color: var(--ink); background: var(--ink); }
.result-switch button:focus-visible, .table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.case-navigation button:disabled { opacity: .3; cursor: default; }
.audio-condition-switch { margin-top: 1.25rem; }
.paper-table-note { color: var(--muted); font-size: .78rem; line-height: 1.6; }
.paper-result-table { min-width: 790px; }
.paper-result-table th, .paper-result-table td { padding: .72rem .5rem; font-size: .78rem; }
.paper-result-table thead th { font-size: .72rem; }
.paper-result-table small { display: block; font-weight: 400; }
.paper-result-table th[scope="row"], .paper-ablation-table th[scope="row"], .paper-recovery-table th[scope="row"] { background: transparent; font-weight: 500; }
.paper-result-table strong { color: var(--ink); font-weight: 750; }
.paper-result-table caption, .paper-ablation-table caption, .paper-recovery-table caption { padding: .7rem 0; color: var(--muted); font-size: .76rem; text-align: left; }
.paper-details { padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.paper-details > summary { color: var(--ink); cursor: pointer; font-weight: 600; }
.paper-details > summary span { margin-left: .5rem; color: var(--muted); font-size: .78rem; font-weight: 400; }
.paper-details > p { font-size: .85rem; }
.paper-details .table-scroll + .table-scroll { margin-top: 1.25rem; }
.paper-ablation-table { min-width: 580px; }
.paper-recovery-table { min-width: 670px; }
.whisper-example { padding: 1.1rem 0 .25rem; border-top: 1px solid var(--line); }
.whisper-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.whisper-heading h3 { margin: 0; }
.whisper-heading > span { flex-shrink: 0; padding: .18rem .5rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: .72rem; }
.wer-breakdown { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: 1rem .8rem; background: #f8f8f8; border: 1px solid var(--line); border-radius: 3px; text-align: center; }
.wer-breakdown span { font-size: .7rem; color: var(--muted); }
.wer-breakdown b { display: block; color: var(--ink); font-size: 1.3rem; font-weight: 600; }
.wer-breakdown .insertions b { color: #9b453c; }
.wer-breakdown i { color: var(--muted); font-style: normal; }
.wer-fraction { flex: 1; max-width: 520px; }
.wer-numerator { display: flex; align-items: center; justify-content: space-around; gap: .6rem; padding: 0 .4rem .65rem; border-bottom: 1px solid var(--line-dark); }
.wer-denominator { padding-top: .45rem; color: var(--text); font-size: .8rem; }
.whisper-reading { padding-left: 1.2rem; font-size: .85rem; }
.whisper-reading li { margin: .45rem 0; }
.runaway-transcript { max-height: 10rem; overflow-y: auto; }
@media (max-width: 600px) {
  .paper-highlights { grid-template-columns: 1fr; }
  .paper-highlights > div { padding: .85rem 0; border: 0; border-bottom: 1px solid var(--line); }
  .paper-highlights > div:last-child { border-bottom: 0; }
  .paper-highlights strong { font-size: 1.4rem; }
  .result-switch button { flex: 1; padding: .6rem; }
  .result-switch button span { display: block; margin: .2rem 0 0; }
  .whisper-heading { align-items: flex-start; flex-direction: column; gap: .6rem; }
  .wer-breakdown { flex-wrap: wrap; justify-content: center; gap: .7rem; }
  .wer-breakdown b { font-size: 1.1rem; }
}

@media (max-width: 760px) {
  .content-wrapper { width: min(100% - 28px, 860px); }
  .paper-header { padding: 2.35rem 0 1.6rem; }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  section { padding: 1.8rem 0 1.35rem; }
  .paper-links { line-height: 1.9; }
  .case-navigation { justify-content: center; }
  .audio-cell,
  .audio-cell.reference,
  .audio-cell.wrong,
  .audio-cell.ours,
  .audio-cell.evidence,
  .audio-cell.failure-output {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    row-gap: .28rem;
    padding: .62rem 0;
  }
  .audio-cell > strong,
  .audio-cell > small {
    grid-column: 1;
    padding: 0 .65rem;
  }
  .audio-cell audio {
    grid-column: 1;
    grid-row: 3;
    width: calc(100% - 1.3rem);
    margin: .15rem .65rem 0;
  }
}
