/* nqub — The invention of trust
   Visual language follows the nqub ATM Reference Guide: paper, ink and one
   orange accent; Archivo for display, Inter for reading, JetBrains Mono for labels. */

:root {
  --paper: #E8DFD3;
  --paper-2: #DFD4C4;
  --ink: #2A2827;
  --ink-soft: #4A4643;
  --orange: #F16B24;
  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(22px, 4.6vw, 64px);
  --head: 70px;
  /* One type scale and one set of vertical positions for every card face. */
  --t-date: clamp(40px, min(11vw, 8vh), 88px);
  --t-title: clamp(30px, min(8vw, 5.8vh), 64px);
  --t-body: clamp(15px, min(4.1vw, 2.2vh), 18px);
  --sp-date: clamp(18px, 3.6vh, 40px);
  --sp-title: clamp(10px, 2vh, 20px);
  --sp-body: clamp(12px, 2.2vh, 22px);
  --foot: 88px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  /* Pinned to the window rather than sized with 100dvh: Chrome on iOS can
     measure dvh a few pixels taller than the visible area, which let the
     page scroll slightly. */
  position: fixed;
  inset: 0;
  height: auto;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body[data-tone=orange] { background: var(--orange); }
body[data-tone=dark] { background: var(--ink); }
::selection { background: var(--orange); color: var(--paper); }
h1, h2, h3, p { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; color: inherit; }
button { font: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.eyebrow, .tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ---------- track & card tones ---------- */

#track {
  height: 100%;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  outline: none;
}
#track::-webkit-scrollbar { display: none; }

.card {
  --bg: var(--paper);
  --fg: var(--ink);
  --soft: var(--ink-soft);
  --mute: rgba(42, 40, 39, .52);
  --rule: rgba(42, 40, 39, .18);
  --rule-strong: rgba(42, 40, 39, .45);
  --accent: var(--orange);
  --logo-letters: var(--ink);
  --logo-bar: var(--orange);
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  padding: calc(var(--head) + env(safe-area-inset-top)) 0 calc(var(--foot) + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--fg);
  /* Each card clips its own fixed header and footer. The chrome stays still
     while the next card's version is revealed exactly at the card's edge. */
  position: relative;
  clip-path: inset(0);
}
/* Cards more than one away from the current one are skipped by the renderer,
   which keeps dialogs and swipes quick on phones. */
.card.far { content-visibility: hidden; }
.card.orange {
  --bg: var(--orange);
  --soft: var(--ink);
  --mute: rgba(42, 40, 39, .68);
  --rule: rgba(42, 40, 39, .28);
  --rule-strong: rgba(42, 40, 39, .6);
  --accent: var(--paper);
  /* On orange the bar would vanish, so the mark goes single-colour ink. */
  --logo-bar: var(--ink);
}
.card.dark {
  --bg: var(--ink);
  --fg: var(--paper);
  --soft: rgba(232, 223, 211, .82);
  --mute: rgba(232, 223, 211, .52);
  --rule: rgba(232, 223, 211, .16);
  --rule-strong: rgba(232, 223, 211, .42);
  --logo-letters: var(--paper);
}

/* ---------- header (fixed; every card carries its own coloured copy) ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: calc(var(--head) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: env(safe-area-inset-top) var(--gutter) 0;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.brand { display: block; line-height: 0; }
.logo { height: 26px; width: auto; display: block; }
.logo .letters { fill: var(--logo-letters); }
.logo .bar { fill: var(--logo-bar); }
.brand-sep { width: 1px; height: 20px; background: var(--rule-strong); }
.brand-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.bar-actions { margin-left: auto; display: flex; gap: 6px; }
.bar-actions button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 12px;
  min-height: 36px;
  border: 1px solid var(--rule-strong);
  color: var(--fg);
  transition: background .12s, color .12s, border-color .12s;
}
.bar-actions button:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- faces ---------- */

.inner {
  flex: 1;
  min-height: 0;
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(2400px) rotateY(0deg);
  transition: transform .65s cubic-bezier(.2, .7, .15, 1);
}
.card.flipped .inner { transform: perspective(2400px) rotateY(180deg); }
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--bg);
  padding: clamp(14px, 2.6vh, 28px) var(--gutter) clamp(14px, 2.4vh, 26px);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
}
.front { transform: rotateY(0deg); }
.back { transform: rotateY(180deg); }
/* iOS Safari can ignore backface-visibility (it shows the mirrored front through
   the back), so the hidden face is also switched off once the turn passes edge-on. */
.front, .card.flipped .back { visibility: visible; transition: visibility 0s .15s; }
.back, .card.flipped .front { visibility: hidden; transition: visibility 0s .15s; }

.scene-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  color: var(--mute);
}
.scene-meta .eyebrow { color: var(--fg); }
.scene-meta .tag { white-space: nowrap; }
/* Long places wrap on phones; reserving two lines keeps every title at the same height. */
.scene-meta .eyebrow { min-height: 2.8em; }
@media (min-width: 800px) { .scene-meta .eyebrow { min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

.story-layout { display: flex; flex-direction: column; flex: 1; min-height: 0; position: relative; }
.copy, .back-copy { max-width: 760px; position: relative; z-index: 1; }

/* Front and back share date → title → body, so text sits at the same place on every card. */
.date {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--t-date);
  line-height: .9;
  letter-spacing: -.035em;
  white-space: nowrap;
  margin: var(--sp-date) 0 var(--sp-title);
}
.back .date { color: var(--mute); }
.date small {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  margin-left: 10px;
  vertical-align: .9em;
  color: var(--mute);
}

h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: .95;
}
h2 em, h3 em { font-style: normal; color: var(--accent); }
.front h2, .back h2 { font-size: var(--t-title); max-width: 13em; margin: 0 0 var(--sp-body); text-wrap: balance; }
.front .story, .back .detail {
  font-size: var(--t-body);
  line-height: 1.55;
  max-width: 34em;
  color: var(--soft);
  text-wrap: pretty;
}

.front.cover .date {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: clamp(22px, 5vh, 56px) 0 clamp(14px, 2.4vh, 24px);
}
.front.cover h2 { font-weight: 900; font-size: clamp(54px, min(15vw, 11vh), 128px); line-height: .88; letter-spacing: -.04em; max-width: 900px; }
.front.cover .story { max-width: 460px; font-size: clamp(15px, min(4.4vw, 2.4vh), 19px); color: var(--fg); }

.cover-strip {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule-strong);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hazard {
  flex: 1;
  height: 10px;
  background: repeating-linear-gradient(-45deg, currentColor 0 3px, transparent 3px 8px);
  opacity: .7;
}

.photo { min-height: 0; flex: 1; margin: clamp(14px, 2.6vh, 26px) calc(-1 * var(--gutter)) calc(-1 * clamp(14px, 2.4vh, 26px)); position: relative; overflow: hidden; border-top: 1px solid var(--rule-strong); }
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; filter: grayscale(1) contrast(1.05); display: block; }
.photo:after { content: ''; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(42, 40, 39, .75)); }
.photo figcaption { position: absolute; bottom: 12px; left: var(--gutter); right: var(--gutter); color: var(--paper); z-index: 1; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- back ---------- */

.takeaway {
  margin-top: clamp(18px, 3.4vh, 34px);
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--accent);
  max-width: 600px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(18px, min(5vw, 3vh), 26px);
  line-height: 1.2;
  letter-spacing: -.015em;
}
.card.orange .takeaway { border-left-color: var(--ink); }

/* ---------- interactive machines ---------- */

.machine { margin-top: clamp(12px, 2.4vh, 24px); border-top: 1px solid var(--rule-strong); padding-top: 8px; max-width: 480px; }
.machine .row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); }
.machine .row b { font-family: var(--display); font-size: clamp(22px, 3.4vh, 30px); font-weight: 900; letter-spacing: -.03em; color: var(--fg); text-transform: none; }
.machine .result { font-family: var(--display); font-weight: 800; font-size: calc(var(--t-body) * 1.3); letter-spacing: -.02em; line-height: 1.1; margin: 12px 0 10px; }
.machine button {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  min-height: 42px;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  border: 1px solid var(--fg);
}
.machine button:hover { background: transparent; color: var(--fg); }
.machine .small { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; line-height: 1.5; color: var(--mute); margin-top: 8px; }
.machine .kv span:first-child { flex: 1; }
.machine .kv span:last-child { min-width: 64px; text-align: right; }
.net-direction { height: 1px; flex: 1; background: currentColor; position: relative; margin: 0 10px; align-self: center; }
.net-direction:after { content: ''; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-right: 1px solid; border-top: 1px solid; transform: rotate(45deg); }

/* ---------- footer (one per card) ---------- */

.foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: calc(var(--foot) + env(safe-area-inset-bottom));
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.navigation { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.navigation button {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  min-height: 40px;
}
.navigation button:disabled { opacity: .25; cursor: default; }
.navigation .flip-btn { font-weight: 400; color: var(--mute); border: 1px solid var(--rule-strong); padding: 0 14px; }
.navigation .flip-btn[aria-pressed=true] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.navigation .next span, .navigation .prev span { color: var(--accent); }
.card.orange .navigation .next span, .card.orange .navigation .prev span { color: inherit; }
.timeline { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.timeline > span { white-space: nowrap; }
.rail { height: 6px; flex: 1; background: var(--rule); position: relative; overflow: hidden; }
.rail span { position: absolute; inset: 0 auto 0 0; background: var(--fg); }
.card:not(.orange) .rail span { background: var(--accent); }
.rail i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--bg); }

/* ---------- dialogs ---------- */

dialog {
  color: var(--ink);
  background: var(--paper);
  width: min(660px, calc(100% - 32px));
  max-width: none;
  height: min(740px, 92dvh);
  max-height: 92dvh;
  border: 1px solid var(--ink);
  margin: auto;
  padding: 0;
  overflow: hidden;
  flex-direction: column;
}
dialog[open] { display: flex; animation: slideIn .14s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(42, 40, 39, .62); }
.dialoghead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(42, 40, 39, .45);
  flex-shrink: 0;
}
.dialoghead .eyebrow { color: rgba(42, 40, 39, .52); display: block; margin-bottom: 8px; }
.dialoghead h2 { font-size: 32px; line-height: 1; letter-spacing: -.02em; }
.dialoghead h2 em { color: var(--orange); }
.close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(42, 40, 39, .45);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.close:hover { border-color: var(--ink); color: var(--ink); }

#chapters, #sourceContent { flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px; }
#chapters { display: grid; align-content: start; }
#chapters button {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: baseline;
  text-align: left;
  padding: 14px 0;
  border-bottom: 1px solid rgba(42, 40, 39, .18);
  position: relative;
}
#chapters button:hover { background: var(--paper-2); }
#chapters b { font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: rgba(42, 40, 39, .52); letter-spacing: .08em; }
#chapters span { font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.15; letter-spacing: -.01em; }
#chapters i { font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: rgba(42, 40, 39, .52); white-space: nowrap; }
#chapters button[aria-current] b, #chapters button[aria-current] i { color: var(--orange); font-weight: 600; }
#chapters .chapter[aria-expanded=true] { border-bottom-color: rgba(42, 40, 39, .45); }
#chapters .chapter-card { padding: 9px 0 9px 54px; grid-template-columns: 34px 1fr auto; background: rgba(223, 212, 196, .5); }
#chapters .chapter-card span { font-family: var(--sans); font-weight: 500; font-size: 14px; letter-spacing: 0; }
#chapters button[aria-current]::before { content: ''; position: absolute; left: -28px; top: 0; bottom: 0; width: 4px; background: var(--orange); }

#sourceContent { padding-top: 22px; }
#sourceContent .eyebrow { color: rgba(42, 40, 39, .52); }
#sourceContent h3 { font-size: 28px; margin: 10px 0 16px; }
#sourceContent p:not(.eyebrow) { font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
#sourceContent .credit { font-family: var(--mono); font-size: 10.5px !important; margin-top: 18px; }
.source-links { display: grid; margin: 18px 0; border-top: 1px solid rgba(42, 40, 39, .45); }
.source-links a {
  padding: 16px 0;
  border-bottom: 1px solid rgba(42, 40, 39, .18);
  text-decoration: none;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1.5;
  text-transform: uppercase;
}
.source-links a:hover { color: var(--ink); }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  background: var(--paper-2);
  border-top: 1px solid rgba(42, 40, 39, .45);
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pager button { min-height: 40px; padding: 0 4px; font-weight: 600; }
.pager button:disabled { opacity: .3; cursor: default; }
.pager span { color: rgba(42, 40, 39, .52); }

/* ---------- larger screens ---------- */

@media (min-width: 800px) {
  .has-photo .story-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 6vw; }
  .has-photo .photo { margin: 0 calc(-1 * var(--gutter)) calc(-1 * clamp(14px, 2.4vh, 26px)) 0; border-top: 0; border-left: 1px solid var(--rule-strong); }
  .front.has-machine .story-layout { display: block; }
}

/* ---------- phones ---------- */

@media (max-width: 799px) {
  :root { --head: 60px; --foot: 84px; }
  .brand-label, .brand-sep { display: none; }
  .logo { height: 22px; }
  .bar-actions button { padding: 6px 10px; font-size: 10.5px; }
  .scene-meta .eyebrow { font-size: 10px; letter-spacing: .08em; }
  .navigation button { font-size: 10.5px; letter-spacing: .06em; }
  .navigation .flip-btn { padding: 0 10px; }
  .timeline { font-size: 9px; gap: 10px; }
  dialog { width: 100%; margin: auto 0 0; height: min(740px, 90dvh); border-width: 1px 0 0; }
  .dialoghead { padding: 20px 22px 16px; }
  .dialoghead h2 { font-size: 26px; }
  #chapters, #sourceContent { padding-left: 22px; padding-right: 22px; }
  #chapters button[aria-current]::before { left: -22px; }
  #chapters i { display: none; }
  #chapters button { grid-template-columns: 34px 1fr; }
  .pager { padding: 8px 22px; }
}

/* Short screens: drop decoration before the story. */
@media (max-height: 560px) {
  .photo { display: none; }
}
@media (max-height: 640px) {
  .back.lab .takeaway { display: none; }
  :root { --head: 54px; --foot: 70px; }
  .foot { gap: 6px; }
  .navigation button { min-height: 34px; }
}
@media (max-height: 480px) {
  :root { --head: 48px; --foot: 50px; --t-date: 28px; --sp-date: 8px; }
  .scene-meta, .timeline, .cover-strip { display: none; }
  .back-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; max-width: 100%; }
  .back-copy h2, .back-copy .date { grid-column: 1 / -1; }
  .takeaway { margin-top: 0; }
  .front.has-machine .copy { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; max-width: 100%; }
  .has-machine .machine { grid-column: 2; grid-row: 1 / 4; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- chapter stacks (isometric line art) ---------- */

.card.plan { --hl: rgba(241, 107, 36, .26); }
/* A faint drafting grid behind the drawing marks stack cards apart from story cards. */
.stack-figure {
  background-image: linear-gradient(rgba(42, 40, 39, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(42, 40, 39, .07) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: center;
  margin: clamp(10px, 2vh, 20px) calc(-1 * var(--gutter)) clamp(10px, 2vh, 20px);
  padding: clamp(8px, 2vh, 20px) var(--gutter);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stack-face .copy h2 { margin-bottom: 0; }
.stack-figure { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.stack-art { width: 100%; height: 100%; max-width: 560px; overflow: visible; }
.stack-art * { vector-effect: non-scaling-stroke; }
.stack-art .guide { stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 4 4; }
.stack-art .layer { cursor: pointer; transition: transform .45s cubic-bezier(.2, .7, .15, 1); }
.stack-art .layer.lifted { transform: translateY(var(--lift)); }
.stack-art .top { fill: var(--bg); stroke: var(--fg); stroke-width: 1.2; stroke-linejoin: round; transition: fill .2s; }
.stack-art .side { fill: var(--paper-2); stroke: var(--fg); stroke-width: 1.2; stroke-linejoin: round; }
.stack-art .layer.on .top { fill: var(--hl); }
.stack-art .motif * { fill: none; stroke: var(--fg); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.stack-art .motif .dash { stroke-dasharray: 3 3; }
.stack-art .motif .hl { fill: var(--hl); }
.stack-art .layer.on .motif * { stroke: var(--fg); stroke-width: 1.4; }
.stack-art .leader { fill: none; stroke: var(--fg); stroke-width: 1; }
.stack-art text { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; fill: var(--fg); }
.stack-art .num { fill: var(--mute); }
.stack-art .layer.on text, .stack-art .layer.on .num { fill: var(--orange); font-weight: 600; }

.stack-caption {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  min-height: calc(var(--t-body) * 5.2);
}
.caption-text { flex: 1; min-width: 0; }
.caption-text .eyebrow { display: block; color: var(--mute); margin-bottom: 6px; }
.caption-text b { display: block; font-family: var(--display); font-weight: 800; font-size: calc(var(--t-body) * 1.3); letter-spacing: -.02em; line-height: 1.1; }
.caption-text p { font-size: var(--t-body); line-height: 1.45; color: var(--soft); margin-top: 4px; }
.caption-steps { display: flex; gap: 6px; }
.caption-steps button { width: 40px; height: 40px; border: 1px solid var(--rule-strong); font-family: var(--mono); font-size: 15px; background: var(--bg); }
.caption-steps button:hover:not(:disabled) { background: var(--fg); color: var(--bg); }
.caption-steps button:disabled { opacity: .3; cursor: default; }

.recap { list-style: none; margin: 0; padding: 0; max-width: 34em; border-top: 1px solid var(--rule-strong); }
.recap li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: calc(var(--t-body) * .88); line-height: 1.4; color: var(--soft); }
.recap b { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--mute); padding-top: .2em; }
.recap strong { color: var(--fg); font-weight: 600; }
.back .recap + .takeaway, .back .detail + .recap { margin-top: var(--sp-body); }

/* Short screens: the drawing is height-bound, so its labels scale up, and the
   recap keeps only the layer names. */
@media (max-height: 760px) {
  .stack-art text { font-size: 15px; }
  .recap-text { display: none; }
  .recap li { padding: 6px 0; }
}
@media (max-height: 760px) and (min-width: 800px) {
  .recap-text { display: inline; }
}
/* Wide screens: the recap runs in two columns so long chapters fit. */
@media (min-width: 800px) {
  .recap { column-count: 2; column-gap: 40px; max-width: 920px; }
  .recap li { break-inside: avoid; }
}
