/* Prepack, revived — longform layout on a 12-column grid. */

@font-face {
  font-family: "Source Serif 4";
  src: url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url(fonts/ibm-plex-sans-latin-wght-normal.woff2) format("woff2-variations");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url(fonts/ibm-plex-mono-latin-400-italic.woff2) format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url(fonts/ibm-plex-mono-latin-600-normal.woff2) format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --bg: #ffffff;
  --ink: #18191d;
  --ink-2: #3c3f46;
  --muted: #676b73;
  --rule: #e2e2de;
  --rule-strong: #c9c9c4;
  --panel: #f6f6f3;
  --panel-border: #e4e3de;
  --accent: #a8431f;
  --accent-soft: #f7ebe5;

  --w-pass: #1f2126;
  --w-bloat: #9fa2a8;
  --w-crash: #dcdcd8;
  --w-wrong: var(--accent);

  --t-k: #36456a;
  --t-s: #7b5626;
  --t-c: #8b8e95;

  --col: 4.75rem;
  --gap: 1.5rem;
  --text-size: 1.1875rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316;
    --ink: #e9e7e2;
    --ink-2: #c7c5bf;
    --muted: #9b9da4;
    --rule: #2b2d32;
    --rule-strong: #3d4047;
    --panel: #191a1e;
    --panel-border: #2b2c31;
    --accent: #e3876a;
    --accent-soft: #2e1f1a;
    --w-pass: #e9e7e2;
    --w-bloat: #7c7f86;
    --w-crash: #34363c;
    --t-k: #a9b8d8;
    --t-s: #d6b588;
    --t-c: #7f828a;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 4.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--text-size);
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 70%, transparent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.8em; }
strong { font-weight: 600; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--bg); padding: 0.5rem 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar and contents ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 3.25rem;
  padding: 0 max(1.25rem, calc((100vw - 76rem) / 2));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
}
.topbar-title { font-weight: 600; text-decoration: none; white-space: nowrap; }
.topbar-section { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.toc-button {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
}
.toc-button:hover, .toc-button[aria-expanded="true"] { border-color: var(--ink); }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }

.toc-panel {
  position: fixed;
  z-index: 6;
  top: 3.5rem;
  right: max(1rem, calc((100vw - 76rem) / 2));
  width: min(25rem, calc(100vw - 2rem));
  max-height: calc(100vh - 5rem);
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 1rem 1.25rem;
}
.toc-panel ol { list-style: none; margin: 0; padding: 0; }
.toc-panel > ol > li { padding: 0.5rem 0; border-top: 1px solid var(--rule); }
.toc-panel > ol > li:first-child { border-top: 0; }
.toc-panel > ol > li > a { font-weight: 600; text-decoration: none; display: flex; gap: 0.6rem; }
.toc-panel ol ol { margin: 0.3rem 0 0 1.6rem; }
.toc-panel ol ol a { text-decoration: none; color: var(--muted); display: block; padding: 0.12rem 0; }
.toc-panel a:hover, .toc-panel a.active { color: var(--accent); }
.toc-num { font-variant-numeric: tabular-nums; color: var(--accent); min-width: 1rem; }

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: minmax(1.25rem, 1fr) repeat(12, minmax(0, var(--col))) minmax(1.25rem, 1fr);
  column-gap: var(--gap);
}
/* Default measure: columns 3–9. Lines 4/11 in grid terms (line 2 is the start of column 1). */
.grid > * { grid-column: 4 / 11; min-width: 0; }
.grid > .w, .grid > .problems, .grid > .approaches, .grid > .when, .grid > .opener, .grid > .wn { grid-column: 2 / 14; }

.wn { display: grid; grid-template-columns: subgrid; align-items: start; }
.wn > .b { grid-column: 3 / 10; }
.wn > .note { grid-column: 10 / 13; margin-top: 0.4rem; }
.grid > .wn { grid-column: 2 / 14; }
.wn > .b { grid-column: 3 / 10; }

/* ---------- text ---------- */

p { margin: 0 0 1.15em; }
.lede { font-size: 1.42rem; line-height: 1.5; color: var(--ink); margin-bottom: 1.6rem; }
h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.012em;
  margin: 3.75rem 0 1rem;
}
h4 { font-family: var(--sans); font-weight: 600; font-size: 1.08rem; line-height: 1.3; margin: 0 0 0.6rem; }
.grid > h4 { font-size: 1.15rem; margin: 2.75rem 0 0.75rem; }
em { font-style: italic; }
sup { line-height: 0; }

.note {
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
  border-top: 1px solid var(--rule-strong);
  padding-top: 0.6rem;
}
.note strong { color: var(--ink-2); }

/* ---------- cover ---------- */

.cover { padding: 5.5rem 0 4rem; row-gap: 0; }
.cover-text { grid-column: 2 / 14; }
.kicker {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 1.25rem;
}
.cover h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(3.4rem, 10.5vw, 9.25rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0 0 2rem;
}
.grid > .dek { grid-column: 2 / 10; grid-row: 2; font-size: 1.5rem; line-height: 1.45; color: var(--ink-2); max-width: 40rem; margin: 0 0 3.5rem; }
.grid > .cover-fig { grid-column: 2 / 10; grid-row: 3; margin: 0; }
.grid > .cover-main { grid-column: 2 / 10; grid-row: 2; }
.cover-main .dek { margin-bottom: 3rem; }
.cover-links { display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; margin-top: 1.25rem; font-family: var(--sans); font-size: 0.95rem; line-height: 1.5; color: var(--ink-3, var(--ink-2)); }
.cover-links a { color: var(--accent); }
.cover-stats .stat-row { margin: 0; }
.grid > .contents { grid-column: 10 / 14; grid-row: 2 / span 2; font-family: var(--sans); border-top: 2px solid var(--ink); padding-top: 0.75rem; align-self: start; margin-top: 0.4rem; }
.contents-title { font-size: 0.8rem; font-weight: 600; margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; }
.contents ol { list-style: none; padding: 0; margin: 0; }
.contents li { border-top: 1px solid var(--rule); }
.contents li:first-child { border-top: 0; }
.contents a { display: grid; grid-template-columns: 1.5rem 1fr; text-decoration: none; padding: 0.65rem 0; }
.contents a:hover .toc-title { color: var(--accent); }
.toc-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; }
.toc-deck { grid-column: 2; font-size: 0.8rem; color: var(--muted); line-height: 1.45; margin-top: 0.15rem; }

.waffles { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.waffle-head { font-family: var(--sans); font-size: 1rem; font-weight: 500; margin: 0; }
.waffle-head .big { font-size: 3.25rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin-right: 0.35rem; font-variant-numeric: tabular-nums; }
.accent { color: var(--accent); }
.waffle-sub { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 1rem; }
.waffle-sub strong { color: var(--ink); }
svg.waffle { width: 100%; height: auto; display: block; }
.w-pass { fill: var(--w-pass); background: var(--w-pass); }
.w-bloat { fill: var(--w-bloat); background: var(--w-bloat); }
.w-crash { fill: var(--w-crash); background: var(--w-crash); }
.w-wrong { fill: var(--w-wrong); background: var(--w-wrong); }
.legend { list-style: none; padding: 0; margin: 1.25rem 0 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-family: var(--sans); font-size: 0.82rem; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.45rem; vertical-align: -0.05rem; }
figcaption { font-family: var(--sans); font-size: 0.85rem; line-height: 1.5; color: var(--muted); }
.cover-fig figcaption { margin-top: 0.5rem; max-width: 36rem; }

/* ---------- part openers ---------- */

.part { padding-top: 7rem; }
.part + .part { border-top: 1px solid var(--rule); margin-top: 6rem; }
.opener { display: grid; grid-template-columns: subgrid; margin-bottom: 3rem; align-items: start; }
.part-num {
  grid-column: 1 / 3;
  font-family: var(--sans);
  font-weight: 200;
  font-size: 8.5rem;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: var(--accent);
  margin: 0;
}
.opener-text { grid-column: 3 / 12; }
.part-label { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; color: var(--muted); margin: 0 0 0.6rem; }
.opener h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem;
}
.deck { font-size: 1.35rem; line-height: 1.45; color: var(--ink-2); font-style: italic; max-width: 44rem; margin: 0; }

/* ---------- quotes ---------- */

.quote { margin: 1.75rem 0 2rem; padding-left: 1.25rem; border-left: 2px solid var(--accent); }
.quote blockquote { margin: 0; }
.quote blockquote p { margin: 0 0 0.5rem; font-size: 1.12rem; line-height: 1.55; color: var(--ink); font-style: italic; }
.quote figcaption { font-size: 0.82rem; }
.grid > .pull { grid-column: 2 / 11; margin: 3.25rem 0 3.5rem; }
.pull blockquote { margin: 0; position: relative; }
.pull blockquote p {
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0 0 1rem;
  text-indent: -0.42em;
}
.pull blockquote p::before { content: "“"; color: var(--accent); }
.pull blockquote p::after { content: "”"; color: var(--accent); }
.pull figcaption { font-size: 0.88rem; }
.pull figcaption::before { content: ""; display: inline-block; width: 1.5rem; height: 1px; background: var(--ink); vertical-align: middle; margin-right: 0.6rem; }

/* ---------- problems, approaches ---------- */

.problems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: calc(var(--gap) * 2); row-gap: 1rem; margin: 1rem 0 2.5rem; }
.problem { border-top: 1px solid var(--rule-strong); padding-top: 1.1rem; }
.problem p { font-size: 1.02rem; line-height: 1.6; }
.problem .quote { margin: 1rem 0 1.25rem; }
.problem .quote blockquote p { font-size: 1rem; }
.pn { font-family: var(--mono); font-weight: 600; color: var(--accent); font-size: 0.85em; margin-right: 0.35rem; }

.approaches { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--gap) * 2); margin: 1rem 0 2.5rem; }
.approach { border-top: 2px solid var(--ink); padding-top: 1rem; }
.approach h3 { margin: 0 0 0.75rem; font-size: 1.6rem; }
.approach p { font-size: 1.05rem; }
.approach-tag { font-family: var(--sans); font-size: 0.82rem; font-weight: 600; color: var(--accent); margin: 0 0 0.35rem; }

.when { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--gap) * 1.5); margin: 0.5rem 0 2rem; }
.when > div { border-top: 1px solid var(--rule-strong); padding-top: 0.9rem; }
.when p { font-size: 1rem; }

.links { padding-left: 1.1rem; }
.links li { margin-bottom: 0.5rem; }
.methods li { margin-bottom: 0.45rem; font-size: 1.02rem; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: 1.75rem 0 2.25rem; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.88rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.grid > .table-caption { font-family: var(--sans); font-size: 0.85rem; line-height: 1.5; color: var(--muted); margin: 1.75rem 0 -1rem; max-width: 52rem; }
caption { caption-side: top; text-align: left; font-size: 0.85rem; color: var(--muted); padding-bottom: 0.75rem; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
thead th { font-weight: 600; font-size: 0.78rem; color: var(--muted); border-bottom: 1px solid var(--ink); vertical-align: bottom; }
tbody th { font-weight: 500; }
tfoot th, tfoot td { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 600; }
td.num, th.num { white-space: nowrap; }
.compare th[scope="row"] { width: 22%; color: var(--ink-2); }
.compare td { width: 39%; }
.verdict .v { font-weight: 600; white-space: nowrap; }
.muted, .muted-row { color: var(--muted); }
.bench td strong { font-weight: 600; }
.failrow th, .failrow td { color: var(--muted); }
.blk code { font-size: 0.82em; }
.react-perf td { font-weight: 500; }

.folders .mbar { display: inline-block; width: 7rem; height: 0.55rem; background: var(--w-crash); vertical-align: middle; margin-right: 0.6rem; }
.folders .mbar span { display: block; height: 100%; width: var(--v); background: var(--w-bloat); }
.folders .mbar.new span { background: var(--w-pass); }
.folders .mnum { display: inline-block; min-width: 3.2rem; }
.folders .wr { color: var(--accent); font-weight: 600; }
.folders tfoot .mnum { font-weight: 600; }

.audit td:first-child { width: 55%; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin: 1.75rem 0 1rem; }
.stat { border-top: 2px solid var(--ink); padding-top: 0.6rem; font-family: var(--sans); }
.stat-num { display: block; font-size: 2.75rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
.stat:first-child .stat-num { color: var(--accent); }
.stat-label { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }

details.all-cases { margin: 1rem 0 2rem; font-family: var(--sans); }
details.all-cases summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; padding: 0.6rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.cases { font-size: 0.78rem; }
.cases th code { font-size: 0.95em; }
.cases td.s { white-space: nowrap; }
.cases .s-wrong { color: var(--accent); font-weight: 600; }
.cases .s-crash, .cases .s-bloat { color: var(--muted); }
.cases td.detail { color: var(--muted); font-size: 0.95em; word-break: break-word; }

/* ---------- charts ---------- */

.chart { margin: 2rem 0 2.5rem; }
.bars { font-family: var(--sans); }
.bar-row { margin-bottom: 0.9rem; }
.bar-label { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.3rem; }
.bar-label .muted { font-weight: 400; }
.bar { display: flex; height: 1.6rem; }
.seg { display: block; height: 100%; border-right: 1px solid var(--bg); overflow: hidden; }
.seg:last-child { border-right: 0; }
.seg-num { display: block; font-size: 0.75rem; font-weight: 600; line-height: 1.6rem; padding-left: 0.4rem; color: var(--ink); }
.seg.w-pass .seg-num, .seg.w-wrong .seg-num { color: var(--bg); }
.timeline { list-style: none; padding: 0; margin: 1.5rem 0 2.5rem; font-family: var(--sans); font-size: 0.92rem; line-height: 1.45; border-left: 1px solid var(--rule-strong); }
.timeline li { position: relative; display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: 0.4rem 0 0.4rem 1.25rem; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 0.85rem; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--ink); }
.timeline li.key::before { background: var(--accent); border-color: var(--accent); }
.timeline .tl-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline li.key .tl-text { font-weight: 600; }
.pipeline { list-style: none; padding: 0; margin: 0 0 0.9rem; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; font-family: var(--sans); counter-reset: none; }
.pipeline li { position: relative; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 6px; padding: 0.8rem 0.9rem 0.9rem; }
.pipeline li + li::before { content: "→"; position: absolute; left: -0.72rem; top: 1.6rem; width: 0.75rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.pipeline .pnum { display: block; font-size: 0.78rem; font-weight: 600; color: var(--accent); }
.pipeline .ptitle { display: block; font-size: 1.05rem; font-weight: 600; margin: 0.15rem 0 0.35rem; }
.pipeline .pline { display: block; font-size: 0.82rem; line-height: 1.45; color: var(--muted); }
@media (max-width: 760px) {
  .pipeline { grid-template-columns: 1fr; }
  .pipeline li + li::before { content: "↓"; left: 50%; top: -0.78rem; }
}

/* ---------- code comparisons ---------- */

.cmp { margin: 2.25rem 0 2.75rem; }
.grid > .cmp { grid-column: 2 / 14; }
@media (min-width: 1180px) {
  .grid > .cmp.cols-3, .grid > .cmp.cols-4 {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(calc(100vw - 4rem), 92rem);
  }
}
.cmp > figcaption { max-width: 46rem; margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--ink-2); }
.cmp > figcaption code { font-size: 0.85em; }
.trim-note { color: var(--muted); }
.panes { display: grid; gap: 0.9rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .cols-2 .panes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4 .panes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1180px) {
  .cols-3 .panes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  overflow: hidden;
}
.pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem 0.5rem;
  border-bottom: 1px solid var(--panel-border);
  font-family: var(--sans);
}
.pane-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.pane-input .pane-label { color: var(--muted); }
.pane-input { align-self: start; }
.pane-sub, .pane-file { font-size: 0.75rem; color: var(--muted); }
.pane-file { font-family: var(--mono); }
.pane-status { font-family: var(--sans); font-size: 0.8rem; font-weight: 500; padding: 0.45rem 0.9rem; border-bottom: 1px solid var(--panel-border); color: var(--ink-2); }
.pane[data-status="wrong"] .pane-status { color: var(--accent); background: var(--accent-soft); }
.pane[data-status="wrong"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--panel-border)); }
.pane[data-status="ok"] .st-icon { color: var(--ink); }
.st-icon { display: inline-block; width: 1em; font-weight: 600; }
pre.code {
  margin: 0;
  padding: 0.85rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.6;
  overflow: auto;
  max-height: 34rem;
  tab-size: 2;
  color: var(--ink);
}
pre.code code { font-size: inherit; }
pre.code.wrap { white-space: pre-wrap; word-break: break-all; }
pre.code.excerpt { max-height: none; }
.gap { font-family: var(--sans); font-size: 0.75rem; color: var(--muted); padding: 0.35rem 0.9rem; border-top: 1px dashed var(--rule-strong); border-bottom: 1px dashed var(--rule-strong); background: var(--bg); }
.no-output { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); padding: 1rem 0.9rem; font-style: italic; }
.diag { border-top: 1px dashed var(--rule-strong); padding: 0.55rem 0.9rem 0.6rem; }
.diag-label { display: block; font-family: var(--sans); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.25rem; }
.diag pre { margin: 0; font-family: var(--mono); font-size: 0.7rem; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.gap-inline { color: var(--muted); font-family: var(--sans); }
.pane-meta { margin-top: auto; font-family: var(--sans); font-size: 0.72rem; color: var(--muted); padding: 0.45rem 0.9rem; border-top: 1px solid var(--panel-border); }
.t-k { color: var(--t-k); }
.t-s, .t-r, .t-n { color: var(--t-s); }
.t-c { color: var(--t-c); font-style: italic; }

.runs { margin-top: 0.75rem; overflow-x: auto; }
.runs table { font-size: 0.8rem; }
.runs th, .runs td { padding: 0.45rem 1rem 0.45rem 0; }
.runs tbody th { font-weight: 400; color: var(--ink-2); font-family: var(--mono); font-size: 0.92em; }
.runs td code { font-size: 0.95em; word-break: break-all; }
.runs td.ne { color: var(--accent); }
.runs td.ne code { color: var(--accent); }
.ne-mark { font-weight: 600; white-space: nowrap; }
.runs td.na { color: var(--muted); font-style: italic; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--rule); margin-top: 6rem; padding: 2rem max(1.25rem, calc((100vw - 76rem) / 2)) 3rem; font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }

/* ---------- smaller screens ---------- */

@media (max-width: 1100px) {
  .grid > *, .grid > .pull { grid-column: 2 / 14; }
  .grid > p, .grid > h3, .grid > .quote, .grid > ul, .grid > .lede { max-width: 42rem; }
  .wn { display: block; }
  .wn > .b { max-width: 42rem; }
  .wn > .note { max-width: 42rem; margin: 0.25rem 0 1.75rem; }
  .grid > .dek, .grid > .cover-fig, .grid > .contents, .grid > .cover-main { grid-column: 2 / 14; grid-row: auto; }
  .grid > .contents { margin-top: 3rem; }
  .opener-text { grid-column: 3 / 14; }
}
@media (max-width: 760px) {
  :root { --text-size: 1.0625rem; --gap: 1rem; }
  .grid { grid-template-columns: 1.1rem repeat(12, minmax(0, 1fr)) 1.1rem; column-gap: 0; }
  .lede { font-size: 1.22rem; }
  .dek { font-size: 1.2rem; }
  .cover { padding-top: 3rem; }
  .waffles { gap: 1.25rem; }
  .waffle-head .big { font-size: 2.3rem; }
  .problems, .approaches, .when, .stat-row { grid-template-columns: 1fr; }
  .opener { display: block; }
  .part-num { font-size: 4.5rem; margin-bottom: 0.75rem; }
  .part { padding-top: 4rem; }
  .part + .part { margin-top: 3.5rem; }
  .deck { font-size: 1.15rem; }
  h3 { font-size: 1.3rem; margin-top: 3rem; }
  .topbar-section { display: none; }
  .grid > .pull { margin: 2.25rem 0; }
  .runs thead { display: none; }
  .runs table, .runs tbody, .runs tr, .runs th, .runs td { display: block; width: 100%; }
  .runs tr { border-bottom: 1px solid var(--rule); padding: 0.4rem 0 0.5rem; }
  .runs th, .runs td { border: 0; padding: 0.15rem 0; }
  .runs td::before { content: attr(data-label); display: block; font-size: 0.72rem; color: var(--muted); }
  .folders .mbar { width: 3rem; }
  .topbar .toc-button { margin-left: auto; }
  th, td { padding-right: 0.6rem; }
}

@media print {
  .topbar, .toc-panel { display: none; }
  pre.code { max-height: none; }
}
