/* Model documentation pages: a page-scoped layer over /style.css.
   Loaded only on the seven models' pages and their paper/report tabs
   (stamped by tools/model_hero.py). Owns the hero strip (.mh), the tab-bar
   weight on these pages, and per-tab body polish. Global components stay
   in style.css; every rule here is scoped to a page that carries .mh. */

/* ================= hero strip =================
   style.css §6.3 dissolves .model-hero into <main>'s column (title bar,
   tabs, lede). The strip restores one identity block, then the tab bar,
   then the body. */
.doc main:has(> .hero.mh) > * { order: 5; }
.doc main:has(> .hero.mh) > .model-tabs { order: 2; }
.crumbs:has(+ main > .hero.mh) { display: none; }
.doc main > .hero.model-hero.mh {
  display: block;
  order: 1;
  min-height: 0;
  padding: 28px var(--col-x) 20px;
  background: var(--surface-card);
  color: var(--text-body);
}
.doc main > .hero.mh > .hero-inner.mh-inner {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}
.doc main > .hero.mh > .hero-inner.mh-inner > .mh-icon,
.doc main > .hero.mh > .hero-inner.mh-inner > .mh-body { width: auto; margin: 0; }
.doc main > .hero.mh > .hero-inner.mh-inner > .mh-body { flex: 1 1 auto; min-width: 0; }
.doc main > .hero.mh .mh-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-tint);
  color: var(--teal-700);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--hairline));
}
.doc main > .hero.mh .mh-kind {
  margin: 0;
  font: 500 12px/1.3 var(--code);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.doc main > .hero.mh h1 {
  margin: 2px 0 6px;
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--text-strong);
  text-wrap: balance;
}
.doc main > .hero.mh .lede {
  margin: 0;
  max-width: 64ch;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.doc main > .hero.mh a:not(.btn):not(.mh-chip) { color: var(--link); }
.doc main > .hero.mh code { color: var(--text-strong); background: var(--surface-sunken); }
.mh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.mh-meta li:not(.mh-chip) { display: contents; }
.mh-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--canvas);
  color: var(--text-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.mh-chip svg { flex: 0 0 auto; color: var(--text-faint); }
.doc main > .hero.mh a.mh-trust {
  background: var(--surface-tint);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--hairline));
  color: var(--teal-700);
  font-weight: 600;
  text-decoration: none;
}
.doc main > .hero.mh a.mh-trust:hover { border-color: var(--primary); }
.mh-trust svg, .mh-hosted svg { color: var(--primary); }
.mh-pin { font-family: var(--code); font-size: 12px; }
@media (max-width: 560px) {
  .doc main > .hero.model-hero.mh { padding: 20px 16px 16px; }
  .doc main > .hero.mh > .hero-inner.mh-inner { gap: 12px; }
  .doc main > .hero.mh .mh-icon { width: 40px; height: 40px; border-radius: 10px; }
  .mh-icon svg { width: 22px; height: 22px; }
}

/* ================= tab bar (lighter on model pages) ================= */
.doc main:has(> .hero.mh) > .model-tabs { border-top: 0; border-bottom: 1px solid var(--hairline); box-shadow: none; }
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-row { gap: 4px; }
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-link {
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border-radius: 6px 6px 0 0;
}
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-link::before { width: 16px; height: 16px; opacity: .7; }
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-link:hover { color: var(--text-strong); background: var(--surface-sunken); }
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-link[aria-current] { color: var(--tab-teal); font-weight: 600; background: none; }
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-link[aria-current]::before { opacity: 1; }
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-link[aria-current]::after { height: 2px; background: var(--teal-600); }
.doc main:has(> .hero.mh) > .model-tabs .model-tabs-row > .model-tabs-link:first-child {
  --tab-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6v8H4zM4 16h6v4H4zM14 12h6v8h-6zM14 4h6v4h-6z'/%3E%3C/svg%3E");
}
@media (max-width: 560px) {
  .doc main:has(> .hero.mh) > .model-tabs .model-tabs-row { gap: 0; padding-inline: 8px; }
  .doc main:has(> .hero.mh) > .model-tabs .model-tabs-link { padding: 0 8px; font-size: 13px; gap: 6px; }
  .doc main:has(> .hero.mh) > .model-tabs .model-tabs-link:not([aria-current])::before { display: none; }
}

/* ================= Overview ================= */
/* verdict: a note, not a card */
.doc main:has(> .hero.mh) .ov-verdict { background: none; box-shadow: none; border: 0; padding-inline: 0; }
.doc main:has(> .hero.mh) .ov-verdict-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin: 0;
  padding: 12px 16px;
  background: var(--surface-tint);
  border-left: 3px solid var(--teal-600);
  border-radius: 8px;
  font-size: 14.5px;
  line-height: 1.5;
}
.doc main:has(> .hero.mh) .ov-verdict-line > span { flex: 1 1 32ch; }
.doc main:has(> .hero.mh) .ov-verdict-link { margin-left: auto; font-weight: 600; white-space: nowrap; }

/* good for / not for */
.doc main:has(> .hero.mh) .fit-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc main:has(> .hero.mh) .fit-card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 18px 20px 8px;
  background: var(--surface-card);
  box-shadow: none;
}
.doc main:has(> .hero.mh) .fit-no { background: var(--canvas); }
.doc main:has(> .hero.mh) .fit-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}
.doc main:has(> .hero.mh) .fit-card h2::before {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--fit-icon) center / contain no-repeat;
          mask: var(--fit-icon) center / contain no-repeat;
}
.doc main:has(> .hero.mh) .fit-yes h2 { color: var(--teal-700); }
.doc main:has(> .hero.mh) .fit-yes h2::before { --fit-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8.5 12 2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.doc main:has(> .hero.mh) .fit-no h2 { color: var(--text-faint); }
.doc main:has(> .hero.mh) .fit-no h2::before { --fit-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m9 9 6 6M15 9l-6 6'/%3E%3C/svg%3E"); }
.doc main:has(> .hero.mh) .fit-card ul { list-style: none; margin: 0; padding: 0; }
.doc main:has(> .hero.mh) .fit-card li {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  font-size: 14.5px;
  line-height: 1.5;
}
.doc main:has(> .hero.mh) .fit-card li::before { display: none; }
@media (max-width: 720px) { .doc main:has(> .hero.mh) .fit-pair { grid-template-columns: 1fr; } }

/* what it returns: segmented switch, quiet stat tiles */
.doc main:has(> .hero.mh) .scen-switch {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  gap: 2px;
  padding: 3px;
  background: var(--surface-sunken);
  border-radius: 8px;
  border: 0;
  scrollbar-width: none;
}
.doc main:has(> .hero.mh) .scen-switch button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.doc main:has(> .hero.mh) .scen-switch button::after { display: none; }
.doc main:has(> .hero.mh) .scen-switch button[aria-selected="true"] {
  background: var(--surface-card);
  color: var(--text-strong);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
.doc main:has(> .hero.mh) .scen-title { margin: 18px 0 12px; font-size: 16px; font-weight: 600; }
.doc main:has(> .hero.mh) .stat-row { gap: 12px; }
.doc main:has(> .hero.mh) .stat-row .stat {
  border: 0;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--canvas);
  box-shadow: none;
}
.doc main:has(> .hero.mh) .stat-row .stat::before { display: none; }
.doc main:has(> .hero.mh) .stat-row .stat-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.doc main:has(> .hero.mh) .stat-row .stat-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.doc main:has(> .hero.mh) .stat-row .stat-sub { font-size: 12px; }
.doc main:has(> .hero.mh) .stat-row .stat-neutral .stat-value { color: var(--text-strong); }
.doc main:has(> .hero.mh) .scen-note { font-size: 13.5px; max-width: 72ch; color: var(--text-muted); }
.doc main:has(> .hero.mh) .ov-source {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font: 12px/1.5 var(--code);
  color: var(--text-faint);
}
@media (max-width: 560px) {
  .doc main:has(> .hero.mh) .stat-row-4 { grid-template-columns: 1fr 1fr; }
  .doc main:has(> .hero.mh) .stat-row .stat-value { font-size: 24px; }
}

/* pipeline: the shared style.css pipeline owns layout; at <=820 it draws one
   vertical connector under the step number. Cancel the older 640px rotation. */
@media (max-width: 820px) {
  .doc main:has(> .hero.mh) .pipeline .pl-arrow { align-self: flex-start; transform: none; rotate: none; }
}
.doc main:has(> .hero.mh) .callout { border-radius: 8px; font-size: 14px; }

/* model card */
.doc main:has(> .hero.mh) .ov-spec .expander > summary { min-height: 48px; font-size: 15px; font-weight: 600; }
.doc main:has(> .hero.mh) dl.model-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.doc main:has(> .hero.mh) dl.model-card > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  background: none;
  border-radius: 0;
}
.doc main:has(> .hero.mh) dl.model-card > .model-card-wide { grid-column: 1 / -1; }
.doc main:has(> .hero.mh) dl.model-card dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}
.doc main:has(> .hero.mh) dl.model-card dd { margin: 0; font-size: 14px; }
@media (max-width: 640px) {
  .doc main:has(> .hero.mh) dl.model-card { grid-template-columns: 1fr; }
  .doc main:has(> .hero.mh) dl.model-card > div { grid-template-columns: 1fr; gap: 2px; }
}

/* where next: link cards */
.doc main:has(> .hero.mh) .where-next .chip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.doc main:has(> .hero.mh) .where-next .chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-card);
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.doc main:has(> .hero.mh) .where-next .chip::after { content: "\2192"; color: var(--primary); margin-left: 12px; }
.doc main:has(> .hero.mh) .where-next .chip:hover { border-color: var(--teal-600); }
@media (max-width: 560px) { .doc main:has(> .hero.mh) .where-next .chip-row { grid-template-columns: 1fr; } }

/* ================= Validation ================= */
.doc main:has(> .hero.mh) tr[data-level] .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.doc main:has(> .hero.mh) tr[data-level] .chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.doc main:has(> .hero.mh) tr[data-level="weak"] .chip { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.doc main:has(> .hero.mh) tr[data-level="moderate"] .chip { background: var(--surface-sunken); color: var(--text-body); border-color: var(--hairline-strong); }
.doc main:has(> .hero.mh) tr[data-level="strong"] .chip { background: var(--surface-tint); color: var(--teal-700); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.doc main:has(> .hero.mh) tr[data-level="na"] .chip { background: none; color: var(--text-faint); border-color: var(--hairline); }

/* limits: one bordered list instead of a stack of cards */
.doc main:has(> .hero.mh) .limits {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-card);
}
.doc main:has(> .hero.mh) .limits > details.expander {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  box-shadow: none;
  background: none;
}
.doc main:has(> .hero.mh) .limits > details.expander:first-child { border-top: 0; }
.doc main:has(> .hero.mh) .limits > details.expander > summary { padding: 12px 16px; font-size: 14.5px; font-weight: 500; }
.doc main:has(> .hero.mh) .limits > details.expander[open] { background: var(--canvas); }
.doc main:has(> .hero.mh) .limits > details.expander[open] > :not(summary) { padding-inline: 16px; }

/* ================= steps + code (Methodology, Code) ================= */
.doc main:has(> .hero.mh) .meth-step-num { border-radius: 50%; background: var(--teal-700); color: var(--band-text); transition: none; }
@media (prefers-color-scheme: dark) {
  .doc main:has(> .hero.mh) .meth-step-num { background: #38B2AC; color: #0B0E14; }
}
.doc main:has(> .hero.mh) .codeblock {
  position: relative;
  border: 0;
  border-radius: 10px;
  background: #0f1b1d;
  color: #E2E8F0;
}
.doc main:has(> .hero.mh) .codeblock pre {
  margin: 0;
  padding: 16px;
  background: none;
  color: inherit;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}
.doc main:has(> .hero.mh) .codeblock code { color: inherit; background: none; }
.doc main:has(> .hero.mh) .codeblock .kw { color: #81E6D9; }
.doc main:has(> .hero.mh) .codeblock .cb-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 6px;
  background: rgba(255, 255, 255, .04);
  color: #CBD5E1;
  font-size: 11px;
  font-weight: 600;
}
.doc main:has(> .hero.mh) .codeblock .cb-copy:hover { color: #fff; border-color: rgba(255, 255, 255, .45); }
.doc main:has(> .hero.mh) .dial-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
@media (max-width: 400px) { .doc main:has(> .hero.mh) .dial-cards { grid-template-columns: 1fr; } }

/* ---- Fable review round 2 ---- */
/* validation tiles: footers align at the bottom, chips read as text */
.doc main:has(> .hero.mh) .stat-row .stat { display: flex; flex-direction: column; }
.doc main:has(> .hero.mh) .stat-row .stat-foot { margin-top: auto; }
.doc main:has(> .hero.mh) .stat-foot .chip {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 12.5px;
  font-weight: 500;
}
.doc main:has(> .hero.mh) .stat-foot a.chip-warn { color: var(--warn-ink); }
/* tab bar sits at one height across tabs */
/* room between tiles and the chart */
.doc main:has(> .hero.mh) .stat-row { margin-bottom: 20px; }
.doc main:has(> .hero.mh) .limits + .limits,
.doc main:has(> .hero.mh) * + .limits { margin-top: 12px; }
/* any four-tile row lays out 4 across (2x2 on phones), never 3 + 1 */
@media (min-width: 900px) {
  .doc main:has(> .hero.mh) .stat-row:has(> .stat:nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); display: grid; }
}
@media (max-width: 899px) {
  .doc main:has(> .hero.mh) .stat-row:has(> .stat:nth-child(4):last-child) { grid-template-columns: 1fr 1fr; display: grid; }
}

/* ================= r12 terse pass: icons everywhere ================= */
:root {
  --mi-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
  --mi-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
  --mi-gauge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 15 4-4 3 3 6-7'/%3E%3C/svg%3E");
  --mi-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 5 3.4 8.3 8 9 4.6-.7 8-4 8-9V6l-8-3Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --mi-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m13 6 6 6-6 6'/%3E%3C/svg%3E");
}
.doc main:has(> .hero.mh) .mi::before,
.doc main:has(> .hero.mh) .ov-verdict-short::before,
.doc main:has(> .hero.mh) .stat-row .stat-label::before,
.doc main:has(> .hero.mh) .prose ul > li::before,
.doc main:has(> .hero.mh) .meth-step ul > li::before,
.doc main:has(> .hero.mh) .expander ul > li::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--mi) center / contain no-repeat;
          mask: var(--mi) center / contain no-repeat;
}

/* verdict: chip-length line + Evidence link; the full sentence folds away */
.doc main:has(> .hero.mh) .ov-verdict-line { align-items: center; }
.doc main:has(> .hero.mh) .ov-verdict-short {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
}
.doc main:has(> .hero.mh) .ov-verdict-short::before { --mi: var(--mi-shield); width: 18px; height: 18px; color: var(--teal-600); }
.doc main:has(> .hero.mh) .ov-verdict-more { flex: 1 0 100%; margin: 0; }
.doc main:has(> .hero.mh) .ov-verdict-more > summary {
  cursor: pointer;
  width: fit-content;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.doc main:has(> .hero.mh) .ov-verdict-more > p { margin: 6px 0 0; font-size: 14px; color: var(--text-muted); max-width: 72ch; }

/* stat tiles: a small chart glyph before every label */
.doc main:has(> .hero.mh) .stat-row .stat-label { display: flex; align-items: center; gap: 6px; }
.doc main:has(> .hero.mh) .stat-row .stat-label::before { --mi: var(--mi-gauge); width: 13px; height: 13px; color: var(--primary); }

/* itemised lists: icon bullet + phrase, on every model tab */
.doc main:has(> .hero.mh) .prose ul,
.doc main:has(> .hero.mh) .meth-step ul,
.doc main:has(> .hero.mh) .expander ul { list-style: none; padding-left: 0; }
.doc main:has(> .hero.mh) .prose ul > li,
.doc main:has(> .hero.mh) .meth-step ul > li,
.doc main:has(> .hero.mh) .expander ul > li {
  position: relative;
  padding-left: 24px;
  margin: 6px 0;
}
.doc main:has(> .hero.mh) .prose ul > li::before,
.doc main:has(> .hero.mh) .meth-step ul > li::before,
.doc main:has(> .hero.mh) .expander ul > li::before {
  --mi: var(--mi-chevron);
  position: absolute;
  left: 2px;
  top: .42em;
  width: 14px;
  height: 14px;
  color: var(--primary);
}

/* CTAs: icon-led link cards */
.doc main:has(> .hero.mh) .where-next .chip::before {
  content: "";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  background: var(--primary);
  -webkit-mask: var(--cta-icon, var(--mi-arrow)) center / contain no-repeat;
          mask: var(--cta-icon, var(--mi-arrow)) center / contain no-repeat;
}
.doc main:has(> .hero.mh) .where-next .chip { justify-content: flex-start; }
.doc main:has(> .hero.mh) .where-next .chip::after { margin-left: auto; }
.doc main:has(> .hero.mh) .where-next .chip[href$="/validation"] { --cta-icon: var(--mi-shield); }
.doc main:has(> .hero.mh) .where-next .chip[href*="/papers/"],
.doc main:has(> .hero.mh) .where-next .chip[href*="/reports/"] { --cta-icon: var(--i-doc); }
.doc main:has(> .hero.mh) .where-next .chip[href$="/methodology"] { --cta-icon: var(--i-book); }
.doc main:has(> .hero.mh) .where-next .chip[href^="/connect"],
.doc main:has(> .hero.mh) .where-next .chip[href$="/code"] { --cta-icon: var(--i-code); }
.doc main:has(> .hero.mh) .where-next .chip[href^="/models"] { --cta-icon: var(--i-layers); }

/* tighter reading measure: long paragraphs on model tabs */
.doc main:has(> .hero.mh) .meth-step > p { max-width: 68ch; }
.doc main:has(> .hero.mh) .scen-points { list-style: none; margin: 0; padding: 0; font-size: 13.5px; color: var(--text-muted); }
.doc main:has(> .hero.mh) .scen-points > li { position: relative; padding-left: 22px; margin: 0 0 6px; }
.doc main:has(> .hero.mh) .scen-points > li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 13px; height: 13px; background: var(--primary);
  -webkit-mask: var(--mi-chevron) center / contain no-repeat; mask: var(--mi-chevron) center / contain no-repeat;
}

/* ================= Fable OBR polish pass ================= */
.doc main:has(> .hero.mh) .meth-step-num { position: relative; z-index: 1; }
.doc main:has(> .hero.mh) .codeblock .cm { color: #8FA3AD; }
.doc main:has(> .hero.mh) .stat-foot .chip { min-height: 0; }
@media (min-width: 900px) {
  .doc main:has(> .hero.mh) .stat-row-4 .stat-label { min-height: 2.7em; align-items: flex-start; }
}
@media (max-width: 560px) {
  .doc main:has(> .hero.mh) .scen-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .doc main:has(> .hero.mh) .scen-switch button { height: 36px; }
}
.doc main:has(> .hero.mh) .vmet-notes { margin-inline: 0; }
.doc main:has(> .hero.mh) .paper-result { font: 13.5px/1.55 var(--body); }

/* =====================================================================
   Autumn Budget 2026 dashboard spec (review-nov16/autumn-budget-design-spec.md)
   Sections are bare on the canvas: icon circle + h2 + one grey line.
   Cards only for charts, stat-tile rows and expanders. Gains teal, losses
   amber, sign always printed. 48px between sections, 20px between cards.
   ===================================================================== */
/* gain/loss/none/inset come from the shell (style.css section 11); this page
   adds only an AA-safe amber for text and the dark-mode tones. */
.doc main:has(> .hero.mh) { --ab-loss-ink: #B45309; }
@media (prefers-color-scheme: dark) {
  .doc main:has(> .hero.mh) { --ab-loss: #F59E0B; --ab-loss-ink: #FBBF24; --ab-gain: #38B2AC; }
}

/* 1. no section card: drop the painted surface behind every band */
.doc main:has(> .hero.mh) .band:has(> .band-head:first-child):not(.band .band):not(.glance-band)::after,
.doc main:has(> .hero.mh) .band:has(> .band-head:first-child):not(.band .band):not(.glance-band) > .band-head:first-child::after { content: none; }
.doc main:has(> .hero.mh) .band:has(> .band-head:first-child):not(.band .band):not(.glance-band) {
  margin-top: var(--section-y, 48px);
  padding: 0;
  overflow: visible;
  border-radius: 0;
}
.doc main:has(> .hero.mh) .band:has(> .band-head:first-child):not(.band .band):not(.glance-band) > .band-head:first-child {
  margin: 0 0 20px;
}
.doc main:has(> .hero.mh) .band-head .section-intro,
.doc main:has(> .hero.mh) .band-head > p { font-size: 15px; color: var(--gray-500); }
.doc main:has(> .hero.mh) .band-head > h2 { font-size: var(--fs-ab-h2, 20px); font-weight: 600; color: var(--gray-800); }
.doc main:has(> .hero.mh) .band > p,
.doc main:has(> .hero.mh) .band > .prose > p { max-width: 72ch; }

/* 2. the card: charts, stat-tile rows, expanders, tables-as-figures */
.doc main:has(> .hero.mh) .stat-row,
.doc main:has(> .hero.mh) figure.spark,
.doc main:has(> .hero.mh) .vfig,
.doc main:has(> .hero.mh) .mo-figcard,
.doc main:has(> .hero.mh) .band > details.expander,
.doc main:has(> .hero.mh) .scrolly-steps > .meth-step,
.doc main:has(> .hero.mh) .scrolly-code > .meth-step {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: none;
}

/* 3. stat-tile row: one card, tiles separated by space, value first */
.doc main:has(> .hero.mh) .stat-row { display: grid; gap: 24px; padding: 24px; margin: 0 0 20px; }
.doc main:has(> .hero.mh) .stat-row .stat {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  min-width: 0;
}
.doc main:has(> .hero.mh) .stat-row .stat-value { order: -1; font-size: var(--fs-ab-stat, 28px); line-height: 1.2; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.doc main:has(> .hero.mh) .stat-row .stat-label { margin-top: 4px; font-size: 14px; color: var(--gray-600); min-height: 0; }
.doc main:has(> .hero.mh) .stat-row .stat-sub { font-size: 13px; font-weight: 600; color: var(--gray-500); }
.doc main:has(> .hero.mh) .stat-value.is-gain { color: var(--ab-gain); }
.doc main:has(> .hero.mh) .stat-value.is-loss { color: var(--ab-loss-ink); }
@media (max-width: 768px) { .doc main:has(> .hero.mh) .stat-row { padding: 16px; gap: 16px; } }

/* 4. charts: teal gains, amber losses, rounded bars, dashed baseline */
.doc main:has(> .hero.mh) figure.spark { padding: 20px 24px 14px; margin: 0; }
.doc main:has(> .hero.mh) .spark-neg { fill: var(--ab-loss); }
.doc main:has(> .hero.mh) .spark-pos { fill: var(--ab-gain); }
.doc main:has(> .hero.mh) .spark-zero { stroke: var(--gray-400); stroke-dasharray: 6 4; }
.doc main:has(> .hero.mh) .spark-axis { font-size: 12px; color: var(--gray-500); }
.doc main:has(> .hero.mh) .scen-panel { gap: 20px; }

/* 5. measure cards: limits (amber accent) and levers (teal accent) */
.doc main:has(> .hero.mh) .limits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  border: 0;
  background: none;
  overflow: visible;
  border-radius: 0;
}
.doc main:has(> .hero.mh) .limits > details.expander,
.doc main:has(> .hero.mh) .limits > details.expander:first-child {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-card);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.doc main:has(> .hero.mh) .limits > details.expander::before,
.doc main:has(> .hero.mh) .dial-cards > *::before,
.doc main:has(> .hero.mh) .fit-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent, var(--ab-loss));
}
.doc main:has(> .hero.mh) .limits > details.expander > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
}
.doc main:has(> .hero.mh) .limits > details.expander > summary::before {
  content: "";
  flex: 0 0 32px;
  height: 32px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ab-loss) 16%, var(--card)) center / 16px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B45309' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}
.doc main:has(> .hero.mh) .limits > details.expander[open] { background: var(--surface-card); grid-column: 1 / -1; }
.doc main:has(> .hero.mh) .limits > details.expander[open] > :not(summary) { padding: 0 20px 18px 64px; font-size: 15px; }
/* 18 Nov review: on a phone the 64px indent left a 225px text column inside an open limit */
@media (max-width: 640px) { .doc main:has(> .hero.mh) .limits > details.expander[open] > :not(summary) { padding-left: 20px; } }
@media (max-width: 767px) { .doc main:has(> .hero.mh) .limits { grid-template-columns: minmax(0, 1fr); } }
.doc main:has(> .hero.mh) .dial-cards { gap: 20px; }
.doc main:has(> .hero.mh) .dial-cards > * {
  --accent: var(--ab-gain);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-card);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
  transition: box-shadow 200ms, transform 200ms;
}
.doc main:has(> .hero.mh) .dial-cards > *:hover { box-shadow: 0 6px 18px rgba(17, 24, 39, .08); transform: translateY(-2px); }
.doc main:has(> .hero.mh) .fit-card { position: relative; overflow: hidden; }
.doc main:has(> .hero.mh) .fit-yes { --accent: var(--ab-gain); }
.doc main:has(> .hero.mh) .fit-no { --accent: var(--ab-none); }

/* 6. bullets: 6px squares in the accent colour (measure-card points) */
.doc main:has(> .hero.mh) .prose ul > li::before,
.doc main:has(> .hero.mh) .meth-step ul > li::before,
.doc main:has(> .hero.mh) .expander ul > li::before,
.doc main:has(> .hero.mh) .scen-points > li::before {
  -webkit-mask: none;
          mask: none;
  width: 6px;
  height: 6px;
  top: .62em;
  left: 4px;
  border-radius: 1px;
  background: var(--primary);
}
.doc main:has(> .hero.mh) .prose ul > li,
.doc main:has(> .hero.mh) .meth-step ul > li,
.doc main:has(> .hero.mh) .expander ul > li,
.doc main:has(> .hero.mh) .scen-points > li { padding-left: 18px; }
.doc main:has(> .hero.mh) .limits ul > li::before { background: var(--ab-loss); }

/* 7. tables: no cell borders, 1px row underline, numbers tabular */
.doc main:has(> .hero.mh) .band table td,
.doc main:has(> .hero.mh) .band table th { border-left: 0; border-right: 0; font-variant-numeric: tabular-nums; }
.doc main:has(> .hero.mh) .band table tbody tr { border-bottom: 1px solid var(--gray-100); }
.doc main:has(> .hero.mh) .band table thead th { font-size: 12px; font-weight: 500; color: var(--gray-500); }
/* long inline identifiers wrap on phones instead of pushing the page wide */
.doc main:has(> .hero.mh) :not(pre) > code { overflow-wrap: anywhere; }

/* ---- Fable spec review: step cards padded, model card single-level, static cards flat ---- */
.doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step { --mp: 24px; margin: 0 0 20px; }
.doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step:last-child { margin-bottom: 0; }
.doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step:not(.meth-fold) { padding: var(--mp) var(--mp) var(--mp) calc(var(--mp) + 52px); }
.doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step:not(.meth-fold)::before { left: calc(var(--mp) + 17px); top: calc(var(--mp) + 40px); bottom: var(--mp); }
.doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step.meth-fold { padding: 0 20px; }
@media (max-width: 768px) { .doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step { --mp: 16px; } }
@media (max-width: 480px) {
  .doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step:not(.meth-fold) { padding: 16px; }
  .doc main:has(> .hero.mh) :is(.scrolly-steps, .scrolly-code) > .meth-step.meth-fold { padding: 0 16px; }
}
.doc main:has(> .hero.mh) .band.ov-spec { margin-top: 20px; padding: 0; background: none; border: 0; box-shadow: none; }
.doc main:has(> .hero.mh) .band.ov-spec > details.expander { margin: 0; padding: 0 24px; }
@media (max-width: 768px) { .doc main:has(> .hero.mh) .band.ov-spec > details.expander { padding: 0 16px; } }
.doc main:has(> .hero.mh) .limits > details.expander,
.doc main:has(> .hero.mh) .limits > details.expander:first-child { box-shadow: none; }

/* ---- Fable spec review, six models ---- */
.doc main:has(> .hero.mh) .stat-row { gap: 8px; padding: 12px 10px; }
.doc main:has(> .hero.mh) .stat-row .stat { padding: 12px 14px; }
@media (max-width: 768px) { .doc main:has(> .hero.mh) .stat-row { gap: 6px; padding: 8px 6px; } }
.doc main:has(> .hero.mh) :is(.band > .prose, .scen-panel) > .table-scroll { background: var(--surface-card); border: 1px solid var(--hairline); border-radius: 12px; padding: 8px 24px 16px; }
@media (max-width: 768px) { .doc main:has(> .hero.mh) :is(.band > .prose, .scen-panel) > .table-scroll { padding: 4px 16px 12px; } }
.doc main:has(> .hero.mh) .band > .vfig { padding: 20px 24px 16px; margin: 0 0 20px; }
.doc main:has(> .hero.mh) :is(.meth-step, details, .mo-figcard) .vfig { border: 0; border-radius: 0; background: none; }
.doc main:has(> .hero.mh) .band > details.expander { padding: 0 24px; }
@media (max-width: 768px) { .doc main:has(> .hero.mh) .band > details.expander { padding: 0 16px; } }
.doc main:has(> .hero.mh) .vfig .vc-fig ul.vc-legend > li { padding: 3px 12px 3px 10px; margin: 0; }
.doc main:has(> .hero.mh) .vfig .vc-fig ul.vc-legend > li::before { content: none; }
.doc main:has(> .hero.mh) .dial-cards > * { padding: 20px 20px 16px; box-shadow: none; }
.doc main:has(> .hero.mh) .dial-cards > *:hover { box-shadow: none; transform: none; }
.doc main:has(> .hero.mh) .ov-mini { gap: 20px; }
.doc main:has(> .hero.mh) .ov-mini > .card { background: var(--surface-card); border: 1px solid var(--hairline); border-radius: 12px; padding: 24px; }

/* ---- Fable text/flow pass: OBR, pe, svar ---- */
.doc main:has(> .hero.mh) .meth-step tbody th::first-letter { text-transform: none; }
.doc main:has(> .hero.mh) .mo-tablecard caption { caption-side: top; }
.doc main:has(> .hero.mh) .ov-example > .callout, .doc main:has(> .hero.mh) .ov-example .callout { max-width: none; margin: 16px 0 0; }
.doc main:has(> .hero.mh) .meth-step > .codeblock { margin-top: 12px; }
.doc main:has(> .hero.mh) #pe-bridge .callout { max-width: none; }
.doc main:has(> .hero.mh) .ov-flow-note { margin-bottom: 0; }
.doc main:has(> .hero.mh) details.about h4 + ul, .doc main:has(> .hero.mh) details.more p + ul { margin-top: 8px; }
.doc main:has(> .hero.mh) .limit li + li { margin-top: 8px; }

/* ---- headline-only steps: supporting detail behind one expander ----
   icon, title, one-line summary of what is inside, chevron (matches the
   shell's expander shape). */
.doc main:has(> .hero.mh) details.more {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}
.doc main:has(> .hero.mh) details.more > summary {
  display: grid;
  grid-template-columns: 24px auto 1fr 16px;
  align-items: center;
  column-gap: 10px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  color: var(--text-strong);
}
.doc main:has(> .hero.mh) details.more > summary::-webkit-details-marker { display: none; }
.doc main:has(> .hero.mh) details.more > summary::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ab-teal-50, var(--surface-tint)) center / 14px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F766E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16M4 12h16M4 18h10'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 1px var(--ab-teal-100, var(--hairline));
}
.doc main:has(> .hero.mh) details.more > summary::after {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--text-faint);
  -webkit-mask: var(--mi-chevron) center / contain no-repeat;
          mask: var(--mi-chevron) center / contain no-repeat;
  transform: rotate(90deg);
  transition: transform 150ms;
}
.doc main:has(> .hero.mh) details.more[open] > summary::after { transform: rotate(-90deg); }
.doc main:has(> .hero.mh) .more-title { font-size: 15px; font-weight: 600; }
.doc main:has(> .hero.mh) .more-sub { font-size: 13px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc main:has(> .hero.mh) details.more[open] { padding-bottom: 8px; }

/* ---- Fable text/flow pass: frb-us, us-hank, olg, define ---- */
.doc main:has(> .hero.mh) .meth-step > details.about + details.about,
.doc main:has(> .hero.mh) .meth-step > details.more + details.about { border-top: 0; }
.doc main:has(> .hero.mh) #answers > .callout { max-width: none; }
.doc main:has(> .hero.mh) .band-head .section-intro { max-width: 68ch; }
.doc main:has(> .hero.mh) .meth-step > p + p { margin-top: 8px; }
.doc main:has(> .hero.mh) .kv-title code { font-size: inherit; background: none; border: 0; padding: 0; }

/* ---- combined-site review fixes ---- */
/* verdict: reason inline under the headline, no native toggle */
.doc main:has(> .hero.mh) .ov-verdict-why { flex: 1 0 100%; font-size: 14px; color: var(--text-muted); max-width: 80ch; }
/* benchmark tile: plain tile with an eyebrow, aligned with its row */
.doc main:has(> .hero.mh) .stat-row .stat-bench { padding: 12px 14px; }
.doc main:has(> .hero.mh) .stat-eyebrow { order: -2; margin-bottom: 2px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
/* full-width notes and callouts under full-width cards */
.doc main:has(> .hero.mh) .band > .callout,
.doc main:has(> .hero.mh) .band > .prose > .callout,
.doc main:has(> .hero.mh) .band > .ov-flow-note,
.doc main:has(> .hero.mh) .band > .prose > .note,
.doc main:has(> .hero.mh) .scen-note { max-width: none; }
/* pe chart: padded, compact */
.doc main:has(> .hero.mh) .band > .vfig svg { max-height: 300px; }
.doc main:has(> .hero.mh) .ov-verdict-line > span.ov-verdict-why { flex: 1 0 100%; order: 3; margin-top: 2px; }
.doc main:has(> .hero.mh) .stat-row .stat-bench { position: relative; }
.doc main:has(> .hero.mh) .stat-row .stat-bench .stat-eyebrow { position: absolute; top: -4px; left: 14px; line-height: 1; }

/* ---- Round 4 (Fable screenshot review of #267) ---- */
/* every tile is the same tile: no dashed or tinted "neutral" box */
.doc main:has(> .hero.mh) .stat-row .stat-neutral { background: none; border: 0; margin: 0; }
.doc main:has(> .hero.mh) .limits { gap: 12px; }
.doc main:has(> .hero.mh) .limits > details.expander > summary { padding: 14px 16px; font-size: 14.5px; }
.doc main:has(> .hero.mh) .limits-h { display: flex; align-items: center; gap: 10px; }
.doc main:has(> .hero.mh) .limits-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ab-teal-50); box-shadow: inset 0 0 0 1px var(--ab-teal-100); color: var(--ab-teal-700); flex: 0 0 auto; }
/* configuration cards (obr/validation): two-line facts, detail in an expander */
.doc main:has(> .hero.mh) .cfg-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 12px; }
@media (max-width: 767px) { .doc main:has(> .hero.mh) .cfg-cards { grid-template-columns: minmax(0, 1fr); } }
.doc main:has(> .hero.mh) .cfg-card { padding: 16px 18px; background: var(--card); border: 1px solid var(--ab-border); border-radius: 12px; }
.doc main:has(> .hero.mh) .cfg-card h3 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin: 0 0 8px; font-size: var(--fs-ab-body, 16px); }
.doc main:has(> .hero.mh) .cfg-card p { margin: 0; color: var(--text-body); font-size: var(--fs-ab-small, 14px); line-height: 1.45; }
.doc main:has(> .hero.mh) .cfg-card .cfg-fact { margin-top: 6px; color: var(--text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.doc main:has(> .hero.mh) dl.cfg-detail { margin: 0; }
.doc main:has(> .hero.mh) dl.cfg-detail dt { margin-top: 12px; color: var(--text-strong); font-weight: 600; }
.doc main:has(> .hero.mh) dl.cfg-detail dt:first-child { margin-top: 0; }
.doc main:has(> .hero.mh) dl.cfg-detail dd { margin: 2px 0 0; }
/* a row with a "Benchmark" eyebrow reserves that row on every tile, so values share one baseline */
.doc main:has(> .hero.mh) .stat-row:has(.stat-eyebrow) > .stat { position: relative; padding-top: 34px; }
.doc main:has(> .hero.mh) .stat-row:has(.stat-eyebrow) .stat-eyebrow { position: absolute; top: 12px; left: 14px; margin: 0; line-height: 1.2; }
/* sparkline: first and last values on the axis; its notes sit inside the card */
.doc main:has(> .hero.mh) .spark-axis b { color: var(--text-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.doc main:has(> .hero.mh) figure.spark > .scen-points { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--ab-border); }
/* trailing notes: one card-footer style. Under a card they attach to it; elsewhere they are a quiet inset strip. */
.doc main:has(> .hero.mh) :is(.scen-note, .ov-flow-note) {
  max-width: none; margin: 12px 0 0; padding: 10px 16px;
  background: var(--ab-inset); border: 1px solid var(--ab-border); border-radius: 10px;
  color: var(--text-muted); font-size: var(--fs-ab-cap, 13px); line-height: 1.5;
}
.doc main:has(> .hero.mh) :is(.stat-row, .vfig, figure.spark, .mo-figcard):has(+ :is(.scen-note, .ov-flow-note)) {
  margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}
.doc main:has(> .hero.mh) :is(.stat-row, .vfig, figure.spark, .mo-figcard) + :is(.scen-note, .ov-flow-note) {
  margin-top: 0; border-top: 0; border-radius: 0 0 12px 12px;
}
.doc main:has(> .hero.mh) :is(.scen-note, .ov-flow-note) + :is(.callout, .xp, details) { margin-top: 16px; }
/* step index: a compact chip grid (3 across), not a second set of step cards */
.doc main:has(> .hero.mh) .meth-map { margin: 8px 0 24px; }
.doc main:has(> .hero.mh) .meth-map-list,
.doc main:has(> .hero.mh) .meth-map-list:has(> li:nth-child(7)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.doc main:has(> .hero.mh) .meth-map-list li::before,
.doc main:has(> .hero.mh) .meth-map-list li::after { display: none; }
.doc main:has(> .hero.mh) .meth-map-list a {
  flex-direction: row; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px 6px 6px;
  border: 1px solid var(--ab-border); border-radius: 999px; background: var(--card);
  font-size: var(--fs-ab-cap, 13px); font-weight: 600; line-height: 1.25;
}
.doc main:has(> .hero.mh) .meth-map-list a:hover { border-color: var(--ab-teal-700); background: var(--ab-teal-50); }
.doc main:has(> .hero.mh) .meth-map-num { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--ab-teal-50); box-shadow: inset 0 0 0 1px var(--ab-teal-100); color: var(--ab-teal-700); }
.doc main:has(> .hero.mh) .meth-map-t { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 767px) { .doc main:has(> .hero.mh) .meth-map-list, .doc main:has(> .hero.mh) .meth-map-list:has(> li:nth-child(7)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .doc main:has(> .hero.mh) .meth-map-list, .doc main:has(> .hero.mh) .meth-map-list:has(> li:nth-child(7)) { grid-template-columns: minmax(0, 1fr); } }
/* r4 Fable follow-ups */
@media (max-width: 820px) {
  .doc main:has(> .hero.mh) .pipeline .pl-arrow { margin-block: 6px; }
  .doc main:has(> .hero.mh) .pipeline .pl-arrow::after { display: none; }
}
.doc main:has(> .hero.mh) .limits > details.expander:not([open]) { align-self: stretch; display: flex; flex-direction: column; }
.doc main:has(> .hero.mh) .limits > details.expander > summary { flex: 1 1 auto; align-items: center; }
.doc main:has(> .hero.mh) .limits > details.expander > summary::after { flex: 0 0 auto; }
.doc main:has(> .hero.mh) .scen-panel > figure.spark + .xp,
.doc main:has(> .hero.mh) .scen-panel > :is(figure.spark, .scen-note) + .xp { margin-top: 16px; }
.doc main:has(> .hero.mh) .codeblock + .scen-note { margin-top: 12px; }
.doc main:has(> .hero.mh) details.step-fold { border-top: 0; }
.doc main:has(> .hero.mh) .scrolly-wrap + .xp { margin-top: 16px; }

/* ===== Polish run (16–17 Nov): proof list, run tabs, validation scorecard ===== */
/* result chips: one closed vocabulary, keyed on [data-result] (the registry trust card keeps [data-level]) */
.doc main:has(> .hero.mh) [data-result] .chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border: 1px solid var(--hairline-strong);
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-sunken); color: var(--text-body);
}
.doc main:has(> .hero.mh) [data-result] .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.doc main:has(> .hero.mh) [data-result="pass"] .chip { background: var(--surface-tint); color: var(--teal-700); border-color: color-mix(in srgb, var(--primary) 30%, transparent); }
.doc main:has(> .hero.mh) [data-result="weak"] .chip { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.doc main:has(> .hero.mh) [data-result="fail"] .chip { background: color-mix(in srgb, #DC2626 10%, var(--card)); color: #B91C1C; border-color: color-mix(in srgb, #DC2626 40%, transparent); }
.doc main:has(> .hero.mh) [data-result="na"] .chip { background: none; color: var(--text-faint); border-color: var(--hairline); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .doc main:has(> .hero.mh) [data-result="fail"] .chip { color: #FCA5A5; }
}
:root[data-theme="dark"] .doc main:has(> .hero.mh) [data-result="fail"] .chip { color: #FCA5A5; }

/* Overview: How far to trust it (3-row proof list) */
.doc main:has(> .hero.mh) .proof-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--ab-border); border-radius: 12px; overflow: hidden; }
.doc main:has(> .hero.mh) .proof-row { margin: 0; padding: 0; }
.doc main:has(> .hero.mh) .proof-row::before { display: none; }
.doc main:has(> .hero.mh) .proof-row + .proof-row { border-top: 1px solid var(--ab-border); }
.doc main:has(> .hero.mh) .proof-link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 16px; align-items: center; gap: 16px;
  padding: 14px 20px; color: inherit; text-decoration: none;
}
.doc main:has(> .hero.mh) .proof-link::after { content: "→"; color: var(--text-faint); transition: transform 150ms; }
.doc main:has(> .hero.mh) .proof-link:hover { background: var(--ab-teal-50); }
.doc main:has(> .hero.mh) .proof-link:hover::after { transform: translateX(3px); color: var(--ab-teal-700); }
.doc main:has(> .hero.mh) .proof-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.doc main:has(> .hero.mh) .proof-check { color: var(--text-strong); font-size: var(--fs-ab-small, 14px); font-weight: 600; line-height: 1.35; }
.doc main:has(> .hero.mh) .proof-check small { display: block; margin-top: 2px; color: var(--text-faint); font-size: var(--fs-ab-cap, 13px); font-weight: 400; }
.doc main:has(> .hero.mh) .proof-num { color: var(--text-strong); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc main:has(> .hero.mh) .proof-more, .doc main:has(> .hero.mh) .run-more { margin: 10px 0 0; font-size: var(--fs-ab-cap, 13px); }
@media (max-width: 640px) {
  .doc main:has(> .hero.mh) .proof-link { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; }
  .doc main:has(> .hero.mh) .proof-link::after { display: none; }
  .doc main:has(> .hero.mh) .proof-check { grid-column: 1 / -1; }
}

/* Overview: Run it (MCP / CLI / Python tabs on the shared scenario switch) */
.doc main:has(> .hero.mh) .run-panel { margin-top: 12px; }
.doc main:has(> .hero.mh) .run-panel > .codeblock { margin: 0; }
.doc main:has(> .hero.mh) .run-prompt {
  margin: 0; padding: 14px 18px; background: var(--card); border: 1px solid var(--ab-border); border-left: 3px solid var(--ab-teal-700);
  border-radius: 10px; color: var(--text-strong); font-size: var(--fs-ab-small, 14px); line-height: 1.55;
}
.doc main:has(> .hero.mh) .run-prompt small { display: block; margin-top: 6px; color: var(--text-faint); font-size: var(--fs-ab-cap, 13px); }

/* Validation: scorecard table, first under the heading */
.doc main:has(> .hero.mh) .table-scroll.scorecard { margin: 0 0 16px; }
.doc main:has(> .hero.mh) .scorecard th[scope="row"] a { color: var(--text-strong); font-weight: 600; text-decoration: none; }
.doc main:has(> .hero.mh) .scorecard th[scope="row"] a:hover { color: var(--ab-teal-700); text-decoration: underline; }
.doc main:has(> .hero.mh) .scorecard .sc-num { color: var(--text-strong); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc main:has(> .hero.mh) .scorecard td:last-child { white-space: nowrap; }
.doc main:has(> .hero.mh) .trust-sub { margin: 20px 0 8px; color: var(--text-strong); font-size: var(--fs-ab-body, 16px); font-weight: 600; }

/* Methodology: the step index reads as one connected strip */
.doc main:has(> .hero.mh) .meth-map-list li { position: relative; }
@media (min-width: 768px) {
  .doc main:has(> .hero.mh) .meth-map-list li:not(:nth-child(3n)):not(:last-child)::after {
    display: block; content: ""; position: absolute; top: 50%; right: -8px; width: 8px; height: 2px; background: var(--ab-teal-100);
  }
}
.doc main:has(> .hero.mh) .meth-lead { max-width: 72ch; margin: 0 0 12px; color: var(--text-body); font-size: var(--fs-ab-body, 16px); line-height: 1.55; }
.doc main:has(> .hero.mh) .proof-more { max-width: none; }
/* r-polish Fable fixes */
.doc main:has(> .hero.mh) [data-result="none"] .chip { background: none; color: var(--text-muted); border-style: dashed; }
/* scorecard: fixed columns at desktop so labels never break mid-word */
.doc main:has(> .hero.mh) .scorecard table { table-layout: fixed; width: 100%; }
.doc main:has(> .hero.mh) .scorecard th, .doc main:has(> .hero.mh) .scorecard td { overflow-wrap: normal; word-break: normal; hyphens: none; vertical-align: top; }
.doc main:has(> .hero.mh) .scorecard thead th:nth-child(1) { width: 24%; }
.doc main:has(> .hero.mh) .scorecard thead th:nth-child(2) { width: 35%; }
.doc main:has(> .hero.mh) .scorecard thead th:nth-child(3) { width: 22%; }
.doc main:has(> .hero.mh) .scorecard thead th:nth-child(4) { width: 19%; }
.doc main:has(> .hero.mh) .scorecard .sc-num { white-space: normal; }
/* 18 Nov review: the verdict column (was 16%) was narrower than the "by construction" chip, so the wrapper
   overflowed by 4px, reveal.js flagged it .is-scroll, and the shared wide-table rule (style.css, "first column
   stays one line") painted long check labels over the Against column. The column now fits the chip (19%, taken
   from Against), and a scorecard's first column always wraps, since its columns are fixed. */
.doc main:has(> .hero.mh) .scorecard.is-scroll > table tbody tr > :first-child { white-space: normal; min-width: 0; }
/* 18 Nov review: a list inside a table cell keeps the cell's type size (was 14px/1.7 beside 13px/1.5 plain cells in the same table) */
.doc main:has(> .hero.mh) td li { font-size: inherit; line-height: inherit; }
/* below 900px every scorecard row is a compact card (also between 640 and 900, where the shared stack does not apply) */
@media (max-width: 900px) {
  .doc main:has(> .hero.mh) .scorecard { overflow: visible; }
  .doc main:has(> .hero.mh) .scorecard table, .doc main:has(> .hero.mh) .scorecard tbody { display: block; width: 100%; table-layout: auto; }
  .doc main:has(> .hero.mh) .scorecard thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc main:has(> .hero.mh) .scorecard caption { display: block; text-align: left; }
  .doc main:has(> .hero.mh) .scorecard tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--ab-border); }
  .doc main:has(> .hero.mh) .scorecard tr:last-child { border-bottom: 0; }
  .doc main:has(> .hero.mh) .scorecard tr > * { display: block; padding: 0 !important; margin: 0; border: 0 !important; background: none; width: auto; }
  .doc main:has(> .hero.mh) .scorecard tr > :first-child { grid-column: 1; grid-row: 1; }
  .doc main:has(> .hero.mh) .scorecard tr > td:last-child { grid-column: 2; grid-row: 1; }
  .doc main:has(> .hero.mh) .scorecard tr > td.sc-num { grid-column: 1 / -1; grid-row: 2; }
  .doc main:has(> .hero.mh) .scorecard tr > td:nth-child(2) { grid-column: 1 / -1; grid-row: 3; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
  .doc main:has(> .hero.mh) .scorecard td::before, .doc main:has(> .hero.mh) .scorecard th::before { display: none !important; }
}
/* code: readable tokens in light mode, visible copy button, long lines scroll */
.doc main:has(> .hero.mh) .codeblock .kw { color: var(--ab-teal-700); font-weight: 600; }
.doc main:has(> .hero.mh) .codeblock .cm { color: var(--text-muted); }
.doc main:has(> .hero.mh) .codeblock .cb-copy { color: var(--text-body); border-color: var(--hairline-strong); }
.doc main:has(> .hero.mh) .codeblock pre { overflow-x: auto; }
/* 18 Nov review: on a phone style.css already puts the copy button in the flow above the code (static, order -1), so the 36px
   reserved for an absolute button doubled the gap, and the 24px block padding plus the pre's 16px left 40px of indent */
@media (max-width: 640px) { .doc main:has(> .hero.mh) .codeblock:has(> .cb-copy) { padding-top: 0; padding-right: 12px; padding-left: 8px; } }
/* run tabs: three equal columns, never 2 + 1 */
.doc main:has(> .hero.mh) .run-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 420px); }
/* notes: only a note attached under a card is a strip; a free note is plain muted text, full width */
.doc main:has(> .hero.mh) :is(.scen-note, .ov-flow-note) { grid-column: 1 / -1; width: auto; }
.doc main:has(> .hero.mh) :not(.stat-row, .vfig, figure.spark, .mo-figcard) + :is(.scen-note, .ov-flow-note),
.doc main:has(> .hero.mh) :is(.scen-note, .ov-flow-note):first-child { padding: 0; background: none; border: 0; border-radius: 0; margin-top: 10px; }
/* final Fable pass */
.doc main:has(> .hero.mh) .band > p:is(.scen-note, .ov-flow-note, .proof-more, .run-more) { max-width: none; }
.doc main:has(> .hero.mh) .scorecard td:last-child { padding-right: 16px; }
@media (max-width: 640px) {
  .doc main:has(> .hero.mh) .proof-num { white-space: normal; min-width: 0; font-size: 14px; }
  .doc main:has(> .hero.mh) .proof-link { align-items: start; }
}
/* group B: section heading icon sits on the heading's centre line; intro spans the full width; no zebra fragments in stacked scorecards */
.doc main:has(> .hero.mh) .band:has(> .band-head:first-child):not(.band .band):not(.glance-band) > .band-head:first-child { grid-template-columns: 20px minmax(0, 1fr); column-gap: 8px; margin-left: 0; margin-right: 0; }
.doc main:has(> .hero.mh) .band:has(> .band-head:first-child):not(.band .band):not(.glance-band) > .band-head:first-child::before { align-self: center; }
.doc main:has(> .hero.mh) .band:has(> .band-head:first-child):not(.band .band):not(.glance-band) > .band-head:first-child > :is(p, .section-intro) { grid-column: 1 / -1; max-width: 72ch; }
@media (max-width: 900px) {
  .doc main:has(> .hero.mh) .scorecard tr, .doc main:has(> .hero.mh) .scorecard tr > * { background: none !important; }
}

/* Overnight review (Opus 5.5, Fable limit): a list directly inside a details.xp body was the browser's
   round disc beside the 6px square of every other model-tab list. One list style: the square. */
.doc main:has(> .hero.mh) .xp-body > ul:not([class]) { list-style: none; padding-left: 0; }
.doc main:has(> .hero.mh) .xp-body > ul:not([class]) > li { position: relative; padding-left: 18px; margin: 6px 0; }
.doc main:has(> .hero.mh) .xp-body > ul:not([class]) > li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 6px; height: 6px; border-radius: 1px; background: var(--primary); }
