:root {
  --bg:#f6f7f9;
  --paper:#fff;
  --ink:#17233a;
  --muted:#58657a;
  --blue:#245ce5;
  --blue-soft:#ecf2ff;
  --line:#dce2ea;
  --green:#17644d;
  --green-soft:#edf7f1;
  --amber:#87501a;
  --amber-soft:#fff5e7;
  --mono:ui-monospace,SFMono-Regular,Consolas,monospace;
  --sans:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  scroll-behavior:smooth;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--sans);
  font-size:16px;
  line-height:1.6;
}

button,input,select,textarea {
  font:inherit;
}

button,a,input,select,summary,textarea {
  -webkit-tap-highlight-color:transparent;
}

button,select,summary,input[type=range],input[type=checkbox] {
  cursor:pointer;
}

a {
  color:var(--blue);
  text-underline-offset:4px;
}

button,a,summary {
  transition:color .16s,background .16s,box-shadow .16s;
}

button:hover {
  background:var(--blue-soft);
}

a:hover {
  color:#173f9e;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {
  outline:3px solid var(--blue);
  outline-offset:3px;
}

[hidden] {
  display:none!important;
}

.sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.skip {
  position:fixed;
  top:-70px;
  left:20px;
  z-index:20;
  background:white;
  padding:12px;
}

.skip:focus {
  top:12px;
}

.site-header {
  max-width:1480px;
  margin:auto;
  min-height:96px;
  padding:20px 48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  border-bottom:1px solid var(--line);
}

.brand {
  display:flex;
  align-items:center;
  gap:13px;
  color:var(--ink);
  text-decoration:none;
  font-size:12px;
  letter-spacing:.08em;
}

.brand b {
  font-weight:500;
  color:var(--muted);
}

.brand-mark {
  height:36px;
  width:37px;
  border-radius:8px;
  background:var(--ink);
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
  letter-spacing:-2px;
  font-weight:650;
}

.brand-mark span {
  font-size:19px;
  align-self:flex-start;
  line-height:1.4;
  margin-left:1px;
  letter-spacing:-2px;
}

.site-header nav {
  display:flex;
  gap:30px;
}

.site-header nav a {
  color:var(--muted);
  text-decoration:none;
  font-size:13px;
}

.site-header nav a:hover {
  color:var(--blue);
}

.local-badge {
  display:flex;
  gap:8px;
  align-items:center;
  font-size:12px;
  color:var(--muted);
}

.local-badge i {
  width:6px;
  height:6px;
  background:var(--green);
  border-radius:50%;
}

main {
  max-width:1384px;
  padding:0 24px;
  margin:auto;
}

.intro {
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:56px;
  align-items:center;
  padding:70px 20px 66px;
}

.eyebrow {
  font:10px/1.5 var(--mono);
  letter-spacing:.13em;
  font-weight:550;
  color:var(--muted);
  margin:0 0 15px;
}

h1,h2,h3,p {
  margin-top:0;
}

h1 {
  font-weight:550;
  letter-spacing:-2.8px;
  font-size:clamp(38px,4.7vw,64px);
  line-height:1.09;
  margin-bottom:24px;
}

h1 span {
  color:var(--blue);
}

.lede {
  color:var(--muted);
  max-width:540px;
  font-size:16px;
  line-height:1.75;
  margin-bottom:22px;
}

.intro-link {
  font-size:13px;
  font-weight:550;
  text-decoration:none;
}

.intro-link span {
  margin-left:15px;
}

.hero-figure {
  height:290px;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  background-image:radial-gradient(#cfd8e5 .75px,transparent .75px);
  background-size:16px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  transform:rotate(-1deg);
}

.figure-label {
  position:absolute;
  top:20px;
  left:22px;
  font:9px var(--mono);
  letter-spacing:.12em;
  color:var(--muted);
}

.figure-caption {
  position:absolute;
  bottom:17px;
  font-size:11px;
  color:var(--muted);
  background:var(--bg);
  padding:0 10px;
}

.paper-stack {
  position:relative;
}

.paper {
  width:130px;
  min-height:165px;
  background:white;
  border:1px solid #cbd5e4;
  box-shadow:0 6px 14px #26394f08;
  padding:15px 14px;
  transform:rotate(-4deg);
  position:relative;
  border-radius:3px;
}

.paper.ghost {
  position:absolute;
  inset:1px 0 0 -9px;
  transform:rotate(-10deg);
  background:#eaf0f7;
}

.mini-label {
  font:8px var(--mono);
  letter-spacing:.1em;
  color:var(--muted);
  display:block;
  margin-bottom:16px;
}

.paper i {
  display:block;
  height:5px;
  background:#e5e9ef;
  border-radius:1px;
  margin:9px 0;
  width:100%;
}

.paper i.short {
  width:68%;
}

.paper i.blue {
  background:#8aa9fb;
}

.paper.compressed {
  width:120px;
  min-height:145px;
  transform:rotate(4deg);
  border-color:#91aff9;
}

.paper-note {
  font-size:10px;
  color:var(--blue);
  margin-top:15px;
  line-height:1.4;
}

.filter-line {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  color:var(--blue);
}

.filter-line span {
  font:9px var(--mono);
  padding:4px 7px;
  background:var(--blue-soft);
  border:1px solid #d1ddfa;
  border-radius:4px;
}

.filter-line b {
  font-size:26px;
  font-weight:400;
  line-height:1;
}

.section-top {
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:20px;
  margin-bottom:25px;
}

.section-top .eyebrow {
  margin-bottom:9px;
}

h2 {
  font-weight:550;
  letter-spacing:-1px;
  font-size:29px;
  line-height:1.25;
  margin-bottom:0;
}

.section-top>p {
  font-size:12px;
  color:var(--muted);
  margin:0;
}

.section-top>p strong {
  font-weight:500;
}

.lab-section {
  scroll-margin-top:24px;
}

.scenario-tabs {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin-bottom:22px;
}

.scenario-tabs button {
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:9px;
  min-height:80px;
  padding:16px 20px;
  display:flex;
  align-items:center;
  text-align:left;
  gap:14px;
  color:var(--ink);
}

.scenario-tabs button[aria-pressed=true] {
  border-color:var(--blue);
  box-shadow:inset 0 0 0 1px var(--blue);
  background:var(--blue-soft);
}

.tab-number {
  font:12px var(--mono);
  color:var(--muted);
}

.scenario-tabs button[aria-pressed=true] .tab-number {
  color:var(--blue);
}

.scenario-tabs button>span:nth-child(2) {
  font-size:14px;
  font-weight:600;
}

.scenario-tabs small {
  display:block;
  font-size:11px;
  color:var(--muted);
  font-weight:400;
  margin-top:2px;
}

.tab-arrow {
  margin-left:auto;
  font-size:18px;
  color:var(--muted);
}

.workspace {
  display:grid;
  grid-template-columns:255px minmax(0,1fr);
  border:1px solid var(--line);
  background:var(--paper);
  border-radius:12px;
  overflow:hidden;
}

.controls {
  padding:24px 22px;
  border-right:1px solid var(--line);
  background:#fafbfd;
}

.control-title {
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:22px;
}

.control-title h3 {
  font-size:13px;
  font-weight:650;
  margin:0;
}

.step-dot {
  height:20px;
  width:20px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:50%;
  font:10px var(--mono);
  background:white;
}

.control-title.second {
  border-top:1px solid var(--line);
  padding-top:25px;
  margin-top:22px;
}

label {
  display:block;
  font-size:11px;
  font-weight:600;
  margin:14px 0 7px;
  color:#34435b;
}

label output {
  float:right;
  color:var(--blue);
  font-family:var(--mono);
}

select,textarea,input[type=number] {
  width:100%;
  border:1px solid #cbd4e1;
  border-radius:5px;
  background:white;
  padding:10px;
  color:var(--ink);
  font-size:12px;
}

select {
  min-height:42px;
  padding-right:4px;
}

textarea {
  resize:vertical;
  line-height:1.7;
  min-height:78px;
}

input[type=range] {
  width:100%;
  margin:7px 0;
  accent-color:var(--blue);
  min-height:24px;
}

input[type=checkbox] {
  accent-color:var(--blue);
  width:15px;
  height:15px;
  margin:0;
  flex-shrink:0;
}

.check {
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:500;
  font-size:11px;
  min-height:30px;
  margin:13px 0 0;
}

.hint {
  color:var(--muted);
  font-size:11px;
  line-height:1.7;
  margin:5px 0 0;
}

.range-ends {
  display:flex;
  justify-content:space-between;
  color:var(--muted);
  font-size:9px;
}

.field-pair {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.advanced {
  border-top:1px solid var(--line);
  padding-top:16px;
  margin-top:22px;
}

.advanced summary {
  font-size:11px;
  color:var(--muted);
  min-height:32px;
}

.unit {
  float:right;
  color:var(--muted);
  font-weight:400;
}

.reset {
  border:0;
  border-top:1px solid var(--line);
  background:transparent;
  padding:20px 0 0;
  display:flex;
  justify-content:space-between;
  width:100%;
  font-size:11px;
  color:var(--muted);
  margin-top:12px;
  min-height:44px;
}

.experiment {
  padding:26px;
  min-width:0;
}

.source-meta {
  display:flex;
  align-items:start;
  justify-content:space-between;
  gap:12px;
}

.source-meta h3 {
  font-size:17px;
  font-weight:600;
  letter-spacing:-.3px;
  margin-bottom:4px;
}

.source-meta .eyebrow {
  font-size:9px;
  margin-bottom:6px;
}

.source-meta p {
  font-size:12px;
  color:var(--muted);
  max-width:610px;
  margin-bottom:0;
}

.text-button {
  color:var(--blue);
  background:transparent;
  border:0;
  white-space:nowrap;
  font-size:11px;
  min-height:38px;
  padding:7px 0;
}

.retrieved {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:12px;
}

.retrieved span {
  font:9px var(--mono);
  color:var(--muted);
  border:1px solid var(--line);
  border-radius:4px;
  padding:3px 5px;
}

.metrics {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  margin:23px 0;
}

.metrics>div {
  padding:18px 12px 17px;
  border-right:1px solid var(--line);
}

.metrics>div:first-child {
  padding-left:0;
}

.metrics>div:last-child {
  border:0;
}

.metrics span {
  font-size:10px;
  color:var(--muted);
  display:block;
  margin-bottom:5px;
}

.metrics strong {
  font-weight:550;
  font-size:29px;
  letter-spacing:-.8px;
  line-height:1.2;
  font-variant-numeric:tabular-nums;
}

.metrics small {
  font-size:10px;
  color:var(--muted);
  font-weight:400;
  letter-spacing:0;
}

.blue-text {
  color:var(--blue);
}

.lanes {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.lane {
  border:1px solid var(--line);
  border-radius:7px;
  overflow:hidden;
  min-width:0;
}

.lane-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:10px 13px;
  min-height:52px;
}

.lane-heading>div {
  display:flex;
  align-items:center;
  gap:8px;
}

.lane-heading h3 {
  font-size:12px;
  font-weight:650;
  margin:0;
}

.lane-heading>span {
  font:9px var(--mono);
  color:var(--muted);
}

.lane-dot {
  width:6px;
  height:6px;
  border-radius:50%;
  flex-shrink:0;
}

.lane-dot.original {
  background:#718097;
}

.lane-dot.kept {
  background:var(--blue);
}

.lane-subheading {
  background:#f8fafc;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  font-size:9px;
  color:var(--muted);
  padding:7px 13px;
}

.document {
  height:390px;
  overflow:auto;
  padding:19px 16px;
  font:12px/1.9 var(--mono);
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  scrollbar-width:thin;
  scrollbar-color:#c2cddd transparent;
}

.source-span {
  border-radius:2px;
}

.source-span.selected {
  background:#eaf0fc;
  color:#243f71;
}

.source-span.unselected {
  color:#677284;
}

.kept-span {
  background:#ecf3ff;
  color:#254a98;
  border-radius:2px;
}

.cut {
  white-space:normal;
  margin:12px 0;
  border:1px dashed #cbd4e1;
  background:#fafbfd;
  border-radius:4px;
  color:var(--muted);
}

.cut summary {
  font:10px/1.5 var(--mono);
  padding:10px;
  list-style:none;
  display:flex;
  justify-content:space-between;
  gap:8px;
  min-height:36px;
}

.cut summary::-webkit-details-marker {
  display:none;
}

.cut[open] summary {
  border-bottom:1px dashed #cbd4e1;
}

.cut[open] summary span {
  transform:rotate(45deg);
}

.dropped-text {
  white-space:pre-wrap;
  padding:10px;
  color:#6c5363;
  font:11px/1.8 var(--mono);
  background:#fcf9fa;
}

.legend {
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  font-size:9px;
  color:var(--muted);
  padding-top:12px;
}

.legend span {
  display:flex;
  align-items:center;
  gap:5px;
}

.legend span:last-child {
  margin-left:auto;
  font-family:var(--mono);
}

.legend i {
  width:9px;
  height:9px;
  border-radius:1px;
}

.kept-key {
  background:#c2d4ff;
}

.dropped-key {
  border:1px dashed #8796ae;
  background:#fafbfd;
}

.decision {
  font-size:11px;
  color:var(--muted);
  line-height:1.8;
  margin:17px 0 24px;
}

.decision>span:first-child {
  color:var(--blue);
  margin-right:4px;
}

.decision .hint {
  display:block;
  margin:3px 0 0 15px;
  font-size:10px;
}

.evidence-panel {
  background:#fafbfd;
  border:1px solid var(--line);
  border-radius:7px;
  padding:20px;
}

.evidence-heading {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}

.evidence-heading .eyebrow {
  font-size:9px;
  margin-bottom:6px;
}

.evidence-heading h3 {
  font-size:15px;
  font-weight:600;
  letter-spacing:-.2px;
  margin:0;
}

.evidence-score {
  font:10px var(--mono);
  padding:6px 9px;
  border-radius:5px;
  background:#eef0f4;
  white-space:nowrap;
}

.evidence-score.pass {
  background:var(--green-soft);
  color:var(--green);
}

.evidence-score.warn {
  background:var(--amber-soft);
  color:var(--amber);
}

#evidence-description {
  margin:8px 0 17px;
}

.fact {
  display:flex;
  align-items:start;
  gap:10px;
  padding:13px 0;
  border-top:1px solid var(--line);
}

.fact-icon {
  display:grid;
  place-items:center;
  width:18px;
  height:18px;
  font-size:11px;
  border-radius:50%;
  flex-shrink:0;
  margin-top:1px;
}

.fact.pass .fact-icon {
  color:var(--green);
  background:#dfefe6;
}

.fact.warn .fact-icon {
  color:var(--amber);
  background:#faead3;
}

.fact strong {
  font-size:11px;
  font-weight:600;
}

.fact blockquote {
  margin:4px 0 0;
  font-size:11px;
  line-height:1.7;
  color:var(--muted);
}

.fact-status {
  margin-left:auto;
  font:9px/1.6 var(--mono);
  white-space:nowrap;
  padding-top:3px;
}

.fact.pass .fact-status {
  color:var(--green);
}

.fact.warn .fact-status {
  color:var(--amber);
}

.lesson {
  font-size:11px;
  margin:10px 0 0;
  padding:12px 14px;
  background:var(--blue-soft);
  color:#254a98;
  border-left:2px solid #8daafa;
  border-radius:0 3px 3px 0;
}

.ranking,.custom {
  border-top:1px solid var(--line);
  margin-top:20px;
  padding-top:12px;
}

.ranking>summary,.custom>summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:12px;
  font-weight:550;
  min-height:44px;
  gap:10px;
  list-style:none;
}

.ranking>summary>span,.custom>summary>span {
  font-size:10px;
  color:var(--muted);
  font-weight:400;
}

.ranking[open]>summary,.custom[open]>summary {
  color:var(--blue);
}

table {
  border-collapse:collapse;
  width:100%;
  font-size:11px;
  margin-top:15px;
  text-align:left;
}

th,td {
  border-bottom:1px solid var(--line);
  vertical-align:top;
  padding:12px 8px;
}

thead th {
  font:9px var(--mono);
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.03em;
}

td small {
  display:block;
  color:var(--muted);
  font-size:10px;
  margin-top:5px;
}

#ranking td:first-child {
  width:75%;
  overflow-wrap:anywhere;
}

#ranking td:last-child {
  white-space:nowrap;
}

#ranking {
  max-height:500px;
  overflow:auto;
}

.custom textarea {
  font-family:var(--mono);
  font-size:12px;
}

.custom-actions {
  display:flex;
  gap:10px;
  margin:10px 0;
}

.custom-actions button,.try-buttons button {
  border:1px solid var(--line);
  border-radius:5px;
  background:white;
  color:var(--ink);
  min-height:44px;
  padding:9px 14px;
  font-size:12px;
}

.custom-actions .primary {
  background:var(--blue);
  color:white;
  border-color:var(--blue);
}

.custom-actions .primary:hover {
  background:#1748be;
}

.empty {
  font:11px/1.8 var(--sans);
  white-space:normal;
  color:var(--muted);
  padding:15px;
  border:1px dashed var(--line);
  border-radius:5px;
}

.error {
  padding:14px;
  border:1px solid #b74b4b;
  background:#fff0f0;
  color:#8c2525;
  font-size:13px;
  margin-top:14px;
}

.mechanism {
  padding:75px 20px 65px;
  scroll-margin-top:25px;
}

.mechanism-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:35px;
  border-top:1px solid var(--line);
  padding-top:25px;
}

.large-number {
  font:12px var(--mono);
  color:var(--blue);
  display:block;
  margin-bottom:25px;
}

.mechanism-grid h3 {
  font-size:17px;
  font-weight:550;
  letter-spacing:-.3px;
  margin-bottom:10px;
}

.mechanism-grid p {
  color:var(--muted);
  font-size:13px;
  line-height:1.8;
  margin-bottom:22px;
}

.mechanism-grid code {
  font:10px var(--mono);
  color:#3c587e;
  padding:7px 10px;
  background:#eaf0f7;
  border-radius:4px;
  display:inline-block;
}

.comparison-note {
  display:flex;
  gap:18px;
  background:#edf1f8;
  border-radius:7px;
  padding:25px;
  margin-top:35px;
}

.note-symbol {
  font-size:25px;
  line-height:1;
  color:var(--blue);
}

.comparison-note h3 {
  font-size:14px;
  margin:0 0 7px;
  font-weight:600;
}

.comparison-note p {
  font-size:12px;
  line-height:1.8;
  color:var(--muted);
  margin-bottom:9px;
}

.comparison-note a {
  font-size:11px;
  text-decoration:none;
}

.limits {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:70px;
  border-top:1px solid var(--line);
  padding:55px 20px 65px;
  scroll-margin-top:25px;
}

.limits h2 {
  font-size:29px;
  line-height:1.3;
  margin-bottom:20px;
}

.limits>div>p:not(.eyebrow) {
  font-size:13px;
  color:var(--muted);
  line-height:1.8;
  max-width:480px;
}

.try-buttons {
  display:flex;
  gap:12px;
  margin-top:26px;
  flex-wrap:wrap;
}

.try-buttons button {
  background:transparent;
  border-color:#b9c7dc;
  color:var(--blue);
}

.tradeoff-notes {
  display:grid;
  gap:20px;
}

.tradeoff-notes h3 {
  font-size:13px;
  font-weight:600;
  margin:0 0 5px;
}

.tradeoff-notes p {
  font-size:12px;
  color:var(--muted);
  margin:0;
  line-height:1.8;
}

.sweep-section {
  padding:25px;
  background:white;
  border:1px solid var(--line);
  border-radius:8px;
  margin:0 20px 50px;
  scroll-margin-top:24px;
}

.sweep-section h2 {
  font-size:24px;
  margin-bottom:10px;
}

.sweep-section>p {
  font-size:12px;
  color:var(--muted);
}

.budget-bar {
  width:130px;
  height:5px;
  background:#e9edf5;
  border-radius:2px;
  margin:4px 0 7px;
}

.budget-bar span {
  height:100%;
  display:block;
  background:var(--blue);
  border-radius:2px;
}

footer {
  border-top:1px solid var(--line);
  padding:32px 20px 40px;
  display:flex;
  justify-content:space-between;
  gap:30px;
}

.footer-brand {
  font-size:14px;
  font-weight:550;
  line-height:1.8;
}

.footer-brand a {
  font-size:11px;
  text-decoration:none;
}

footer p {
  font-size:10px;
  color:var(--muted);
  line-height:1.9;
  margin:0;
  max-width:530px;
}

footer p a {
  color:var(--muted);
}

:disabled {
  opacity:.55;
  cursor:not-allowed;
}

@media(min-width:1450px) {
  .intro {
    padding-top:85px;
    padding-bottom:80px;
  }
  .hero-figure {
    height:310px;
  }
  .document {
    height:430px;
  }
}

@media(max-width:1100px) {
  .site-header {
    padding:20px 28px;
  }
  .intro {
    gap:30px;
    padding-left:0;
    padding-right:0;
  }
  .workspace {
    grid-template-columns:230px minmax(0,1fr);
  }
  .controls {
    padding:22px 16px;
  }
  .experiment {
    padding:20px;
  }
  .metrics small {
    display:block;
    margin-top:5px;
  }
  .metrics strong {
    font-size:26px;
  }
  .lane-heading {
    flex-wrap:wrap;
    gap:3px;
    padding:9px;
  }
  .lane-heading .text-button {
    min-height:24px;
    font-size:9px;
  }
  .document {
    padding:14px 12px;
    font-size:11px;
  }
  .legend span:last-child {
    margin-left:0;
  }
  .mechanism,.limits {
    padding-left:0;
    padding-right:0;
  }
  .metrics span {
    font-size:9px;
  }
}

@media(max-width:800px) {
  .local-badge {
    display:none;
  }
  .intro {
    grid-template-columns:1fr 1fr;
    gap:24px;
    padding-top:45px;
    padding-bottom:45px;
  }
  h1 {
    font-size:42px;
    letter-spacing:-1.9px;
  }
  .lede {
    font-size:14px;
  }
  .hero-figure {
    height:250px;
    gap:10px;
  }
  .paper {
    width:95px;
    padding:12px;
    min-height:145px;
  }
  .paper.compressed {
    width:85px;
  }
  .figure-label {
    font-size:8px;
    left:14px;
  }
  .figure-caption {
    font-size:9px;
  }
  .section-top>p {
    display:none;
  }
  .scenario-tabs {
    gap:8px;
  }
  .scenario-tabs button {
    padding:13px 12px;
    gap:9px;
    min-height:74px;
  }
  .tab-arrow {
    display:none;
  }
  .scenario-tabs button>span:nth-child(2) {
    font-size:12px;
  }
  .scenario-tabs small {
    font-size:10px;
  }
  .workspace {
    grid-template-columns:1fr;
  }
  .controls {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 20px;
    padding:20px;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .controls>.control-title,.controls>.reset {
    grid-column:1/-1;
  }
  .controls>label {
    grid-column:1/-1;
  }
  .controls>#question-preset,.controls>#question,.controls>#focus-group,.controls>#retrieval-group,.controls>.hint,.controls>#method,.controls>#granularity,.controls>#budget-mode,.controls>#fixed-controls,.controls>#dynamic-controls,.controls>.advanced {
    grid-column:1/-1;
  }
  .control-title.second {
    padding-top:18px;
    margin-top:18px;
    margin-bottom:4px;
  }
  .controls textarea {
    min-height:70px;
  }
  .controls>.check {
    grid-column:1/-1;
  }
  .controls>label {
    margin-top:10px;
  }
  .experiment {
    padding:20px;
  }
  .document {
    height:360px;
  }
  .mechanism-grid {
    gap:22px;
  }
  .mechanism-grid h3 {
    font-size:15px;
  }
  .mechanism-grid p {
    font-size:12px;
  }
  .limits {
    gap:32px;
  }
  .limits h2 {
    font-size:25px;
  }
  .mechanism {
    padding-top:55px;
  }
}

@media(max-width:540px) {
  main {
    padding:0 16px;
  }
  .site-header {
    padding:15px 16px;
    min-height:72px;
  }
  .brand {
    font-size:9px;
    gap:9px;
    letter-spacing:.04em;
  }
  .brand-mark {
    width:30px;
    height:30px;
    font-size:20px;
  }
  .brand-mark span {
    font-size:16px;
  }
  .site-header nav {
    gap:14px;
  }
  .site-header nav a {
    font-size:10px;
  }
  .site-header nav a:last-child {
    display:none;
  }
  .intro {
    grid-template-columns:1fr;
    padding-top:38px;
    gap:28px;
  }
  h1 {
    font-size:44px;
    letter-spacing:-2px;
  }
  .lede {
    font-size:14px;
    max-width:360px;
  }
  .hero-figure {
    height:220px;
    margin:0 6px 2px;
    gap:20px;
  }
  .paper {
    width:112px;
    min-height:142px;
  }
  .paper.compressed {
    width:100px;
  }
  .paper i {
    height:4px;
    margin:7px 0;
  }
  .paper-note {
    font-size:9px;
  }
  .figure-label {
    top:14px;
  }
  .figure-caption {
    bottom:12px;
  }
  .section-top {
    margin-bottom:20px;
  }
  h2 {
    font-size:24px;
    letter-spacing:-.7px;
  }
  .scenario-tabs {
    grid-template-columns:1fr;
    gap:7px;
    margin-bottom:16px;
  }
  .scenario-tabs button {
    min-height:56px;
    padding:9px 14px;
    gap:12px;
  }
  .scenario-tabs button>span:nth-child(2) {
    font-size:13px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex:1;
    gap:8px;
  }
  .scenario-tabs small {
    margin:0;
    font-size:10px;
  }
  .workspace {
    border-radius:8px;
  }
  .controls {
    padding:20px;
  }
  .experiment {
    padding:16px 12px;
  }
  .source-meta h3 {
    font-size:14px;
  }
  .source-meta p {
    font-size:11px;
  }
  .source-meta>.text-button {
    font-size:9px;
  }
  .metrics {
    grid-template-columns:1fr 1fr;
    margin:18px 0;
  }
  .metrics>div {
    padding:12px 10px!important;
    border-bottom:1px solid var(--line);
  }
  .metrics>div:nth-child(2) {
    border-right:0;
  }
  .metrics>div:nth-child(3),.metrics>div:nth-child(4) {
    border-bottom:0;
  }
  .metrics strong {
    font-size:27px;
  }
  .metrics small {
    display:inline;
    margin-left:3px;
    font-size:9px;
  }
  .metrics span {
    font-size:10px;
  }
  .lanes {
    grid-template-columns:1fr;
    gap:16px;
  }
  .document {
    height:280px;
    font-size:11px;
  }
  .lane-heading {
    padding:9px 12px;
  }
  .lane-heading .text-button {
    font-size:10px;
    min-height:32px;
  }
  .lane-subheading {
    font-size:9px;
  }
  .legend {
    font-size:9px;
    gap:8px 14px;
  }
  .evidence-panel {
    padding:16px 12px;
  }
  .evidence-heading {
    align-items:start;
  }
  .evidence-heading h3 {
    font-size:14px;
  }
  .evidence-score {
    font-size:9px;
    padding:5px 6px;
  }
  .evidence-heading .eyebrow {
    font-size:8px;
  }
  .fact {
    gap:7px;
    flex-wrap:wrap;
  }
  .fact>div {
    flex:1;
    min-width:160px;
  }
  .fact-status {
    font-size:8px;
  }
  .ranking>summary,.custom>summary {
    font-size:11px;
  }
  .ranking>summary>span,.custom>summary>span {
    font-size:9px;
  }
  .mechanism {
    padding-top:45px;
    padding-bottom:35px;
  }
  .mechanism-grid {
    grid-template-columns:1fr;
    gap:26px;
  }
  .large-number {
    margin-bottom:10px;
  }
  .mechanism-grid p {
    margin-bottom:12px;
    font-size:13px;
  }
  .mechanism-grid h3 {
    font-size:17px;
  }
  .comparison-note {
    padding:18px 15px;
    gap:10px;
  }
  .limits {
    grid-template-columns:1fr;
    gap:30px;
    padding-top:35px;
    padding-bottom:40px;
  }
  .tradeoff-notes {
    border-top:1px solid var(--line);
    padding-top:25px;
  }
  .try-buttons {
    gap:8px;
  }
  .try-buttons button {
    font-size:11px;
    padding:8px 10px;
  }
  .sweep-section {
    margin:0 0 30px;
    padding:16px;
    overflow:auto;
  }
  .sweep-section table {
    min-width:400px;
  }
  footer {
    padding:26px 0;
    flex-direction:column;
    gap:18px;
  }
  footer p {
    font-size:10px;
  }
  input,select,textarea {
    font-size:16px!important;
  }
}

@media(prefers-reduced-motion:reduce) {
  :root {
    scroll-behavior:auto;
  }
  *,*::before,*::after {
    transition:none!important;
    animation:none!important;
  }
}

#toggle-settings {
  display:none;
}

@media(max-width:800px) {
  #toggle-settings {
    display:flex;
    grid-column:1/-1;
    justify-content:space-between;
    align-items:center;
    background:transparent;
    color:var(--blue);
    border:0;
    padding:0;
    min-height:44px;
    font-size:13px;
    text-align:left;
  }
  .controls.collapsed>:not(#toggle-settings) {
    display:none!important;
  }
  .controls.collapsed {
    padding:6px 20px;
  }
  .controls:not(.collapsed) #toggle-settings {
    border-bottom:1px solid var(--line);
    padding-bottom:12px;
    margin-bottom:18px;
  }
}

/* Grid children may shrink below their text's intrinsic width when zoomed. */
.intro>div {
  min-width:0;
}

@media(max-width:540px) {
  h1 {
    font-size:clamp(36px,11.7vw,44px);
  }
  .hero-figure {
    gap:clamp(8px,3vw,20px);
  }
  .paper {
    width:clamp(88px,26vw,112px);
  }
  .paper.compressed {
    width:clamp(80px,24vw,100px);
  }
}

.model-controls { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.model-controls .check { align-items: flex-start; line-height: 1.6; }
.model-controls input[type=checkbox] { margin-top: 3px; }
.model-controls button { width: 100%; min-height: 44px; border: 1px solid var(--blue); background: var(--blue); color: white; border-radius: 5px; margin: 14px 0 6px; font-size: 12px; }
.model-controls button:disabled { background: #e9edf5; color: #58657a; border-color: #cbd4e1; }
@media(max-width:800px) { #method-description, #model-controls, #diversity-controls { grid-column: 1 / -1; } }

.comparison-section { margin-top: 56px; padding: 30px 24px; background: white; border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 24px; }
.comparison-section > p { font-size: 13px; color: var(--muted); }
.comparison-controls { display: flex; gap: 20px; flex-wrap: wrap; align-items: end; }
.comparison-controls > div { min-width: 210px; flex: 1; }
.run-primary, #export-comparison { min-height: 44px; padding: 10px 18px; margin: 20px 0; border: 1px solid var(--blue); background: var(--blue); color: white; border-radius: 5px; font-size: 13px; }
.run-primary:disabled { background: #e9edf5; color: var(--muted); border-color: var(--line); }
.run-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.run-lane { border: 1px solid var(--line); border-radius: 8px; padding: 20px; min-width: 0; }
.run-lane h3, .judge-result h3 { font-size: 17px; margin-bottom: 8px; }
.run-status { font: 11px/1.7 var(--mono); color: var(--muted); }
.run-answer { max-height: 260px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin: 20px 0; line-height: 1.9; }
.comparison-section details { margin: 15px 0; border-top: 1px solid var(--line); padding-top: 10px; }
.comparison-section summary { font-size: 12px; min-height: 36px; }
.comparison-section pre { font: 11px/1.8 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 400px; overflow-y: auto; background: #f5f7fa; padding: 14px; border-radius: 4px; }
.comparison-section h4 { font-size: 12px; margin-bottom: 0; }
.run-disclaimer, .judge-result { background: var(--blue-soft); padding: 16px; border-radius: 6px; margin-top: 22px; font-size: 13px; }
@media(max-width:700px) { .comparison-section { padding: 22px 14px; } .run-lanes { grid-template-columns: 1fr; } .comparison-controls { gap: 10px; } .comparison-controls > div { min-width: 0; width: 100%; flex-basis: 100%; } .site-header nav { gap: 12px; } }

.cut-explanation { padding: 14px; background: #f4f6fb; color: #38445b; font: 12px/1.7 var(--sans); white-space: normal; }
.cut-explanation p { margin: 6px 0 12px; }
.cut-explanation ul { margin: 0; padding-left: 18px; }
.cut-explanation q { font-weight: 600; }
.cut summary { white-space: normal; overflow-wrap: anywhere; }

.score-calculation { padding-left: 20px; margin: 10px 0; }
.score-calculation li { margin-bottom: 10px; overflow-wrap: anywhere; }

/* ---------- Technique tour ---------- */
.tour-section { padding: 10px 0 70px; scroll-margin-top: 24px; }
.tour-setup { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 22px; }
.tour-setup > div { background: var(--paper); padding: 16px 20px; }
.tour-setup p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.setup-label { font: 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.tour-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.tour-tabs button { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font-size: 14px; font-weight: 600; text-align: left; }
.tour-tabs button[aria-selected=true] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-soft); }
.tour-tabs button[aria-selected=true] .tab-number { color: var(--blue); }
.tour-tabs button:focus-visible, .step-rail button:focus-visible, .step-nav button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.tour-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 30px 32px; }
.chapter-head { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 24px; }
.chapter-head h3 { font-size: 26px; font-weight: 600; letter-spacing: -.6px; margin: 0; }
.chapter-idea { font-size: 17px; color: var(--muted); margin: 6px 0 0; }
.chapter-body { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.step-rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step-rail button { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; background: transparent; border: 0; border-radius: 7px; padding: 9px 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.step-rail button:hover { background: var(--bg); color: var(--ink); }
.step-rail button[aria-current=step] { background: var(--blue-soft); color: var(--ink); font-weight: 600; }
.step-num { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font: 11px var(--mono); background: var(--paper); }
.step-rail button.done .step-num { border-color: var(--blue); color: var(--blue); }
.step-rail button[aria-current=step] .step-num { background: var(--blue); border-color: var(--blue); color: white; }
.step-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 32px; min-height: 380px; animation: step-in .25s ease; }
@keyframes step-in { from { opacity: .4; } to { opacity: 1; } }
.step-count { font: 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.step-text h4 { font-size: 20px; font-weight: 600; letter-spacing: -.3px; margin: 0 0 12px; }
.step-text p { font-size: 15px; line-height: 1.65; margin: 0 0 12px; }
.step-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.step-nav button { min-height: 42px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-size: 13px; }
.step-nav button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.step-nav button:disabled { opacity: .45; cursor: default; }
.step-visual { min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 20px; align-self: start; }
.visual-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }
.formula { font: 13px/1.6 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
.calc { border-left: 3px solid var(--blue); background: var(--blue-soft); padding: 12px 14px; border-radius: 0 6px 6px 0; margin-top: 14px; }
.calc-label { font: 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--blue); }
.calc q { display: block; font-size: 13px; margin: 4px 0 8px; }
.calc p { font: 12px/1.7 var(--mono); margin: 0 !important; }

/* Document map */
.doc-map { display: flex; flex-direction: column; gap: 10px; }
.map-section { display: flex; flex-direction: column; gap: 3px; }
.map-heading { font: 10px/1.4 var(--mono); color: var(--muted); letter-spacing: .04em; margin-bottom: 1px; }
.map-row { display: flex; align-items: center; gap: 6px; height: 9px; }
.map-bar { height: 7px; border-radius: 2px; background: #e3e7ee; overflow: hidden; display: block; }
.map-bar > span { display: block; height: 100%; background: var(--blue); transition: width .3s ease; }
.doc-map.neutral .map-bar { background: #cfd7e3; }
.map-row.is-fact .map-bar { outline: 1.5px solid var(--amber); outline-offset: 1px; }
.map-fact { font: 9px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--amber); background: var(--amber-soft); border-radius: 3px; padding: 2px 4px; }

/* Words and terms */
.q-original { font-size: 15px; font-style: italic; margin: 0 0 14px; }
.q-original.muted { color: var(--muted); }
.word-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.word { font: 13px/1.3 var(--mono); padding: 5px 8px; border-radius: 5px; border: 1px solid var(--line); }
.word.kept { background: var(--blue-soft); border-color: #bfd0f7; color: var(--ink); }
.word.kept b { color: var(--blue); font-weight: 600; }
.word.dropped { color: #8a95a7; text-decoration: line-through; background: var(--paper); }
.word.flagged { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.legend-row { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.key { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--line); }
.key.kept { background: var(--blue-soft); border-color: #bfd0f7; }
.big-number { font-size: 56px; font-weight: 600; letter-spacing: -2px; margin: 10px 0; }
.big-number small { display: block; font-size: 14px; letter-spacing: 0; color: var(--muted); font-weight: 400; }

/* Tables and lists */
.weights, .rounds { width: 100%; border-collapse: collapse; font-size: 13px; }
.weights th, .weights td, .rounds th, .rounds td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.weights thead th, .rounds thead th { font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.weights tbody th { font-family: var(--mono); font-weight: 500; }
.weights td:last-child { display: flex; align-items: center; gap: 8px; font-family: var(--mono); }
.bar { flex: 1; max-width: 160px; height: 7px; background: #e3e7ee; border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); }
.rounds td small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.rounds td:nth-child(n+3) { font-family: var(--mono); white-space: nowrap; }
.rounds tr.changed td { background: var(--amber-soft); }
.score-list, .pack-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.score-list li { display: grid; grid-template-columns: 90px 40px 1fr; gap: 4px 10px; align-items: center; font-size: 12.5px; }
.score-bar { height: 8px; background: #e3e7ee; border-radius: 4px; overflow: hidden; }
.score-bar > span { display: block; height: 100%; background: var(--blue); }
.score-value { font: 12px var(--mono); }
.score-terms { grid-column: 3; font: 10.5px var(--mono); color: var(--blue); }
.pack-list { margin-top: 14px; }
.pack-list li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; font-size: 12.5px; line-height: 1.45; }
.pack-outcome { font: 11px var(--mono); color: var(--green); }
.pack-list li.over-budget { color: var(--muted); }
.pack-list li.over-budget .pack-outcome { color: var(--amber); }
.meter-track { position: relative; height: 12px; background: #e3e7ee; border-radius: 6px; overflow: hidden; }
.meter-budget { position: absolute; inset: 0 auto 0 0; background: #c9d6f4; }
.meter-used { position: absolute; inset: 0 auto 0 0; background: var(--blue); }
.meter-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.meter-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.meter-legend i.used { background: var(--blue); }
.meter-legend i.budget { background: #c9d6f4; }
.kept-text { font: 12.5px/1.65 var(--mono); white-space: pre-wrap; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin: 0 0 14px; max-height: 180px; overflow: auto; }
.cut-mark { color: var(--amber); font-weight: 700; margin-left: 2px; }
.section-states { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.section-states li { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.section-states span { font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; width: 64px; padding: 3px 0; text-align: center; border-radius: 4px; }
.section-states .kept span { background: var(--blue-soft); color: var(--blue); }
.section-states .cut span { background: var(--amber-soft); color: var(--amber); }
.section-states .dropped { color: var(--muted); }
.section-states .dropped span { background: #e9edf3; color: var(--muted); }
.formula-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formula-card > div { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.formula-card span { font: 12px var(--mono); color: var(--muted); }
.formula-card strong { display: block; font-size: 30px; font-weight: 600; }
.formula-card small { color: var(--muted); font-size: 12px; }

/* Verdicts */
.verdict { margin-top: 16px; border-radius: 8px; padding: 14px 16px; border: 1px solid var(--line); background: var(--paper); }
.verdict.good { border-color: #b9dcc8; background: var(--green-soft); }
.verdict.bad { border-color: #efd0a8; background: var(--amber-soft); }
.verdict ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.verdict li { display: flex; gap: 8px; font-size: 13.5px; }
.verdict li.kept > span:first-child { color: var(--green); font-weight: 700; }
.verdict li.lost > span:first-child { color: var(--amber); font-weight: 700; }
.verdict p { font-size: 13.5px; margin: 0; line-height: 1.5; }

/* Facts, demo, foot */
.chapter-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--line); margin-top: 28px; padding-top: 22px; }
.chapter-facts h5 { font: 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.chapter-facts p { font-size: 14px; line-height: 1.55; margin: 0; }
.demo { margin-top: 22px; border: 1px solid var(--line); border-radius: 9px; }
.demo summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 14px; font-weight: 600; }
.demo summary::-webkit-details-marker { display: none; }
.demo summary > span:first-child { font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--amber); background: var(--amber-soft); padding: 3px 7px; border-radius: 4px; font-weight: 500; }
.demo summary > span:last-child { margin-left: auto; color: var(--blue); }
.demo[open] summary > span:last-child { transform: rotate(45deg); }
.demo-body { padding: 0 18px 16px; }
.demo-body p { font-size: 14px; line-height: 1.6; }
.demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.demo-label { font-size: 13px; width: 190px; color: var(--muted); }
.chip { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); }
.chip.kept { background: var(--green-soft); color: var(--green); border-color: #b9dcc8; }
.chip.lost { background: var(--amber-soft); color: var(--amber); border-color: #efd0a8; }
.need-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.need-grid > div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px; font-size: 13px; }
.need-grid strong { display: block; font-size: 24px; font-weight: 600; margin: 2px 0; }
.need-grid small { color: var(--muted); }
.chapter-foot { margin-top: 8px; }
.chapter-foot .text-button, .demo-body .text-button { font-size: 13px; }

/* Compare all four */
.compare-controls { max-width: 460px; margin-bottom: 20px; }
.compare-controls label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.compare-controls input { width: 100%; }
.compare-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.compare-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--paper); }
.compare-card.good { border-top: 3px solid var(--green); }
.compare-card.bad { border-top: 3px solid var(--amber); }
.compare-card h4 { font-size: 15px; margin: 0 0 4px; font-weight: 600; }
.compare-tokens { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.compare-tokens strong { color: var(--ink); font-size: 18px; }
.compare-facts { list-style: none; padding: 0; margin: 14px 0 8px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.compare-facts .kept { color: var(--green); }
.compare-facts .lost { color: var(--amber); }
.compare-need { font-size: 12px; color: var(--muted); margin: 0; }

/* Beyond lexical */
.beyond-section { padding: 10px 0 70px; scroll-margin-top: 24px; }
.beyond-intro { max-width: 820px; font-size: 15px; line-height: 1.65; color: var(--muted); margin: 0 0 24px; }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.model-card { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 22px; display: flex; flex-direction: column; }
.model-family { font: 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--blue); margin: 0 0 6px; }
.model-card h3 { font-size: 19px; font-weight: 600; margin: 0 0 8px; }
.model-scores { font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.model-flow { display: flex; flex-direction: column; gap: 0; margin-bottom: 14px; }
.model-flow span { font: 11.5px/1.4 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 6px 9px; position: relative; }
.model-flow span + span { margin-top: 14px; }
.model-flow span + span::before { content: "↓"; position: absolute; top: -15px; left: 12px; font-size: 11px; color: var(--muted); }
.model-card dl { margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.model-card dt { font: 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.model-card dd { margin: 2px 0 0; font-size: 13.5px; line-height: 1.5; }
.model-status { margin: auto 0 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.model-card a { font-size: 13px; color: var(--blue); text-decoration: none; }
.compare-why { font-size: 15px !important; color: var(--ink) !important; max-width: 820px; line-height: 1.6; }

@media (max-width: 1100px) {
  .tour-tabs { grid-template-columns: repeat(3, 1fr); }
  .chapter-body { grid-template-columns: 1fr; }
  .step-rail { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .step-rail button { white-space: nowrap; }
  .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .tour-setup { grid-template-columns: 1fr; }
  .tour-tabs { grid-template-columns: 1fr 1fr; }
  .tour-panel { padding: 22px 16px; }
  .step-view { grid-template-columns: 1fr; min-height: 0; gap: 18px; }
  .step-rail button > span:last-child { display: none; }
  .chapter-facts { grid-template-columns: 1fr; gap: 16px; }
  .model-grid, .need-grid { grid-template-columns: 1fr; }
  .demo-label { width: 100%; }
}
@media (max-width: 540px) {
  .compare-grid { grid-template-columns: 1fr; }
  .tour-tabs button { min-height: 50px; padding: 10px 12px; font-size: 13px; }
  .score-list li { grid-template-columns: 60px 38px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .step-view { animation: none; }
  .map-bar > span { transition: none; }
}
@media (max-width: 540px) {
  .step-visual { padding: 14px 12px; overflow-x: auto; }
  .rounds { font-size: 12px; }
  .rounds th, .rounds td { padding: 6px 4px; }
  .rounds thead th { font-size: 9px; letter-spacing: .02em; }
  .rounds th:first-child, .rounds td:first-child { display: none; }
}

.chapter-foot .text-button, .demo-body .text-button { white-space: normal; text-align: left; }
