/* Figures for "Agent Harnesses Need an eBPF".
   Light only, like the rest of the site. Colors by job:
   rust = a static default / vanilla setup, cobalt = ext, ochre = over budget,
   blue = untrusted policy code, slate = protected host mechanism.
   Text always wears ink tokens; color goes on marks, swatches and borders. */

:root {
  --xf-ext: #3451b2;
  --xf-ext-soft: #eaedf8;
  --xf-def: #b5532c;
  --xf-def-soft: #f6e8e0;
  --xf-amb: #cc961c;
  --xf-amb-soft: #f8efd8;
  --xf-pol: #4b6c9b;
  --xf-pol-soft: #e9eef5;
  --xf-host: #3f443e;
  --xf-host-soft: #eef0ec;
  --xf-card: #ffffff;
  --xf-line: #e3e1da;
  --xf-grid: #eeece6;
  --xf-faint: #a29d92;
  --xf-ext2: #93a2d8;
  --xf-bg: #fcfbf8;
  --xf-wide: min(880px, calc(100vw - 40px));
}
.xf {
  margin: 44px 0;
  font: 14px/1.5 var(--sans);
  color: var(--ink);
}
.xf.xf-wide {
  width: var(--xf-wide);
  margin-left: calc((100% - var(--xf-wide)) / 2);
}
.xf *, .xf *::before, .xf *::after { box-sizing: border-box; }
.xf p { margin: 0; }
.xf ol, .xf ul { margin-bottom: 0; }
.xf li { padding-left: 0; }
.xf li + li { margin-top: 0; }
.xf code, .xf .mono { font-family: var(--mono); font-size: 12px; }
.xf :not(pre) > code { padding: 0; background: none; }

/* Header and caption */
.xf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 14px; }
.xf-num { color: var(--accent); font-size: 11px; font-weight: 650; }
.xf-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.xf figcaption, .xf .xf-cap { margin-top: 14px; color: var(--muted); font: 13px/1.55 var(--sans); max-width: 760px; }

/* Panels and layout */
.xf-panel { background: var(--xf-card); border: 1px solid var(--xf-line); border-radius: 8px; padding: 18px; min-width: 0; }
.xf-panel-title { margin-bottom: 12px; font-size: 13px; font-weight: 650; }
.xf-panel-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.xf-eyebrow { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10.5px; font-weight: 650; }
.xf-cols { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xf-cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xf-cols.c-5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.xf-cols.c-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
@media (max-width: 820px) {
  .xf-cols, .xf-cols.c3, .xf-cols.c-5-7, .xf-cols.c-7-5 { grid-template-columns: minmax(0, 1fr); }
}

/* Small parts */
.xf .xf-pill, .xf-pill { display: inline-block; padding: 1px 7px; border: 1px solid var(--xf-line); border-radius: 999px; background: #f6f5f1; font: 11.5px/1.6 var(--mono); white-space: nowrap; }
.xf .xf-pill.pol { border-color: #c4d3e8; background: var(--xf-pol-soft); }
.xf .xf-pill.ext { border-color: #bfc8e4; background: var(--xf-ext-soft); }
.xf .xf-pill.def { border-color: #e9c9b9; background: var(--xf-def-soft); }
.xf-badge { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px 3px 8px; border-left: 3px solid var(--xf-ext); background: var(--xf-ext-soft); border-radius: 0 4px 4px 0; font-size: 12.5px; font-weight: 600; }
.xf-badge.def { border-left-color: var(--xf-def); background: var(--xf-def-soft); }
.xf-badge.amb { border-left-color: var(--xf-amb); background: var(--xf-amb-soft); }
.xf-badge.neutral { border-left-color: var(--xf-faint); background: #f1f0ec; }
.xf-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; background: var(--xf-faint); flex-shrink: 0; }
.xf-sw.ext { background: var(--xf-ext); }
.xf-sw.def { background: var(--xf-def); }
.xf-sw.amb { background: var(--xf-amb); }
.xf-sw.pol { background: var(--xf-pol); }
.xf-sw.host { background: var(--xf-host); }
.xf-sw.line { height: 2px; width: 14px; border-radius: 1px; vertical-align: 3px; }
.xf-sw.dot { border-radius: 50%; }
.xf-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 12px; }
.xf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.xf-muted { color: var(--muted); }
.xf-num-strong { font-variant-numeric: tabular-nums; font-weight: 650; }
.xf-ok::before, .xf-no::before { display: inline-block; width: 1.1em; font-weight: 700; }
.xf-ok::before { content: "✓"; color: var(--xf-ext); }
.xf-no::before { content: "✕"; color: var(--xf-def); }

/* Before / after rows used in several cards */
.xf-vs { display: grid; gap: 6px; margin-top: 10px; font-size: 12.5px; line-height: 1.45; }
.xf-vs p { padding: 6px 9px; border-radius: 5px; }
.xf-vs .def { background: var(--xf-def-soft); }
.xf-vs .ext { background: var(--xf-ext-soft); }
.xf-vs b { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; font-size: 10.5px; }
.xf-vs .def b::before, .xf-vs .ext b::before { content: ""; width: 8px; height: 8px; border-radius: 2px; }
.xf-vs .def b::before { background: var(--xf-def); }
.xf-vs .ext b::before { background: var(--xf-ext); }

/* Tooltip */
.xf-tip { position: fixed; z-index: 50; max-width: 280px; padding: 7px 10px; border-radius: 6px; background: #262a26; color: #fff; font: 12px/1.45 var(--sans); pointer-events: none; opacity: 0; transition: opacity .08s; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.xf-tip.on { opacity: 1; }
.xf-tip b { font-weight: 650; }
[data-tip] { cursor: default; }
.xf svg { display: block; width: 100%; height: auto; overflow: visible; }
.xf svg text { font-family: var(--sans); fill: var(--ink); }
.xf svg .ax { font-size: 11px; fill: var(--muted); }
.xf svg .gr { stroke: var(--xf-grid); stroke-width: 1; }
.xf svg .bl { stroke: #c9c7bf; stroke-width: 1; }
.xf svg text.halo { paint-order: stroke; stroke: var(--xf-card); stroke-width: 4px; stroke-linejoin: round; }

/* ---------------------------------------------------------------- Figure 1 */
.xf-pipe { position: relative; padding: 16px 16px 14px; background: var(--xf-card); border: 1px solid var(--xf-line); border-radius: 8px; }
.xf-nodes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; margin: 0; padding: 0; list-style: none; }
.xf-nodes li { position: relative; margin: 0; padding: 0; }
.xf-nodes li + li::before { content: ""; position: absolute; top: 26px; left: -19px; width: 16px; height: 2px; background: #b9b7ae; }
.xf-nodes li + li::after { content: ""; position: absolute; top: 22px; left: -6px; border: 5px solid transparent; border-left: 6px solid #b9b7ae; }
.xf-node { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; height: 100%; padding: 9px 10px 10px; border: 1px solid var(--xf-line); border-radius: 7px; background: #faf9f6; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s; }
.xf-node:hover, .xf-node.on { border-color: var(--xf-ext); background: var(--xf-ext-soft); }
.xf-node .n, .xf-card .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.xf-node b { font-size: 13px; line-height: 1.25; }
.xf-node .xf-pill { font-size: 10.5px; }
.xf-loop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; margin-top: 6px; }
.xf-loop span { grid-column: 2 / 5; height: 18px; border: 1.5px solid #b9b7ae; border-top: 0; border-radius: 0 0 10px 10px; text-align: center; color: var(--muted); font-size: 11px; line-height: 1; }
.xf-loop span em { position: relative; top: 11px; padding: 0 8px; background: var(--xf-card); font-style: normal; }
.xf-rails { display: grid; gap: 6px; margin-top: 16px; }
.xf-rail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; padding: 6px 10px; border: 1px solid var(--xf-line); border-radius: 6px; background: #f6f5f1; color: inherit; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.xf-rail:hover, .xf-rail.on { border-color: var(--xf-ext); background: var(--xf-ext-soft); }
.xf-rail b { min-width: 128px; font-size: 12px; }
.xf-rail.static { cursor: default; }
.xf-rail.static:hover { border-color: var(--xf-line); background: #f6f5f1; }
.xf-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.xf-card { display: flex; flex-direction: column; padding: 14px; background: var(--xf-card); border: 1px solid var(--xf-line); border-radius: 8px; transition: border-color .12s, box-shadow .12s; }
.xf-card.on { border-color: var(--xf-ext); box-shadow: 0 0 0 1px var(--xf-ext); }
.xf-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 10px; font-size: 13.5px; font-weight: 650; }
.xf-card .viz { margin: 2px 0 2px; }
.xf-card .xf-vs { margin-top: auto; padding-top: 10px; }
.xf-card .xf-badge { align-self: flex-start; margin-top: 10px; }
@media (max-width: 900px) { .xf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .xf-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .xf-nodes li + li::before, .xf-nodes li + li::after { display: none; }
  .xf-nodes li:last-child { grid-column: 1 / -1; }
  .xf-loop { display: none; }
  .xf-cards { grid-template-columns: minmax(0, 1fr); }
}

/* Effort grid (card 2) */
.xf-effort { display: grid; grid-template-columns: 44px repeat(13, minmax(0, 1fr)); gap: 2px; align-items: center; font-size: 10.5px; color: var(--muted); }
.xf-effort .lv { padding-right: 4px; text-align: right; }
.xf-effort .c { height: 15px; border-radius: 2px; background: #f1f0eb; }
.xf-effort .c.win { background: var(--xf-host); }
.xf-effort .tick { height: 12px; text-align: center; font-size: 9.5px; }
.xf-effort-note { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* Context window bars (card 3) */
.xf-win { display: grid; gap: 7px; }
.xf-win-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.xf-win-track { position: relative; display: flex; gap: 2px; height: 20px; }
.xf-win-track .seg { height: 100%; border-radius: 3px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.xf-win-track .rules { background: #8b9196; }
.xf-win-track .read { background: var(--xf-def); }
.xf-win-track .trim { background: var(--xf-ext); }
.xf-win-track .free { background: repeating-linear-gradient(135deg, #f1f0eb 0 4px, #e8e6df 4px 6px); color: var(--muted); }
.xf-win-track .limit { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px solid var(--ink); }
.xf-win-track .limit.lbl::after { content: "200K"; position: absolute; top: -13px; left: -12px; font-size: 9.5px; color: var(--ink); }

/* Quote blocks */
.xf-quote { position: relative; margin: 0; padding: 10px 12px 10px 14px; border-left: 3px solid var(--xf-faint); background: #f6f5f1; border-radius: 0 6px 6px 0; font: italic 13px/1.5 var(--serif); }
.xf-quote.def { border-left-color: var(--xf-def); background: var(--xf-def-soft); }
.xf-quote.ext { border-left-color: var(--xf-ext); background: var(--xf-ext-soft); }
.xf-quote cite { display: block; margin-top: 5px; font: normal 11px/1.4 var(--sans); color: var(--muted); }

/* Flow steps (card 5) */
.xf-flow { display: grid; gap: 5px; font-size: 12px; }
.xf-flow .st { display: block; padding: 5px 8px; border: 1px solid var(--xf-line); border-radius: 5px; background: #faf9f6; }
.xf-flow .st.def { border-color: #e9c9b9; background: var(--xf-def-soft); }
.xf-flow .st.ext { border-color: #bfc8e4; background: var(--xf-ext-soft); }
.xf-flow .ar { padding-left: 14px; color: var(--xf-faint); font-size: 11px; line-height: 1; }
.xf-split { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

/* Gauge (card 6) */
.xf-gauge { display: grid; gap: 8px; font-size: 11.5px; }
.xf-gauge-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 8px; color: var(--muted); }
.xf-gauge-track { position: relative; height: 10px; border-radius: 5px; background: #ecebe5; }
.xf-gauge-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.xf-gauge-cap { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--ink); }

/* ---------------------------------------------------------------- Figure 2 */
.xf-bars { display: grid; gap: 10px; }
.xf-bar { display: grid; grid-template-columns: minmax(96px, 150px) minmax(0, 1fr); align-items: center; gap: 10px; font-size: 12.5px; }
.xf-bar .track { position: relative; height: 22px; }
.xf-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.xf-bar .val { position: absolute; top: 50%; transform: translate(6px, -50%); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xf-bar .ci { position: absolute; top: 5px; bottom: 5px; border: 1.5px solid var(--ink); border-top: 0; border-bottom: 0; }
.xf-bar .ci::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--ink); }
.xf .xf-code { margin: 0; padding: 12px 14px; overflow-x: auto; background: #f0eee8; border: 1px solid var(--xf-line); border-radius: 6px; font: 12px/1.6 var(--mono); white-space: pre; }
.xf .xf-code .hl { display: inline-block; min-width: 100%; margin: 0 -14px; padding: 0 14px; background: #f7e3b5; box-shadow: inset 3px 0 0 var(--xf-amb); }
.xf .xf-code .cm { color: #666c65; font-style: italic; }
.xf .xf-code .kw { color: #855033; font-weight: 600; }
.xf-gates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.xf-gate { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 9px 9px 10px; border: 1px solid var(--xf-line); border-radius: 6px; background: #faf9f6; font-size: 11.5px; line-height: 1.4; }
.xf-gate b { font-size: 12px; }
.xf-gate .verdict { font-weight: 650; font-size: 12px; }
.xf-gate.pass { border-top: 3px solid var(--xf-def); }
.xf-gate.block { border-top: 3px solid var(--xf-ext); background: var(--xf-ext-soft); border-color: #bfc8e4; }
.xf-gate .why { color: var(--muted); }
@media (max-width: 820px) { .xf-gates { grid-template-columns: repeat(2, minmax(0, 1fr)); } .xf-gate.block { grid-column: 1 / -1; } }
.xf .xf-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.xf .xf-table th, .xf .xf-table td { padding: 6px 8px; border-bottom: 1px solid var(--xf-grid); text-align: left; vertical-align: top; }
.xf .xf-table th { border-top: 1px solid var(--ink); font-weight: 650; }
.xf .xf-table td.r, .xf .xf-table th.r { text-align: right; }
.xf .xf-table tr.hi td { background: var(--xf-ext-soft); font-weight: 600; }
.xf .xf-tablewrap { overflow-x: auto; }

/* ---------------------------------------------------------------- Figure 3 */
.xf-stack { display: flex; flex-direction: column; gap: 0; }
.xf-stack .zone { padding: 12px; border-radius: 6px; font-size: 12.5px; }
.xf-stack .zone + .zone { margin-top: 8px; }
.xf-stack .zone h4 { margin: 0 0 6px; font: 650 11px/1.3 var(--sans); }
.xf-stack .editable { flex: 1; background: var(--xf-def-soft); border: 1px solid #e9c9b9; }
.xf-stack .policy { background: var(--xf-pol-soft); border: 1px solid #c4d3e8; }
.xf-stack .mech { background: var(--xf-host-soft); border: 1px solid #cfd3d7; }
.xf-stack .mech.thick { flex: 1; background: var(--xf-host); border-color: var(--xf-host); color: #fff; }
.xf-stack .mech.thick h4 { color: #fff; }
.xf-stack .chips { display: flex; flex-wrap: wrap; gap: 5px; }
.xf-stack .chip { padding: 2px 8px; border-radius: 4px; background: rgba(255,255,255,.75); border: 1px solid rgba(0,0,0,.08); font-size: 11.5px; }
.xf-stack .mech.thick .chip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color: #fff; }
.xf-stack .chip.leak { border: 1px dashed var(--xf-def); background: #fff; }
.xf-boundary { position: relative; margin: 10px 0 2px; height: 0; border-top: 2px solid var(--ink); }
.xf-boundary span { position: absolute; top: -9px; right: 0; padding: 0 0 0 8px; background: var(--xf-card); font-size: 10.5px; font-weight: 700; }
.xf-gatebar { margin: 8px 0; padding: 10px 12px; border-radius: 6px; background: var(--xf-ext-soft); border: 1.5px solid var(--xf-ext); font-size: 12.5px; }
.xf-gatebar h4 { margin: 0 0 4px; font: 650 11px/1.3 var(--sans); }
.xf-pins { display: grid; gap: 6px; margin-top: 10px; padding: 0; list-style: none; font-size: 12px; }
.xf-pins li { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 0; }
.xf-pins li::before { counter-increment: pin; content: counter(pin); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--xf-def); color: #fff; font-size: 10.5px; font-weight: 700; flex-shrink: 0; }
.xf-pins { counter-reset: pin; }

/* ---------------------------------------------------------------- Figure 4 */
.xf-funnel { display: grid; gap: 6px; justify-items: center; }
.xf-funnel .lvl { margin-inline: auto; width: 100%; padding: 8px 10px; border-radius: 6px; background: var(--xf-ext-soft); border: 1px solid #bfc8e4; font-size: 12px; line-height: 1.4; }
.xf-funnel .lvl:nth-child(2) { width: 94%; }
.xf-funnel .lvl:nth-child(3) { width: 88%; }
.xf-funnel .lvl:nth-child(4) { width: 82%; }
.xf-funnel .lvl b { display: block; font-size: 12.5px; }
.xf-funnel .in, .xf-funnel .out { text-align: center; font-size: 11.5px; color: var(--muted); }
.xf-funnel .in .xf-pill { margin-top: 2px; }
.xf-pyr { display: grid; gap: 4px; justify-items: center; }
.xf-pyr div { padding: 7px 10px; border-radius: 5px; text-align: center; font-size: 12px; line-height: 1.35; }
.xf-pyr .t1 { width: 100%; background: var(--xf-host); color: #fff; }
.xf-pyr .t2 { width: 80%; background: #66717c; color: #fff; }
.xf-pyr .t3 { width: 60%; background: var(--xf-pol); color: #fff; }
.xf-pyr .ar { padding: 0; color: var(--muted); font-size: 11px; }
.xf-cart { display: grid; gap: 6px; margin-top: 12px; }
.xf-cart .slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px dashed #b9b7ae; border-radius: 5px; font-size: 12px; }
.xf-loops { display: grid; gap: 8px; }
.xf-loopbox { padding: 10px 12px; border-radius: 6px; border: 1px solid var(--xf-line); font-size: 12px; line-height: 1.45; }
.xf-loopbox.inner { background: #faf9f6; }
.xf-loopbox.outer { background: var(--xf-pol-soft); border-color: #c4d3e8; }
.xf-loopbox b { display: block; margin-bottom: 3px; font-size: 12.5px; }
.xf-loopbox ol { margin: 4px 0 0; padding-left: 18px; }
.xf-loopbox li { margin: 2px 0; padding: 0; }
.xf-wall { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.xf-wall::before, .xf-wall::after { content: ""; flex: 1; border-top: 2px dashed #c9c7bf; }

/* ---------------------------------------------------------------- Figure 5 */
.xf-lanes { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1.15fr); gap: 0 10px; align-items: stretch; }
.xf-lane-h { padding: 10px 12px; border-radius: 8px 8px 0 0; font-size: 12.5px; font-weight: 650; }
.xf-lane-h small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.xf-lane-h.c { background: #f3e9e5; border: 1px solid #e9c9b9; border-bottom: 0; }
.xf-lane-h.h { background: var(--xf-host-soft); border: 1px solid #cfd3d7; border-bottom: 0; }
.xf-lane { padding: 8px 12px; font-size: 12px; line-height: 1.4; }
.xf-lane.c { background: #fbf6f4; border-inline: 1px solid #e9c9b9; }
.xf-lane.h { background: #f7f8f8; border-inline: 1px solid #cfd3d7; }
.xf-lane.last.c { border-bottom: 1px solid #e9c9b9; border-radius: 0 0 8px 8px; }
.xf-lane.last.h { border-bottom: 1px solid #cfd3d7; border-radius: 0 0 8px 8px; }
.xf-lane .ev { display: block; padding: 6px 8px; border-radius: 5px; background: #fff; border: 1px solid var(--xf-line); }
.xf-lane .ev .xf-pill { margin-right: 4px; }
.xf-arrow { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 8px 0; font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.25; }
.xf-arrow i { position: relative; display: block; width: 100%; height: 2px; background: #9fa4a8; }
.xf-arrow i::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid #9fa4a8; }
.xf-arrow.back i::after { right: auto; left: -2px; border-left-color: transparent; border-right: 7px solid #9fa4a8; }
.xf-arrow.both i::before { content: ""; position: absolute; left: -2px; top: -4px; border: 5px solid transparent; border-right: 7px solid #9fa4a8; }
.xf-host-items { display: flex; flex-wrap: wrap; gap: 5px; }
.xf-host-items span { padding: 2px 8px; border-radius: 4px; background: var(--xf-host); color: #fff; font-size: 11.5px; }
@media (max-width: 720px) {
  .xf-lanes { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 0 6px; }
  .xf-arrow { font-size: 9.5px; }
}

/* ---------------------------------------------------------------- Figure 6 */
.xf .xf-dots { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.xf .xf-dots th, .xf .xf-dots td { padding: 8px 6px; border-bottom: 1px solid var(--xf-grid); text-align: left; vertical-align: middle; }
.xf .xf-dots thead th { border-top: 1px solid var(--ink); font-size: 11.5px; font-weight: 650; }
.xf .xf-dots .runs { white-space: nowrap; }
.xf .xf-dots .runs .grp { display: inline-flex; gap: 4px; margin-right: 10px; }
.xf-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: #ccc; box-shadow: 0 0 0 2px var(--xf-card); vertical-align: middle; }
.xf-dot.ok { background: var(--xf-ext); }
.xf-dot.over { background: var(--xf-amb); }
.xf-dot.dead { background: var(--xf-def); }
.xf-dot.ok::after, .xf-dot.over::after, .xf-dot.dead::after { display: grid; place-items: center; height: 100%; color: #fff; font-size: 9px; font-weight: 800; line-height: 16px; text-align: center; }
.xf-dot.ok::after { content: "✓"; }
.xf-dot.over::after { content: "$"; }
.xf-dot.dead::after { content: "✕"; }
.xf .xf-dots .score { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xf .xf-dots tr.hi td { background: var(--xf-ext-soft); }
.xf .xf-dots tr.hi td:first-child { font-weight: 650; }
.xf .xf-dots .enf { font-size: 11.5px; }
.xf .xf-dots th.runs-h { white-space: nowrap; }
.xf .xf-dots .runs-h span { display: inline-block; width: 36px; margin-right: 10px; color: var(--muted); font-weight: 400; }
@media (max-width: 620px) { .xf-dots .enf { display: none; } .xf-dots .runs .grp { margin-right: 5px; } }

/* ---------------------------------------------------------------- Figure 8, 9 */
.xf-stat { display: grid; gap: 2px; }
.xf-stat .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; }
.xf-stat .l { color: var(--muted); font-size: 12px; }
.xf-rlloop { display: grid; gap: 6px; font-size: 12px; }
.xf-rlloop .box { padding: 8px 10px; border: 1px solid var(--xf-line); border-radius: 6px; background: #faf9f6; text-align: center; }
.xf-rlloop .box.z3 { background: var(--xf-ext-soft); border-color: #bfc8e4; }
.xf-rlloop .box.pol { background: var(--xf-pol-soft); border-color: #c4d3e8; }
.xf-rlloop .ar { text-align: center; color: var(--muted); font-size: 11px; line-height: 1.2; }
.xf-rlloop .fork { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.xf-rlloop .fork .box.no { background: var(--xf-def-soft); border-color: #e9c9b9; }

/* ---------------------------------------------------------------- Figure 10 */
.xf-scatter { display: flex; flex-wrap: wrap; gap: 6px; }
.xf-scatter span { padding: 3px 8px; border-radius: 4px; background: #f6f5f1; border: 1px solid var(--xf-line); font: 11.5px/1.5 var(--mono); }
.xf-scatter span:nth-child(3n) { transform: rotate(-1.5deg); }
.xf-scatter span:nth-child(3n+1) { transform: rotate(1deg); }
.xf-obl { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-top: 10px; }
.xf-obl div { padding: 6px 8px; border-radius: 5px; background: var(--xf-ext-soft); border: 1px solid #bfc8e4; font-size: 12px; }
.xf-obl div b { font-variant-numeric: tabular-nums; }
.xf-pinref { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; background: var(--xf-def); color: #fff; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.xf-stack .chip[data-tip] { cursor: help; }
.xf-quotes { display: grid; gap: 6px; }
.xf-marknum { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 4px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.xf-notes { display: grid; gap: 3px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; }
.xf blockquote { margin: 0; }
.xf .xf-table, .xf .xf-dots { display: table; margin: 0; }

/* ---------------------------------------------------------------- frame (restyle) */
.xf { margin: 34px 0 40px; font: 15px/1.5 var(--sans); }
.xf.xf-wide { width: var(--xf-wide); margin-left: calc((100% - var(--xf-wide)) / 2); }
.xf .xf-box { padding: 20px 22px 22px; background: #fff; border: 1px solid var(--xf-line); border-radius: 6px; }
.xf .xf-box-title { margin: 0 0 16px; color: var(--ink); font-size: 16.5px; font-weight: 650; line-height: 1.35; }
.xf figcaption { max-width: none; margin-top: 10px; color: var(--muted); font: 14.5px/1.55 var(--sans); }
.xf figcaption b { color: var(--ink); font-weight: 650; }
.xf-tip { font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif; font-size: 13px; background: #262a26; }

/* panels are regions of the one box, split by hairlines */
.xf-box .xf-panel { padding: 0; background: none; border: 0; border-radius: 0; }
.xf-box .xf-cols { gap: 0; }
@media (min-width: 821px) {
  .xf-box .xf-cols > .xf-panel + .xf-panel { padding-left: 24px; border-left: 1px solid var(--xf-line); }
  .xf-box .xf-cols > .xf-panel:not(:last-child) { padding-right: 24px; }
}
@media (max-width: 820px) {
  .xf-box .xf-cols > .xf-panel + .xf-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--xf-line); }
}
.xf-box > .xf-cols + .xf-panel, .xf-box > .xf-panel + .xf-panel { margin-top: 22px !important; padding-top: 20px; border-top: 1px solid var(--xf-line); }
.xf-panel-title { font-size: 15px; font-weight: 650; }
.xf-panel-title small { font-size: 13.5px; }
.xf-eyebrow { margin-bottom: 2px; color: var(--xf-ext); font-size: 13.5px; font-weight: 650; }

/* labels in sentence case */
.xf-vs b { font-size: 12.5px; font-weight: 700; }
.xf-vs { font-size: 13.5px; }
.xf-stack .zone h4, .xf-gatebar h4 { font-size: 13px; font-weight: 700; }
.xf-boundary span { font-size: 12px; font-weight: 700; }

/* Figure 1 inside the box */
.xf-box .xf-pipe { padding: 0; background: none; border: 0; }
.xf-box .xf-card { background: #f8f7f3; border-color: transparent; }
.xf-box .xf-card.on { background: #fff; border-color: var(--xf-ext); }
.xf-node { background: #fff; }
.xf-node .n, .xf-card .n, .xf-marknum { background: #e3e5df; color: var(--ink); }
.xf-loop span em { background: #fff; }
.xf-boundary span { background: #fff; }

/* light fills instead of dark blocks */
.xf-stack .mech.thick { background: var(--xf-host-soft); border-color: #d6d9d3; color: var(--ink); }
.xf-stack .mech.thick h4 { color: var(--ink); }
.xf-stack .mech.thick .chip { background: #fff; border-color: rgba(0,0,0,.08); color: var(--ink); }
.xf-pyr .t1 { background: #e4e6e0; color: var(--ink); }
.xf-pyr .t2 { background: #eef0ec; color: var(--ink); }
.xf-pyr .t3 { background: var(--xf-pol-soft); color: var(--ink); }
.xf-host-items span { background: var(--xf-host-soft); border: 1px solid #d6d9d3; color: var(--ink); }
.xf-win-track .rules { background: var(--xf-faint); }
.xf .xf-code { background: #f7f6f2; font-size: 12.5px; }
.xf code, .xf .mono, .xf .xf-code, .xf .xf-pill { font-variant-ligatures: none; }
.xf-cols.c-4-8 { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
@media (max-width: 820px) { .xf-cols.c-4-8 { grid-template-columns: minmax(0, 1fr); } }
.xf svg .ax { font-size: 13px; }

/* ---------------------------------------------------------------- v3: reference-style frame */
.xf .xf-box { background: transparent; border-color: #dcd9d1; border-radius: 8px; padding: 22px 24px 24px; }
.xf .xf-box-title { font-size: 17px; }
.xf svg .lbl { font-size: 14px; font-weight: 600; fill: var(--ink); }
.xf svg .num { font-family: var(--mono); font-size: 12px; font-variant-ligatures: none; }
.xf svg text.halo { stroke: var(--xf-bg); }

/* Figure 1: tabs, one panel per decision */
.h1-tabs { display: flex; align-items: stretch; gap: 0; margin: 0 0 22px; border-bottom: 1px solid var(--xf-line); overflow-x: auto; scrollbar-width: none; }
.h1-tab { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px 10px; border: 0; background: none; color: var(--muted); font: 600 15.5px/1.25 var(--sans); white-space: nowrap; cursor: pointer; }
.h1-tab code { font: 11.5px/1.3 var(--mono); color: var(--xf-faint); font-variant-ligatures: none; }
.h1-tab:hover { color: var(--ink); }
.h1-tab.on { color: var(--ink); }
.h1-tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 2px; background: var(--xf-ext); }
.h1-tab.on code { color: var(--xf-ext); }
.h1-sep { align-self: center; padding: 0 2px 8px; color: #c4c1b8; font-size: 13px; }
.h1-sep.gap { width: 1px; height: 26px; margin: 0 10px 8px; padding: 0; background: var(--xf-line); }
.h1-panel { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.h1-panel[hidden] { display: none; }
.h1-ask { margin: 0 0 14px !important; color: var(--ink); font-size: 19px; line-height: 1.35; font-weight: 600; }
.h1-art-h { margin: 0 0 10px !important; color: var(--muted); font-size: 13.5px; }
.h1-art-cap { margin-top: 10px !important; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.h1-right { padding-top: 2px; }
.h1-find { margin: 0 0 14px !important; color: #2f4aa6; font-size: 18px; line-height: 1.35; font-weight: 600; }
.h1-hero { margin: 0 !important; color: var(--ink); font: 650 52px/1 var(--sans); letter-spacing: -.02em; }
.h1-sub { margin-top: 8px !important; color: var(--ink); font-size: 15.5px; line-height: 1.45; }
.h1-dflt { margin-top: 18px !important; padding-top: 12px; border-top: 1px solid var(--xf-line); color: var(--muted); font-size: 14px; line-height: 1.45; }
.h1-dflt b { color: var(--xf-def); font-weight: 650; }
.h1-note { padding: 14px 16px; background: #fff; border: 1px solid var(--xf-line); border-radius: 8px; font-size: 15px; line-height: 1.55; }
.h1-note .h1-art-h { margin-bottom: 6px !important; }
.xf mark { padding: 1px 2px; background: #d7dcec; color: inherit; border-radius: 2px; }
.h1-effort { display: grid; grid-template-columns: 58px repeat(13, minmax(0, 1fr)); gap: 3px; align-items: center; font-size: 13px; color: var(--muted); }
.h1-effort .tk { text-align: center; font: 11px var(--mono); color: var(--xf-faint); }
.h1-effort .lv { padding-right: 6px; text-align: right; }
.h1-effort .c { height: 24px; border-radius: 3px; background: #ecebe6; }
.h1-effort .c.win { background: var(--xf-ext); }
.h1-win .xf-win-track { height: 30px; }
.h1-win .xf-win-row { grid-template-columns: 58px minmax(0, 1fr); font-size: 13px; }
.h1-win .xf-win-track .seg { font-size: 12px; }
.h1-win { gap: 12px; padding-top: 14px; }
.h1-trace { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; font-size: 15px; line-height: 1.45; }
.h1-trace::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: #d9dce6; }
.h1-trace li { position: relative; margin: 0 0 10px; }
.h1-trace li::before { content: ""; position: absolute; left: -26px; top: 5px; width: 10px; height: 10px; border: 2px solid var(--xf-ext); border-radius: 50%; background: var(--xf-bg); }
.h1-trace li.hook::before { background: var(--xf-ext); }
.h1-trace code { font: 13px var(--mono); }
.h1-strip { position: relative; display: grid; gap: 12px; padding: 4px 0 0; }
.h1-srow { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 13.5px; }
.h1-strack { position: relative; height: 22px; border-bottom: 1px solid var(--xf-line); }
.h1-sdot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; box-shadow: 0 0 0 2px var(--xf-bg); }
.h1-sdot.ok { background: var(--xf-ext); }
.h1-sdot.dead { background: var(--xf-def); }
.h1-saxis { position: relative; height: 16px; font: 11px var(--mono); color: var(--xf-faint); }
.h1-saxis span { position: absolute; transform: translateX(-50%); }
.h1-scap { position: absolute; top: 0; bottom: 18px; left: calc(138px + (100% - 138px) * .6667); border-left: 1.5px dashed var(--ink); opacity: .55; }
@media (max-width: 760px) {
  .h1-panel { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .h1-hero { font-size: 44px; }
  .h1-effort { grid-template-columns: 50px repeat(13, minmax(0, 1fr)); gap: 2px; }
  .h1-effort .c { height: 18px; }
}

/* Figure 6: step-through player */
.xf-player-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
.xf-player-clock { min-width: 104px; color: var(--ink); font: 600 26px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.xf-player-text { margin: 0 !important; color: var(--ink); font-size: 16px; line-height: 1.45; }
.xf-player-text code { font: 13.5px var(--mono); }
.xf-play { align-self: center; padding: 7px 16px; border: 1px solid var(--xf-line); border-radius: 999px; background: #fff; color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.xf-play:hover { border-color: var(--xf-ext); }
.xf-player svg { cursor: pointer; }
.xf-player svg:focus-visible { outline: 2px solid var(--xf-ext); outline-offset: 4px; }
.xf-player-range { display: block; width: calc(100% - 130px); margin: 6px 0 0 auto; accent-color: var(--xf-ext); }
@media (max-width: 620px) {
  .xf-player-head { grid-template-columns: minmax(0, 1fr) auto; }
  .xf-player-text { grid-column: 1 / -1; grid-row: 2; }
  .xf-player-range { width: 100%; }
}

/* Figure 7 */
.h7-h { margin: 0 0 10px !important; color: var(--ink); font-size: 15px; font-weight: 600; }
.h7 { display: grid; gap: 6px; }
.h7-group { margin: 8px 0 0 !important; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.h7-row { display: grid; grid-template-columns: 190px minmax(0, 1fr) 120px; align-items: center; gap: 12px; font-size: 14px; }
.h7-track { position: relative; height: 20px; border-bottom: 1px solid var(--xf-line); }
.h7-dot { position: absolute; top: 50%; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--xf-bg); }
.h7-dot.def { background: var(--xf-def); }
.h7-dot.ext { background: var(--xf-ext); }
.h7-val { font: 12.5px var(--mono); color: var(--muted); }
.h7-axis { position: relative; height: 16px; font: 11px var(--mono); color: var(--xf-faint); }
.h7-axis span { position: absolute; transform: translateX(-50%); }
@media (max-width: 620px) { .h7-row { grid-template-columns: 110px minmax(0, 1fr) 70px; gap: 8px; font-size: 12.5px; } }
.h1 .h1-panel { min-height: 300px; }
.h1-effort .c.win { background: var(--xf-host); }
@media (max-width: 760px) { .h1 .h1-panel { min-height: 0; } }
.xf-win-track .limit.pol { border-left: 2px dashed var(--xf-ext); }

/* ---------------------------------------------------------------- v4: diagrams */
/* node: icon + short label, Epochal-style */
.dn { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px 10px 7px 8px; background: #fff; border: 1px solid var(--xf-line); border-radius: 8px; font-size: 14px; line-height: 1.25; }
.dn[data-tip] { cursor: help; }
.dn-ic { display: grid; flex-shrink: 0; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: #f1f0eb; color: var(--ink); }
.xf .dn-ic svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.dn-t { display: flex; flex-direction: column; min-width: 0; font-weight: 600; color: var(--ink); }
.dn-s { margin-top: 1px; color: var(--muted); font: 400 12.5px/1.3 var(--sans); }
.dn .xf-pinref { position: absolute; top: -7px; right: -7px; margin: 0; }
.dn.warn { border: 1.5px dashed #d9a58f; }
.dn.pol .dn-ic { background: var(--xf-pol-soft); color: var(--xf-pol); }
.dn.gate { border-color: var(--xf-ext); box-shadow: 0 0 0 1px var(--xf-ext); }
.dn.gate .dn-ic { background: var(--xf-ext-soft); color: var(--xf-ext); }
.dn.bad { border-color: #e3bfae; }
.dn.bad .dn-ic { background: var(--xf-def-soft); color: var(--xf-def); }
.dn.wide { grid-column: 1 / -1; }

/* Figure 2 */
.f2-top { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.f2-art .h1-trace li:nth-child(2) { font: italic 15.5px/1.5 var(--serif); }
.f2-art .mono { font: 13px var(--mono); }
.xf .f2-table { display: table; width: 100%; margin: 16px 0 0; border-collapse: collapse; font-size: 14px; }
.xf .f2-table th, .xf .f2-table td { padding: 10px 10px; border-bottom: 1px solid var(--xf-line); text-align: left; vertical-align: top; }
.xf .f2-table thead th { border-top: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.xf .f2-table tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.f2-what { color: var(--muted); }
.f2-v b { display: inline; font-size: 15px; font-weight: 650; }
.f2-mark { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; }
tr.bad .f2-mark { background: var(--xf-def); }
tr.good .f2-mark { background: var(--xf-ext); }
tr.good td, tr.good th { background: var(--xf-ext-soft); }
.f2-why { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.xf .f2-n { text-align: right; font: 13.5px var(--mono); white-space: nowrap; }
.xf .f2-table thead th.f2-n { font: 600 12.5px var(--sans); }
.f2-more { margin-top: 4px; font-size: 13px; }
.f2-more summary { color: #2f4aa6; font-weight: 600; cursor: pointer; }
.f2-more p { margin: 6px 0 0 !important; color: var(--ink); font: italic 13.5px/1.5 var(--serif); }
@media (max-width: 760px) { .f2-top { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* Figure 3 */
.f3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; }
.f3-h { margin: 0 0 12px !important; color: var(--muted); font-size: 14px; }
.f3-h b { display: block; color: var(--ink); font-size: 16px; }
.f3-zone { padding: 4px 0; }
.f3-zl { margin: 0 0 12px !important; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.f3-nodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.f3-line { position: relative; display: flex; align-items: center; min-height: 44px; margin: 10px 0; }
.f3-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid var(--ink); }
.f3-line > span { position: relative; padding: 0 8px 0 0; background: var(--xf-bg); color: var(--ink); font-size: 12.5px; font-weight: 700; }
.f3-line.gate { justify-content: center; }
.f3-line.gate .dn { position: relative; width: 100%; }
.f3 + .xf-pins { margin-top: 16px; }
@media (max-width: 760px) {
  .f3 { grid-template-columns: minmax(0, 1fr); }
  .f3-h:nth-of-type(2) { order: 10; margin-top: 22px !important; }
  .f3 > :nth-child(4) { order: 11; } .f3 > :nth-child(6) { order: 12; } .f3 > :nth-child(8) { order: 13; }
  .f3 > :nth-child(1) { order: 1; } .f3 > :nth-child(3) { order: 2; } .f3 > :nth-child(5) { order: 3; } .f3 > :nth-child(7) { order: 4; }
}

/* Figure 4 and the tiles of Figure 8 */
.f4 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.f4 > .f4-tile + .f4-tile { padding-left: 22px; border-left: 1px solid var(--xf-line); }
.f4 > .f4-tile:not(:last-child) { padding-right: 22px; }
.f4-tile { display: flex; flex-direction: column; min-width: 0; }
.f4-label { margin: 0 0 12px !important; color: var(--ink); font-size: 16px; font-weight: 650; }
.f4-art { min-height: 132px; margin-bottom: 14px; }
.xf .f4-hero { font-size: 40px; }
.f4-steps { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; counter-reset: st; font-size: 13.5px; }
.f4-steps li { counter-increment: st; display: flex; align-items: center; gap: 8px; padding: 6px 9px; background: #fff; border: 1px solid var(--xf-line); border-radius: 7px; }
.f4-steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--xf-ext-soft); color: var(--xf-ext); font-size: 11px; font-weight: 700; }
.f4-pyr { display: grid; justify-items: center; gap: 5px; font-size: 13.5px; }
.f4-pyr span { padding: 6px 8px; border-radius: 6px; text-align: center; }
.f4-pyr .t1 { width: 100%; background: #e6e8e2; }
.f4-pyr .t2 { width: 78%; background: #eef0ec; }
.f4-pyr .t3 { width: 56%; background: var(--xf-pol-soft); }
.f4-note { margin-top: 8px !important; color: var(--muted); font-size: 12.5px; text-align: center; }
.f4-loops { position: relative; display: grid; gap: 8px; font-size: 13.5px; }
.f4-loops span { display: block; padding: 9px 11px; border-radius: 8px; }
.f4-loops .in { background: #fff; border: 1px solid var(--xf-line); }
.f4-loops .out { background: var(--xf-pol-soft); border: 1px solid #cfdbec; }
.f8-tiles { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; }
.f8-tiles > .f4-tile + .f4-tile { padding-left: 24px; border-left: 1px solid var(--xf-line); }
.f8-tiles > .f4-tile:first-child { padding-right: 24px; }
.xf .f8-db { width: 100%; max-width: 360px; margin: 0 0 10px; }
@media (max-width: 760px) {
  .f4, .f8-tiles { grid-template-columns: minmax(0, 1fr); }
  .f4 > .f4-tile + .f4-tile, .f8-tiles > .f4-tile + .f4-tile { margin-top: 20px; padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--xf-line); }
  .f4 > .f4-tile:not(:last-child), .f8-tiles > .f4-tile:first-child { padding-right: 0; }
  .f4-art { min-height: 0; }
}

/* Figure 5 */
.f5 { display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1.15fr); gap: 10px 0; align-items: center; }
.f5-top { padding-bottom: 6px; border-bottom: 1px solid var(--xf-line); }
.f5-top .dn { border: 0; background: none; padding-left: 0; }
.f5-c { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 10px; background: #fff; border: 1px solid var(--xf-line); border-radius: 8px; }
.f5-w { color: var(--muted); font-size: 13px; }
.f5-m { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 0 12px; color: var(--muted); font-size: 12px; text-align: center; }
.f5-m span { min-height: 15px; }
.f5-ar { position: relative; display: block; height: 2px; background: var(--xf-ext); }
.f5-ar::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--xf-ext); border-right: 0; }
.f5-ar.both::before { content: ""; position: absolute; left: -2px; top: -4px; border: 5px solid transparent; border-right: 7px solid var(--xf-ext); border-left: 0; }
.f5-ar.back::after { right: auto; left: -2px; border-left: 0; border-right: 7px solid var(--xf-ext); }
.f5-m.api .f5-ar { background: var(--xf-faint); }
.f5-m.api .f5-ar::after { border-left-color: var(--xf-faint); }
.f5-h .dn { width: 100%; }
.f5-to { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.f5-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--xf-line); font-size: 14px; color: var(--muted); }
.f5-stats b { margin-right: 4px; color: var(--ink); font-size: 22px; font-weight: 650; }
@media (max-width: 760px) {
  .f5 { grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr); }
  .f5-m { padding: 0 6px; font-size: 11px; }
  .f5-to { display: none; }
}

/* Figure 9 */
.f9-flow { display: grid; gap: 4px; }
.f9-fork { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.f9-ar { color: var(--xf-faint); font-size: 14px; line-height: 1; text-align: center; }
.f9-ar.right { padding-left: 50%; }
.f9-bars { display: grid; gap: 9px; }
.f9-bar { display: grid; grid-template-columns: minmax(130px, 210px) minmax(0, 1fr); align-items: center; gap: 12px; font-size: 14px; }
.f9-bar.on .f9-l { font-weight: 650; color: var(--ink); }
.f9-l { display: flex; flex-direction: column; color: var(--ink); line-height: 1.25; }
.f9-l small { color: var(--muted); font-size: 12px; }
.f9-track { position: relative; height: 20px; margin-right: 62px; }
.f9-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.f9-ci { position: absolute; top: 4px; bottom: 4px; border: 1.5px solid var(--ink); border-top: 0; border-bottom: 0; }
.f9-ci::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--ink); }
.f9-val { position: absolute; top: 50%; transform: translate(7px, -50%); font: 600 13px var(--mono); white-space: nowrap; }

/* Figure 10 */
.f10 { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: start; }
.f10-arrow { align-self: center; color: var(--xf-faint); font-size: 26px; text-align: center; }
.f10-rules { display: grid; grid-template-columns: 1fr; gap: 5px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.f10-rules li { display: flex; align-items: baseline; gap: 8px; padding: 5px 9px; background: #fff; border: 1px solid var(--xf-line); border-radius: 6px; cursor: help; }
.f10-rules code { min-width: 22px; color: var(--xf-def); font: 600 12.5px var(--mono); }
.f10-gen { margin: 10px 0 8px !important; color: var(--muted); font-size: 13.5px; }
.f10-obl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.f10-obl div { padding: 8px 10px; background: var(--xf-ext-soft); border-radius: 7px; font-size: 13.5px; }
.f10-obl b { display: block; font: 650 22px/1.1 var(--sans); color: var(--ink); }
@media (max-width: 760px) {
  .f10 { grid-template-columns: minmax(0, 1fr); }
  .f10-arrow { transform: rotate(90deg); margin: 8px 0; }
}

.xf-box > .f2-top + .xf-panel, .xf-box > .f8-tiles + .xf-panel { margin-top: 22px !important; padding-top: 20px; border-top: 1px solid var(--xf-line); }
.f4-loops .f4-flow { padding: 0 4px; color: var(--muted); font-size: 12.5px; text-align: center; }
.xf .dn-t, .xf .dn-s { overflow-wrap: normal; word-break: normal; }
@media (max-width: 620px) {
  .f5 { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1.25fr); }
  .f5-m span { display: none; }
  .f5-m { padding: 0 4px; }
  .f5 .dn-ic { display: none; }
  .f5-c { padding: 7px 8px; }
  .f5-c .xf-pill { font-size: 10.5px; }
  .xf .f2-table th:nth-child(2), .xf .f2-table td.f2-what { display: none; }
}
.f2-mob { display: none; }
@media (max-width: 620px) {
  .xf .f2-table .f2-n { display: none; }
  .f2-mob { display: block; margin-top: 4px; color: var(--ink); font-size: 12.5px; }
  .xf .f2-table tbody th { white-space: normal; }
}

/* Shared figure typography and interaction. */
.xf .xf-box-title, .xf .trace-title {
  color: #262a26; font: 650 clamp(21px, 2.3vw, 28px)/1.16 var(--sans);
  letter-spacing: -.025em; text-wrap: balance;
}
.xf .xf-box { background: #fff; border-color: #cdcfd7; }
.xf :is(button, input, select, summary, [tabindex]):focus-visible, .policy-listing summary:focus-visible {
  outline: 3px solid #2945a3; outline-offset: 3px;
}
.xf [role="tabpanel"][hidden] { display: none; }
.xf .h1-tabs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); overflow: visible; }
.h1-tabs .h1-sep { display: none; }
.h1-tabs .h1-tab { padding: 10px 5px; align-items: center; border-bottom: 2px solid transparent; }
.h1-tabs .h1-tab.on { background: #e9ecf4; border-color: #2f4aa6; }
.h1-tabs .h1-tab.on::after { display: none; }
.h1-tabs .h1-tab code { color: #606d69; font-size: 11px; }
.h1 .h1-panel { min-height: 0; }
.h1-panel .h1-right { background: #f0f1f6; padding: 18px; border-left: 3px solid #6f7ca9; }
.h1-right .h1-find { color: #2f4aa6; }
.h1-effort .c.win { background: #2f4aa6; }

/* Three snapshots from the incident log, rendered from the timeline's data. */
.rp-prose .read-trace { margin-top: 0; }
.trace-frame { border: 1px solid #bbbfcd; border-radius: 12px; overflow: hidden; background: #fff; }
.trace-head { padding: 22px 26px 16px; }
.trace-head .trace-source { margin-bottom: 7px; color: #4d5880; font: 600 13px var(--sans); }
.trace-head .trace-title { margin-bottom: 6px; font-size: clamp(27px, 3.2vw, 37px); }
.trace-head > p:last-child, .policy-intro, .trial-setup { color: #4f605a; font-size: 16px; line-height: 1.45; }
.trace-tabs { display: grid; grid-template-columns: repeat(3,1fr); border-block: 1px solid #d7dae2; background: #f6f8f6; }
.trace-tabs button, .trial-tabs button {
  appearance: none; background: transparent; color: #4d5880; cursor: pointer; border: 0;
  font: 600 16px/1.2 var(--sans); padding: 14px 12px;
}
.trace-tabs button + button { border-left: 1px solid #d7dae2; }
.trace-tabs button span { color: #4d5880; font: 500 12px var(--mono); margin-right: 6px; }
.trace-tabs button[aria-selected="true"], .trial-tabs button[aria-selected="true"] {
  background: #e0e3ef; color: #262a26; box-shadow: inset 0 -3px #2f489d;
}
.trace-tabs button:hover, .trial-tabs button:hover { background: #eaecf2; }
.trace-tabs button:focus-visible { outline-offset: -4px; }
.read-panel { display: grid; grid-template-columns: 1.35fr 1fr; }
.read-sheet { padding: 20px 26px; background: #f4f8f5; min-width: 0; }
.read-sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 8px; }
.read-sheet-head strong { font: 650 17px var(--sans); }
.read-sheet-head span { color: #4d5880; font-size: 14px; }
.read-sheet-head b { font: 550 14px var(--mono); }
.read-cells { display: grid; grid-template-columns: repeat(12,1fr); gap: 4px; margin: 13px 0; }
.read-cells i { position: relative; height: clamp(12px, 1.4vw, 18px); background: #e1eae3; }
.read-cells i::before, .read-cells i::after { content: ""; position: absolute; height: 100%; left: 0; top: 0; }
.read-cells i::before, .read-key span:nth-child(2)::before, .policy-ages [data-action="MASK"] {
  background: repeating-linear-gradient(135deg, #e6eae5 0 3px, #a1b1a6 3px 4px);
}
.read-cells i::before { width: var(--offered); }
.read-cells i::after { width: var(--kept); background: #324a9a; }
.read-key, .trial-key { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 15px; color: #4d5880; font-size: 13px; }
.read-key span, .trial-key span { display: inline-flex; align-items: center; gap: 6px; }
.read-key span::before { content: ""; width: 12px; height: 10px; background: #324a9a; }
.read-key small { margin-left: auto; font-size: 12px; }
.read-verdict { border-left: 1px solid #d9e4dc; padding: 20px 26px; display: flex; flex-direction: column; justify-content: center; }
.read-code { display: flex; align-items: center; gap: 9px; }
.read-code code { color: #4d5880; }
.read-code span, .policy-decision { color: #2f4aa6; background: #e1e4ee; padding: 2px 6px; font: 600 12px var(--mono); }
.read-quantity { display: flex; flex-wrap: wrap; flex-direction: column; color: #30499c; margin: 12px 0 8px !important; }
.read-quantity b { font: 650 clamp(34px, 4.2vw, 48px)/1 var(--sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.read-quantity span { font: 600 16px var(--sans); }
.read-verdict > p:last-child { color: #4d5880; font-size: 15px; line-height: 1.4; }
.read-trace figcaption a { color: #2945a3; text-underline-offset: .16em; }
.xf .policy-intro, .xf .trial-setup { margin: -5px 0 16px; }

/* Read the same compaction policy across consecutive step ages. */
.policy-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 15px; }
.policy-controls label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.policy-controls output { color: #2845a4; font: 600 15px var(--mono); min-width: 2ch; }
.policy-controls :is(input, select) { accent-color: #2f499d; }
.policy-controls input[type="range"] { flex: 1 1 100px; min-width: 60px; }
.policy-controls select { max-width: 100%; font: inherit; color: #4d5880; padding: 6px; border: 1px solid #c6c9d4; border-radius: 5px; background: white; }
.policy-map { margin-top: 21px; }
.policy-ages { display: grid; grid-template-columns: repeat(17,1fr); gap: 3px; }
.policy-ages span { display: grid; place-items: center; padding-block: 12px; background: #3e508e; color: white; font: 550 13px var(--mono); }
.policy-ages [data-action="MASK"] { color: #262a26; }
.policy-ages .selected { outline: 2px solid #262a26; outline-offset: 2px; position: relative; }
.policy-ends { display: flex; justify-content: space-between; margin-top: 5px; font-size: 13px; color: #4d5880; }
.policy-response { display: flex; align-items: baseline; gap: 13px; background: #f3f7f4; padding: 13px 16px; margin-top: 12px; }
.policy-branch { font: 550 14px var(--mono); overflow-wrap: anywhere; }
.policy-effect { font-size: 15px; }
.policy-listing { margin: 1em 0; }
.policy-listing summary, .trial-chart summary { font-weight: 600; color: #2f4aa6; cursor: pointer; }

/* Common scales within each cohort; numeric labels stay in the reading order. */
.trial-tabs { display: inline-flex; border-bottom: 1px solid #cbceda; }
.trial-tabs button { padding: 9px 14px; font-size: 15px; }
.trial-row { display: grid; grid-template-columns: .6fr 1.2fr 1fr; gap: 28px; align-items: center; padding: 16px 0; border-bottom: 1px solid #dcdee3; }
.trial-row > strong { font-size: 18px; }
.trial-measure { display: grid; grid-template-columns: 1fr auto; gap: 3px 7px; align-items: baseline; }
.trial-measure span { color: #4d5880; font-size: 13px; }
.trial-measure b { font-size: 16px; font-variant-numeric: tabular-nums; }
.trial-track { position: relative; height: 2px; margin: 8px 6px; grid-column: 1/-1; background: #e2e3e8; }
.trial-track i { position: absolute; inset: 0 min(calc(100% - var(--base)),calc(100% - var(--ext))) 0 min(var(--base),var(--ext)); background: #586693; }
.trial-track::before, .trial-track::after, .trial-key span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #4d5880; background: #fff; }
.trial-track::before, .trial-track::after { position: absolute; left: var(--base); top: 50%; transform: translate(-50%, -50%); }
.trial-track::after, .trial-key span:nth-child(2)::before { width: 8px; height: 8px; background: #2f4aa6; border: 0; left: var(--ext); }
.trial-key { padding: 12px 0 6px; }
.trial-chart details { font-size: 14px; }
.trial-other { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--xf-line); }
.trial-other > strong { font-size: 17px; }
.trial-other p { margin-top: 6px; color: #4d5880; line-height: 1.45; }
@media (max-width: 760px) {
  .xf .h1-tabs { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .trial-row { grid-template-columns: 1fr 1fr; gap: 5px 20px; }
  .trial-row > strong { grid-column: 1/-1; }
  .trial-measure { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .xf .xf-box, .trace-head, .read-sheet, .read-verdict { padding: 15px; }
  .trace-tabs button { padding: 10px 4px; font-size: 14px; }
  .trace-tabs button span { display: block; margin: 0 0 3px; }
  .read-panel { grid-template-columns: minmax(0,1fr); }
  .read-sheet { padding-bottom: 12px; }
  .read-verdict { border-left: 0; border-top: 1px solid #d9e4dc; }
  .read-quantity { flex-direction: row; align-items: baseline; gap: 8px; }
  .policy-ages { gap: 2px; }
  .policy-ages span { font-size: 10px; }
  .policy-controls { display: grid; grid-template-columns: auto 1fr; }
  .policy-controls .policy-case { grid-column: 1/-1; }
  .policy-controls input[type="range"] { width: 100%; }
  .read-key { column-gap: 10px; }
}
.lane-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 14px; margin: 14px 0; }
.lane-controls label { font-weight: 600; }
.lane-controls output { display: inline-block; min-width: 3ch; font: 600 14px var(--mono); }
.lane-controls input { flex: 1 1 100px; min-width: 50px; accent-color: #2f499d; }
.lane-jumps { display: flex; flex-wrap: wrap; gap: 5px; }
.lane-jumps button { border: 1px solid #c6c9d4; background: white; padding: 6px 10px; font: 600 14px var(--sans); color: #495683; border-radius: 4px; cursor: pointer; }
.lane-jumps button[aria-pressed="true"] { background: #e0e3ef; border-color: #4b5781; }
[data-xf-chart="lanes"] svg { touch-action: pan-y; cursor: crosshair; }
.lane-readout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.lane-readout p { background: #f4f5f7; padding: 9px 12px; font-size: 15px; }
.lane-readout strong { display: block; color: var(--xf-def); }
.lane-readout p + p strong { color: var(--xf-ext); }
.h7-track { height: 34px; }
.h7-dot { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }
.h7-dot:nth-child(2) { top: 78%; }
.h7-track:has(.h7-dot:nth-child(3)) .h7-dot:first-child { top: 18%; }
.h7-track:has(.h7-dot:nth-child(3)) .h7-dot:nth-child(3) { top: 48%; }
@media (max-width: 620px) {
  .lane-jumps { flex: 1 0 100%; }
  .lane-jumps button { flex-grow: 1; font-size: 13px; padding-inline: 4px; }
  .lane-readout { grid-template-columns: 1fr; gap: 5px; }
}
.lane-readout small { display: block; margin-top: 4px; font-size: 13px; }
.lane-readout small br { display: none; }
.lane-readout small b { margin-right: .3em; }

/* Execution path, with separate return routes for proof failure and revision. */
.proof-map {
  display: grid; grid-template-columns: minmax(0,1fr) 8% minmax(0,1.15fr) 11% minmax(0,1fr);
  grid-template-rows: 46px auto 46px; align-items: center; padding: 8px 10px;
}
.proof-stage { min-width: 0; color: #262a26; font-size: 15px; line-height: 1.4; }
.proof-stage > strong { display: block; font-weight: 650; font-size: 20px; margin-bottom: 6px; }
.proof-stage > code { display: inline-block; margin-top: 9px; padding: 4px 7px; color: #4d5880; background: #eeeff4; border-radius: 3px; }
.proof-author { grid-area: 2/1; }
.proof-run { grid-area: 2/5; padding-left: 14px; }
.proof-gate { grid-area: 2/3; padding: 15px; border: 1.5px solid #5d6b9b; border-radius: 9px; background: #f1f2f7; }
.proof-gate ol { margin: 10px 0 0; padding: 0; list-style: none; }
.proof-gate li { border-top: 1px solid #ccd0dd; padding: 3px 0; font-weight: 600; }
.proof-connector { grid-area: 2/2; position: relative; height: 1.5px; background: #4e5a83; }
.proof-gate + .proof-connector { grid-column: 4; }
.proof-connector span { position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%); color: #4d5880; white-space: nowrap; font-size: 12px; }
.proof-connector::after { content: ""; position: absolute; right: 0; top: -3px; border: 4px solid transparent; border-left: 6px solid #4e5a83; border-right: 0; }
.proof-retry, .proof-feedback { position: relative; align-self: stretch; text-align: center; color: #4d5880; font-size: 13px; }
.proof-retry { grid-area: 1/1/2/4; margin: 15px 20% 1px 18%; border: 1px dashed #83978b; border-bottom: 0; border-radius: 7px 7px 0 0; }
.proof-feedback { grid-area: 3/1/4/6; margin: 2px 13% 12px; border: 1px solid #8d97ba; border-top: 0; border-radius: 0 0 7px 7px; }
.proof-retry span, .proof-feedback span { position: relative; background: white; padding: 0 7px; }
.proof-retry span { top: -.85em; }
.proof-feedback span { top: calc(100% - .85em); }
.proof-retry::before, .proof-feedback::before { content: ""; position: absolute; left: -4px; bottom: -2px; border: 3px solid transparent; border-top: 5px solid #5f6d9e; border-bottom: 0; }
.proof-feedback::before { top: -1px; bottom: auto; transform: rotate(180deg); }
.xf .proof-actor { padding: 12px 16px; background: #f4f5f7; margin: 10px 0; }
.proof-evidence summary { font-weight: 600; color: #2f4aa6; cursor: pointer; }
.proof-evidence dl { margin: 10px 0 0; }
.proof-evidence dt { margin-top: 7px; font-weight: 600; }
.proof-evidence dd { margin: 0; }
@media (max-width: 690px) {
  .proof-map { display: flex; align-items: stretch; flex-direction: column; padding: 0; }
  .proof-stage { padding: 10px 14px; }
  .proof-stage > strong { margin-bottom: 2px; }
  .proof-connector { width: 1.5px; height: 28px; margin-left: 22px; }
  .proof-connector span { left: 12px; top: 4px; bottom: auto; transform: none; }
  .proof-connector::after { top: auto; bottom: 0; right: -3px; transform: rotate(90deg); }
  .proof-feedback, .proof-retry { display: none; }
}

/* ================================================================ v5: closer to the references
   Figures sit in the text column, titles are quiet, controls move, details wait for hover. */
.rp .xf.xf-wide { width: auto; margin-left: 0; margin-right: 0; }
.xf .xf-box { padding: 18px 20px 20px; border-color: #d9d6ce; border-radius: 8px; background: transparent; }
.xf .xf-box-title, .xf .trace-title { margin-bottom: 14px; color: var(--ink); font: 600 16.5px/1.35 var(--sans); letter-spacing: 0; }
.xf .trace-head .trace-title { font-size: 19px; }
.xf figcaption { font-size: 14px; }
.xf :is(button, .h1-tab, .xf-play, summary, [role="tab"]) { transition: color .15s cubic-bezier(.16,1,.3,1), background-color .15s cubic-bezier(.16,1,.3,1), border-color .15s cubic-bezier(.16,1,.3,1), box-shadow .15s cubic-bezier(.16,1,.3,1), transform .15s cubic-bezier(.16,1,.3,1); }
.xf button:active { transform: scale(.97); }
@keyframes xf-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.xf [role="tabpanel"]:not([hidden]) { animation: xf-in .22s cubic-bezier(.16,1,.3,1); }
@media (prefers-reduced-motion: reduce) { .xf [role="tabpanel"]:not([hidden]) { animation: none; } }

/* tooltip: part of the page, not a dark popover */
.xf-tip { max-width: 300px; padding: 8px 11px; background: #fff; color: var(--ink); border: 1px solid #d9d6ce; border-radius: 8px; box-shadow: 0 6px 20px rgba(38, 42, 38, .12); font-size: 13px; }
.xf-tip b { color: var(--ink); }

/* WSP-style expanders */
.xf details.xf-more { margin-top: 10px; }
.xf details.xf-more > summary { display: inline-flex; align-items: center; gap: 5px; color: #2f4aa6; font-size: 14px; font-weight: 600; cursor: pointer; list-style: none; }
.xf details.xf-more > summary::-webkit-details-marker { display: none; }
.xf details.xf-more > summary::after { content: "\25B8"; font-size: 11px; transition: transform .15s cubic-bezier(.16,1,.3,1); }
.xf details.xf-more[open] > summary::after { transform: rotate(90deg); }
.xf details.xf-more > :not(summary) { animation: xf-in .22s cubic-bezier(.16,1,.3,1); }

/* pill tabs, Epochal-style, shared by figures that switch between views */
.xf-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.xf-pills [role="tab"] { padding: 6px 13px; border: 1px solid transparent; border-radius: 999px; background: #efeee9; color: var(--muted); font: 600 13.5px var(--sans); cursor: pointer; }
.xf-pills [role="tab"]:hover { color: var(--ink); background: #e8e6e0; }
.xf-pills [role="tab"][aria-selected="true"] { background: #fff; color: var(--ink); border-color: #4d5880; }
.xf .xf-glide { transition: transform .32s cubic-bezier(.16,1,.3,1); }
@media (prefers-reduced-motion: reduce) { .xf .xf-glide { transition: none; } }
.xf .lane-readout { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.xf svg .lane-value { font-size: 13px; }
/* v5 per-figure */
.f2-snip { margin-top: 10px !important; }
.f2-v[data-tip] { cursor: help; }
.xf .f2-table td, .xf .f2-table th { padding: 8px 10px; }
.f3 .dn { padding: 5px 9px 5px 6px; font-size: 13.5px; }
.f3 .dn-ic { width: 24px; height: 24px; }
.f3 .f3-nodes { gap: 6px; }
.f10-rules.two { grid-template-columns: 1fr 1fr; }
.f10-rules.two li { padding: 5px 8px; font-size: 13px; }
.f9-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.f9-strip .dn { padding: 5px 9px 5px 6px; font-size: 13px; }
.f9-strip .dn-ic { width: 24px; height: 24px; }
.f9-to { color: var(--xf-faint); }
.f9-note { margin: 4px 0 16px !important; color: var(--muted); font-size: 13.5px; }
@media (max-width: 620px) { .f10-rules.two { grid-template-columns: 1fr; } .f9-to { display: none; } }
/* opening replay */
.race-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.race-clock { color: var(--ink); font: 600 30px/1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.race-row { margin-top: 12px; padding: 10px 12px 8px; border: 1px solid transparent; border-radius: 8px; transition: border-color .3s cubic-bezier(.16,1,.3,1), background-color .3s cubic-bezier(.16,1,.3,1); }
.race-row.bad { border-color: #e6c3b4; background: #fbf1ec; }
.race-row.ok { border-color: #bcc5e3; background: #eef0f7; }
.race-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.race-name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.race-name i { width: 14px; height: 3px; border-radius: 2px; }
.race-row.def .race-name i { background: var(--xf-def); }
.race-row.ext .race-name i { background: var(--xf-ext); }
.race-val { color: var(--muted); font: 13px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.race-val b { color: var(--ink); font-weight: 600; }
.race-plot { margin-top: 4px; }
.xf .race-plot svg { display: block; width: 100%; height: auto; }
.race-dot { fill: var(--xf-bg); stroke: var(--xf-faint); stroke-width: 1.5; opacity: 0; transition: opacity .2s; }
.race-row.def .race-dot.on { opacity: 1; fill: var(--xf-def); stroke: #fff; animation: race-pop .5s cubic-bezier(.16,1,.3,1); }
.race-row.ext .race-dot.on { opacity: 1; fill: var(--xf-ext); stroke: #fff; animation: race-pop .5s cubic-bezier(.16,1,.3,1); }
@keyframes race-pop { 0% { r: 9; } 100% { r: 4; } }
.race-headdot { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.race-row.ended .race-headdot { opacity: 0; }
.race-end { min-height: 22px; margin: 4px 0 0 !important; font-size: 14.5px; font-weight: 600; opacity: 0; transition: opacity .3s; }
.race-row.ended .race-end { opacity: 1; }
.race-row.bad .race-end { color: #9a3f22; }
.race-row.ok .race-end { color: #2f4aa6; }
@media (max-width: 620px) { .race-clock { font-size: 24px; } .race-head { flex-direction: column; gap: 2px; } }
/* scroll reveals (only when the script runs, so content never stays hidden) */
.xf-js .f2-table[data-xf-reveal] tbody tr { opacity: 0; transform: translateY(6px); }
.xf-js .f2-table[data-xf-reveal].in tbody tr { animation: xf-row .45s cubic-bezier(.16,1,.3,1) forwards; animation-delay: calc(var(--i) * 320ms + 150ms); }
@keyframes xf-row { to { opacity: 1; transform: none; } }
.xf-js .f9-bars[data-xf-reveal] .f9-fill { transform: scaleX(0); transform-origin: left; transition: transform .8s cubic-bezier(.16,1,.3,1); }
.xf-js .f9-bars[data-xf-reveal] .f9-ci, .xf-js .f9-bars[data-xf-reveal] .f9-val { opacity: 0; transition: opacity .3s .7s; }
.xf-js .f9-bars[data-xf-reveal].in .f9-fill { transform: none; }
.xf-js .f9-bars[data-xf-reveal].in .f9-ci, .xf-js .f9-bars[data-xf-reveal].in .f9-val { opacity: 1; }
.xf-js .f9-bars[data-xf-reveal] .f9-bar:nth-child(2) .f9-fill { transition-delay: .08s; }
.xf-js .f9-bars[data-xf-reveal] .f9-bar:nth-child(3) .f9-fill { transition-delay: .16s; }
.xf-js .f9-bars[data-xf-reveal] .f9-bar:nth-child(4) .f9-fill { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .xf-js .f2-table[data-xf-reveal] tbody tr { opacity: 1; transform: none; animation: none; } }
/* Figure 3: isometric stacks */
.xf .iso { display: block; width: 100%; height: auto; overflow: visible; }
.iso-layer { cursor: help; outline: none; transition: transform .9s cubic-bezier(.16,1,.3,1); }
.xf-js .iso-wrap[data-xf-reveal]:not(.in) .iso-layer { transform: translateY(var(--dz)); }
.iso-wrap .iso-layer:nth-of-type(2) { transition-delay: .06s; }
.iso-wrap .iso-layer:nth-of-type(3) { transition-delay: .12s; }
.iso-top { stroke-width: 1.2; transition: filter .15s; }
.iso-side { fill: #d8d6cf; }
.iso-side.r { fill: #c9c7bf; }
.iso-layer:hover .iso-top, .iso-layer:focus .iso-top { filter: brightness(.96); }
.iso-layer.edit .iso-top { fill: #f3ddd2; stroke: #d9a58f; }
.iso-layer.dev .iso-top { fill: #fbefe9; stroke: #d9a58f; stroke-dasharray: 4 3; }
.iso-layer.prot .iso-top { fill: #e6e9e4; stroke: #b4bab2; }
.iso-layer.pol .iso-top { fill: #dfe7f3; stroke: #9fb5d6; }
.iso-layer.gate .iso-top { fill: rgba(39, 68, 165, .08); stroke: var(--xf-ext); stroke-width: 2; }
.iso-layer.gate .iso-side { fill: #b9c2e2; }
.iso-boundary { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 6 4; opacity: .7; }
.iso-pin { cursor: help; }
.iso-pin circle { fill: var(--xf-def); stroke: #fff; stroke-width: 2; }
.iso-pin text { fill: #fff; font: 700 11px var(--sans); }
.iso-note { margin-top: 6px !important; color: var(--muted); font-size: 13.5px; }
/* Figure 3: a policy is checked at the gate; the first is rejected, the second loads */
.iso-tokens .tok { opacity: 0; }
.iso-tokens .tok.bad { fill: var(--xf-def); }
.iso-tokens .tok.good { fill: var(--xf-ext); }
.iso-tokens .tok-msg { opacity: 0; font: 600 13px var(--sans); paint-order: stroke; stroke: var(--xf-bg); stroke-width: 4px; }
.iso-tokens .tok-msg.bad { fill: #9a3f22; }
.iso-tokens .tok-msg.good { fill: #2f4aa6; }
.iso-wrap.in .tok.bad { animation: tok-bad 2.2s 1.1s cubic-bezier(.45,0,.2,1) both; }
.iso-wrap.in .tok.good { animation: tok-good 2.4s 3.4s cubic-bezier(.45,0,.2,1) both; }
.iso-wrap.in .tok-msg.bad { animation: msg 2.2s 1.1s both; }
.iso-wrap.in .tok-msg.good { animation: msg-stay 2.4s 3.4s both; }
.iso-wrap.in .iso-layer.gate .iso-top { animation: gate-red 2.2s 1.1s both, gate-teal 2.4s 3.4s both; }
@keyframes tok-bad { 0% { opacity: 0; transform: translateY(var(--yp)); } 10% { opacity: 1; } 42% { transform: translateY(calc(var(--yg) - 10px)); } 62% { transform: translateY(calc(var(--yg) - 22px)); opacity: 1; } 100% { transform: translateY(var(--yp)); opacity: 0; } }
@keyframes tok-good { 0% { opacity: 0; transform: translateY(var(--yp)); } 10% { opacity: 1; } 40% { transform: translateY(calc(var(--yg) - 10px)); } 55% { transform: translateY(calc(var(--yg) - 10px)); } 90% { transform: translateY(var(--yh)); opacity: 1; } 100% { transform: translateY(var(--yh)); opacity: 0; } }
@keyframes msg { 0%, 38% { opacity: 0; } 48%, 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes msg-stay { 0%, 40% { opacity: 0; } 52%, 100% { opacity: 1; } }
@keyframes gate-red { 0%, 38% { stroke: var(--xf-ext); } 45%, 70% { stroke: var(--xf-def); fill: rgba(181, 83, 44, .12); } 100% { stroke: var(--xf-ext); } }
@keyframes gate-teal { 48%, 62% { fill: rgba(39, 68, 165, .22); } }
.xf-js .iso-wrap:not(.in) .tok-msg.good { opacity: 0; }
html:not(.xf-js) .iso-tokens .tok-msg.good { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .iso-wrap.in .tok, .iso-wrap.in .tok-msg.bad, .iso-wrap.in .iso-layer.gate .iso-top { animation: none; } .iso-wrap .tok-msg.good { opacity: 1; } }
.xf .iso.m { display: none; }
@media (max-width: 620px) { .xf .iso.d { display: none; } .xf .iso.m { display: block; margin-bottom: 8px; } }
.xf .f2-table tbody th[data-tip] { cursor: help; text-decoration: underline dotted #b9b7ae; text-underline-offset: 3px; }
/* rule deep dive */
.rmap-rule { margin: 2px 0 12px; padding: 10px 12px; background: #f7f6f2; border: 1px solid var(--xf-line); border-radius: 8px; }
.rmap-name { display: block; color: var(--ink); font: 600 13px var(--mono); }
.rmap-code { display: block; margin: 3px 0 6px; color: #3d4a43; font: 12.5px/1.5 var(--mono); white-space: normal; overflow-wrap: anywhere; }
.rmap-rule p { margin: 0 !important; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.rmap-pols { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rmap-pols button { padding: 5px 11px; border: 1px solid var(--xf-line); border-radius: 999px; background: #fff; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; }
.rmap-pols button:hover { color: var(--ink); }
.rmap-pols button[aria-pressed="true"] { border-color: var(--xf-ext); color: var(--ink); box-shadow: 0 0 0 1px var(--xf-ext); }
.rmap-plot { position: relative; padding-left: 18px; }
.rmap-ylab { position: absolute; left: 0; top: 50%; transform: translate(-42%, -50%) rotate(-90deg); color: var(--muted); font-size: 12px; white-space: nowrap; }
.rmap-grid { display: grid; gap: 3px; align-items: center; }
.rmap-yt, .rmap-xt { color: var(--xf-faint); font: 11px var(--mono); }
.rmap-yt { padding-right: 6px; text-align: right; }
.rmap-xt { text-align: left; white-space: nowrap; overflow: visible; }
.rmap-xlab { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; text-align: center; }
.rmap-c { position: relative; height: 22px; border-radius: 3px; background: #ecebe6; cursor: crosshair; transition: background-color .28s cubic-bezier(.16,1,.3,1) var(--d), box-shadow .2s; }
.rmap-c.on { background: var(--xf-ext); }
.rmap-c.forbid::after, .rmap-c.conflict::after { content: ""; position: absolute; inset: 0; border-radius: 3px; background: repeating-linear-gradient(135deg, rgba(181, 83, 44, .55) 0 2px, transparent 2px 6px); }
.rmap-c.force { box-shadow: inset 0 0 0 1.5px var(--ink); }
.rmap-c.bad { background: var(--xf-def); }
.rmap-c.bad::after { background: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 2px, transparent 2px 6px); }
.rmap-c.none { background: #f3f2ee; }
.rmap-c.cex { outline: 2px solid var(--ink); outline-offset: 2px; animation: cex-pulse 1.6s ease-in-out infinite; z-index: 1; }
@keyframes cex-pulse { 50% { outline-color: rgba(38, 42, 38, .2); } }
.rmap-c:hover { box-shadow: 0 0 0 2px var(--ink); }
.rmap-read { min-height: 42px; margin: 10px 0 0 !important; color: var(--ink); font-size: 14px; line-height: 1.45; }
.rmap-x { color: #9a3f22; font-weight: 600; }
.rmap-verdict { margin: 6px 0 0 !important; padding: 8px 11px; border-radius: 7px; font-size: 14px; font-weight: 600; line-height: 1.45; }
.rmap-verdict.ok { background: var(--xf-ext-soft); color: #2f4aa6; }
.rmap-verdict.bad { background: var(--xf-def-soft); color: #8a3a20; }
.rmap-ms { margin-left: 4px; color: var(--muted); font: 500 12px var(--mono); }
@media (max-width: 620px) { .rmap-c { height: 14px; } .rmap-grid { gap: 2px; } .rmap-xt { font-size: 9px; } }
@media (prefers-reduced-motion: reduce) { .rmap-c { transition: none; } .rmap-c.cex { animation: none; } }
.rmap-c.bad.none, .rmap-c.conflict { background: var(--xf-def); }
.rmap-c { height: 19px; }
/* Figure 5: session player */
.f5-ph { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; margin-bottom: 14px; min-height: 48px; }
.f5-clock { color: var(--ink); font: 600 15px var(--mono); white-space: nowrap; }
.f5-say { margin: 0 !important; color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.f5-say code { font: 12.5px var(--mono); }
.f5 [data-row] { transition: opacity .3s cubic-bezier(.16,1,.3,1), box-shadow .3s; cursor: pointer; }
.f5:has(.lit) [data-row]:not(.lit) { opacity: .38; }
.f5-c.lit, .f5-h.lit .dn { box-shadow: 0 0 0 2px var(--xf-ext); }
.f5-m { position: relative; }
.f5-dot { position: absolute; left: 12px; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px #fff; opacity: 0; pointer-events: none; }
.f5-m.go .f5-dot { animation: dot-go .9s cubic-bezier(.45,0,.2,1) both; }
.f5-m.back .f5-dot { animation: dot-back .9s cubic-bezier(.45,0,.2,1) both; }
.f5-m.both .f5-dot { animation: dot-both 1.8s cubic-bezier(.45,0,.2,1) both; }
@keyframes dot-go { 0% { left: 12px; opacity: 1; } 95% { opacity: 1; } 100% { left: calc(100% - 12px); opacity: 0; } }
@keyframes dot-back { 0% { left: calc(100% - 12px); opacity: 1; } 95% { opacity: 1; } 100% { left: 12px; opacity: 0; } }
@keyframes dot-both { 0% { left: 12px; opacity: 1; } 50% { left: calc(100% - 12px); } 95% { opacity: 1; } 100% { left: 12px; opacity: 0; } }
@media (max-width: 620px) { .f5-ph { grid-template-columns: minmax(0, 1fr) auto; } .f5-say { grid-column: 1 / -1; grid-row: 2; } }
/* Figure 10: tabs; obligations appear one by one */
#fig-budget .f10-side { max-width: 560px; }
.xf-js .f10-obl[data-xf-reveal] div { opacity: 0; transform: translateY(6px); }
.xf-js .f10-obl[data-xf-reveal].in div { animation: xf-row .45s cubic-bezier(.16,1,.3,1) forwards; }
.xf-js .f10-obl.in div:nth-child(2) { animation-delay: .12s; } .xf-js .f10-obl.in div:nth-child(3) { animation-delay: .24s; }
.xf-js .f10-obl.in div:nth-child(4) { animation-delay: .36s; } .xf-js .f10-obl.in div:nth-child(5) { animation-delay: .48s; }
.xf-js .f10-obl.in div:nth-child(6) { animation-delay: .6s; }
.f10-count { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .xf-js .f10-obl[data-xf-reveal] div { opacity: 1; transform: none; animation: none; } }
/* Figure 8: dots slide from vanilla to the policy's result */
@property --pos { syntax: "<percentage>"; inherits: true; initial-value: 0%; }
.trial-track { --pos: var(--ext); transition: --pos 1s cubic-bezier(.16,1,.3,1) .15s; }
.xf-js .trial-chart[data-xf-reveal]:not(.in) .trial-track { --pos: var(--base); }
.trial-track i { inset: 0 min(calc(100% - var(--base)), calc(100% - var(--pos))) 0 min(var(--base), var(--pos)); }
.trial-track::after { left: var(--pos); }
.f8-h { margin: 0 0 8px !important; color: var(--ink); font-size: 15px; font-weight: 600; }
.f8-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.f8-stats div { padding: 9px 11px; border: 1px solid var(--xf-line); border-radius: 8px; cursor: help; transition: border-color .15s; }
.f8-stats div:hover { border-color: #4d5880; }
.f8-stats b { display: block; color: var(--ink); font: 650 19px/1.15 var(--sans); font-variant-numeric: tabular-nums; }
.f8-stats span { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
@media (max-width: 620px) { .f8-stats { grid-template-columns: 1fr 1fr; } }
/* Figure 1: each tab animates in */
@keyframes xf-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.h1-panel:not([hidden]) .xf-draw { stroke-dasharray: 1; animation: xf-draw 1.1s cubic-bezier(.45,0,.2,1) both; }
@keyframes xf-grow { from { transform: scaleX(0); } to { transform: none; } }
.h1-panel:not([hidden]) .xf-win-track .seg { transform-origin: left; animation: xf-grow .7s cubic-bezier(.16,1,.3,1) both; }
.h1-panel:not([hidden]) .xf-win-track .seg:nth-child(2) { animation-delay: .25s; }
.h1-panel:not([hidden]) .xf-win-track .seg:nth-child(3) { animation-delay: .45s; }
.h1-panel:not([hidden]) .xf-win-track .seg:nth-child(4) { animation-delay: .6s; }
@keyframes xf-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.h1-panel:not([hidden]) .h1-effort .c.win { animation: xf-pop .45s cubic-bezier(.16,1,.3,1) .15s both; }
.h1-panel:not([hidden]) .h1-sdot { animation: xf-pop .45s cubic-bezier(.16,1,.3,1) both; }
.h1-panel:not([hidden]) .h1-trace li { animation: xf-in .4s cubic-bezier(.16,1,.3,1) both; }
.h1-panel:not([hidden]) .h1-trace li:nth-child(2) { animation-delay: .25s; } .h1-panel:not([hidden]) .h1-trace li:nth-child(3) { animation-delay: .5s; }
.h1-panel:not([hidden]) .h1-trace li:nth-child(4) { animation-delay: .75s; } .h1-panel:not([hidden]) .h1-trace li:nth-child(5) { animation-delay: 1s; }
@media (prefers-reduced-motion: reduce) { .h1-panel:not([hidden]) * { animation: none !important; } }
/* deep dive: the language view */
.rmap-intro { margin: 2px 0 10px !important; color: var(--muted); font-size: 14px; }
.lang-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lang-side { min-width: 0; padding: 12px; border-radius: 8px; border: 1px solid var(--xf-line); animation: xf-in .3s cubic-bezier(.16,1,.3,1); }
.lang-side.bad { background: #fbf3ef; border-color: #ecd0c4; }
.lang-side.ok { background: #f2f4f9; border-color: #c9d0e7; }
.lang-h { margin: 0 0 8px !important; color: var(--ink); font-size: 14px; font-weight: 600; }
.lang-side .xf-code { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.lang-fate { margin: 8px 0 0 !important; color: #8a3a20; font-size: 13.5px; line-height: 1.45; }
.lang-err { margin: 8px 0 0; padding-left: 18px; color: var(--ink); font: 12px/1.5 var(--mono); }
.lang-err li { margin: 2px 0; }
@media (max-width: 620px) { .lang-pair { grid-template-columns: 1fr; } }
/* Figure 4: a policy travels the flow once when the figure comes into view */
.proof-map[data-xf-reveal] .proof-connector::before { content: ""; position: absolute; top: -4px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); opacity: 0; }
.proof-map.in .proof-connector::before { animation: proof-dot 1s cubic-bezier(.45,0,.2,1) both; }
.proof-map.in .proof-gate + .proof-connector::before { animation-delay: 1.4s; }
.proof-map.in .proof-author + .proof-connector::before { animation-delay: .3s; }
@keyframes proof-dot { 0% { left: 0; opacity: 1; } 90% { opacity: 1; } 100% { left: calc(100% - 9px); opacity: 0; } }
.proof-map.in .proof-gate { animation: proof-lit 1s ease 1s both; }
.proof-map.in .proof-run { animation: proof-run 1s ease 2.3s both; }
@keyframes proof-lit { 40% { box-shadow: 0 0 0 4px rgba(39, 68, 165, .25); } }
@keyframes proof-run { 40% { background: rgba(39, 68, 165, .08); border-radius: 8px; } }
@media (prefers-reduced-motion: reduce) { .proof-map.in * , .proof-map.in *::before { animation: none !important; } }
.rmap-plot { padding-left: 0; padding-top: 18px; }
.rmap-ylab { top: 0; left: 0; transform: none; font-size: 12px; }
.rmap-ylab::before { content: "\2191\00a0"; }

/* ================================================================ v6: one system
   Figures are numbered by a counter, setup details sit behind a toggle, every switcher is a pill. */
.rp-prose { counter-reset: xfig; }
.xf figcaption.n::before { counter-increment: xfig; content: "Figure " counter(xfig) ": "; color: var(--ink); font-weight: 650; }
.xf .xf-box { position: relative; }
.xf .xf-box:has(> .xf-setup) > .xf-box-title { padding-right: 86px; }
.xf .xf-setup { margin: -6px 0 12px; }
.xf .xf-setup > summary { position: absolute; top: 15px; right: 16px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid #cfd5ea; border-radius: 999px; background: #fff; color: #2f4aa6; font: 600 12.5px var(--sans); cursor: pointer; list-style: none; }
.xf .xf-setup > summary::-webkit-details-marker { display: none; }
.xf .xf-setup > summary::before { content: "i"; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #2f4aa6; color: #fff; font: 700 9.5px var(--serif); font-style: italic; }
.xf .xf-setup[open] > summary { background: var(--xf-ext-soft); }
.xf .xf-setup dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; padding: 10px 12px; background: #f7f7fb; border: 1px solid #e1e4ef; border-radius: 8px; font-size: 13px; line-height: 1.45; animation: xf-in .22s cubic-bezier(.16,1,.3,1); }
.xf .xf-setup dt { color: var(--muted); font-weight: 600; }
.xf .xf-setup dd { margin: 0; color: var(--ink); }
@media (max-width: 620px) { .xf .xf-setup dl { grid-template-columns: 1fr; gap: 0; } .xf .xf-setup dd { margin-bottom: 6px; } }

/* every view switcher looks the same */
.xf .trial-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; border: 0; background: none; }
.xf .trial-tabs button { padding: 6px 13px; border: 1px solid transparent; border-radius: 999px; background: #efeee9; color: var(--muted); font: 600 13.5px var(--sans); box-shadow: none; }
.xf .trial-tabs button[aria-selected="true"] { background: #fff; color: var(--ink); border-color: var(--xf-ext); }
.xf .trial-tabs button:hover { color: var(--ink); }
.xf .xf-pills [role="tab"][aria-selected="true"], .rmap-pols button[aria-pressed="true"] { border-color: var(--xf-ext); }
.xf .lane-jumps button[aria-pressed="true"] { border-color: var(--xf-ext); background: var(--xf-ext-soft); }

/* authoring walkthrough */
.aw { position: relative; margin: 0; padding: 0 0 0 26px; list-style: none; }
.aw::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 10px; width: 2px; background: #dfe3f1; }
.aw > li { position: relative; margin: 0 0 14px; }
.aw > li::before { content: ""; position: absolute; left: -26px; top: 5px; width: 10px; height: 10px; border: 2px solid var(--xf-ext); border-radius: 50%; background: var(--xf-bg); }
.aw > li.ok::before { background: var(--xf-ext); }
.aw > li.bad::before { border-color: var(--xf-def); background: var(--xf-def); }
.aw-k { display: block; color: var(--muted); font: 600 12px var(--mono); }
.aw p { margin: 2px 0 0 !important; color: var(--ink); font-size: 15px; }
.aw-v { font-weight: 600; }
.aw-v.bad { color: #8a3a20; }
.aw-v.ok { color: #2f4aa6; }
.xf .aw-pre { margin-top: 6px; white-space: pre-wrap; font-size: 12px; max-height: 320px; overflow: auto; }
.aw-q { margin: 6px 0 0 !important; padding: 6px 0 6px 12px; border-left: 2px solid var(--xf-ext); color: var(--ink); font: italic 15px/1.5 var(--serif); }
/* compaction key and the label that pops up beside each new compaction */
.cmp-key { display: inline-flex; align-items: center; gap: 7px; margin: 0 auto 0 18px; color: var(--muted); font-size: 13px; }
.cmp-key i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px #fff, 0 0 0 3px #c9c7bf; }
.lanes-key { margin: 0 0 4px !important; justify-content: flex-end; display: flex; }
.xf svg .race-tag { fill: var(--ink); font: 600 11.5px var(--sans); paint-order: stroke; stroke: var(--xf-bg); stroke-width: 4px; animation: race-tag 1.3s cubic-bezier(.16,1,.3,1) both; }
@keyframes race-tag { 0% { opacity: 0; transform: translateY(4px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 620px) { .race-top { flex-wrap: wrap; } .cmp-key { order: 3; margin: 6px 0 0; width: 100%; } }

/* ---- v7: prose tables (eBPF mapping, coding results) ---- */
.rp .rp-prose .xf-table-wrap { margin: 1.6em 0; overflow-x: auto; }
.rp .rp-prose .xf-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.rp .rp-prose .xf-table th { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--xf-ink, #262a26); color: var(--xf-ink, #262a26); font-weight: 600; text-align: left; vertical-align: bottom; }
.rp .rp-prose .xf-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rp-line, #e3e1da); vertical-align: top; }
.rp .rp-prose .xf-table td:first-child { color: var(--rp-muted, #6b6f68); }
.rp .rp-prose .xf-table.xf-num td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp .rp-prose .xf-table.xf-num td:first-child { color: var(--xf-ink, #262a26); font-weight: 600; }
.rp .rp-prose .xf-table code { font-size: .84em; }

/* ---- v7: Figure (architecture): container | trust boundary | host ---- */
.arch { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1.15fr); grid-template-rows: auto auto auto auto; column-gap: 0; row-gap: 12px; padding: 4px 0; }
.arch-zone { border-radius: 10px; }
.arch-zone-c { grid-column: 1; grid-row: 1 / 5; margin: -8px 0 -8px -8px; background: #f4f3ef; }
.arch-zone-h { grid-column: 3; grid-row: 1 / 5; margin: -8px -8px -8px 0; background: var(--xf-ext-soft); }
.arch-h { margin: 0; padding: 0 4px; font-size: 13px; font-weight: 650; color: var(--ink); z-index: 1; }
.arch-h-c { grid-column: 1; grid-row: 1; }
.arch-h-m { grid-column: 2; grid-row: 1; text-align: center; color: var(--xf-faint); font-weight: 500; font-size: 12px; }
.arch-h-h { grid-column: 3; grid-row: 1; }
.arch::before { content: ""; grid-column: 2; grid-row: 2 / 5; justify-self: center; width: 0; border-left: 1.5px dashed #b9b5aa; }
.arch-card { position: relative; z-index: 1; display: grid; gap: 5px; align-content: start; padding: 12px 14px; background: var(--xf-card); border: 1px solid var(--xf-line); border-radius: 8px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.arch-card strong { color: var(--ink); font-size: 14.5px; font-weight: 650; }
.arch-card code { justify-self: start; padding: 1px 6px; background: #f0eee8; border-radius: 4px; font: 12px var(--mono); color: var(--ink); }
.arch-tag { display: none; }
.arch-author { grid-column: 1; grid-row: 2; }
.arch-ver { grid-column: 3; grid-row: 2; border-color: #bfc8e4; }
.arch-cc { grid-column: 1; grid-row: 3 / 5; }
.arch-run { grid-column: 3; grid-row: 3; border-color: #bfc8e4; }
.arch-proxy { grid-column: 3; grid-row: 4; }
.arch-l1 { grid-column: 2; grid-row: 2; }
.arch-l2 { grid-column: 2; grid-row: 3; }
.arch-l3 { grid-column: 2; grid-row: 4; }
.arch-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.arch-chips > span { padding: 2px 8px; border-radius: 999px; background: var(--xf-ext-soft); color: var(--xf-ext); font-size: 12px; font-weight: 600; }
.arch-chips > span code { padding: 0; background: none; color: inherit; font-size: 11.5px; }
.arch-fallback { margin-top: 4px; padding: 7px 9px; border-radius: 6px; background: #f4f3ef; font-size: 12.5px; }
.arch-fallback b { margin-right: 4px; color: var(--ink); font-weight: 650; }
.arch-down { position: absolute; top: -13px; left: 50%; transform: translate(-50%, -50%); padding: 0 6px; background: var(--xf-ext-soft); color: var(--xf-ext); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.arch-down::before { content: "\2193\00a0"; }
/* connectors: a drawn line with an arrowhead and its label */
.arch-link { position: relative; z-index: 1; display: grid; align-content: center; gap: 16px; padding: 0 6px; }
.arch-fw, .arch-bk { position: relative; display: block; height: 16px; }
.arch-fw i, .arch-bk i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-top: 1.5px solid var(--xf-ext); transform-origin: left center; }
.arch-bk i { transform-origin: right center; border-top-color: var(--xf-host); }
.arch-fw i::after, .arch-bk i::after { content: ""; position: absolute; top: -5.5px; border: 5px solid transparent; }
.arch-fw i::after { right: -2px; border-left: 7px solid var(--xf-ext); border-right: 0; }
.arch-bk i::after { left: -2px; border-right: 7px solid var(--xf-host); border-left: 0; }
.arch-cx i { border-top: 1.5px dashed var(--xf-def); }
.arch-cx i::after { border-right-color: var(--xf-def); }
.arch-fw em, .arch-bk em { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font: 500 11.5px var(--sans); font-style: normal; color: var(--muted); white-space: nowrap; }
.arch-cx em { color: var(--xf-def); }
/* reveal: each connector draws once, in the order a policy travels */
.arch[data-xf-reveal] .arch-link i { transform: scaleX(0); }
.arch[data-xf-reveal] .arch-link em, .arch[data-xf-reveal] .arch-down { opacity: 0; }
.arch.in .arch-link i { animation: arch-draw .45s cubic-bezier(.16,1,.3,1) both; }
.arch.in .arch-link em, .arch.in .arch-down { animation: arch-fade .3s ease both; }
.arch.in .arch-l1 .arch-fw i, .arch.in .arch-l1 .arch-fw em { animation-delay: .15s; }
.arch.in .arch-l1 .arch-bk i, .arch.in .arch-l1 .arch-bk em { animation-delay: .7s; }
.arch.in .arch-down { animation-delay: 1.25s; }
.arch.in .arch-l2 .arch-fw i, .arch.in .arch-l2 .arch-fw em { animation-delay: 1.7s; }
.arch.in .arch-l2 .arch-bk i, .arch.in .arch-l2 .arch-bk em { animation-delay: 2.1s; }
.arch.in .arch-l3 .arch-fw i, .arch.in .arch-l3 .arch-fw em { animation-delay: 2.5s; }
.arch.in .arch-ver { animation: arch-proof .9s ease 1s both; }
@keyframes arch-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes arch-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes arch-proof { 40% { box-shadow: 0 0 0 4px rgba(52, 81, 178, .18); } }
@media (prefers-reduced-motion: reduce) { .arch.in *, .arch.in { animation: none !important; } .arch[data-xf-reveal] .arch-link i { transform: none; } .arch[data-xf-reveal] .arch-link em, .arch[data-xf-reveal] .arch-down { opacity: 1; } }
@media (max-width: 640px) {
  .arch { grid-template-columns: 1fr; row-gap: 8px; }
  .arch::before, .arch-zone, .arch-h { display: none; }
  .arch-card, .arch-link { grid-column: 1 !important; grid-row: auto !important; }
  .arch-tag { display: block; color: var(--xf-faint); font-size: 11px; font-weight: 600; }
  .arch-author { order: 1; } .arch-l1 { order: 2; } .arch-ver { order: 3; } .arch-run { order: 4; margin-top: 10px; } .arch-l2 { order: 5; } .arch-cc { order: 6; } .arch-l3 { order: 7; } .arch-proxy { order: 8; }
  .arch-link { gap: 4px; padding: 2px 0 4px 24px; }
  .arch-fw, .arch-bk { height: 14px; }
  .arch-fw i, .arch-bk i { display: none; }
  .arch-fw em, .arch-bk em { position: static; text-align: left; }
  .arch-fw em::before { content: "\2193\00a0"; } .arch-bk em::before { content: "\2191\00a0"; }
  .arch-down { position: static; transform: none; justify-self: start; background: none; padding: 0; }
}
@media (max-width: 640px) { .arch-l2 .arch-fw em::before { content: "\2191\00a0"; } .arch-l2 .arch-bk em::before { content: "\2193\00a0"; } }
.xf .arch-chips > code { padding: 2px 7px; background: #f0eee8; border-radius: 4px; font: 12px var(--mono); color: var(--ink); }

/* ---- v7: Setup sits at the foot of each figure, never stacked over its controls ---- */
.xf .xf-box:has(> .xf-setup) { display: flex; flex-direction: column; }
.xf .xf-box:has(> .xf-setup) > * { min-width: 0; }
.xf .xf-box:has(> .xf-setup) > .xf-box-title { padding-right: 0; }
.xf .xf-box > .xf-setup { order: 99; margin: 16px 0 0; }
.xf .xf-setup > summary { position: static; align-self: flex-start; width: max-content; padding: 3px 10px 3px 8px; }
.xf .xf-setup[open] dl { margin-top: 8px; }

/* ---- v7: effort grid ---- */
.ef { display: grid; gap: 4px; font-size: 13px; }
.ef-row { display: grid; grid-template-columns: 170px repeat(4, minmax(0, 1fr)); gap: 4px; align-items: stretch; }
.ef-head span { padding: 0 8px 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ef-t { align-self: center; color: var(--ink); }
.ef-c { position: relative; display: flex; align-items: center; height: 28px; padding: 0 8px; border-radius: 5px; overflow: hidden; font-variant-numeric: tabular-nums; cursor: default; }
.ef-c.ok { background: #f1f0eb; }
.ef-c.ok i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: #dedbd2; transform-origin: left; }
.ef-c.ok b { position: relative; font: 500 12px var(--mono); color: var(--ink); }
.ef-c.best { background: var(--xf-ext-soft); box-shadow: inset 0 0 0 1.5px var(--xf-ext); }
.ef-c.best i { background: #c9d1ef; }
.ef-c.best b { color: var(--xf-ext); font-weight: 650; }
.ef-c.miss { background: repeating-linear-gradient(135deg, #f6f5f1 0 5px, #ecebe5 5px 6px); color: var(--muted); font-size: 12px; }
.ef[data-xf-reveal] .ef-c.ok i { transform: scaleX(0); }
.ef.in .ef-c.ok i { animation: ef-grow .7s cubic-bezier(.16,1,.3,1) both; animation-delay: var(--d); }
@keyframes ef-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ef-key { margin-top: 12px; }
.ef-sw { display: inline-block; width: 14px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }
.ef-sw.best { background: var(--xf-ext-soft); box-shadow: inset 0 0 0 1.5px var(--xf-ext); }
.ef-sw.ok { background: linear-gradient(90deg, #dedbd2 60%, #f1f0eb 60%); }
.ef-sw.miss { background: repeating-linear-gradient(135deg, #f6f5f1 0 3px, #dcdad3 3px 4px); }
@media (max-width: 640px) { .ef-row { grid-template-columns: 96px repeat(4, minmax(0, 1fr)); } .ef-t { font-size: 11.5px; line-height: 1.2; } .ef-c { padding: 0 4px; } .ef-c.ok b { font-size: 10.5px; } .ef-c.miss span { font-size: 0; } .ef-c.miss span::before { content: "missed"; font-size: 10.5px; } }

/* ---- v7: context meter ---- */
.ax { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; }
.ax-h { margin: 0 0 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.ax-meter { position: relative; height: 30px; border-radius: 6px; background: #f1f0eb; overflow: visible; }
.ax-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--f); border-radius: 6px 0 0 6px; background: linear-gradient(90deg, #e9cdbf, var(--xf-def)); transform-origin: left; }
.ax-val { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #fff; font: 600 12.5px var(--mono); text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.ax-lim { position: absolute; right: 0; top: 100%; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.ax-meter::after { content: ""; position: absolute; right: -1px; top: -4px; bottom: -4px; border-right: 2px solid var(--ink); }
.ax-q { margin: 30px 0 14px; padding: 10px 14px; border-left: 3px solid var(--xf-def); background: #fbf3ee; color: var(--ink); font-size: 15px; line-height: 1.45; }
.ax-q cite { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-style: normal; }
.ax-ans { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; max-width: 360px; }
.ax-a { aspect-ratio: 1; border-radius: 3px; }
.ax-a.on { background: var(--xf-ext); }
.ax-a.unk { box-shadow: inset 0 0 0 1.5px #c9c5ba; background: #fff; }
.ax-cap { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.ax-cap b { color: var(--ink); font-weight: 600; }
.ax-side { align-self: center; display: grid; gap: 14px; }
.ax-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.ax-bar span { grid-column: 1 / -1; color: var(--ink); }
.ax-bar > div { height: 12px; border-radius: 3px; background: #f1f0eb; overflow: hidden; }
.ax-bar i { display: block; height: 100%; width: var(--f); background: var(--xf-host); transform-origin: left; }
.ax-bar.bad i { background: var(--xf-def); }
.ax-bar b { align-self: center; font: 600 13px var(--mono); color: var(--ink); }
.ax[data-xf-reveal] .ax-fill, .ax[data-xf-reveal] .ax-bar i { transform: scaleX(0); }
.ax[data-xf-reveal] .ax-q, .ax[data-xf-reveal] .ax-a { opacity: 0; }
.ax.in .ax-fill { animation: ef-grow 1.1s cubic-bezier(.45,0,.2,1) both; }
.ax.in .ax-q { animation: arch-fade .4s ease .9s both; }
.ax.in .ax-a { animation: ax-pop .45s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(var(--d) + 500ms); }
.ax.in .ax-bar i { animation: ef-grow .8s cubic-bezier(.16,1,.3,1) .3s both; }
@keyframes ax-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 640px) { .ax { grid-template-columns: 1fr; gap: 20px; } }

/* ---- v7: guardrails ---- */
.gd { display: grid; gap: 2px; font-size: 13.5px; }
.gd-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 7px 8px; border-radius: 6px; }
.gd-row:not(.gd-head):hover { background: #f4f3ef; }
.gd-head { padding-bottom: 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.gd-n { color: var(--ink); }
.gd-m { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; align-items: center; }
.gd-bar { height: 10px; border-radius: 3px; background: #f1f0eb; overflow: hidden; }
.gd-bar i { display: block; height: 100%; width: var(--w); min-width: 0; background: var(--xf-def); transform-origin: left; }
.gd-m b { font: 500 12px var(--mono); color: var(--ink); text-align: right; white-space: nowrap; }
.gd-row.good .gd-m b { color: var(--muted); }
.gd-row.ext { margin-top: 6px; background: var(--xf-ext-soft); }
.gd-row.ext .gd-n { color: var(--xf-ext); font-weight: 650; }
.gd-row.ext .gd-m b { color: var(--xf-ext); }
.gd[data-xf-reveal] .gd-bar i { transform: scaleX(0); }
.gd.in .gd-bar i { animation: ef-grow .8s cubic-bezier(.16,1,.3,1) both; }
.gd-lead { margin: 0 0 10px; color: var(--ink); font-size: 14px; }
.gd-code { font-size: 11.5px; }
.gd-code .gd-hl { display: inline-block; width: 100%; background: #f6e2d8; }
.gd-ctx { display: grid; gap: 10px; margin: 16px 0 12px; font-size: 13px; }
.gd-cr { display: grid; grid-template-columns: 190px minmax(0, 1fr) 64px; gap: 10px; align-items: center; }
.gd-cr > span { color: var(--ink); }
.gd-cr > b { font: 600 12.5px var(--mono); text-align: right; }
.gd-ct { position: relative; height: 16px; border-radius: 3px; background: #f1f0eb; }
.gd-ct i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 3px; transform-origin: left; }
.gd-ct i.seen { background: var(--xf-host); opacity: .55; }
.gd-ct i.real { background: var(--xf-def); }
.gd-lim { position: absolute; top: -5px; bottom: -5px; border-left: 2px solid var(--ink); }
.gd-lim s { position: absolute; left: 6px; top: 100%; margin-top: 2px; text-decoration: none; color: var(--muted); font: 11px var(--sans); white-space: nowrap; }
.gd-ctx[data-xf-reveal] .gd-ct i { transform: scaleX(0); }
.gd-ctx.in .gd-ct i { animation: ef-grow 1s cubic-bezier(.45,0,.2,1) both; }
.gd-ctx.in .gd-cr:nth-child(2) .gd-ct i { animation-delay: .35s; }
.gd-verdicts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.gd-verdicts span { padding: 3px 10px; border-radius: 999px; background: #f6e8e0; color: var(--ink); font-size: 12.5px; }
.gd-verdicts b { color: var(--xf-def); font-weight: 650; }
.gd-quote { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; font-style: italic; }
@media (max-width: 640px) { .gd-row { grid-template-columns: 1fr 1fr; gap: 4px 10px; } .gd-n { grid-column: 1 / -1; } .gd-head span:first-child { display: none; } .gd-m { grid-template-columns: 1fr; } .gd-m b { text-align: left; } .gd-cr { grid-template-columns: 1fr 56px; } .gd-cr > span { grid-column: 1 / -1; } }

/* ---- v7: long-task frontier ---- */
.fr svg { overflow: visible; }
.fr-g { stroke: var(--xf-grid); stroke-width: 1; }
.fr-one { stroke: #cfccc3; stroke-dasharray: 3 3; }
.fr-ax { fill: var(--muted); font: 11.5px var(--mono); }
.fr-p circle { fill: #a9a59b; stroke: var(--xf-bg); stroke-width: 2; }
.fr-p.def circle { fill: var(--xf-host); }
.fr-p.bad circle { fill: var(--xf-def); }
.fr-p.ext circle { fill: var(--xf-ext); }
.fr-ci { stroke: #c9c5ba; stroke-width: 1.5; }
.fr-p.ext .fr-ci { stroke: #9fb0e3; }
.fr-l { fill: var(--muted); font: 12.5px var(--sans); }
.fr-p.ext .fr-l { fill: var(--xf-ext); font-weight: 650; }
.fr-p.def .fr-l { fill: var(--ink); }
.fr-p.bad .fr-l { fill: var(--xf-def); }
.fr-p { cursor: default; }
.fr-p:hover circle, .fr-p:focus circle { stroke: var(--ink); }
.fr[data-xf-reveal] .fr-p { opacity: 0; }
.fr.in .fr-p { animation: fr-in .55s cubic-bezier(.34,1.56,.64,1) both; animation-delay: var(--d); transform-box: fill-box; }
@keyframes fr-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- v7: cost strip ($0.30) ---- */
.cb { position: relative; display: grid; gap: 2px; font-size: 13px; }
.cb-g { margin: 8px 0 2px; color: var(--ink); font-weight: 600; font-size: 13px; }
.cb-g:first-child { margin-top: 0; }
.cb-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 10px; }
.cb-m { color: var(--muted); }
.cb-track { position: relative; height: 30px; border-bottom: 1px solid var(--xf-grid); }
.cb-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; transform: translateY(var(--dy, 0)); box-shadow: 0 0 0 2px var(--xf-bg); cursor: default; }
.cb-dot.cb-ext { background: var(--xf-ext); }
.cb-dot.cb-exo { background: #8f8b81; }
.cb-dot.cb-zero { background: #fff; box-shadow: inset 0 0 0 2px var(--xf-def), 0 0 0 2px var(--xf-bg); }
.cb-key { position: relative; display: inline-block; top: auto; margin: 0 5px 0 0; transform: none; vertical-align: -2px; width: 11px; height: 11px; }
.cb-lab { position: absolute; top: 50%; margin: -8px 0 0 12px; font: 600 11.5px var(--mono); white-space: nowrap; }
.cb-lab-over { color: var(--xf-def); }
.cb-lab-zero { color: var(--xf-def); }
.cb-axisrow { margin-top: 2px; }
.cb-axis { position: relative; height: 16px; font: 11px var(--mono); color: var(--xf-faint); }
.cb-axis span { position: absolute; transform: translateX(-50%); }
.cb-cap { position: absolute; top: 18px; bottom: 18px; left: calc(80px + (100% - 80px) * .5); border-left: 1.5px dashed var(--ink); opacity: .6; pointer-events: none; }
.cb-cap em { position: absolute; top: -18px; left: 6px; font: 600 11px var(--sans); font-style: normal; white-space: nowrap; }
.xf-mut { color: var(--muted); }
.ax-q { margin: 30px 0 14px; padding: 10px 14px; border-left: 3px solid var(--xf-def); border-radius: 0 6px 6px 0; background: #fbf3ee; color: var(--ink); font-size: 15px; line-height: 1.45; }
.ax-ans { max-width: 300px; }
.ax-lim { z-index: 1; }
.xf .xf-box:has(> .xf-setup) > .xf-box-title { max-width: none; width: auto; align-self: stretch; }

/* ---- v7: research QA ---- */
.rq-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 18px; }
.rq-m > p { margin: 0 0 8px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.rq-b { display: grid; grid-template-columns: 84px minmax(0, 1fr) 44px; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.rq-b > div { height: 12px; border-radius: 3px; background: #f1f0eb; overflow: hidden; }
.rq-b i { display: block; height: 100%; width: var(--w); transform-origin: left; }
.rq-b.def i { background: var(--xf-def); } .rq-b.ext i { background: var(--xf-ext); }
.rq-b b { font: 600 12.5px var(--mono); color: var(--ink); text-align: right; }
.rq-b.ext b { color: var(--xf-ext); }
.rq[data-xf-reveal] .rq-b i { transform: scaleX(0); }
.rq.in .rq-b i { animation: ef-grow .8s cubic-bezier(.16,1,.3,1) both; }
.rq.in .rq-b.ext i { animation-delay: .25s; }
.rq-policy { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; }
.rq-h { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rq-h code { margin-left: 4px; font-size: 11.5px; }
.xf .rq-code { margin: 0; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.rq-focus { margin: 0; padding: 10px 12px; border: 1px solid var(--xf-line); border-radius: 6px; background: #fff; font: 12px/1.6 var(--mono); color: #4a4e48; }
.rq-focus mark { background: var(--xf-ext-soft); color: var(--xf-ext); border-radius: 2px; padding: 0 1px; }
.rq-run { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--xf-line); color: var(--muted); font-size: 13px; }
.rq-run > span { margin-right: 6px; color: var(--ink); font-weight: 600; }
.rq-run b { margin-left: 10px; color: var(--xf-ext); font: 650 15px var(--mono); }
.rq-run b:first-of-type { margin-left: 0; }
@media (max-width: 640px) { .rq-stats, .rq-policy { grid-template-columns: 1fr; gap: 14px; } }

/* ---- v7: RL training rounds ---- */
.rl-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.rl-line.rl-v { stroke: var(--xf-ext); } .rl-line.rl-r { stroke: var(--xf-ext2); stroke-dasharray: 5 4; } .rl-line.rl-p { stroke: #a9a59b; }
.rl-dot { stroke: var(--xf-bg); stroke-width: 2; cursor: default; }
.rl-dot.rl-v { fill: var(--xf-ext); } .rl-dot.rl-r { fill: var(--xf-ext2); } .rl-dot.rl-p { fill: #a9a59b; }
.rl-end { font: 600 12px var(--sans); } .rl-end.rl-v { fill: var(--xf-ext); } .rl-end.rl-r { fill: #6f80c0; } .rl-end.rl-p { fill: var(--muted); }
.rl[data-xf-reveal] .rl-line { stroke-dashoffset: 0; }
.rl.in .rl-line.rl-v, .rl.in .rl-line.rl-p { stroke-dasharray: 1; animation: rl-draw 1.1s cubic-bezier(.45,0,.2,1) both; }
@keyframes rl-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---- v7: RL loop ---- */
.f9-strip { flex-wrap: nowrap; gap: 4px; margin-bottom: 0; }
.f9-strip .dn { flex: 0 1 auto; min-width: 0; padding: 5px 8px 5px 5px; font-size: 12.5px; white-space: nowrap; }
.f9-to { flex: 0 0 auto; }
.f9-strip > .f9-to:last-child { display: none; }
.f9-loop { position: relative; height: 16px; margin: 2px 0 10px; border: 1.5px solid #c9c5ba; border-top: 0; border-radius: 0 0 12px 12px; margin-left: 30px; margin-right: 46px; }
.f9-loop::before { content: ""; position: absolute; left: -6px; top: -7px; border: 5px solid transparent; border-bottom: 7px solid #c9c5ba; border-top: 0; }
.f9-loop span { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 0 6px; background: var(--xf-bg); color: var(--muted); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 720px) { .f9-strip { flex-wrap: wrap; } .f9-loop { display: none; } }

/* ---- v7: learning curves, ported from the research note ---- */
.lc { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; color: var(--ink); }
.lc-p { display: flex; flex-direction: column; min-width: 0; }
.lc-p svg { overflow: visible; }
.lc-note { align-self: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.lc-note p { margin: 0 0 8px; }
@media (max-width: 640px) { .lc { grid-template-columns: 1fr; } }
.ax[data-xf-reveal] .ax-a { opacity: 1; }
.ax.in .ax-a { animation: none; }
.cb-note { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.trial-lede { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.trial-exact { margin-top: 10px; }
.trial-exact table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.trial-exact th { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--ink); text-align: left; font-weight: 600; color: var(--ink); }
.trial-exact td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--xf-line); white-space: nowrap; }
.h1-scope { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.h1-art-h b { color: var(--ink); font-weight: 650; }
.f9-cmp { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.f9-cmp b { color: var(--xf-ext); font-weight: 650; }
.race-clock { font: 500 15px/1 var(--mono); color: var(--muted); letter-spacing: 0; }
.race-name { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.race-out { padding: 1px 8px; border-radius: 999px; font: 650 12.5px var(--sans); }
.race-out.bad { background: #f6e2d8; color: var(--xf-def); }
.race-out.ok { background: var(--xf-ext-soft); color: var(--xf-ext); }
.rq-scope { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rq-when, .rq-keep { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.rq-when li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 6px; background: #fff; border: 1px solid var(--xf-line); }
.rq-when li b { font-weight: 650; }
.rq-when code { justify-self: start; padding: 0; background: none; color: var(--muted); font: 11px var(--mono); }
.rq-keep li { padding: 8px 10px; border-radius: 6px; background: var(--xf-ext-soft); color: #2c3d7a; font-size: 13.5px; }
.rq-full { margin-top: 12px; }

/* ---- v7: Exo vs ext trust boundary, flat and aligned ---- */
.bd { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto 34px auto; column-gap: 18px; row-gap: 8px; }
.bd-c1 { grid-column: 1; } .bd-c2 { grid-column: 2; }
.bd-col-h { grid-row: 1; margin: 0 0 4px; color: var(--ink); font-size: 15px; font-weight: 650; }
.bd-col-h span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.bd-r1 { grid-row: 2; } .bd-r2 { grid-row: 3; } .bd-r4 { grid-row: 5; }
.bd-band { position: relative; display: grid; gap: 3px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--xf-line); background: #fff; font-size: 13px; line-height: 1.45; color: var(--muted); cursor: default; }
.bd-band b { color: var(--ink); font-size: 13.5px; font-weight: 650; }
.bd-band code { padding: 0; background: none; font: 11.5px var(--mono); color: var(--ink); }
.bd-band.edit { background: #fbf1ec; border-color: #ecc9b9; }
.bd-band.edit b { color: var(--xf-def); }
.bd-band.pol { background: #f6f5f1; }
.bd-band.gate { background: var(--xf-ext-soft); border-color: #bfc8e4; }
.bd-band.gate b { color: var(--xf-ext); }
.bd-band.prot { background: #f4f3ef; }
.bd-band.prot.ext { background: var(--xf-ext-soft); border-color: #d3d9f0; }
.bd-guard em { font-style: normal; font-weight: 650; color: var(--xf-def); }
.bd-line { grid-column: 1 / -1; grid-row: 4; position: relative; align-self: center; height: 0; border-top: 1.5px dashed var(--ink); opacity: .7; }
.bd-line span { position: absolute; left: 0; top: -9px; padding-right: 8px; background: var(--xf-bg); color: var(--ink); font: 600 12px var(--sans); }
/* the guardian starts where it belongs, below the line, and rises to where Exo's dev setup puts it */
.bd[data-xf-reveal] .bd-guard { transform: translateY(150%); opacity: .35; }
.bd.in .bd-guard { animation: bd-rise 1.1s cubic-bezier(.34, 1.4, .64, 1) .5s both; }
@keyframes bd-rise { from { transform: translateY(150%); opacity: .35; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bd[data-xf-reveal] .bd-guard { transform: none; opacity: 1; } .bd.in .bd-guard { animation: none; } }
@media (max-width: 640px) {
  .bd { grid-template-columns: 1fr; grid-template-rows: none; }
  .bd > * { grid-column: 1 !important; grid-row: auto !important; }
  .bd-col-h.bd-c2 { margin-top: 14px; }
  .bd-line { display: none; }
  .bd-c1.bd-r4, .bd-c2.bd-r4 { margin-top: 10px; }
  .bd .bd-col-h.bd-c1 { order: 0; } .bd .bd-c1.bd-r1 { order: 1; } .bd .bd-c1.bd-r2 { order: 2; } .bd .bd-c1.bd-r4 { order: 3; }
  .bd .bd-col-h.bd-c2 { order: 4; } .bd .bd-c2.bd-r1 { order: 5; } .bd .bd-c2.bd-r2 { order: 6; } .bd .bd-c2.bd-r4 { order: 7; }
}
.rq-when li { display: block; }
.rq-when code { display: block; margin-top: 2px; }
.xf code, .xf pre, .xf .xf-code { font-feature-settings: "calt" 0, "liga" 0; font-variant-ligatures: none; }
.rq-run { flex-wrap: wrap; }
.rmap-lab { align-self: center; margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.rmap-views .rmap-lab { min-width: 52px; }
.rmap-pols .rmap-lab { min-width: 52px; }
.race-out { opacity: 0; transform: translateY(3px); transition: opacity .35s ease, transform .45s cubic-bezier(.34,1.56,.64,1); }
.race-row.ended .race-out, .race .ended .race-out { opacity: 1; transform: none; }
.race-end:empty { display: none; }
.arch-fw em, .arch-bk em { left: 50%; right: auto; transform: translateX(-50%); padding: 0 5px; background: var(--xf-bg); border-radius: 3px; }
.arch-card { align-content: start; }
@media (max-width: 640px) { .arch-fw em, .arch-bk em { left: auto; transform: none; padding: 0; background: none; } }
.rmap-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 2px; color: var(--muted); font-size: 12px; }
.rmap-key span { display: inline-flex; align-items: center; gap: 5px; }
.rmap-key i.rmap-c { display: inline-block; width: 14px; height: 11px; cursor: default; transition: none; }
.rmap-key i.rmap-c.off { background: #ecebe6; }
.rmap-key i.rmap-c.force { background: #ecebe6; }
.rmap-key i.rmap-c.kcex { background: #ecebe6; outline: 2px solid var(--ink); outline-offset: 1px; }
/* decisions figure: every tab takes the height of the tallest, so the page does not jump */
.h1-panels { display: grid; }
.h1-panels > .h1-panel { grid-area: 1 / 1; }
.h1-panels > .h1-panel[hidden] { display: grid; visibility: hidden; pointer-events: none; }
@media (max-width: 760px) { .h1-panels > .h1-panel[hidden] { display: none; } }
.h1-win .seg.free { place-items: center end; padding-right: 6px; }
.xf-win-track .limit.lbl::after { font-size: 11px; top: -15px; left: -16px; }
.h1-left { align-self: stretch; }
.cb-lab-zero { transform: translateX(calc(-100% - 26px)); }
.cb-note { margin: 2px 0 14px; }
.trial-track .tt-t { position: absolute; top: 9px; transform: translateX(-50%); color: var(--xf-faint); font: 10.5px var(--mono); }
.trial-track .tt-same { position: absolute; bottom: 9px; transform: translateX(-50%); color: var(--muted); font: italic 11px var(--sans); white-space: nowrap; }
.trial-track.same::before { width: 14px; height: 14px; }
.trial-measure { padding-bottom: 12px; }
.fr-y { margin: 0 0 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
@media (max-width: 640px) { .fr { overflow-x: auto; } .fr svg { min-width: 600px; } }
/* long code lines wrap inside figures; prose code scrolls with a fade cue */
.xf .xf-code { white-space: pre-wrap; overflow-wrap: anywhere; }
.rp .rp-prose pre:not(.xf *) { overflow-x: auto; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.f9-cmp { margin: 0 0 14px; }

/* ---- v7 round 2 ---- */
.ef-row.ef-first { margin-top: 8px; }
.ef-c.hl b { font-weight: 700; color: var(--ink); }
.ef-c.hl { box-shadow: inset 0 0 0 1.5px var(--ink); }
.gd-grp { margin: 10px 0 2px; padding: 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.gd-grp:first-child { margin-top: 0; }
.gd-grp-ext { color: var(--xf-ext); }
.ax-fill { background: linear-gradient(90deg, #c9c5ba, var(--xf-host)); }
.ax-bar.bad i { background: #a9a59b; }
.ax-q { border-left-color: #c9c5ba; background: #f6f5f1; }
.rq-when { counter-reset: rqw; }
.rq-when li { counter-increment: rqw; position: relative; padding-left: 34px; }
.rq-when li::before { content: counter(rqw); position: absolute; left: 10px; top: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--xf-ext-soft); color: var(--xf-ext); font: 700 11px/16px var(--sans); text-align: center; }
.rq-run-h { margin-top: 16px; }
.rq-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rq-tiles > div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--xf-line); border-radius: 6px; background: #fff; }
.rq-tiles b { color: var(--xf-ext); font: 650 20px var(--mono); }
.rq-tiles span { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
@media (max-width: 640px) { .rq-tiles { grid-template-columns: 1fr 1fr; } }
.cb-pre { margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--xf-line); border-radius: 8px; background: #fff; }
.cb-pre-h { margin: 0 0 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
.cb-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; counter-reset: none; }
.cb-steps li { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; }
.cb-steps li b { font-weight: 650; }
.cb-steps li.bad { background: #f6e8e0; color: #8f3a22; }
.cb-steps li.ok { background: var(--xf-ext-soft); color: var(--xf-ext); }
.cb-steps li + li::before { content: "\2192"; margin-right: 2px; color: var(--xf-faint); }
.cb-pre-n { margin: 6px 0; color: var(--muted); font-size: 12.5px; }
/* the baseline is grey everywhere; rust marks only a failure */
.race-row.def .race-name i { background: var(--xf-host); }
.race-row.def .race-dot.on { fill: var(--xf-host); }
.race-out { opacity: 1; transform: none; }
.bd { grid-template-rows: auto auto auto 34px auto auto; }
.bd-r5 { grid-row: 6; }
.bd-c1.bd-r4 { grid-row: 5 / 7; }
.bd-band { align-content: start; gap: 4px; }
.bd-band b { line-height: 1.3; }
.bd-cross { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 54px; }
.bd-cross::before { content: ""; position: absolute; left: 50%; top: 0; bottom: -40px; border-left: 2px solid var(--xf-ext); }
.bd-cross::after { content: ""; position: absolute; left: calc(50% - 6px); bottom: -42px; border: 6px solid transparent; border-top: 8px solid var(--xf-ext); border-bottom: 0; }
.bd-cross span { position: relative; z-index: 1; margin-bottom: 12px; padding: 1px 8px; background: var(--xf-bg); color: var(--xf-ext); font: 600 12px var(--sans); }
@media (max-width: 640px) { .bd-cross { display: none; } .bd .bd-c2.bd-r4 { order: 6; } .bd .bd-c2.bd-r5 { order: 7; } }
.arch-cc { grid-row: 3 !important; }
.arch-cc2 { grid-column: 1; grid-row: 4; }
.arch[data-xf-reveal] .arch-link i { transform: none; }
.arch[data-xf-reveal] .arch-link em, .arch[data-xf-reveal] .arch-down { opacity: 1; }
.arch.in .arch-link i, .arch.in .arch-link em, .arch.in .arch-down { animation: none; }
@media (max-width: 640px) { .arch-cc2 { order: 7; } .arch-l3 { order: 8 !important; } .arch-proxy { order: 9 !important; } }
.rmap-check { margin: 4px 0 10px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.rmap-body { min-height: 560px; }
.rmap-key i.rmap-c.bad.kcex { background: var(--xf-def); }
.lang-side .xf-code { white-space: pre; overflow-x: auto; }
@media (max-width: 640px) { .rmap-body { min-height: 0; } }
/* thrash figure: baseline grey; values live in the tooltips; dots at 0 sit inside the axis */
.h7-dot.def { background: var(--xf-host); }
.h7-row { grid-template-columns: 170px minmax(0, 1fr) 0 !important; }
.h7-val { display: none; }
.h7-track, .h7-axis { margin-left: 8px; margin-right: 8px; }
@media (max-width: 620px) { .h7-row { grid-template-columns: 110px minmax(0, 1fr) 0 !important; } }
.trial-track .tt-t { color: var(--muted); }
.trial-track.same::after { display: none; }
.trial-track.same::before { background: var(--xf-ext); border-color: var(--xf-ext); width: 11px; height: 11px; }
.trial-track .tt-same-l { bottom: auto; top: -7px; transform: none; }
.f9-strip .dn { padding: 5px 12px 5px 6px; }
.f9-strip .dn.gate { border-color: var(--xf-line); background: var(--xf-ext-soft); box-shadow: none; }
#f9-c .f9-strip { margin-top: 4px; }
#f9-c .f9-note { margin: 0 0 14px; }
.lang-pair { grid-template-columns: 1fr !important; gap: 10px; }
.lang-side .xf-code { white-space: pre; }
.rmap-body { min-height: 610px; }
@media (max-width: 640px) { .rmap-body { min-height: 0; } }

/* ---- v8: figures ported from the reviewer-built prototypes (scoped under .fp) ---- */
.xf.fp { --bg:#fcfbf8; --ink:#1f2421; --muted:#6b6860; --faint:#a39f95; --rule:#dcd8cd; --grid:#ebe8e0;
  --accent:#2f47a8; --accent-soft:#e7eaf6; --warn:#b5532f; --warn-soft:#f5e3da; --grey:#8f8b80; --grey-soft:#e4e1d8; }
.fp .fp-fig { position: relative; }
.fp .fp-fig h3 { margin: 0 0 6px; color: var(--ink); font: 650 16.5px/1.35 var(--sans); }
.fp .sub { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.fp .legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 2px 0 6px; color: var(--muted); font-size: 13px; }
.fp .legend span { display: inline-flex; align-items: center; gap: 6px; }
.fp .legend svg { width: auto; height: auto; display: inline-block; }
.fp .fp-fig svg { display: block; overflow: visible; }
.fp .fp-fig svg text { font-family: var(--sans); }
.fp .tip { position: absolute; display: none; pointer-events: none; z-index: 5; max-width: 300px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; box-shadow: 0 4px 14px rgba(40,40,30,.10); font-size: 12.5px; line-height: 1.45; }
.fp .tip table { border-collapse: collapse; margin-top: 3px; width: auto; }
.fp .tip td { padding: 1px 10px 1px 0; border: 0; font-variant-numeric: tabular-nums; }
.fp .tip td.r { text-align: right; }
.fp .mono { font-family: var(--mono); }
.fp button.pill { padding: 5px 14px; border: 1px solid var(--rule); border-radius: 999px; background: #fff; color: var(--ink); font: 600 13.5px var(--sans); cursor: pointer; }
.fp button.pill:hover { border-color: var(--accent); color: var(--accent); }
.fp .panel-h { margin: 14px 0 2px; font-size: 14px; font-weight: 700; color: var(--ink); }
@media (max-width: 640px) { .fp .fp-fig { overflow-x: auto; } .fp .fp-fig > svg { min-width: 640px; } }
.fp .rq-d { transform-box: fill-box; }
#fig-sawtooth figcaption.n::before, #fig-sawtooth .n::before { content: none; counter-increment: none; }

/* ---- v8: 3D scenes ---- */
.s3 { position: relative; }
.s3-svg { display: block; width: 100%; height: auto; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: hidden; border-radius: 6px; outline: none; }
.s3-svg.dragging { cursor: grabbing; }
.s3-svg:focus-visible { box-shadow: 0 0 0 2px var(--xf-ext); }
.s3-box polygon { stroke: var(--xf-bg); stroke-width: 1; stroke-linejoin: round; }
.s3-box[data-id] { cursor: pointer; }
.s3-box[data-id]:hover polygon { stroke: var(--ink); }
.s3-box.on polygon { stroke: var(--ink); stroke-width: 1.5; }
.s3-plane { fill: rgba(52, 81, 178, .07); stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 5 4; pointer-events: none; }
.s3-line { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .7; }
.s3-trail { fill: none; stroke-width: 1.5; stroke-dasharray: 2 4; opacity: .55; pointer-events: none; }
.s3-token polygon { stroke: #fff; stroke-width: .8; }
.s3-svg text { pointer-events: none; text-anchor: middle; font-family: var(--sans); }
.s3-l { font-size: 12.5px; font-weight: 650; fill: var(--ink); paint-order: stroke; stroke: rgba(252,251,248,.85); stroke-width: 3px; }
.s3-l.mono { font: 500 11px var(--mono); }
.s3-l.dk { fill: #fff; stroke: none; }
.s3-l.edge { font-size: 14px; }
.s3-s { font-size: 11px; fill: var(--muted); paint-order: stroke; stroke: rgba(252,251,248,.85); stroke-width: 3px; }
.s3-s.dk { fill: rgba(255,255,255,.85); stroke: none; }
.s3-pl { font-size: 11.5px; font-weight: 600; fill: var(--ink); text-anchor: start !important; }
.s3-tl { font-size: 11.5px; font-weight: 650; paint-order: stroke; stroke: rgba(252,251,248,.9); stroke-width: 3px; }
.s3-ctl { position: absolute; top: 4px; right: 4px; display: flex; gap: 6px; align-items: center; }
.s3-ctl button { height: 30px; min-width: 30px; padding: 0 9px; border: 1px solid var(--xf-line); border-radius: 999px; background: #fff; color: var(--ink); font: 600 14px var(--sans); cursor: pointer; }
.s3-ctl button:hover { border-color: var(--ink); }
.s3-ctl .s3-play { padding: 0 14px; font-size: 13.5px; }
.s3-foot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; min-height: 44px; margin-top: 6px; }
.s3-steps { display: flex; gap: 4px; }
.s3-steps button { width: 24px; height: 24px; padding: 0; border: 1px solid var(--xf-line); border-radius: 50%; background: #fff; color: var(--muted); font: 600 12px var(--sans); cursor: pointer; }
.s3-steps button[aria-selected="true"] { border-color: var(--xf-ext); background: var(--xf-ext); color: #fff; }
.s3-read { margin: 0; color: var(--ink); font-size: 14.5px; line-height: 1.4; }
@media (max-width: 640px) { .s3-foot { grid-template-columns: 1fr; gap: 6px; } .s3-ctl { position: static; justify-content: flex-end; margin-bottom: 4px; } }
.xf .s3 svg.s3-svg { overflow: hidden; background: transparent; }

/* ---- v9 ---- */
.fp .fp-draw { stroke-dasharray: 1; animation: rl-draw 1.4s cubic-bezier(.45,0,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .fp .fp-draw { animation: none; stroke-dasharray: none; } }
.fp .fp-inset { margin-top: 18px; padding: 4px 14px 10px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.rmap-body { min-height: 0 !important; }
.st2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.st { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 14px 12px; border: 1px solid var(--xf-line); border-radius: 8px; background: #fff; }
.st-k { margin: 0; color: var(--xf-ext); font-size: 13px; font-weight: 700; }
.st-h { margin: 0; color: var(--ink); font-size: 15.5px; font-weight: 650; line-height: 1.3; }
.st-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 4px 0 6px; font-size: 12.5px; }
.st-flow span { padding: 3px 9px; border: 1px solid var(--xf-line); border-radius: 999px; background: var(--xf-bg); color: var(--ink); white-space: nowrap; }
.st-flow span.g { border-color: #bfc8e4; background: var(--xf-ext-soft); color: var(--xf-ext); font-weight: 650; }
.st-flow span.r { border-style: dashed; }
.st-flow i { color: var(--xf-faint); font-style: normal; }
.st svg { width: 100%; height: auto; overflow: visible; margin-top: auto; }
.st-r { margin: 4px 0 0; padding-top: 8px; border-top: 1px solid var(--xf-line); color: var(--muted); font-size: 13.5px; }
.st-r b { color: var(--xf-ext); font: 650 17px var(--mono); margin-right: 4px; }
@media (max-width: 640px) { .st2 { grid-template-columns: 1fr; } }
.st-flow { flex-wrap: nowrap; gap: 3px; font-size: 12px; }
.st-flow span { padding: 2px 7px; }
@media (max-width: 640px) { .st-flow { flex-wrap: wrap; } }

.s3 .s3-huff { stroke: #b5532c; stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }

/* named steps take their own row; the sentence sits under them */
.s3-foot.named { grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.s3-foot.named .s3-steps { flex-wrap: wrap; align-items: center; gap: 6px; }
.s3-foot.named .s3-steps button { flex: none; width: auto; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; line-height: 26px; white-space: nowrap; }
.s3-foot.named .s3-read { min-height: 2.8em; }                 /* two lines reserved, so the card keeps its height from step to step */
.rmap-body .rmap-verdict { margin: 10px 0 12px; }

.s3 .s3-huff { stroke-width: 2.2; }
/* table numbers are text, not links */
.rp .rp-prose .xf-table td, .rp .rp-prose .xf-table td b { color: var(--xf-ink, #262a26); }

.rp .rp-prose pre:not(.xf *):not(.rp-clip) { -webkit-mask-image: none; mask-image: none; }
.rmap-rule p { margin: 2px 0 6px; }
.fp .xf-pills { margin: 2px 0 12px; }

.st svg .st-hit { cursor: default; outline: none; }
.st svg .st-hit:hover, .st svg .st-hit:focus { fill: rgba(52, 81, 178, .1); }
.st svg [data-tip] { outline: none; }
.st-flow span[data-tip] { cursor: default; }

.rmap-xt { text-align: center; }
.s3-foot.named .s3-steps button b { font-weight: 650; opacity: .6; margin-right: 3px; }

/* ---- figures play when they first scroll into view ---- */
.xf svg { transition: opacity .3s ease; }
html.xf-anim figure.xf:not(.xf-seen) svg:not(.s3-svg) { opacity: 0; }
html.xf-anim figure.xf .legend svg, html.xf-anim figure.xf .xf-setup svg, html.xf-anim figure.xf button svg { opacity: 1 !important; }
html.xf-anim figure.xf:not(.xf-seen) *, html.xf-anim figure.xf:not(.xf-seen) *::before, html.xf-anim figure.xf:not(.xf-seen) *::after { animation-play-state: paused !important; }
.st-n { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
