@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "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: "Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

/* Tokens. One accent, one meaning: vermilion = P2, cobalt = HD, chartreuse = measured evidence. */
:root {
  --paper: #f3efe6;
  --paper-2: #ebe5d8;
  --card: #fbf9f4;
  --ink: #1d2321;
  --ink-2: #4a524f;
  --rule: #d6cfbf;
  --stage: #2a2e2f;
  --stage-ink: #ecebe5;
  --p2: #bd3d1d;
  --on-accent: #ffffff;
  --p2-ink: #a3321a;
  --p2-tint: #f6ddd3;
  --hd: #2f5fd0;
  --hd-ink: #2147a6;
  --hd-tint: #dbe4f8;
  --lime: #c9dc5a;
  --lime-ink: #3d4a06;
  --lime-tint: #eef3c9;
  --obs: #e6b84a;
  --obs-tint: #f8ebc6;
  --obs-ink: #5c4307;
  --open-ink: #4a524f;
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151918; --paper-2: #1c2120; --card: #1f2423; --ink: #ecebe5; --ink-2: #a9b0ac;
    --rule: #333a38; --stage: #262a2b; --p2: #ef6a48; --p2-ink: #ff9a7e; --p2-tint: #3a211a;
    --hd: #6d93ef; --hd-ink: #9db7f6; --hd-tint: #1c2640; --lime: #c9dc5a; --lime-ink: #d9e88a;
    --lime-tint: #2b3112; --obs: #e6b84a; --obs-tint: #3a2f12; --obs-ink: #f0d18a; --open-ink: #a9b0ac; --on-accent: #151918;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151918; --paper-2: #1c2120; --card: #1f2423; --ink: #ecebe5; --ink-2: #a9b0ac;
  --rule: #333a38; --stage: #262a2b; --p2: #ef6a48; --p2-ink: #ff9a7e; --p2-tint: #3a211a;
  --hd: #6d93ef; --hd-ink: #9db7f6; --hd-tint: #1c2640; --lime: #c9dc5a; --lime-ink: #d9e88a;
  --lime-tint: #2b3112; --obs: #e6b84a; --obs-tint: #3a2f12; --obs-ink: #f0d18a; --open-ink: #a9b0ac; --on-accent: #151918;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--font); font-feature-settings: "ss01";
  text-rendering: optimizeLegibility; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--hd); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.08; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
code { font: 0.86em var(--mono); background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 4px; }
b, strong { font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }

/* Unofficial notice: above the fold, every page. */
.unofficial { background: var(--ink); color: var(--paper); font-size: 13.5px; line-height: 1.45; }
.unofficial p { max-width: var(--wrap); margin: 0 auto; padding: 9px var(--gutter); }

.masthead { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.masthead__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 58px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; text-decoration: none; font-size: 17px; }
.wordmark__dim { font-weight: 500; color: var(--ink-2); }
.wordmark__mark { width: 24px; height: 24px; }
.toplinks { display: flex; gap: 4px; }
.toplinks a { text-decoration: none; font-size: 14.5px; font-weight: 600; padding: 7px 11px; border-radius: 999px; color: var(--ink-2); }
.toplinks a:hover { background: var(--paper-2); color: var(--ink); }
@media (max-width: 720px) { .toplinks { display: none; } }

/* Evidence grade chips */
.g { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 7px 4px; border-radius: 5px; vertical-align: 0.15em; white-space: nowrap; }
.g--m { background: var(--lime-tint); color: var(--lime-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 70%, transparent); }
.g--o { background: var(--obs-tint); color: var(--obs-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--obs) 60%, transparent); }
.g--v { background: var(--paper-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); }
.g--x { background: transparent; color: var(--open-ink); box-shadow: inset 0 0 0 1px var(--ink-2); border: 0; background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--ink-2) 14%, transparent) 4px 5px); }

/* Hero */
.hero { padding: clamp(36px, 6vw, 72px) 0 28px; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(28px, 4vw, 60px); align-items: center; }
.kicker { font: 600 13px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 18px; }
.hero h1 { font-size: clamp(40px, 5.6vw, 76px); font-weight: 850; letter-spacing: -0.035em; line-height: 0.98; }
.hero h1 em { font-style: italic; font-weight: 800; color: var(--p2); background: linear-gradient(transparent 62%, var(--lime) 62% 90%, transparent 90%); padding: 0 0.04em; }
.lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-2); margin: 22px 0 22px; max-width: 34em; }
.grades { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; font-size: 14px; color: var(--ink-2); }
.grades li { display: flex; gap: 8px; align-items: baseline; }
.grades .g { min-width: 78px; text-align: center; }

.triptych { margin: 0; }
.triptych__row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.tile { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--stage); aspect-ratio: 605 / 842; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile--ref img { object-fit: contain; background: #c9c9c7; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; z-index: 1; }
.tile--ref::before { background: var(--ink); }
.tile--p2::before { background: var(--p2); }
.tile--hd::before { background: var(--hd); }
.tile__tag { position: absolute; left: 8px; bottom: 8px; right: 8px; font: 600 12.5px/1.25 var(--font); color: #f4f2ec; background: rgba(20, 22, 23, 0.78); padding: 6px 8px; border-radius: 7px; }
.triptych figcaption { font-size: 13.5px; color: var(--ink-2); margin-top: 12px; }

.stats { margin: clamp(32px, 5vw, 56px) 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.stats > div { padding: 16px 16px 4px 0; border-right: 1px solid var(--rule); padding-left: 16px; }
.stats > div:first-child { padding-left: 0; }
.stats > div:last-child { border-right: 0; }
.stats dt { font-size: 13.5px; color: var(--ink-2); line-height: 1.35; min-height: 2.7em; }
.stats dd { margin: 6px 0 0; font-size: clamp(34px, 3.6vw, 48px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stats small { display: block; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); margin-top: 6px; }
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div { border-right: 0; padding-left: 0; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
  .stats > div:last-child { grid-column: 1 / -1; border-bottom: 0; }
}
@media (max-width: 520px) { .grades { grid-template-columns: 1fr; } .triptych__row { gap: 6px; } .tile__tag { font-size: 10px; left: 4px; right: 4px; bottom: 4px; padding: 4px 5px; } }

/* Layout with section rail */
.layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); padding-top: clamp(28px, 4vw, 48px); }
.rail { position: relative; }
.toc { position: sticky; top: 84px; list-style: none; margin: 0; padding: 0; counter-reset: toc; font-size: 14px; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 26px 1fr; padding: 6px 0; text-decoration: none; color: var(--ink-2); border-left: 2px solid transparent; padding-left: 10px; margin-left: -12px; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 600 11.5px/1.9 var(--mono); }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--p2); font-weight: 650; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } .rail { display: none; } }
.content { min-width: 0; max-width: 860px; }

.sec { padding: clamp(40px, 6vw, 72px) 0; border-top: 1px solid var(--rule); }
.sec:first-child { border-top: 0; padding-top: 0; }
.sec__no { font: 600 13px/1 var(--mono); color: var(--p2); margin: 0 0 12px; letter-spacing: 0.06em; }
.sec h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 820; margin-bottom: 20px; }
.sec > p { max-width: 42em; }
.big { font-size: clamp(21px, 2.1vw, 27px); line-height: 1.38; font-weight: 500; letter-spacing: -0.012em; }
mark { background: linear-gradient(transparent 55%, var(--lime) 55% 92%, transparent 92%); color: inherit; padding: 0 0.05em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) mark { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--lime) 45%, transparent) 55% 92%, transparent 92%); } }
.aside { font-size: 14px; color: var(--ink-2); }
.note { color: var(--ink-2); font-size: 14.5px; padding: 18px; }

/* Route pair */
.routepair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 24px; }
.route { border-radius: var(--radius); padding: 22px 22px 18px; background: var(--card); border: 1px solid var(--rule); position: relative; overflow: hidden; }
.route::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; }
.route--p2::before { background: var(--p2); }
.route--hd::before { background: var(--hd); }
.route h3 { font: 600 13px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.route--p2 .dot { background: var(--p2); }
.route--hd .dot { background: var(--hd); border-radius: 2px; }
.route__claim { font-size: clamp(26px, 2.6vw, 34px); font-weight: 820; letter-spacing: -0.025em; margin: 10px 0 14px; line-height: 1.05; }
.route--p2 .route__claim { color: var(--p2-ink); }
.route--hd .route__claim { color: var(--hd-ink); }
.route dl { margin: 0 0 14px; font-size: 14.5px; }
.route dl > div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--rule); }
.route dt { color: var(--ink-2); }
.route dd { margin: 0; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13.5px; }
.route dd b { font-family: var(--font); font-size: 15px; }
.route__read { font-size: 15px; margin: 0; }
@media (max-width: 760px) { .routepair { grid-template-columns: 1fr; } }

/* Chart */
.chart { margin: 8px 0 28px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 18px 14px; }
.chart__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chart__title { font-weight: 700; margin: 0; }
.chart__plot { position: relative; }
.chart__plot svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--mono); }
.chart__plot .axis line, .chart__plot .grid line { stroke: var(--rule); }
.chart__plot .grid line { stroke-dasharray: 2 4; }
.chart__plot .axis text, .chart__plot .grid text { fill: var(--ink-2); font-size: 11px; }
.chart__plot .label { fill: var(--ink-2); font-size: 11.5px; font-family: var(--font); }
.chart__plot .zone { font-family: var(--font); font-size: 12.5px; font-weight: 650; }
.chart__plot .zone--p2 { fill: var(--p2-ink); }
.chart__plot .zone--hd { fill: var(--hd-ink); }
.pt { cursor: pointer; transition: opacity 0.2s, transform 0.2s; transform-box: fill-box; transform-origin: center; }
.pt--P2 { fill: var(--p2); }
.pt--HD, .pt--HDUltra { fill: var(--hd); }
.pt--HDUltra { fill: var(--card); stroke: var(--hd); stroke-width: 2.4; }
.pt[data-kind="rigged"] { stroke: var(--ink); stroke-width: 1.6; }
.pt.is-dim { opacity: 0.12; }
.pt:focus { outline: none; }
.pt:focus-visible, .pt.is-hot { transform: scale(1.6); stroke: var(--ink); stroke-width: 2; }
.chart__readout { font: 13px/1.5 var(--mono); color: var(--ink-2); min-height: 3em; margin: 6px 0 4px; }
.chart__readout b { color: var(--ink); }
.chart figcaption, .chart > figcaption { font-size: 13.5px; color: var(--ink-2); }
.chart__table summary { cursor: pointer; font-size: 14px; font-weight: 600; margin-top: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.legend .l-p2 { background: var(--p2); }
.legend .l-hd { background: var(--hd); }
.legend .l-ultra { border: 2.4px solid var(--hd); }
.legend .l-rig { border: 1.6px solid var(--ink); background: transparent; }

/* Segmented controls */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--paper-2); border-radius: 999px; border: 1px solid var(--rule); }
.seg button { font: 600 13.5px/1 var(--font); color: var(--ink-2); background: transparent; border: 0; border-radius: 999px; padding: 9px 13px; cursor: pointer; min-height: 36px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.seg--wrap { border-radius: 16px; }
.seg--wrap button { border-radius: 12px; }

/* Tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
caption { text-align: left; font-weight: 700; padding: 0 0 10px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-top: 1px solid var(--rule); }
thead th { font: 600 12px/1.2 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); border-top: 0; }
tbody th { font-weight: 600; color: var(--ink-2); width: 22%; }
.cmp { margin-top: 26px; }
.cmp .c-p2 { color: var(--p2-ink); }
.cmp .c-hd { color: var(--hd-ink); }
#survey-table { font: 12.5px/1.4 var(--mono); }
#survey-table td, #survey-table th { padding: 6px 10px 6px 0; white-space: nowrap; }
#survey-table td.n { text-align: right; font-variant-numeric: tabular-nums; }

.facts { display: grid; gap: 10px; }
.facts p { margin: 0; padding: 14px 16px; background: var(--card); border-radius: 10px; border: 1px solid var(--rule); font-size: 15.5px; }
.facts .g { margin-right: 6px; }

/* Live viewer */
.viewer { margin: 26px 0 0; background: var(--stage); color: var(--stage-ink); border-radius: calc(var(--radius) + 4px); padding: 12px; }
.viewer__bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.viewer .seg { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.viewer .seg button { color: #c9cbc6; }
.viewer .seg button:hover { color: #fff; }
.viewer .seg button[aria-pressed="true"] { background: var(--stage-ink); color: #1c1f20; }
.viewer[data-active="p2"] .seg:first-child button[aria-pressed="true"] { background: var(--p2); color: var(--on-accent); }
.viewer[data-active="hd"] .seg:first-child button[aria-pressed="true"],
.viewer[data-active="retopo"] .seg:first-child button[aria-pressed="true"] { background: var(--hd); color: var(--on-accent); }
.viewer__stage { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: stretch; background: #2f3334; border-radius: 12px; }
.viewer__side { display: flex; flex-direction: column; justify-content: space-between; padding: 18px 16px 14px 0; }
.viewer__stage img { width: auto; max-width: 100%; max-height: 660px; justify-self: center; border-radius: 12px; transition: opacity 0.18s; }
.viewer__stage img.is-swapping { opacity: 0.35; }
.viewer__facts { margin: 0; font-size: 13.5px; }
.viewer__facts > div { padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.12); }
.viewer__facts dt { font: 600 11px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #a8aca7; }
.viewer__facts dd { margin: 3px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.viewer__note { font-size: 15px; line-height: 1.5; color: #dcddd8; margin: 0 0 16px; min-height: 4.5em; }
@media (max-width: 760px) {
  .viewer__stage { grid-template-columns: 1fr; }
  .viewer__side { padding: 0 14px 12px; }
  .viewer__note { min-height: 3em; }
  .viewer__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
  .viewer__facts dd { font-size: 15px; }
}

/* Pair figures */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 18px; }
.pair figure, .split__fig, .desk { margin: 0; }
.pair img, .split__fig img { border-radius: var(--radius); background: var(--stage); width: 100%; }
.pair figcaption, .split__fig figcaption, .desk figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.findings { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.findings li { padding-left: 0; }
.findings .g { margin-right: 6px; }

/* Motion chain */
.split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; align-items: start; margin-bottom: 22px; }
.chain { list-style: none; margin: 0; padding: 0; counter-reset: c; }
.chain li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule); font-size: 15.5px; }
.chain li b { display: block; font-size: 17px; margin-bottom: 2px; }
.chain__cost { font: 600 20px/1 var(--mono); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 56px; border-radius: 12px; background: var(--p2-tint); color: var(--p2-ink); }
.chain__cost::after { content: "credits"; font-size: 9.5px; letter-spacing: 0.04em; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split__fig { max-width: 340px; } }

.callout { border-left: 5px solid var(--p2); background: var(--card); padding: 16px 18px; border-radius: 0 12px 12px 0; font-size: 16px; max-width: none !important; }
.callout--warn { border-left-color: var(--obs); }

/* Repairs grid */
.repairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.repairs article { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 18px 14px; display: flex; flex-direction: column; }
.repairs h3 { font-size: 20px; font-weight: 780; margin-bottom: 8px; }
.repairs p { font-size: 15px; margin-bottom: 10px; }
.repairs .tagline { margin: auto 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 900px) { .repairs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .repairs { grid-template-columns: 1fr; } }

/* Chooser */
.chooser { margin: 22px 0 26px; }
.chooser__panel { margin-top: 14px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 20px; }
.plan { margin: 0; }
.plan > div { display: grid; grid-template-columns: 210px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.plan > div:first-child { border-top: 0; }
.plan dt { font: 600 12px/1.5 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); padding-top: 2px; }
.plan dd { margin: 0; font-size: 16.5px; }
@media (max-width: 640px) { .plan > div { grid-template-columns: 1fr; gap: 4px; } }

.twoways { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.twoways__title { grid-column: 1 / -1; font-weight: 700; margin: 0; }
.way { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 18px; border-radius: var(--radius); }
.way p { margin: 0; font-size: 15px; }
.way b { display: block; font-size: 17px; }
.way__sum { font-size: 44px; font-weight: 850; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.way__sum::after { content: " cr"; font: 600 13px var(--mono); letter-spacing: 0; }
.way--p2 { background: var(--p2-tint); }
.way--p2 .way__sum { color: var(--p2-ink); }
.way--hd { background: var(--hd-tint); }
.way--hd .way__sum { color: var(--hd-ink); }
@media (max-width: 640px) { .twoways { grid-template-columns: 1fr; } }

/* Ledger */
.ledger { margin: 22px 0 20px; }
.ledger__bar { display: flex; height: 64px; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--ink); }
.lg { display: flex; flex-direction: column; justify-content: center; padding: 0 10px; font-size: 12.5px; line-height: 1.15; min-width: 0; white-space: nowrap; overflow: hidden; border-right: 1.5px solid var(--ink); }
.lg:last-child { border-right: 0; }
.lg b { font: 600 18px/1 var(--mono); }
.lg--hd { background: var(--hd); color: var(--on-accent); }
.lg--hd2 { background: var(--hd-tint); color: var(--hd-ink); }
.lg--p2 { background: var(--p2); color: var(--on-accent); }
.lg--p2b { background: var(--p2-tint); color: var(--p2-ink); }
.lg--left { background: repeating-linear-gradient(135deg, var(--card) 0 7px, var(--paper-2) 7px 9px); color: var(--ink-2); }
.ledger figcaption { font-size: 14px; color: var(--ink-2); margin-top: 10px; }
@media (max-width: 560px) { .lg { padding: 0 5px; font-size: 10.5px; } .lg b { font-size: 14px; } }

.desk img { border-radius: var(--radius); border: 1px solid var(--rule); margin-top: 18px; }

/* Limits */
.limits { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 10px; }
.limits h3 { font-size: 20px; margin-bottom: 10px; }
.limits ul, .limits ol { margin: 0; padding-left: 1.2em; display: grid; gap: 9px; font-size: 15.5px; }
@media (max-width: 760px) { .limits { grid-template-columns: 1fr; } }

/* Footer */
.foot { margin-top: 40px; background: var(--ink); color: var(--paper); padding: 44px 0 52px; font-size: 14.5px; }
.foot__grid { display: grid; grid-template-columns: 1.1fr 1.4fr 1fr; gap: 32px; }
.foot p { margin: 0 0 0.6em; color: color-mix(in srgb, var(--paper) 78%, transparent); }
.foot__h { font: 600 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px; color: var(--paper); }
.wordmark--foot { color: var(--paper) !important; font-size: 18px; margin-bottom: 12px !important; }
@media (max-width: 860px) { .foot__grid { grid-template-columns: 1fr; gap: 22px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .masthead, .rail, .seg, .skip { display: none; }
  body { background: #fff; color: #000; }
  .layout { display: block; }
}
.lg--hd { flex: 55 1 0; } .lg--p2 { flex: 20 1 0; } .lg--p2b { flex: 20 1 0; } .lg--hd2 { flex: 40 1 0; } .lg--left { flex: 65 1 0; }

/* Pair viewer */
.pv { margin: 8px 0 28px; background: var(--stage); color: var(--stage-ink); border-radius: calc(var(--radius) + 4px); padding: 12px; }
.pv__bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.pv .seg { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.pv .seg button { color: #c9cbc6; }
.pv .seg button:hover { color: #fff; }
.pv .seg button[aria-pressed="true"] { background: var(--stage-ink); color: #1c1f20; }
.pv .seg button:disabled { color: #9a9d98; cursor: not-allowed; }
.pv .seg button[aria-pressed="true"]:disabled { background: rgba(255,255,255,0.12); color: #c9cbc6; }
.pv__stage { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #2b2f30; }
.pv__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.pv__stage canvas:active { cursor: grabbing; }
.pv__stage::after { content: ""; position: absolute; top: 12px; bottom: 12px; left: 50%; width: 1px; background: rgba(255,255,255,0.14); pointer-events: none; }
.pv__label { position: absolute; top: 12px; font: 600 12.5px/1 var(--font); padding: 7px 10px; border-radius: 999px; color: #fff; z-index: 2; pointer-events: none; }
.pv__label--l { left: 12px; background: #bd3d1d; }
.pv__label--r { right: 12px; background: #2f5fd0; }
.pv__gate { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; }
.pv__gate img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(0.9) brightness(0.62); }
.pv__gatebox { position: relative; max-width: 400px; margin: 16px; text-align: center; background: rgba(20, 22, 23, 0.82); padding: 22px 22px 20px; border-radius: 16px; backdrop-filter: blur(6px); }
.pv__gatebox p { color: #d6d7d2; font-size: 15px; margin: 0 0 14px; }
.pv__gatebox .pv__gatetitle { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 8px; }
.pv__load { font: 700 15px/1 var(--font); color: #1d2321; background: var(--lime); border: 0; border-radius: 999px; padding: 14px 20px; cursor: pointer; }
.pv__load:hover { filter: brightness(1.06); }
.pv:not([data-state="idle"]) .pv__gate { display: none; }
.pv__home { position: absolute; right: 12px; bottom: 12px; z-index: 2; font: 600 12.5px/1 var(--font); color: #e8e8e3; background: rgba(20,22,23,0.7); border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.pv[data-state="idle"] .pv__home { display: none; }
.pv__status { font: 13px/1.5 var(--mono); color: #c9cbc6; margin: 10px 4px 2px; min-height: 1.5em; }
.pv figcaption { font-size: 13.5px; color: #a9aea9; margin: 6px 4px 2px; }
.pv figcaption .g--m { background: #2b3112; color: #d9e88a; }
@media (max-width: 640px) { .pv__stage { aspect-ratio: 4 / 5; } .pv__gatebox { padding: 16px; } .pv__gatebox .pv__gatetitle { font-size: 19px; } }

/* Piece inversion figure */
.stats--inline { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 22px 0 22px; }
.stats--inline > div:last-child { grid-column: auto; }
@media (max-width: 640px) { .stats--inline { grid-template-columns: 1fr; } .stats--inline > div { border-right: 0; } }
.inversion { margin: 0 0 22px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.inv__row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.inv__label { margin: 0; font: 600 12px/1.3 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.inv__bar { display: flex; height: 44px; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--ink); }
.iv { display: flex; align-items: center; padding: 0 8px; font: 600 13px/1 var(--mono); white-space: nowrap; overflow: hidden; min-width: 0; border-right: 1.5px solid var(--ink); }
.iv:last-child { border-right: 0; }
.iv--a { background: var(--ink); color: var(--paper); }
.iv--b { background: var(--p2); color: var(--on-accent); }
.iv--c { background: var(--p2-tint); color: var(--p2-ink); }
.iv--d { background: var(--obs); color: #1d2321; }
.iv--e { background: var(--lime); color: #1d2321; }
.iv--f { background: repeating-linear-gradient(135deg, var(--card) 0 6px, var(--paper-2) 6px 8px); color: var(--ink-2); }
.iv-c-e { flex: 58 1 0; } .iv-c-b { flex: 15 1 0; } .iv-c-a { flex: 6 1 0; } .iv-c-c { flex: 6 1 0; } .iv-c-d { flex: 2 1 0; padding: 0; } .iv-c-f { flex: 7 1 0; }
.iv-t-e { flex: 7.5 1 0; } .iv-t-b { flex: 16.5 1 0; } .iv-t-a { flex: 62.8 1 0; } .iv-t-c { flex: 11.3 1 0; } .iv-t-d { flex: 0.4 1 0; padding: 0; } .iv-t-f { flex: 1.5 1 0; padding: 0; }
.inv__legend { list-style: none; margin: 14px 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 13.5px; color: var(--ink-2); }
.inv__legend li { display: flex; gap: 8px; align-items: baseline; }
.inv__legend i { flex: none; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--ink); transform: translateY(1px); }
.inversion figcaption { font-size: 13.5px; color: var(--ink-2); }
.montage { margin: 0 0 22px; }
.montage img { border-radius: var(--radius); width: 100%; background: var(--stage); }
.montage figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
@media (max-width: 640px) { .inv__row { grid-template-columns: 1fr; gap: 6px; } .inv__legend { grid-template-columns: 1fr; } .iv { font-size: 11px; padding: 0 4px; } }
