:root {
  --bg: #e6edf3; --panel: #f7fafc; --fg: #142433; --muted: #52687c; --line: #c9d6e0; --cell: #dfe8ef;
  --red: #c9302c; --green: #17803d; --plane: #123f73; --mine: #1f6fb2; --theirs: #c8591a;
  --pos: #1f6fb2; --neg: #c8591a; --neutral: #eef1f3; --on: #0f6b45; --off: #8496a6;
  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1721; --panel: #15212d; --fg: #e6eef5; --muted: #95a9ba; --line: #2a3a49; --cell: #1c2a37;
  --red: #f0625c; --green: #4ccb7c; --plane: #8fc3f7; --mine: #5ba6e6; --theirs: #e8894f;
  --pos: #5ba6e6; --neg: #e8894f; --neutral: #24323f; --on: #5fd0a9; --off: #6d8193; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0e1721; --panel: #15212d; --fg: #e6eef5; --muted: #95a9ba; --line: #2a3a49; --cell: #1c2a37;
  --red: #f0625c; --green: #4ccb7c; --plane: #8fc3f7; --mine: #5ba6e6; --theirs: #e8894f;
  --pos: #5ba6e6; --neg: #e8894f; --neutral: #24323f; --on: #5fd0a9; --off: #6d8193; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--display); line-height: 1.55; font-size: 16px; }
.wrap { max-width: 900px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right, 0px)) 56px max(16px, env(safe-area-inset-left, 0px)); }
nav.crumbs { font: 400 .78rem var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 18px; }
a { color: var(--plane); }
h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.12; text-wrap: balance; }
.lede { color: var(--muted); margin: 0 0 8px; max-width: 70ch; font-size: 1.05rem; }
h2 { margin: 40px 0 8px; font-size: 1.32rem; line-height: 1.25; }
h3 { margin: 20px 0 6px; font-size: 1rem; }
p { margin: 0 0 12px; max-width: 72ch; }
ul, ol { margin: 0 0 12px; padding-left: 22px; max-width: 72ch; }
li { margin-bottom: 6px; }
/* Text colour: running text (paragraphs and list items) is grey; headings, bold lead-ins and box titles are bright.
   Tables stay bright, since they're data to scan rather than text to read. Links keep their own colour. */
p, li { color: var(--muted); }
h1, h2, h3, h4, strong, b, dt, th, td { color: var(--fg); }
/* A table whose cells are explanations rather than data: the text is grey like other running text, while bold titles
   and number columns stay bright. */
table.prose td { color: var(--muted); }
table.prose td.num, table.prose td strong { color: var(--fg); }
code, .mono { font-family: var(--mono); font-size: .86em; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 16px; margin: 14px 0; }
/* "About this page": a small panel near the top that says what kind of page the reader is on. */
.about { background: var(--panel); border: 1px solid var(--line); padding: 12px 16px; margin: 18px 0 10px; }
.about strong { display: block; margin-bottom: 4px; }
.about p { margin: 0; max-width: none; }
.note { border-left: 3px solid var(--plane); padding: 8px 14px; background: var(--panel); margin: 14px 0; max-width: 72ch; }
.note p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 10px 0 14px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 10px 7px 0; text-align: left; vertical-align: top; }
th { font-weight: 600; }
td.num, th.num { text-align: right; font-family: var(--mono); font-size: .84rem; font-variant-numeric: tabular-nums; padding-right: 12px; }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
button { font: 600 .82rem var(--display); color: var(--fg); background: var(--panel); border: 1px solid var(--line); padding: 7px 11px; cursor: pointer; min-height: 34px; }
.panel button { background: var(--bg); }
button:hover { border-color: var(--muted); }
button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--plane); outline-offset: 2px; }
.split { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 680px) { .split, .split.even { grid-template-columns: minmax(0, 1fr); } }
svg.grid { width: 100%; height: auto; display: block; max-width: 420px; }
.grid-title { font: 600 .78rem var(--mono); color: var(--muted); margin: 0 0 4px; }
.layers { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; margin: 12px 0; }
.layer { flex: 1 1 120px; background: var(--panel); border: 1px solid var(--line); padding: 10px; min-width: 0; }
.layer b { display: block; font-size: .9rem; }
.layer .count { font: 600 1.15rem var(--mono); display: block; margin: 2px 0; }
.layer small { color: var(--muted); font-size: .78rem; display: block; line-height: 1.35; }
.arrow { align-self: center; color: var(--muted); font: 400 1rem var(--mono); }
@media (max-width: 680px) { .arrow { display: none; } .layer { flex-basis: 100%; } }
.fires { font: 600 .76rem var(--mono); white-space: nowrap; }
.fires.yes { color: var(--on); }
.fires.no { color: var(--off); }
.bar { height: 8px; background: var(--cell); border-radius: 0 4px 4px 0; overflow: hidden; margin-top: 3px; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--plane); border-radius: 0 4px 4px 0; }
.explain { font-size: .94rem; margin: 10px 0 0; }
/* The reading column: text on the page itself, and in the overview's intro panel, sits in one column of the same width,
   centred on the same axis as the full-width boxes, so all its left edges line up. */
:root { --measure: 40rem; }
.wrap > :is(nav.crumbs, h1, h2, h3, p, ol, .note), .wrap > ul:not(.legend),
.intro > :is(h2, h3, p, ul) { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font: 400 .74rem var(--mono); color: var(--muted); list-style: none; padding: 0; }
.legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.legend i { width: 12px; height: 12px; display: inline-block; flex: none; border: 1px solid var(--line); }
details { margin: 10px 0; font-size: .86rem; }
summary { cursor: pointer; color: var(--muted); font: 400 .78rem var(--mono); }
.scroll-table { overflow-x: auto; }
.scroll-table table { font: 400 .72rem var(--mono); }
.scroll-table td, .scroll-table th { padding: 2px 8px 2px 0; text-align: right; white-space: nowrap; }
input[type=range] { width: 100%; accent-color: var(--plane); }
.rowline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.rowline label { font: 400 .78rem var(--mono); color: var(--muted); }
#tip { position: fixed; z-index: 20; pointer-events: none; background: var(--fg); color: var(--bg); font: 400 .74rem var(--mono); padding: 4px 8px; max-width: 260px; display: none; }
.kernel { display: inline-grid; grid-template-columns: repeat(3, 56px); gap: 2px; font: 600 .8rem var(--mono); }
.kernel span { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.kernels { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0; }
@media (max-width: 420px) { .kernel { grid-template-columns: repeat(3, 44px); } }
