/* Branch project page. Static, system fonts only. Palette: ink on paper, one green, one orange, plus the four plan
   colours of the paper's maps (paper/figures/build_all.py: BLUE tree, ORANGE dense, AQUA chronological, VIOLET cyclic).
   Three visual kinds: what varies (robot, batch, horizon, GPU) = small-caps underlined words (.vary); the three Branch
   descriptions (problem, plan, schedule) = boxed words with their icon (.part); the applications = plain mono tags (.app-tag). */

:root {
  --paper: #f6f3ec;
  --paper-2: #ece8dd;
  --white: #fffdf8;
  --ink: #1c211d;
  --ink-2: #363d38;
  --muted: #5a625b;
  --line: #d6d1c4;
  --line-2: #b9b3a3;
  --green: #2f6b4f;
  --green-2: #699679;
  --green-3: #d9e7de;
  --orange: #9a4f1f;
  --orange-2: #e6bf9e;
  --code-bg: #1c211d;
  --code-fg: #e8e6dd;
  --plan-tree: #2266b4;
  --plan-dense: #b34f12;
  --plan-chron: #128a5c;
  --plan-cyclic: #8a2a7a;
  --neutral: #5c6670; /* schedule drawings that belong to no plan */
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--green); }
img, svg, video { max-width: 100%; }
button, select, input, output { font: inherit; color: inherit; }
button { cursor: pointer; }
code {
  font: 0.92em var(--mono);
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 3px;
}
pre code { background: none; padding: 0; font: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
h3 { font-size: 21px; line-height: 1.3; }
h3 code { font-size: 0.8em; }
h4 { font: 600 15px/1.4 var(--sans); margin: 0 0 8px; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.dim { color: var(--muted); font-weight: 400; }
.fineprint { font-size: 13px; color: var(--muted); }
.fineprint code { font-size: 0.9em; }
.math { font-family: var(--serif); white-space: nowrap; }
.math i, .app dd i { font-style: italic; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: var(--radius);
  text-decoration: none;
}
.skip:focus { top: 8px; }

/* ---------------------------------------------------------------- shared legend pieces: plan swatch, schedule letter */
.sw {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin: 0 5px 0 1px;
  background: var(--plan, var(--ink)); border-radius: 2px;
}
.lt { font: 700 0.95em var(--mono); color: var(--ink); margin: 0 4px 0 2px; }
.key {
  display: flex; flex-wrap: wrap; gap: 6px 28px; align-items: baseline;
  font-size: 14px; color: var(--ink-2); padding: 14px 2px 0;
}
.key-group { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.key-group > b:first-child { font-weight: 600; color: var(--ink); margin-right: 2px; }
.ki { white-space: nowrap; }
.oom { font: 12px var(--sans); color: #9a9891; letter-spacing: 0.02em; }

/* ---------------------------------------------------------------- the three kinds of inline marks */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* (a) what varies: small caps, underlined, no icon */
.vary {
  font-variant-caps: all-small-caps; font-weight: 600; letter-spacing: 0.06em;
  border-bottom: 2px solid var(--ink); padding-bottom: 0; white-space: nowrap; color: var(--ink);
}
/* (b) the three descriptions Branch separates: a box with its icon, coloured as its card */
.part {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: 1px;
  padding: 0 9px 0 7px; border: 1.5px solid currentColor; border-radius: 4px;
  font: 600 0.88em/1.6 var(--sans); white-space: nowrap; letter-spacing: 0;
}
.part svg, .ti { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.part-model { color: var(--green); }
.part-plan { color: var(--ink); }
.part-schedule { color: var(--orange); }
.ti { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.ti-model { color: var(--green); }
.ti-plan { color: var(--ink); }
.ti-schedule { color: var(--orange); }
/* (c) the applications: a plain tag */
.app-tag { display: block; font: 700 11px/1.6 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--green); margin-bottom: 2px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  height: 60px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  font: 600 18px/1 var(--sans); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap;
}
.wordmark svg { width: 24px; height: 24px; fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; }
.wordmark .dot { color: var(--green); }
.topbar nav { display: flex; gap: 22px; font-size: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; flex: 0 1 auto; min-width: 0; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { text-decoration: none; white-space: nowrap; color: var(--ink-2); padding: 6px 0; }
.topbar nav a:hover { color: var(--green); }
/* when the section links overflow, the scrolled-off ends fade out (app.js sets the classes from the scroll position) */
.topbar nav.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.topbar nav.fade-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px); mask-image: linear-gradient(90deg, transparent, #000 32px); }
.topbar nav.fade-l.fade-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.nav-paper { flex: none; border-left: 1px solid var(--line); padding-left: 22px; font: 600 14px/1.4 var(--sans); text-decoration: none; white-space: nowrap; color: var(--ink-2); }
.nav-paper:hover { color: var(--green); }

/* ---------------------------------------------------------------- hero */
.hero { padding: 56px 0 44px; }
.eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font: 700 11px/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2);
  margin: 0 0 22px;
}
.eyebrow .mark { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.eyebrow .sep { color: var(--line-2); }
.eyebrow .tag { color: var(--orange); }
.hero h1 {
  font-size: clamp(64px, 10vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
}
.project-subtitle { font: 400 clamp(22px, 3vw, 34px)/1.2 var(--serif); letter-spacing: -0.01em; color: var(--ink-2); margin: 0 0 30px; }
.thesis {
  font: 400 clamp(20px, 2.3vw, 28px)/1.35 var(--serif);
  max-width: 34em;
  margin: 0 0 18px;
}
.hero-links { margin: 0; }
.paper-link {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 16px/1.4 var(--sans); color: var(--green); text-decoration: none;
  border-bottom: 2px solid var(--green); padding-bottom: 1px;
}
.paper-link:hover { color: var(--ink); border-color: var(--ink); }

/* ---------------------------------------------------------------- sections */
.section { padding: 64px 0 56px; border-top: 1px solid var(--line); }
.section h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 16px; max-width: 26em; }
.section h2 code { font-size: 0.75em; vertical-align: 2px; }
.lede { font-size: 17px; color: var(--muted); max-width: 78ch; margin-bottom: 32px; }
.lede code { font-size: 0.88em; }
.lede em { color: var(--ink-2); }
.lede strong { color: var(--ink); }
.figure-sub { max-width: 100ch; font-size: 16px; line-height: 1.6; margin-bottom: 22px; }
.figure-sub .part { font-size: 0.85em; }
.takeaway {
  border-left: 3px solid var(--green); padding: 12px 0 12px 22px; margin: 32px 0 0;
  max-width: 84ch; font-size: 17px; line-height: 1.55; color: var(--ink-2);
}
.takeaway strong { color: var(--ink); }
.takeaway.small { font-size: 15px; margin-top: 20px; }

/* ---------------------------------------------------------------- the two statements (the problem, the resolution): figure-like type */
.statement {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(26px, 3.3vw, 42px); line-height: 1.25; letter-spacing: -0.015em;
  max-width: 30em; margin: 4px 0 30px; color: var(--ink);
}
.st { margin: 0; }
.st-marks { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3em 0.45em; padding-left: 1.5em; margin: 0.25em 0 0.6em; }
.st-marks .vary { border-bottom-width: 3px; font-weight: 400; letter-spacing: 0.05em; }
.st-item { white-space: nowrap; color: var(--muted); }
.st-and { color: var(--muted); }
.st-and { font-size: 0.72em; font-family: var(--sans); }
.st-marks .part.big { font: 400 0.62em/1.5 var(--sans); padding: 0.12em 0.7em 0.12em 0.55em; gap: 0.5em; border-width: 2px; border-radius: 6px; vertical-align: 0.15em; }
.st-marks .part.big svg { width: 1.1em; height: 1.1em; stroke-width: 1.6; }
.st-lead { font: 400 clamp(18px, 2vw, 24px)/1.45 var(--serif); color: var(--ink-2); margin: 0; max-width: 44em; }
.st-lead .vary { font-weight: 600; }
.statement-green .st { color: var(--ink); }
.st-small { font-size: 0.7em; color: var(--green); margin-top: 0.4em; }
.statement-green .st-small { color: var(--green); }
.resolution-body { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.resolution-body > p { max-width: 84ch; }
.resolution-body .part { font-size: 0.85em; vertical-align: 2px; }
.resolution-code {
  margin: 18px 0 0; padding: 16px 20px; border-radius: var(--radius); overflow-x: auto;
  background: var(--code-bg); color: var(--code-fg); font: 13px/1.62 var(--mono); tab-size: 4;
}

/* ---------------------------------------------------------------- the maps (the evidence): wide figures, horizontal scroll if needed */
#maps .bleed { width: min(1600px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.maps-hint { display: none; margin: -20px 0 24px; } /* shown where the figures scroll sideways */
.map-figure { margin: 0 0 40px; }
.map-head { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.map-head .vary { font-size: 15px; }
.plot-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.plot-scroll img { display: block; width: 100%; min-width: 640px; height: auto; background: #fff; }
.plot-wide img { min-width: 1100px; } /* fits the bleed at 1280 px and above (1184 / 1344 px); narrower screens scroll it */
.map-figure figcaption { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 120ch; }
.map-figure figcaption strong { color: var(--ink); }

/* ---------------------------------------------------------------- the three cards: problem / elimination plan / GPU schedule
   (the class names card-model / part-model / ti-model keep the older word; the page text says "problem") */
.cards-figure { margin: 0; position: relative; }
.cards-figure > figcaption { font-size: 14px; line-height: 1.55; color: var(--muted); margin-top: 12px; max-width: 92ch; }
/* The cards follow the paper's Fig. 1 (paper/figures/concept_build.py): card widths 4.30 : 5.60 : 7.88, a numbered
   circle before a bold sans title, an italic serif subtitle, plan minis 2 x 2, schedule minis 2 x 3 with the state
   legend "waiting / running / done" in the schedule card's header. */
.cards {
  display: grid;
  grid-template-columns: minmax(0, 4.3fr) minmax(0, 5.6fr) minmax(0, 7.88fr);
}
.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line-2);
  padding: 14px 14px 14px;
  display: flex; flex-direction: column; min-width: 0;
}
.card + .card { margin-left: -1px; }
.card-title {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font: 700 18px/1.3 var(--sans); letter-spacing: 0; margin: 0 0 10px;
}
.card-title small { font: italic 13px/1.4 var(--serif); color: var(--muted); flex-basis: 100%; margin-top: -3px; }
.card-num {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 19px; height: 19px; border-radius: 50%; background: var(--ink); color: var(--white);
  font: 700 11.5px/1 var(--mono);
}
/* the state legend: a hollow, a solid and a tinted box in the plan colour (the tree blue in the card) */
.state-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-left: auto; font: 400 12px/1.3 var(--sans); color: var(--muted); --plan: var(--plan-tree); }
.state-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.state-box { display: inline-block; width: 13px; height: 10px; border-radius: 2px; border: 1.2px solid var(--plan); background: var(--white); }
.state-box.running { background: var(--plan); }
.state-box.done { background: color-mix(in srgb, var(--plan) 30%, white); border-color: color-mix(in srgb, var(--plan) 55%, white); }

/* problem card (.card-model): the humanoid, the math labels of one joint, the relation and two muted lines */
/* the humanoid fills the height the schedule card leaves (the cards share one row), as the paper scales it to the card */
.model-svg { display: block; width: 100%; max-width: 236px; height: auto; flex: 1 1 0; min-height: 150px; max-height: 300px; margin: 2px auto 0; }
.card-model .links path { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.card-model .head { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.card-model .joints circle { fill: var(--white); stroke: var(--green); stroke-width: 2.4; }
.card-model .residual path { stroke: var(--orange); stroke-width: 1.6; fill: none; }
.card-model .residual circle { fill: none; stroke: var(--orange); stroke-width: 1.6; }
.card-model .residual text { font: italic 13px var(--serif); fill: var(--orange); }
.card-model .labels text { font: italic 16px var(--serif); fill: var(--ink); }
.card-model .sub { font-size: 11px; }
.model-relation { font: italic 15.5px/1.3 var(--serif); color: var(--ink); text-align: center; margin: 10px 0 4px; white-space: nowrap; }
.model-relation sub { font-size: 0.7em; line-height: 0; font-style: normal; }
.model-relation sub i { font-style: italic; }
.model-muted { font-size: 12px; line-height: 1.4; letter-spacing: -0.01em; color: var(--muted); text-align: center; margin: 0; }
.model-muted i { font-family: var(--serif); font-size: 1.08em; }

/* plan and schedule minis, shared with the explorer panels through .fsvg */
.minis { display: grid; gap: 8px 10px; }
.minis-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.minis-sched { grid-template-columns: repeat(3, minmax(0, 1fr)); --plan: var(--plan-tree); } /* S-C show the tree plan; F sets its own */
.mini { margin: 0; min-width: 0; }
/* name and one-line sub-caption stay on one line each (as in the paper), so the drawings of a row align */
.mini figcaption { font: 700 12.5px/1.3 var(--sans); letter-spacing: -0.01em; color: var(--ink); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.mini figcaption .sw { margin: 0 5px 0 0; }
.mini figcaption .lt { font-size: 12px; }
.mini svg { width: 100%; height: auto; display: block; background: var(--paper); border-radius: 3px; margin: 3px 0 3px; }
.mini p { font-size: 11.5px; line-height: 1.35; letter-spacing: -0.01em; color: var(--muted); margin: 0; white-space: nowrap; }

/* front-program drawings: colour = the plan (--plan), state = fill (hollow waiting, solid running, tinted done);
   a front's number = the step at which the schedule processes it, coloured with its state */
.fsvg .node rect { fill: var(--white); stroke: var(--plan); stroke-width: 1.3; transition: fill 0.25s, stroke 0.25s; }
.fsvg .node.done rect { fill: color-mix(in srgb, var(--plan) 30%, white); stroke: color-mix(in srgb, var(--plan) 55%, white); }
.fsvg .node.active rect { fill: var(--plan); stroke: var(--plan); }
.fsvg .node text { font: 600 14.5px var(--sans); fill: var(--plan); pointer-events: none; transition: fill 0.25s; }
.fsvg .node.done text { fill: var(--ink-2); }
.fsvg .node.active text { fill: #fff; }
.fsvg .edge { stroke: var(--line-2); stroke-width: 1.1; fill: none; }
/* a tile block is a hull (solid when running); a block of k instances is one hull drawn as a stack */
.fsvg .hull { fill: none; stroke: color-mix(in srgb, var(--ink-2) 70%, var(--paper)); stroke-width: 1.3; transition: stroke 0.25s; }
.fsvg .hull.active { stroke: var(--ink-2); }
.fsvg .hull.all { fill: var(--paper); stroke: var(--ink-2); stroke-width: 1.4; }
.fsvg .hull.stack { fill: var(--paper); stroke: color-mix(in srgb, var(--ink-2) 55%, var(--paper)); stroke-width: 1.2; }
/* a thread is a thin dashed line through the fronts it visits, in order */
.fsvg .walk { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 3 2.4; stroke-linejoin: round; }
.fsvg .seps line { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 3; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.two-col h3 { font-size: 20px; margin-bottom: 10px; }
.two-col p { font-size: 15px; color: var(--ink-2); margin: 0; }

/* ---------------------------------------------------------------- code panel (collapsed under the cards) */
.api-details { margin-top: 36px; }
.api-details summary { font: 600 15px/1.4 var(--sans); cursor: pointer; }
.api-details > p { max-width: 88ch; color: var(--muted); font-size: 14px; margin: 12px 0 16px; }
.code-panel { background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius); overflow: hidden; }
.tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.tabs [role="tab"] {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 14px 18px; color: #b9c2ba; font: 500 13.5px var(--sans);
}
.tabs [role="tab"]:hover { color: var(--code-fg); }
.tabs [role="tab"][aria-selected="true"] { color: var(--code-fg); border-bottom-color: var(--green-2); }
.tabs [role="tab"]:focus-visible { outline-offset: -3px; }
.tabs .tab-short { display: none; } /* the short labels replace the long ones on a phone */
.code-body pre { margin: 0; padding: 22px 24px 20px; overflow-x: auto; font: 13px/1.62 var(--mono); tab-size: 4; }
.code-body pre[hidden] { display: none; }
.tok-c { color: #9aa79c; }
.tok-s { color: #d5e6b0; }
.tok-d { color: #e6bf9e; }
.tok-k { color: #8fd0b5; }
.tok-api { color: #cfe8d8; font-weight: 600; }
.code-foot { padding: 14px 24px 16px; margin: 0; font-size: 13.5px; color: #b9c2ba; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.code-foot code { background: rgba(255, 255, 255, 0.1); color: var(--code-fg); }

/* ---------------------------------------------------------------- explorer: plans x schedules */
.matrix { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px 20px; }
.matrix-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.row-title { font: 600 15px/1.4 var(--sans); margin: 0 0 10px; }
.row-title .dim { font-weight: 400; font-size: 14px; }
.row-title output { font-weight: 600; color: var(--ink); }
.row-title .state-legend { margin-left: 14px; vertical-align: 1px; }
.matrix-head .row-title { margin: 0; }
.playbar { display: flex; align-items: center; gap: 6px; }
.playbar button {
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--white); font: 600 13px/1 var(--sans); min-width: 36px;
}
.playbar button:hover { background: var(--paper-2); }
.playbar button:disabled { opacity: 0.4; cursor: default; }
.playbar #x-play { min-width: 66px; }
.playbar #x-play[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.playbar #x-demo { min-width: 64px; margin-right: 6px; }
.playbar #x-demo[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--white); }
.playbar output { font: 12.5px var(--mono); color: var(--ink-2); margin-left: 6px; white-space: nowrap; }
.plan-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 26px; }
.sched-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.panel {
  display: flex; flex-direction: column; min-width: 0; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 9px 9px;
  color: var(--ink);
}
.plan-panel { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.plan-panel:hover { border-color: var(--line-2); }
.plan-panel[aria-pressed="true"] { border-color: var(--plan); box-shadow: inset 0 0 0 1.5px var(--plan); }
.panel-head { display: flex; align-items: center; gap: 2px; font: 600 12.5px/1.3 var(--sans); min-height: 1.3em; }
.panel-head .sw { width: 11px; height: 11px; margin-right: 6px; }
.panel-head .lt { font-size: 12px; }
.panel-name { flex: 1 1 auto; min-width: 0; }
.panel-step { font: 11px var(--mono); color: var(--muted); flex: none; }
.panel svg { width: 100%; height: auto; display: block; margin: 5px 0 4px; }
.panel-foot { font-size: 11.5px; line-height: 1.35; color: var(--muted); margin: 0; }
.plan-panel[aria-pressed="true"] .panel-foot { color: var(--ink-2); }

/* ---------------------------------------------------------------- the named-libraries table */
.lib-table { min-width: 900px; font-size: 14px; }
.lib-table tbody th { white-space: nowrap; }
.lib-table td.c-plan, .lib-table td.c-sched { white-space: nowrap; }
.lib-table td.c-plan .sw { width: 11px; height: 11px; }
.lib-table td.c-note { color: var(--muted); font-size: 13.5px; min-width: 20em; }
.lib-table tbody th[scope="row"] { white-space: normal; min-width: 14em; }
.lib-table .group th { background: var(--paper-2); color: var(--ink); font: 600 13px/1.4 var(--sans); padding: 7px 10px; border-bottom: 1px solid var(--line-2); }
.lib-table .branch-row th, .lib-table .branch-row td { background: var(--green-3); color: var(--ink); white-space: normal; border-bottom: 0; }
.lib-table .branch-row td.c-sched { white-space: nowrap; }
.lib-table .branch-row .lt { margin-right: 3px; }

/* ---------------------------------------------------------------- applications */
.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.app { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 6px; min-width: 0; }
.app h3 { font-size: 21px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.app dd details { margin-top: 6px; }
.app dd summary { font: 600 12.5px var(--sans); cursor: pointer; color: var(--ink-2); }
.app dd details p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.app dl { margin: 0; }
.app dt { font: 700 11px/1.5 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); margin-top: 12px; }
.app dd { margin: 3px 0 12px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.app dd code { font-size: 0.88em; }
.app dd .sw { width: 10px; height: 10px; margin-right: 4px; }
.app dd .vary { font-size: 15px; }

/* ---------------------------------------------------------------- results */
.protocol { max-width: 100ch; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin-bottom: 8px; }
.protocol code { font-size: 0.88em; }
.plot-hint { margin-bottom: 24px; }
.result-block {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px 18px; margin: 0 0 20px; scroll-margin-top: 80px;
}
.result-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.result-heading h3 { display: flex; align-items: center; gap: 12px; font: 600 19px/1.3 var(--sans); letter-spacing: 0; margin-right: 4px; }
.result-heading .q {
  font: 700 12px/1 var(--mono); letter-spacing: 0.06em; color: var(--white); background: var(--green);
  padding: 5px 8px; border-radius: 3px; flex: none;
}
.result-block > p { max-width: 100ch; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.result-block > p:last-child { margin-bottom: 0; }
.badge {
  display: inline-block; vertical-align: middle; white-space: nowrap; margin-left: 8px;
  font: 700 10px/1.7 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0 7px; border-radius: 999px; border: 1px solid;
}
.badge.draft { color: var(--orange); border-color: var(--orange); background: #fbf1e8; }
.badge[hidden] { display: none; }
.lede .badge, .result-block p .badge, .repro .badge { vertical-align: 1px; }

.result-plot { margin: 20px 0 8px; }
.result-plot figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.result-plot figcaption strong { color: var(--ink); }
.counts-details { margin-top: 8px; }
.counts-details summary { font: 600 12.5px var(--sans); cursor: pointer; color: var(--ink-2); }
.counts { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.counts li { font-size: 13px; line-height: 1.5; color: var(--ink-2); border-top: 1px dashed var(--line); padding-top: 6px; }
.counts li b { color: var(--ink); }
.counts code { font-size: 11.5px; padding: 0 4px; }

.table-scroll { overflow-x: auto; margin: 16px 0 12px; }
.result-table { width: 100%; min-width: 640px; border-collapse: collapse; text-align: left; font-size: 14px; }
.result-table thead th { font: 600 12px/1.4 var(--sans); color: var(--muted); border-bottom: 1px solid var(--line-2); padding: 8px 10px; }
.result-table td, .result-table tbody th { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.result-table tbody th { font-weight: 600; color: var(--ink); }
.result-table td { color: var(--ink-2); }
.result-table code { white-space: nowrap; font-size: 12px; }
.choice-table td:nth-child(2), .choice-table thead th:nth-child(2), .choice-table td:nth-child(5), .choice-table thead th:nth-child(5) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.choice-table td.cell-note { font-size: 13px; color: var(--muted); min-width: 14em; }
.cost-table td:nth-child(n+2), .cost-table thead th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-table td:nth-child(2) code { white-space: nowrap; }
.cost-rows .cost-table td:nth-child(2), .cost-rows .cost-table thead th:nth-child(2) { text-align: left; } /* the configuration code starts in view */
.cost-rows { margin: 4px 0 16px; }
.cost-rows summary { font: 600 13.5px var(--sans); cursor: pointer; color: var(--ink-2); }
.cost-rows .result-table { font-size: 13px; }
.findings { gap: 32px; margin-top: 8px; }
.findings p { font-size: 14.5px; line-height: 1.6; }
.empty { color: var(--muted); font-style: italic; }
.error { color: var(--orange); font-size: 14px; }

/* ---------------------------------------------------------------- scope */
.limits { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.limits li { border-top: 1px solid var(--line); padding: 16px 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.limits li strong { display: block; color: var(--ink); margin-bottom: 4px; }
.limits code { font-size: 0.88em; }
.repro { margin: 32px 0 0; padding: 20px 24px 8px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: var(--radius); }
.repro h3 { font: 600 16px/1.35 var(--sans); margin: 0 0 8px; }
.repro p { font-size: 14px; line-height: 1.6; color: var(--ink-2); max-width: 100ch; }
.repro code { font-size: 0.88em; }

/* ---------------------------------------------------------------- footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: baseline; justify-content: space-between; }
footer p { margin: 0; }
footer a { font-size: 13px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1060px) {
  .sched-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card + .card { margin-left: 0; margin-top: 24px; }
  .model-svg { flex: 0 0 auto; height: 230px; width: auto; max-width: 100%; } /* stacked cards: the humanoid at its own height */
  .minis-plan { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .minis-sched { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .apps { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 860px) {
  .two-col, .limits { grid-template-columns: minmax(0, 1fr); }
  .two-col { gap: 24px; }
  .section { padding: 48px 0 40px; }
  .result-block { padding: 20px 18px 14px; }
  .st-marks { padding-left: 0.8em; }
  /* the maps and the baseline plot scroll sideways at a size where their labels stay legible (about 1.5-2x the SVG) */
  .plot-wide img { min-width: 1300px; }
  #map-gpus .plot-scroll img, #q3 .plot-scroll img { min-width: 1000px; }
  .maps-hint { display: block; }
  /* the libraries table fits the screen: no fixed table width, a narrower note column */
  .lib-table { min-width: 0; }
  .lib-table td.c-note { min-width: 14em; }
}
@media (max-width: 700px) {
  /* below a tablet the explorer's plan row and schedule row no longer share the screen in one line each */
  .plan-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sched-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-row .fsvg .node text { font-size: 15px; } /* the panels are half as wide, so the frame numbers keep their size on screen */
}
@media (max-width: 600px) {
  html { scroll-padding-top: 108px; }
  /* two rows: wordmark and the paper link, then the section links (scrolling, faded at the ends); the top padding clears
     the fixed build stamp in the corner */
  .topbar { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 18px; padding-bottom: 2px; }
  .topbar nav { order: 3; flex: 1 1 100%; gap: 16px; font-size: 13px; padding: 0; }
  .nav-paper { order: 2; margin-left: auto; padding-left: 0; border-left: 0; font-size: 13px; }
  .eyebrow .sep { display: none; }
  .key-group { flex-basis: 100%; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tabs [role="tab"] { flex: none; }
  .tabs .tab-long { display: none; }
  .tabs .tab-short { display: inline; }
  /* the playbar: compact buttons, and the readout may wrap under them */
  .playbar { flex-wrap: wrap; }
  .playbar button { padding: 7px 9px; }
  .playbar #x-play { min-width: 56px; }
  .playbar #x-demo { min-width: 54px; margin-right: 2px; }
  /* the libraries table becomes a list: name, plan and schedule on one line, the note on the next; nothing scrolls */
  .lib-table, .lib-table thead, .lib-table tbody { display: block; min-width: 0; width: 100%; }
  .lib-table tr { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 2px 10px; align-items: start; border-bottom: 1px solid var(--line); padding: 9px 0; }
  .lib-table thead tr { padding: 0 0 6px; border-bottom-color: var(--line-2); }
  .lib-table thead th:nth-child(4) { display: none; }
  .lib-table tr.group { display: block; padding: 0; margin-top: 10px; border-bottom: 1px solid var(--line-2); }
  .lib-table tbody th, .lib-table tbody td, .lib-table thead th { border-bottom: 0; padding: 0; }
  .lib-table tbody tr.group th { display: block; padding: 6px 8px; }
  .lib-table tbody th[scope="row"] { min-width: 0; }
  .lib-table td.c-plan, .lib-table td.c-sched { white-space: normal; }
  .lib-table td.c-note { grid-column: 1 / -1; min-width: 0; font-size: 13px; }
  .lib-table .branch-row { background: var(--green-3); padding-left: 8px; padding-right: 8px; border-bottom: 0; }
  .hero { padding-top: 36px; }
  .hero h1 { margin-bottom: 8px; }
  .statement { font-size: 26px; }
  .st-marks { padding-left: 0.5em; }
  .card { padding: 14px 12px 12px; }
  .minis-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .minis-sched { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix { padding: 14px 12px 14px; }
  .matrix-head { flex-direction: column; align-items: flex-start; }
  .code-body pre { font-size: 12px; padding: 16px; }
  .tabs [role="tab"] { padding: 12px 12px; font-size: 13px; }
  .lib-table { font-size: 13px; }
  .result-heading h3 { font-size: 17px; }
  .result-block { padding: 16px 14px 12px; }
  .app { padding: 16px 16px 4px; }
  .repro { padding: 16px 16px 6px; }
  footer { flex-direction: column; }
}
@media (max-width: 340px) {
  .plan-row, .sched-row { grid-template-columns: minmax(0, 1fr); }
}

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

@media print {
  .topbar, .skip, .playbar { display: none; }
  body { background: #fff; }
  .section { break-inside: avoid; }
}

.build-version{position:fixed;top:4px;left:6px;font:10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;color:#9a9a90;z-index:60;pointer-events:none}

/* ---- problem and solution cards, 'Branch' section, compact evidence and table (review v15, 22:10 UTC) ---- */
.cards-top { border-top: 0; padding: 18px 0 0; }
#problem.cards-top { padding-top: 8px; }
#solution.cards-top { padding-bottom: 8px; }
.card-band { border: 1px solid var(--line); border-radius: 16px; padding: 28px 34px 26px; }
.card-problem { background: #f6efe4; border-color: #e6d9c6; }
.card-solution { background: #edf5ef; border-color: #cfe1d4; }
.card-band .eyebrow { margin-bottom: 14px; }
.card-band .statement { margin-bottom: 0; font-size: clamp(24px, 2.9vw, 36px); }
.card-band .st-lead { margin-top: 16px; font-size: clamp(16px, 1.6vw, 20px); }
.card-solution .statement { font-size: clamp(24px, 2.9vw, 36px); }
.card-solution .st-small { font-size: 0.66em; }
#explore { padding-top: 40px; }
#explore .resolution-body { margin-bottom: 26px; }
#explore .resolution-body p { max-width: 78ch; }
#maps .plot-wide img, #maps .plot-scroll img { min-width: 0 !important; max-width: 1000px; margin: 0 auto; }
#maps .plot-scroll { background: transparent; }
#libraries table { font-size: 14px; }
#libraries th, #libraries td { padding: 4px 10px; line-height: 1.3; }
#libraries .c-note { font-size: 12.5px; color: var(--muted); }
@media (max-width: 600px) {
  .card-band { padding: 20px 18px 18px; border-radius: 12px; }
}

/* ---- 'Branch' paragraph: dotted-underlined phrase opens the definitions (review v21) ---- */
.defined { font: inherit; color: inherit; background: none; border: 0; padding: 0; display: inline; text-align: inherit; cursor: pointer; text-decoration: underline dotted var(--ink-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.defined:hover { color: var(--green); }
.defs { margin: 10px 0 0; max-width: 78ch; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; background: var(--paper); }
.defs summary { cursor: pointer; font: 600 14px/1.5 var(--sans); color: var(--ink-2); }
.defs[open] summary { margin-bottom: 6px; }
.defs dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14.5px; line-height: 1.45; }
.defs dt { font-weight: 600; color: var(--ink); }
.defs dd { margin: 0; color: var(--ink-2); }
@media (max-width: 600px) { .defs dl { grid-template-columns: 1fr; gap: 2px 0; } .defs dd { margin-bottom: 6px; } }

/* ---- W13 visual QA of the cards pass: narrow-screen fixes ---- */
@media (max-width: 860px) {
  /* the 1000 px cap above reset min-width to 0 at every width, so on a narrow screen the maps shrank to the column
     (752 px on a tablet, 356 px on a phone) while the hint still promised sideways scrolling: a legible, scrolling width */
  #maps .plot-wide img, #maps .plot-scroll img { min-width: 1000px !important; }
}
@media (max-width: 600px) {
  /* "#libraries th, #libraries td { padding: 4px 10px }" outranks the phone list's padding: 0 and made the grid rows
     372 px wide in a 358 px column (sideways scroll, clipped schedule column); the group headers keep their own padding */
  #libraries th, #libraries td { padding: 0; }
  #libraries tbody tr.group th { padding: 6px 8px; }
  /* "#libraries table { font-size: 14px }" likewise outranked the phone size (13px); at 14px the Branch row's six
     schedule letters (97 px) overran their 85 px column and the list scrolled by 4 px */
  #libraries table { font-size: 13px; }
  .lib-table .branch-row .lt { margin: 0 2px 0 1px; }
  /* nowrap plan / schedule labels overlapped the next column on a phone ("chronological frames" over "—"); the Branch
     row keeps its four plans one per line */
  .lib-table tr:not(.branch-row) td.c-plan .ki, .lib-table td.c-sched .ki { white-space: normal; }
}

/* ---- figures follow the text column (review v24): no screen-edge bleed, captions in the same measure ---- */
#maps .bleed, .bleed { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; padding-inline: 0; }
.map-figure { max-width: none; }
.map-figure figcaption, .map-head { max-width: none; }
/* captions BEFORE the plots (review v27): the tall GPU figure otherwise pushes its caption off screen */
.map-figure { display: flex; flex-direction: column; }
.map-figure .map-head { order: 0; }
.map-figure figcaption { order: 1; margin: 0 0 12px; }
.map-figure .plot-scroll { order: 2; }
#maps .plot-wide img, #maps .plot-scroll img { max-width: 100%; }
#maps .plot-scroll { border: 1px solid var(--line); background: var(--paper); }
#q3 .plot-scroll, #results .plot-scroll { max-width: 100%; }
