/* Inference, Opened. Datasheet paper, navy ink. Colour means location:
   host (CPU/RAM) teal, link (PCIe) slate, HBM amber, SM (compute) magenta.
   Signed values use cobalt (negative) to vermilion (positive). */

:root {
  color-scheme: light;
  --paper: #edf0f3;
  --panel: #ffffff;
  --panel-2: #f6f8fa;
  --ink: #14213a;
  --ink-2: #47566e;
  --ink-3: #6f7b8f;
  --rule: #cfd6df;
  --rule-2: #e2e7ed;

  --host: #0d7480;
  --host-fill: #c9ebee;
  --link: #5b687d;
  --link-fill: #dfe4ea;
  --hbm: #965800;
  --hbm-fill: #f7d68f;
  --sm: #a8126f;
  --sm-fill: #f6c9e3;

  --neg: #2e5bba;
  --pos: #c4432b;
  --focus: #1b4fd8;

  --sans: 'Archivo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --r-s: 4px;
  --r-m: 8px;
  --gutter: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--focus); }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--rule-2); padding: 0.05em 0.35em; border-radius: 3px; }
b { font-weight: 650; }
.dim { color: var(--ink-3); font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.brand {
  font-weight: 800; font-variation-settings: 'wdth' 125; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand span { font-weight: 300; }
.model-pick select {
  font: 500 0.9rem var(--sans); color: var(--ink);
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-s);
  padding: 6px 8px; min-height: 36px;
}
.status {
  margin-left: auto; font-size: 0.85rem; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rule); flex: none; }
.status[data-state="loading"]::before { background: var(--hbm-fill); }
.status[data-state="ready"]::before { background: var(--host); }
.status[data-state="busy"]::before { background: var(--sm); }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  max-width: 1360px; margin: 0 auto;
  padding: 0 var(--gutter);
}
main { min-width: 0; }

/* ---------- buttons & inputs ---------- */
.btn {
  font: 600 0.95rem var(--sans); color: var(--ink);
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-s);
  padding: 10px 16px; min-height: 44px; cursor: pointer;
  transition: background-color 150ms, border-color 150ms;
}
.btn:hover:not(:disabled) { border-color: var(--ink-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #26365a; }
.btn.primary .dim { color: #aab6c9; }
.btn.ghost { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: 0.85rem; }
textarea, input[type="number"], select.inline {
  font: 400 1rem/1.5 var(--sans); color: var(--ink);
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-s);
}
textarea { width: 100%; padding: 12px 14px; resize: vertical; }
input[type="number"] { width: 5.5em; padding: 6px 8px; min-height: 36px; }
input[type="range"] { accent-color: var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--ink-2); cursor: pointer; min-height: 36px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }
.num { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-2); }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 32px; align-items: center;
  padding: 56px 0 40px;
  min-height: min(760px, calc(100vh - 60px));
}
.hero h1 {
  font-weight: 800; font-variation-settings: 'wdth' 118;
  font-size: clamp(2.2rem, 3.7vw, 3.5rem); line-height: 1; letter-spacing: -0.025em;
  margin: 0 0 24px; text-wrap: balance;
}
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 54ch; margin: 0 0 28px; }
.lede b { color: var(--ink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fineprint { font-size: 0.85rem; color: var(--ink-3); margin-top: 16px; }
.hero-stage { position: relative; margin: 0; }
.stage3d {
  position: relative;
  width: 100%; aspect-ratio: 1 / 0.92; border-radius: var(--r-m);
  background: radial-gradient(120% 90% at 50% 40%, #ffffff 0%, var(--paper) 70%);
  cursor: grab; touch-action: pan-y;
}
.stage3d:active { cursor: grabbing; }
.hero-stage figcaption { font-size: 0.85rem; color: var(--ink-3); margin-top: 8px; max-width: 60ch; }
.stage-hover {
  position: absolute; left: 12px; top: 12px; pointer-events: none;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-s);
  padding: 8px 10px; font-size: 0.82rem; line-height: 1.45; max-width: 280px;
}
.stage-hover code { background: none; padding: 0; }

/* ---------- console ---------- */
.console {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m);
  padding: 20px 22px 18px; margin: 8px 0 24px;
  scroll-margin-top: 72px;
}
.console-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.console-title { font-size: 1.25rem; font-weight: 700; margin: 0; font-variation-settings: 'wdth' 112; }
.system { margin: 4px 0 10px; font-size: 0.92rem; }
.system summary { cursor: pointer; color: var(--ink-2); min-height: 32px; display: flex; align-items: center; gap: 6px; }
.system textarea { margin-top: 6px; font-size: 0.92rem; }
.console-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.console-note { font-size: 0.88rem; color: var(--ink-3); }
.output {
  min-height: 84px; padding: 14px; border-radius: var(--r-s);
  background: var(--panel-2); border: 1px solid var(--rule-2);
  font-size: 1.05rem; line-height: 1.9; white-space: pre-wrap; word-break: break-word;
}
.output .placeholder { color: var(--ink-3); }
.output .tk {
  border-radius: 3px; padding: 1px 0; cursor: pointer;
  box-shadow: inset 0 -2px 0 var(--sm-fill);
  transition: background-color 120ms;
}
.output .tk:hover, .output .tk.sel { background: var(--sm-fill); }
.output .tk.fresh { animation: fresh 600ms ease-out; }
@keyframes fresh { from { background: var(--sm-fill); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .output .tk.fresh { animation: none; } }
.run-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; font-size: 0.88rem; color: var(--ink-2); }
.run-stats b { font-variant-numeric: tabular-nums; color: var(--ink); }

/* ---------- chapters ---------- */
.chapter { padding: 56px 0 24px; border-top: 1px solid var(--rule); scroll-margin-top: 60px; }
.ch-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; }
.ch-num {
  font-weight: 900; font-variation-settings: 'wdth' 125;
  font-size: clamp(3.2rem, 6vw, 5rem); line-height: 0.8; letter-spacing: -0.04em;
  color: var(--ink); min-width: 1.2ch; font-variant-numeric: tabular-nums;
}
.ch-head h2 {
  font-weight: 750; font-variation-settings: 'wdth' 112;
  font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.05; letter-spacing: -0.015em;
  margin: 2px 0 10px; text-wrap: balance;
}
.runs-on { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.loc {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 550; padding: 2px 9px 2px 7px; border-radius: 999px;
}
.loc::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.loc.host { color: var(--host); background: var(--host-fill); }
.loc.link { color: var(--link); background: var(--link-fill); }
.loc.hbm { color: var(--hbm); background: var(--hbm-fill); }
.loc.sm { color: var(--sm); background: var(--sm-fill); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 14px; }
.prose h3, .step-h {
  font-size: 1.18rem; font-weight: 700; font-variation-settings: 'wdth' 106;
  margin: 34px 0 8px; letter-spacing: -0.005em;
}
.closing p { font-size: 1.1rem; }

.panel {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m);
  padding: 16px 18px; margin: 14px 0 18px;
}
.empty { color: var(--ink-3); font-size: 0.95rem; padding: 18px; border: 1px dashed var(--rule); border-radius: var(--r-m); margin: 14px 0; }
.caption { font-size: 0.85rem; color: var(--ink-3); margin: 6px 0 0; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 0.92rem; color: var(--ink-2); margin: 10px 0; }
.facts b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- 1. artifact ---------- */
.files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.file {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m);
  padding: 14px 16px;
}
.file .fname { font-family: var(--mono); font-size: 0.9rem; font-weight: 600; }
.file .fsize { font-size: 1.7rem; font-weight: 750; font-variation-settings: 'wdth' 112; margin: 4px 0; font-variant-numeric: tabular-nums; }
.file p { margin: 0; font-size: 0.88rem; color: var(--ink-2); }
.file.big { border-color: var(--hbm); box-shadow: inset 4px 0 0 var(--hbm-fill); }

.config-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; margin: 12px 0 8px; }
.cfg { background: var(--panel); padding: 10px 12px; }
.cfg .k { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
.cfg .v { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cfg .m { font-size: 0.8rem; color: var(--ink-2); line-height: 1.35; }

.param-split { margin: 16px 0; }
.split-bar { display: flex; height: 34px; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--rule); }
.split-bar > div { display: flex; align-items: center; padding: 0 8px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; color: var(--ink); }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.86rem; color: var(--ink-2); margin-top: 8px; }
.split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.tensor-browser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; margin: 16px 0; }
.tensor-list {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m);
  max-height: 380px; overflow: auto; font-family: var(--mono); font-size: 0.78rem;
}
.tensor-list button {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; width: 100%;
  text-align: left; background: none; border: 0; border-bottom: 1px solid var(--rule-2);
  padding: 7px 12px; font: inherit; color: var(--ink); cursor: pointer; min-height: 32px;
}
.tensor-list button:hover { background: var(--panel-2); }
.tensor-list button[aria-pressed="true"] { background: var(--hbm-fill); }
.tensor-list .tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tensor-list .ts { color: var(--ink-3); }
.tensor-list .grp { padding: 8px 12px 4px; color: var(--ink-3); font-family: var(--sans); font-size: 0.8rem; position: sticky; top: 0; background: var(--panel); }
.tensor-detail { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px; }
.tensor-detail h4 { margin: 0 0 4px; font-family: var(--mono); font-size: 0.85rem; font-weight: 600; word-break: break-all; }
.tensor-detail canvas { width: 100%; image-rendering: pixelated; border-radius: 3px; display: block; margin: 10px 0 6px; }
.tensor-detail .hist { height: 70px; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; margin: 12px 0; }
table.data th, table.data td { text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--rule-2); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { font-weight: 600; color: var(--ink-2); font-size: 0.85rem; background: var(--panel-2); }
table.data tr.hl td { background: #fbf3e0; }
table.data td.l { text-align: left; }

.load-panel { margin: 24px 0 8px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.progress { width: 100%; max-width: 640px; }
.progress .bar { height: 10px; background: var(--rule-2); border-radius: 999px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--hbm); transition: width 120ms linear; }
.progress-label { font-size: 0.9rem; color: var(--ink-2); margin: 8px 0 0; font-variant-numeric: tabular-nums; }

/* ---------- 2. tokenizer ---------- */
.pieces, .token-ids {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-end;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m);
  padding: 12px; margin: 10px 0 6px; max-height: 260px; overflow: auto;
}
.piece {
  font-family: var(--mono); font-size: 0.86rem; white-space: pre;
  background: var(--panel-2); border: 1px solid var(--rule); border-radius: 3px;
  padding: 3px 6px; cursor: pointer; color: var(--ink); min-height: 30px;
}
.piece:hover { border-color: var(--ink-3); }
.piece[aria-pressed="true"] { background: var(--host-fill); border-color: var(--host); }
.piece.special { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.piece .ws { color: var(--ink-3); }
.tid { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid var(--rule); border-radius: 3px; overflow: hidden; background: var(--panel); }
.tid .s { font-family: var(--mono); font-size: 0.82rem; padding: 3px 6px; white-space: pre; background: var(--panel-2); }
.tid .n { font-size: 0.78rem; font-weight: 600; padding: 1px 6px; font-variant-numeric: tabular-nums; color: var(--host); }
.tid.special .s { background: var(--ink); color: var(--panel); }
.tid.cached { border-color: var(--hbm); }

.bpe { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 10px 0; }
.bpe-word { font-size: 0.9rem; color: var(--ink-2); margin-bottom: 10px; }
.bpe-bytes { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-3); }
.bpe-bytes span { padding: 2px 5px; background: var(--panel-2); border-radius: 3px; }
.bpe-row { display: flex; flex-wrap: wrap; gap: 4px; min-height: 40px; align-items: center; margin: 8px 0; }
.sym { font-family: var(--mono); font-size: 1rem; padding: 5px 8px; border: 1px solid var(--rule); border-radius: 3px; background: var(--panel-2); white-space: pre; transition: background-color 200ms; }
.sym.merged { background: var(--host-fill); border-color: var(--host); }
.bpe-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.bpe-ctl input[type="range"] { flex: 1; min-width: 160px; }
.bpe-log { font-size: 0.88rem; color: var(--ink-2); margin-top: 8px; min-height: 1.6em; }
.bpe-log code { font-size: 0.85rem; }

/* ---------- canvases / heatmaps ---------- */
canvas.hm { display: block; image-rendering: pixelated; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--ink-3); margin-top: 6px; }
.scale .grad { width: 120px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--neg), #f4f4f4, var(--pos)); }
.scale .grad.seq { background: linear-gradient(90deg, #f4f6f9, #14213a); }

/* ---------- 3. embedding ---------- */
.embed-viz { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
.embed-table { position: relative; }
.embed-table canvas { width: 100%; height: 300px; border-radius: 3px; }
.embed-rows { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-height: 360px; overflow: auto; }
.erow { display: grid; grid-template-columns: 120px 64px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 0.8rem; }
.erow .s { font-family: var(--mono); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.erow .n { color: var(--host); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.erow canvas { width: 100%; height: 14px; border-radius: 2px; }
.neighbors { margin: 12px 0; }
.nb-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nb { font-family: var(--mono); font-size: 0.85rem; padding: 4px 8px; border-radius: 3px; background: var(--panel); border: 1px solid var(--rule); white-space: pre; }
.nb small { font-family: var(--sans); color: var(--ink-3); margin-left: 6px; }

/* ---------- 4. rope ---------- */
.rope { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0; }
.rope svg { width: 100%; height: auto; }
.rope .ctl label { display: block; font-size: 0.88rem; color: var(--ink-2); margin: 10px 0 2px; }
.rope .ctl input[type="range"] { width: 100%; }
.rope .readout { font-size: 0.92rem; margin-top: 12px; font-variant-numeric: tabular-nums; }
.rope .readout p { margin: 4px 0; }

/* ---------- 5. attention ---------- */
.layer-diagram { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 12px; margin: 12px 0; overflow-x: auto; }
.layer-diagram svg { display: block; width: 100%; min-width: 640px; height: auto; }
.attn-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin: 14px 0 8px; font-size: 0.9rem; color: var(--ink-2); }
.attn-controls label { display: inline-flex; align-items: center; gap: 8px; }
.attn-controls input[type="range"] { width: 160px; }
.attn-controls output { font-weight: 650; color: var(--ink); min-width: 2ch; font-variant-numeric: tabular-nums; }
.attn-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.attn-map, .attn-row { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px; min-width: 0; }
.attn-map canvas { width: 100%; height: auto; }
.attn-row h4, .attn-map h4 { margin: 0 0 8px; font-size: 0.92rem; font-weight: 650; }
.arow { display: grid; grid-template-columns: 108px minmax(0, 1fr) 52px; gap: 8px; align-items: center; font-size: 0.8rem; margin: 2px 0; }
.arow .s { font-family: var(--mono); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.arow .b { height: 12px; background: var(--rule-2); border-radius: 2px; overflow: hidden; }
.arow .b span { display: block; height: 100%; background: var(--ink); }
.arow .p { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.arow-list { max-height: 420px; overflow: auto; }

.op-times { margin: 10px 0; }
.stack { display: flex; height: 38px; border-radius: var(--r-s); overflow: hidden; border: 1px solid var(--rule); }
.stack > div { display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 600; color: var(--ink); overflow: hidden; white-space: nowrap; border-right: 1px solid rgba(255,255,255,0.7); }

/* ---------- 6. ffn ---------- */
.ffn, .resid, .lens { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0; }
.ffn canvas { width: 100%; height: 120px; }
.resid svg { width: 100%; height: auto; display: block; }
.lens table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.lens td, .lens th { padding: 4px 8px; border-bottom: 1px solid var(--rule-2); text-align: left; }
.lens th { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.lens td.l { width: 60px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lens .chip { font-family: var(--mono); font-size: 0.82rem; white-space: pre; padding: 1px 5px; border-radius: 3px; }
.lens .wrap { max-height: 520px; overflow: auto; }

/* ---------- 7. sampling ---------- */
.sampler-controls { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; margin: 14px 0; font-size: 0.9rem; color: var(--ink-2); }
.sampler-controls label { display: inline-flex; align-items: center; gap: 8px; }
.sampler-controls input[type="range"] { width: 130px; }
.sampler-controls output { font-weight: 650; color: var(--ink); min-width: 3ch; font-variant-numeric: tabular-nums; }
.dist { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 10px 0; }
.dist-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 10px; }
.dbar { display: grid; grid-template-columns: 130px 70px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 0.85rem; padding: 3px 4px; border-radius: 3px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-family: var(--sans); color: var(--ink); min-height: 30px; }
.dbar:hover { background: var(--panel-2); }
.dbar .s { font-family: var(--mono); white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.dbar .lg { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.dbar .b { height: 14px; border-radius: 2px; background: var(--rule-2); position: relative; overflow: hidden; }
.dbar .b span { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.dbar.out .b span { background: var(--rule); }
.dbar.out .s { color: var(--ink-3); text-decoration: line-through; }
.dbar .p { text-align: right; font-variant-numeric: tabular-nums; }
.dbar.chosen { background: var(--sm-fill); }
.detok { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 10px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.95rem; }
.detok .stage { display: flex; flex-direction: column; gap: 2px; }
.detok .stage small { color: var(--ink-3); font-size: 0.78rem; }
.detok .stage span { font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--rule); border-radius: 3px; padding: 4px 8px; white-space: pre; }
.detok .arrow { color: var(--ink-3); }

/* ---------- 8. KV ---------- */
.kv { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0; }
.kv-scroll { overflow-x: auto; padding-bottom: 6px; }
.kv canvas { display: block; }
.kv-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.84rem; color: var(--ink-2); margin: 10px 0 4px; }
.kv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.kv-vecs { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 4px 10px; align-items: center; font-size: 0.82rem; margin-top: 12px; }
.kv-vecs canvas { width: 100%; height: 14px; border-radius: 2px; }
.steps { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0; }
.steps svg { width: 100%; height: auto; display: block; }
.steps-ctl { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-bottom: 10px; }

/* ---------- 9. roofline ---------- */
.roofline { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.roofline svg { width: 100%; height: auto; display: block; }
.roofline .ctl label { display: block; font-size: 0.88rem; color: var(--ink-2); margin: 10px 0 2px; }
.roofline .ctl input[type="range"] { width: 100%; }
.roofline .ctl p { font-size: 0.9rem; margin: 6px 0; font-variant-numeric: tabular-nums; }
.bench { margin: 12px 0; }
.bench-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.bench-cell { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 12px 14px; }
.bench-cell .v { font-size: 1.6rem; font-weight: 750; font-variation-settings: 'wdth' 112; font-variant-numeric: tabular-nums; }
.bench-cell p { margin: 2px 0; font-size: 0.85rem; color: var(--ink-2); }

/* ---------- 10. prefix ---------- */
.prefix-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin: 14px 0; }
.blocks { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 10px 0; }
.blk-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.blk { border: 1px solid var(--rule); border-radius: var(--r-s); padding: 6px 8px; min-width: 116px; font-size: 0.78rem; background: var(--panel-2); }
.blk .h { font-family: var(--mono); color: var(--ink-3); }
.blk .t { font-family: var(--mono); white-space: pre; overflow: hidden; text-overflow: ellipsis; max-width: 150px; color: var(--ink); }
.blk.hit { background: var(--hbm-fill); border-color: var(--hbm); }
.blk.partial { border-style: dashed; }
.ttft { margin: 10px 0; }

/* ---------- 11. summary ---------- */
.summary { margin: 12px 0; overflow-x: auto; }
.summary table.data td:not(:first-child), .summary table.data th { white-space: nowrap; }

.foot { border-top: 1px solid var(--rule); margin-top: 40px; padding: 24px 0 120px; font-size: 0.88rem; color: var(--ink-3); max-width: 80ch; }

/* ---------- rail / machine map ---------- */
.rail { position: relative; }
.rail-inner {
  position: sticky; top: 64px; padding: 14px 4px 16px 0;
  max-height: calc(100vh - 64px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.rail-title { font-weight: 700; font-variation-settings: 'wdth' 112; margin: 0 0 10px; font-size: 1rem; }
#machine svg { width: 100%; height: auto; display: block; }
.rail-caption { font-size: 0.86rem; color: var(--ink-2); min-height: 4.5em; margin: 8px 0; line-height: 1.45; }
#machine svg { max-height: 36vh; width: auto; max-width: 100%; margin: 0 auto; }
.rail-mapping { font-size: 0.8rem; color: var(--ink-3); margin: 10px 0 0; border-top: 1px solid var(--rule); padding-top: 8px; }
.rail-mapping summary { cursor: pointer; color: var(--ink-2); min-height: 28px; display: flex; align-items: center; }
.rail-mapping dl { margin: 6px 0 0; }
.rail-mapping div { display: grid; grid-template-columns: 44px 1fr; gap: 6px; margin: 3px 0; }
.rail-mapping dt { font-weight: 650; color: var(--ink-2); }
.rail-mapping dd { margin: 0; }

.m-node rect { transition: fill 250ms, stroke 250ms, opacity 250ms; }
.m-node text { transition: fill 250ms; }
.m-link { transition: stroke 250ms, opacity 250ms; }
.m-flow { stroke-dasharray: 4 6; animation: flow 0.9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
@media (prefers-reduced-motion: reduce) { .m-flow { animation: none; } }

.tooltip {
  position: fixed; z-index: 80; pointer-events: none;
  background: var(--ink); color: var(--panel); font-size: 0.82rem; line-height: 1.4;
  padding: 6px 9px; border-radius: var(--r-s); max-width: 300px;
}
.tooltip code { background: rgba(255,255,255,0.12); color: inherit; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(8px);
    border-top: 1px solid var(--rule);
  }
  .rail-inner { position: static; padding: 8px var(--gutter); display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 14px; align-items: center; }
  .rail-title, .rail-mapping { display: none; }
  .rail-caption { min-height: 0; margin: 0; font-size: 0.82rem; }
  .foot { padding-bottom: 180px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; min-height: 0; }
  .files { grid-template-columns: 1fr; }
  .tensor-browser, .attn-grid, .rope, .roofline, .embed-viz { grid-template-columns: minmax(0, 1fr); }
  .embed-table canvas { height: 60px; }
  .bench-out { grid-template-columns: 1fr; }
  .dbar { grid-template-columns: 96px 54px minmax(0, 1fr) 54px; gap: 6px; }
  .erow { grid-template-columns: 84px 52px minmax(0, 1fr); }
  .rail-inner { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rail-caption { display: none; }
  .status { display: none; }
  .ch-head { gap: 12px; }
  table.data { display: block; overflow-x: auto; white-space: nowrap; }
  .brand { white-space: nowrap; font-size: 0.95rem; }
  .model-pick select { max-width: 52vw; }
}

/* ---------- beginner layer: plain leads, glossary, go deeper ---------- */
.plain {
  font-size: 1.16rem; line-height: 1.6; color: var(--ink);
  max-width: 64ch; margin: 0 0 18px;
}
.plain-list { margin: 4px 0 14px; padding-left: 1.2em; }
.plain-list li { margin: 4px 0; }
.notice { margin-top: 12px; }
.notice p { font-size: 0.97rem; color: var(--ink-2); }
.notice b { color: var(--ink); }

dfn[data-term] {
  font-style: normal; cursor: help;
  text-decoration: underline dotted var(--ink-3); text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  border-radius: 2px;
}
dfn[data-term]:hover, dfn[data-term]:focus-visible { background: var(--rule-2); text-decoration-color: var(--ink); }

details.deeper {
  margin: 20px 0 6px; border: 1px solid var(--rule); border-radius: var(--r-m);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
details.deeper > summary {
  cursor: pointer; padding: 12px 16px; font-weight: 650; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px;
}
details.deeper > summary::-webkit-details-marker { display: none; }
details.deeper > summary::before {
  content: '+'; display: inline-grid; place-items: center; width: 20px; height: 20px;
  border: 1.5px solid var(--ink-3); border-radius: 50%; font-size: 0.9rem; line-height: 1; flex: none;
}
details.deeper[open] > summary::before { content: '−'; }
details.deeper[open] > summary { border-bottom: 1px solid var(--rule-2); }
details.deeper > :not(summary) { margin-left: 16px; margin-right: 16px; }
details.deeper > :last-child { margin-bottom: 16px; }
details.deeper .prose:first-of-type { margin-top: 14px; }

.loc.plain-loc { color: var(--ink-2); background: var(--rule-2); }

.how-to-read { margin: 8px 0 0; padding-left: 1.1em; font-size: 0.88rem; color: var(--ink-2); line-height: 1.5; }
.how-to-read li { margin: 4px 0; }
.how-to-read b { color: var(--ink); }
.hero-stage figcaption { font-size: 0.9rem; color: var(--ink-2); }
.hero-stage figcaption > b { color: var(--ink); }

/* 3D overlay labels */
.stage-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stage-label {
  position: absolute; transform: translate(-50%, -100%);
  font-size: 0.75rem; font-weight: 650; color: var(--ink); white-space: nowrap;
  background: color-mix(in srgb, var(--panel) 85%, transparent); padding: 1px 6px; border-radius: 3px;
}
.stage-label.left { transform: translate(-100%, -50%); }
.stage-label.right { transform: translate(0, -50%); }
.stage-label.below { transform: translate(-50%, 6px); }
.hero-stage { position: relative; }
.stage-wrap { position: relative; }

/* ---------- primer widgets ---------- */
.primer-color {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; align-items: center;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0 16px; max-width: 720px;
}
.swatch { width: 140px; height: 110px; border-radius: var(--r-m); border: 1px solid var(--rule); }
.rgb label { display: grid; grid-template-columns: 52px minmax(0, 1fr) 3ch; gap: 10px; align-items: center; font-size: 0.9rem; color: var(--ink-2); min-height: 32px; }
.rgb output { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; text-align: right; }
.vec-line { margin: 10px 0 0; font-size: 0.95rem; }
.vec-readout { font-size: 1rem; }

.primer-shapes { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0 16px; }
.primer-shapes svg { width: 100%; max-width: 720px; height: auto; display: block; margin-bottom: 8px; }
.shapes-table { margin-bottom: 0; }

.primer-matvec { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0 16px; }
.mv { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.mv-col { display: flex; flex-direction: column; gap: 6px; }
.mv-col small { color: var(--ink-3); font-size: 0.78rem; }
.mv-mat { display: flex; flex-direction: column; gap: 4px; }
.mv-row { display: flex; gap: 4px; padding: 3px; border-radius: 4px; }
.mv-row.on { background: var(--sm-fill); }
.mv-row span, .mv-vec input, .mv-out button {
  width: 52px; height: 36px; display: grid; place-items: center; font: 600 0.95rem var(--sans); font-variant-numeric: tabular-nums;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--panel-2); color: var(--ink);
}
.mv-vec { display: flex; flex-direction: column; gap: 4px; padding: 3px; background: var(--host-fill); border-radius: 4px; }
.mv-vec input { text-align: center; padding: 0; background: var(--panel); }
.mv-out { display: flex; flex-direction: column; gap: 4px; padding: 3px; }
.mv-out button { cursor: pointer; }
.mv-out button.on { background: var(--sm); color: #fff; border-color: var(--sm); }
.mv-op { font-size: 1.6rem; color: var(--ink-3); }
.mv-work { font-size: 0.98rem; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.mv-work .w { white-space: nowrap; }

.primer-hw { margin: 12px 0 16px; }
.hw-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hw-place { border-radius: var(--r-m); padding: 10px 12px; border: 1px solid; }
.hw-place p { margin: 4px 0 0; font-size: 0.84rem; line-height: 1.4; color: var(--ink-2); }
.hw-place.host { background: var(--host-fill); border-color: var(--host); }
.hw-place.link { background: var(--link-fill); border-color: var(--link); }
.hw-place.hbm { background: var(--hbm-fill); border-color: var(--hbm); }
.hw-place.sm { background: var(--sm-fill); border-color: var(--sm); }
.hw-speeds { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px 16px; margin-top: 10px; }
.hw-speeds > p:first-child { margin: 0 0 8px; }
.speed { display: grid; grid-template-columns: 190px minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: 0.9rem; margin: 6px 0; }
.speed .bar { height: 14px; background: var(--rule-2); border-radius: 3px; overflow: hidden; }
.speed .bar i { display: block; height: 100%; min-width: 3px; }
.speed .bar.link i { background: var(--link); }
.speed .bar.hbm i { background: var(--hbm); }
.speed b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- vocabulary explorer ---------- */
.vocab { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0 16px; }
.vocab-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.vocab-ctl input[type="search"] {
  font: 400 1rem var(--sans); padding: 8px 12px; min-height: 40px; min-width: 220px; flex: 1;
  border: 1px solid var(--rule); border-radius: var(--r-s); background: var(--panel); color: var(--ink);
}
.vocab-list { display: flex; flex-wrap: wrap; gap: 4px; max-height: 240px; overflow: auto; }
.vocab-note { font-size: 0.86rem; color: var(--ink-3); margin: 10px 0 0; }

/* ---------- tensor detail additions ---------- */
.tensor-role { font-size: 0.95rem; margin: 6px 0 10px; color: var(--ink); line-height: 1.5; }
.tensor-io { font-size: 0.88rem; color: var(--ink-2); margin: 0 0 6px; }
.raw-grid { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-family: var(--mono); font-size: 0.78rem; margin: 8px 0; font-variant-numeric: tabular-nums; }
.raw-grid td { padding: 3px 6px; border: 1px solid var(--rule-2); text-align: right; }
.notice-list { margin: 8px 0 0; padding-left: 1.1em; font-size: 0.88rem; color: var(--ink-2); }
.notice-list li { margin: 3px 0; }

@media (max-width: 860px) {
  .primer-color { grid-template-columns: 1fr; }
  .swatch { width: 100%; height: 70px; }
  .hw-row { grid-template-columns: 1fr 1fr; }
  .speed { grid-template-columns: 1fr 60px; }
  .speed .bar { grid-column: 1 / -1; grid-row: 2; }
}
.btn[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }

/* ---------- primer: two tables, KV shape, shape rule, journeys ---------- */
.two-tables {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0 16px;
}
.tt-id { display: flex; flex-direction: column; align-items: center; padding: 10px 14px; border-radius: var(--r-m); background: var(--host-fill); border: 1px solid var(--host); }
.tt-id small { color: var(--host); font-size: 0.75rem; }
.tt-id b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.tt-rows { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tt-row { display: grid; grid-template-columns: 170px 24px minmax(0, 1fr); gap: 8px; align-items: center; }
.tt-name { font-weight: 650; display: flex; flex-direction: column; }
.tt-name small { font-weight: 400; color: var(--ink-3); font-size: 0.78rem; }
.tt-arrow { color: var(--ink-3); font-size: 1.2rem; }
.tt-text { font-size: 1.05rem; justify-self: start; }
.tt-vec { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tt-vec code { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-self: start; }
.tt-vec canvas { width: 100%; height: 16px; border-radius: 2px; }
.tt-vec small { color: var(--ink-3); font-size: 0.78rem; }

.kv-schematic { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 12px 16px; margin: 12px 0 16px; }
.kv-schematic svg { width: 100%; max-width: 680px; height: auto; display: block; }

.shape-rule { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px 16px; margin: 12px 0 16px; overflow-x: auto; }
.sr-row { display: grid; grid-template-columns: 210px auto 24px auto 24px auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--rule-2); min-width: 640px; }
.sr-row:first-child { font-weight: 650; }
.sr-label { color: var(--ink-2); font-size: 0.92rem; }
.sr-shape { font-variant-numeric: tabular-nums; font-size: 1.02rem; white-space: nowrap; }
.sr-op { color: var(--ink-3); text-align: center; }
.sr-note { color: var(--ink-3); font-size: 0.85rem; }
.dm, .dn, .dt { font-weight: 700; padding: 0 3px; border-radius: 3px; }
.dm { color: var(--sm); background: var(--sm-fill); }
.dn { color: var(--host); background: var(--host-fill); }
.dt { color: var(--hbm); background: var(--hbm-fill); }

.journey { padding: 10px 0; border-top: 1px solid var(--rule-2); }
.j-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.j-path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 6px; font-size: 0.88rem; }
.j-arrow { color: var(--ink-2); padding: 0 4px; }
.j-arrow::before { content: '—— '; color: var(--ink-3); }
.j-arrow::after { content: ' ——▶'; color: var(--ink-3); }
.stop { padding: 3px 9px; border-radius: 999px; font-weight: 600; font-size: 0.85rem; border: 1px solid; }
.stop.host { background: var(--host-fill); color: var(--host); }
.stop.hbm { background: var(--hbm-fill); color: var(--hbm); }
.stop.sm { background: var(--sm-fill); color: var(--sm); }
.journey .speed { grid-template-columns: minmax(0, 1fr) 70px; }

@media (max-width: 860px) {
  .two-tables { grid-template-columns: 1fr; }
  .tt-row { grid-template-columns: 1fr; }
  .tt-arrow { display: none; }
  .journey .speed { grid-template-columns: minmax(0, 1fr) 60px; }
  .journey .speed .bar { grid-column: auto; grid-row: auto; }
}

/* ---------- model anatomy ---------- */
.anatomy { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 12px 16px; margin: 12px 0 16px; overflow-x: auto; }
.an-head, .an-row { display: grid; grid-template-columns: minmax(230px, 1.2fr) 110px 100px 100px minmax(180px, 1fr); gap: 10px; align-items: center; min-width: 720px; }
.an-head { font-size: 0.78rem; color: var(--ink-3); padding: 0 8px 6px; border-bottom: 1px solid var(--rule-2); }
.an-row { width: 100%; text-align: left; background: none; border: 0; border-radius: 4px; padding: 5px 8px; cursor: pointer; font: inherit; color: var(--ink); min-height: 34px; }
.an-row:hover { background: var(--panel-2); }
.an-row.d1 .an-name { padding-left: 14px; }
.an-row.d2 .an-name { padding-left: 32px; }
.an-name { font-family: var(--mono); font-size: 0.82rem; }
.an-shape, .an-n { font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.an-n { text-align: right; }
.an-note { font-size: 0.84rem; color: var(--ink-2); }
.an-draw { display: flex; align-items: center; min-height: 10px; }
.mini { display: inline-block; border-radius: 1px; }
.mini.emb { background: linear-gradient(90deg, #c4cfde 70%, transparent); width: 90px !important; height: 12px !important; }
.mini.attn { background: #7f95b8; }
.mini.mlp { background: #2f4570; }
.mini.norm { background: #14213a; height: 3px !important; }
.an-layer { margin: 8px 0; border: 1.5px solid var(--ink-3); border-radius: var(--r-m); padding: 6px 0 8px; box-shadow: 5px 5px 0 -1px var(--panel), 5px 5px 0 0 var(--rule), 10px 10px 0 -1px var(--panel), 10px 10px 0 0 var(--rule); min-width: 720px; margin-right: 12px; margin-bottom: 18px; }
.an-layer-head { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 4px 8px 8px; font-size: 0.9rem; }
.an-layer-head b { font-family: var(--mono); font-size: 0.88rem; }
.an-layer-head label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.an-layer-head input[type=range] { width: 140px; }
.an-group { font-size: 0.82rem; color: var(--ink-3); padding: 8px 8px 2px 22px; }
.an-subtotal { font-size: 0.85rem; color: var(--ink-2); padding: 2px 8px 6px 40px; font-variant-numeric: tabular-nums; }
.an-repeat { font-size: 0.88rem; color: var(--ink-2); margin: 4px 8px 8px; }
.an-sums { border-top: 1px solid var(--rule-2); margin-top: 8px; padding-top: 8px; }
.an-sum { display: grid; grid-template-columns: 210px auto minmax(0, 1fr); gap: 12px; font-size: 0.92rem; padding: 3px 8px; font-variant-numeric: tabular-nums; min-width: 640px; }

/* BPE staircase */
.stair { border-top: 1px solid var(--rule-2); padding-top: 8px; margin-top: 8px; }
.stair-step { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; align-items: center; padding: 2px 0; }
.stair-step .bpe-row { margin: 2px 0; min-height: 34px; }
.stair-label { font-size: 0.86rem; color: var(--ink-2); }
.stair-label small { color: var(--ink-3); }
.stair-label code { font-size: 0.82rem; }
.stair-step.done .stair-label { color: var(--ink); font-weight: 600; }
.stair .sym { font-size: 0.92rem; padding: 3px 7px; }
@media (max-width: 860px) { .stair-step { grid-template-columns: 1fr; gap: 2px; } }
.heads { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px 16px; margin: 12px 0 16px; overflow-x: auto; }
.heads svg { width: 100%; min-width: 640px; height: auto; display: block; }
.kv-layer { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px 16px; margin: 12px 0 16px; }

/* ---------- console (compact, works docked in the rail or inline) ---------- */
.console-head { margin-bottom: 6px; }
.console #prompt { font-size: 0.98rem; }
.console-load { width: 100%; margin-top: 8px; }
.console-load[hidden] { display: none; }
.console-controls { margin: 8px 0 4px; gap: 8px; }
.console-note { margin: 4px 0 8px; font-size: 0.82rem; line-height: 1.4; }
.console-opts { margin-top: 8px; font-size: 0.9rem; border-top: 1px solid var(--rule-2); padding-top: 4px; }
.console-opts summary { cursor: pointer; color: var(--ink-2); min-height: 36px; display: flex; align-items: center; font-weight: 600; }
.console-opts > label { display: flex; margin: 4px 0; }
.opt-label { display: block; font-size: 0.85rem; color: var(--ink-2); margin: 8px 0 4px; }
.console-opts textarea { font-size: 0.88rem; }

.rail .console { padding: 12px 14px 6px; margin: 0 0 12px; border-color: var(--ink-3); }
.rail .console-head { margin-bottom: 4px; }
.rail .console-note { margin: 2px 0 6px; font-size: 0.78rem; }
.rail .rail-caption { min-height: 0; margin: 4px 0 8px; }
.rail .console-title { font-size: 1.05rem; }
.rail .console-controls .btn { padding: 8px 11px; min-height: 40px; font-size: 0.88rem; }
.rail .output { min-height: 56px; max-height: 17vh; overflow-y: auto; font-size: 0.95rem; line-height: 1.75; padding: 10px; }
.rail .run-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 0.78rem; margin-top: 6px; line-height: 1.35; }
.rail .rail-title { margin-top: 4px; }
@media (min-width: 1181px) and (max-height: 960px) {
  .rail .output { max-height: 13vh; }
  #machine svg { max-height: 28vh; }
  .rail #prompt { min-height: 0; }
}

/* ---------- token tracer ---------- */
.tracer { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 14px 0; }
.tv-top { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.tv-nav { display: flex; gap: 8px; }
.tv-layer { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; color: var(--ink-2); }
.tv-layer input { width: 220px; }
.tv-layer output { font-weight: 700; color: var(--ink); min-width: 2ch; font-variant-numeric: tabular-nums; }
.tv-follow { font-size: 0.88rem; color: var(--ink-3); }
.tv-strip { display: flex; gap: 3px; align-items: stretch; margin: 14px 0 8px; }
.tv-cell { border: 1px solid var(--rule); background: var(--panel-2); border-radius: 3px; cursor: pointer; padding: 0; min-height: 26px; }
.tv-cell.layer { flex: 1; min-width: 0; }
.tv-cell.end { padding: 0 8px; font: 600 0.75rem var(--sans); color: var(--ink-2); }
.tv-cell.done { background: #c7d0de; border-color: #c7d0de; }
.tv-cell.on { background: var(--sm); border-color: var(--sm); color: #fff; }
.tv-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tv-pill { font: 600 0.82rem var(--sans); color: var(--ink-2); background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; cursor: pointer; min-height: 32px; }
.tv-pill.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.tv-pill:disabled { opacity: 0.45; cursor: default; }
.tv-card { border-top: 1px solid var(--rule-2); padding-top: 12px; }
.tv-title { font-size: 1.12rem; margin: 0 0 4px; font-variation-settings: 'wdth' 106; }
.tv-plain { margin: 0 0 12px; max-width: 70ch; color: var(--ink); }
.tv-sub { font-size: 0.9rem; color: var(--ink-2); margin: 12px 0 6px; }
.tv-shape { font-variant-numeric: tabular-nums; margin: 6px 0 10px; font-size: 0.98rem; }
.tv-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 0; }
.tv-name { display: flex; flex-direction: column; }
.tv-name b { font-family: var(--mono); font-size: 0.92rem; }
.tv-name small { color: var(--ink-3); font-size: 0.76rem; }
.tv-data { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tv-nums { font-size: 0.8rem; white-space: pre; overflow: hidden; text-overflow: ellipsis; background: none; padding: 0; }
.tv-data canvas { width: 100%; height: 16px; border-radius: 2px; }
.tv-note { color: var(--ink-3); font-size: 0.78rem; }
.tv-arrow { margin-left: 150px; padding-left: 12px; color: var(--ink-3); font-weight: 700; font-size: 0.9rem; line-height: 1.1; }
.tv-worked { background: var(--panel-2); border-radius: var(--r-s); padding: 4px 12px 6px; margin-top: 10px; }
.tv-heads { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px 14px; margin-bottom: 8px; }
.tv-head { display: flex; flex-direction: column; gap: 3px; padding: 6px 8px; border: 1px solid var(--rule-2); border-radius: var(--r-s); }
.tv-hname { font-weight: 650; font-size: 0.85rem; }
.tv-hname small { font-weight: 400; color: var(--ink-3); }
.tv-hits { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.82rem; }
.tv-hit code { font-size: 0.8rem; }
.tv-pct { color: var(--ink-2); margin-left: 3px; font-variant-numeric: tabular-nums; }
.tv-guess { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-s); background: var(--sm-fill); font-size: 0.92rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.tv-gtok code { background: var(--panel); }
.tv-top10 { display: flex; flex-direction: column; gap: 3px; }
.tv-score { display: grid; grid-template-columns: 140px 100px minmax(0, 1fr) 60px; gap: 10px; align-items: center; font-size: 0.86rem; padding: 2px 4px; border-radius: 3px; }
.tv-score .lg { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tv-score .b { height: 12px; background: var(--rule-2); border-radius: 2px; overflow: hidden; }
.tv-score .b span { display: block; height: 100%; background: var(--ink); }
.tv-score .p { text-align: right; font-variant-numeric: tabular-nums; }
.tv-score.chosen { background: var(--sm-fill); }
@media (max-width: 860px) {
  .tv-row { grid-template-columns: 1fr; gap: 2px; }
  .tv-arrow { margin-left: 0; padding-left: 0; }
  .tv-layer input { width: 140px; }
  .tv-score { grid-template-columns: 90px minmax(0, 1fr) 54px; }
  .tv-score .lg { display: none; }
}
@media (max-width: 860px) {
  .tv-strip { gap: 1px; }
  .tv-cell.end { padding: 0 5px; font-size: 0.7rem; }
}

.jv-nums { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; }
.jv-num { display: grid; grid-template-columns: 110px max-content minmax(0, 1fr); gap: 12px; align-items: baseline; font-size: 0.8rem; }
.jv-num code { background: none; padding: 0; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.jv-num .jv-nlabel { font-weight: 600; }
.jv-num small { color: var(--ink-3); white-space: nowrap; }
@media (max-width: 860px) { .jv-num { grid-template-columns: 1fr; gap: 0; padding-bottom: 4px; } }

/* ---------- chapter 9: the prompt as a matrix ---------- */
.mx-striplabel { font-size: 0.85rem; color: var(--ink-3); margin: 14px 0 -6px; }
.mx-strip .tv-cell.layer { min-height: 40px; overflow: hidden; opacity: 0.5; }
.mx-strip .tv-cell.layer.done, .mx-strip .tv-cell.layer.on { opacity: 1; }
.mx-strip .tv-cell.layer.on { background: var(--panel); outline: 3px solid var(--sm); outline-offset: 1px; }
.mx-strip .tv-cell canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.mx-row { display: flex; gap: 8px; align-items: flex-start; overflow-x: auto; padding: 4px 0 10px; margin: 6px 0; }
.mx { margin: 0; min-width: 72px; display: flex; flex-direction: column; }
.mx figcaption { font-size: 0.78rem; line-height: 1.25; height: 2.6em; overflow: hidden; color: var(--ink-2); }
.mx figcaption b { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.mx-shape { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx-shape .dm, .mx-shape .dn, .mx-shape .dt { padding: 0 2px; }
.mx-box { position: relative; border: 1px solid var(--rule); border-radius: 2px; line-height: 0; }
.mx-cv { display: block; width: 100%; image-rendering: pixelated; }
.mx-box.mx-split::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to right, transparent 0 calc(100% / var(--heads) - 1.5px), #fff calc(100% / var(--heads) - 1.5px) calc(100% / var(--heads)));
}
.mx-hi { position: absolute; top: -3px; bottom: -3px; outline: 2px solid var(--sm); pointer-events: none; }
.mx-wfig { flex: 0 0 auto; min-width: 0; width: 76px; align-self: center; }
.mx-wfig figcaption { height: auto; margin-bottom: 3px; }
.mx-w { width: 64px; height: 64px; border: 1px solid var(--rule); background: var(--panel-2); line-height: 0; }
.mx-w canvas { width: 100%; height: 100%; display: block; }
.mx-wnote { font-size: 0.7rem; color: var(--ink-3); line-height: 1.2; margin-top: 3px; }
.mx-op { flex: 0 0 auto; align-self: center; color: var(--ink-2); font-weight: 650; font-size: 0.86rem; max-width: 92px; text-align: center; line-height: 1.25; }
.mx-tokfig { flex: 0 0 auto; min-width: 0; max-width: 96px; }
.mx-toks { display: flex; flex-direction: column; border-top: 1px solid transparent; }
.mx-toks span { display: block; height: var(--rh); line-height: var(--rh); font: 500 min(11px, var(--rh)) var(--mono); white-space: pre; overflow: hidden; text-overflow: ellipsis; text-align: right; padding-right: 4px; color: var(--ink-2); }
.mx-toks span.last { background: var(--sm-fill); color: var(--ink); font-weight: 700; }
.mx-toks.tiny span { font-size: 0; }
.mx-toks.tiny span.last { font-size: 0; }
.mx-lenfig { flex: 0 0 44px; min-width: 44px; }
.mx-lens { display: flex; flex-direction: column; border-top: 1px solid transparent; }
.mx-lens span { display: block; height: var(--rh); padding: 1px 0; }
.mx-lens i { display: block; height: 100%; background: var(--ink-3); border-radius: 0 2px 2px 0; min-width: 1px; }
.mx-say { max-width: 72ch; font-size: 0.92rem; color: var(--ink-2); margin: 2px 0 12px; }
.mx-heads { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 8px; }
.mx-head { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 6px; border: 1px solid var(--rule); border-radius: var(--r-s); background: var(--panel); cursor: pointer; font: 600 0.8rem var(--sans); color: var(--ink); text-align: left; }
.mx-head canvas { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; }
.mx-head small { font-weight: 400; color: var(--ink-3); font-size: 0.72rem; line-height: 1.2; }
.mx-head.on { border-color: var(--sm); box-shadow: 0 0 0 2px var(--sm); }
.mx-zoom { margin: 10px 0 6px; border: 1px solid var(--rule-2); border-radius: var(--r-s); padding: 8px 12px; }
.mx-zoom summary { cursor: pointer; font-weight: 650; font-size: 0.92rem; }
.mx-ztools { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 8px 0; font-size: 0.85rem; }
.mx-zscroll { overflow-x: auto; padding-bottom: 6px; }
.mx-zgrid { display: grid; grid-template-columns: auto auto; justify-content: start; }
.mx-zcols { display: flex; align-items: flex-end; height: 76px; }
.mx-zcols span { width: var(--cell); writing-mode: vertical-rl; transform: rotate(180deg); font: 500 min(11px, var(--cell)) var(--mono); line-height: var(--cell); white-space: pre; overflow: hidden; text-overflow: ellipsis; max-height: 76px; color: var(--ink-2); }
.mx-zrows { display: flex; flex-direction: column; }
.mx-zrows span { height: var(--cell); line-height: var(--cell); font: 500 min(11px, var(--cell)) var(--mono); white-space: pre; text-align: right; padding-right: 6px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.mx-zcv { image-rendering: pixelated; display: block; border: 1px solid var(--rule); }
.mx-huge { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; border: 1px dashed var(--ink-3); border-radius: 2px; color: var(--ink-3); font-size: 0.82rem; min-height: 60px;
  background: repeating-linear-gradient(90deg, var(--sm-fill) 0 2px, transparent 2px 6px); }
.mx-huge span { background: var(--panel); padding: 4px 8px; border-radius: 3px; }
.mx-gwrap { margin: 0 0 12px; }
.mx-gwrap summary { cursor: pointer; font-weight: 650; font-size: 0.92rem; margin-bottom: 6px; }
.mx-guesses { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; border: 1px solid var(--rule-2); border-radius: var(--r-s); }
.mx-g { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1.3fr); gap: 10px; padding: 3px 10px; font-size: 0.84rem; border-bottom: 1px solid var(--rule-2); align-items: baseline; }
.mx-g code { white-space: pre; }
.mx-g.head { position: sticky; top: 0; background: var(--panel-2); font-weight: 650; color: var(--ink-2); }
.mx-g.ok { background: #eef6f0; }
.mx-g.last { background: var(--sm-fill); }
.mx-tick { color: #2f7a46; }
@media (max-width: 860px) {
  .mx { min-width: 96px; }
  .mx-tokfig { max-width: 72px; }
  .mx-g { grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 3px 6px; font-size: 0.78rem; }
}

/* ---------- transformer loop ---------- */
.loop { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px 16px; margin: 14px 0; }
.loop svg { width: 100%; height: auto; display: block; }
.loop-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.loop-status { font-size: 0.88rem; color: var(--ink-2); margin-left: 8px; font-variant-numeric: tabular-nums; }
.loop-text { margin: 10px 0 2px; min-height: 3.2em; max-width: 72ch; }

/* ---------- forward / backward trainer ---------- */
.trainer { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 12px 0 16px; }
.tr-body { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.tr-col { display: flex; flex-direction: column; gap: 4px; }
.tr-col small { color: var(--ink-3); font-size: 0.78rem; }
.tr-row { display: flex; gap: 4px; }
.tr-cell { width: 64px; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font: 600 0.92rem var(--sans); font-variant-numeric: tabular-nums; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel-2); }
.tr-cell.in { background: var(--host-fill); border-color: var(--host); }
.tr-cell i { font-style: normal; font-weight: 800; }
.tr-cell.up { background: #e7f3e4; border-color: #3a7d2c; }
.tr-cell.up i { color: #2f6b22; }
.tr-cell.down { background: #fbe9e4; border-color: var(--pos); }
.tr-cell.down i { color: var(--pos); }
.tr-out { min-width: 230px; flex: 1; }
.tr-prob { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: 0.9rem; min-height: 36px; }
.tr-prob .b { height: 14px; background: var(--rule-2); border-radius: 3px; overflow: hidden; }
.tr-prob .b span { display: block; height: 100%; background: var(--ink); transition: width 300ms ease-out; }
.tr-prob.target .b span { background: var(--sm); }
.tr-prob.target code { background: var(--sm-fill); }
.tr-prob .p { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tr-ctl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tr-note { margin: 10px 0 0; min-height: 3em; max-width: 72ch; }
@media (prefers-reduced-motion: reduce) { .tr-prob .b span { transition: none; } }
.loop:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.loop-sep { width: 1px; align-self: stretch; background: var(--rule); margin: 0 4px; }
p.loop-status { margin: 6px 0 0; }

/* ---------- follow the shape ---------- */
.journey { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 16px; margin: 14px 0; }
.journey:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.jv-dots { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.jv-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--rule); background: var(--panel); cursor: pointer; padding: 0; }
.jv-dot.done { background: #c7d0de; border-color: #c7d0de; }
.jv-dot.on { background: var(--sm); border-color: var(--sm); }
.jv-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; margin-top: 14px; border-top: 1px solid var(--rule-2); padding-top: 12px; }
.jv-now { flex: none; display: flex; flex-direction: column; align-items: center; padding: 10px 16px; border-radius: var(--r-m); background: var(--ink); color: var(--panel); min-width: 170px; }
.jv-now small { font-size: 0.75rem; color: #aab6c9; }
.jv-now b { font-size: 1.3rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jv-stage { min-height: 300px; display: flex; align-items: center; overflow-x: auto; padding: 8px 0; }
.jv-row { display: flex; align-items: center; gap: 14px; }
.jv-row.enter { animation: jv-in 360ms ease-out; }
@keyframes jv-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.jv-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.jv-label code { font-size: 0.8rem; }
.jv-dim { font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.jv-op { color: var(--ink-2); font-weight: 650; font-size: 0.95rem; max-width: 190px; text-align: center; }
.jv-vec { position: relative; width: 20px; border: 1px solid var(--ink-3); border-radius: 2px; }
.jv-vec canvas, .jv-mat canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.jv-seg { position: absolute; left: -4px; right: -4px; height: 2px; background: var(--ink); }
.jv-mat { border: 1.5px solid var(--hbm); background: repeating-linear-gradient(45deg, var(--panel-2) 0 6px, var(--rule-2) 6px 7px); border-radius: 2px; }
.jv-vec.broken { border-bottom: none; }
.jv-vec.broken::after, .jv-mat.broken-v::after { content: ''; position: absolute; left: -3px; right: -3px; bottom: -2px; height: 10px; z-index: 1; background: linear-gradient(-45deg, transparent 33%, var(--panel) 33% 66%, transparent 66%) 0 0 / 10px 10px, linear-gradient(45deg, transparent 33%, var(--panel) 33% 66%, transparent 66%) 0 0 / 10px 10px; }
.jv-mat { position: relative; }
.jv-mat.broken-h::before { content: ''; position: absolute; top: -2px; bottom: -2px; right: -5px; width: 10px; z-index: 1; background: linear-gradient(45deg, transparent 33%, var(--panel) 33% 66%, transparent 66%) 0 0 / 10px 10px; }
.jv-tok { display: flex; flex-direction: column; align-items: center; padding: 8px 12px; border-radius: var(--r-m); background: var(--host-fill); border: 1px solid var(--host); }
.jv-tok small { font-size: 0.72rem; color: var(--host); }
.jv-tok b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.jv-note { margin-top: 0; }

.jv-ledger { margin-top: 12px; border-top: 1px solid var(--rule-2); padding-top: 12px; }
.jl-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; font-size: 0.95rem; margin-bottom: 8px; }
.jl-total b { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.jl-table { display: flex; flex-direction: column; overflow-x: auto; }
.jl-row { display: grid; grid-template-columns: 150px minmax(330px, 1fr) 110px 120px; gap: 10px; align-items: end; padding: 6px 6px; border-bottom: 1px solid var(--rule-2); opacity: 0.32; transition: opacity 250ms, background-color 250ms; min-width: 720px; }
.jl-row.seen { opacity: 1; }
.jl-row.cur { opacity: 1; background: var(--sm-fill); border-radius: 4px; }
.jl-name { font-weight: 650; }
.jl-formula { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; font-variant-numeric: tabular-nums; }
.jl-dim { display: inline-flex; flex-direction: column; align-items: center; font-family: var(--mono); font-size: 0.85rem; line-height: 1.1; }
.jl-dim sup { font-family: var(--sans); font-size: 0.72rem; color: var(--ink-3); vertical-align: baseline; }
.jl-x { color: var(--ink-3); }
.jl-times { color: var(--ink-2); font-size: 0.88rem; }
.jl-times.hot { color: var(--sm); font-weight: 700; }
.jl-sum { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .jl-row { transition: none; } }
@media (max-width: 860px) {
  .jv-head { flex-direction: column; }
  .jv-now { align-self: stretch; }
}
