/* Triage Room — Dialect A: The Shared Record.
   Many partial accounts become one record; everyone can read it, each side owns its part.
   Everything shared lives in ../shared/case-study.css. This file holds only the dialect:
   orange marks the shortage itself · the page is dark only while the story is scattered ·
   rows and lanes · the anchored record · the five-question ledger, which settles. */
@import url("../shared/case-study.css?v=4");

:root {
  --accent: #e8461f;          /* the shortage: marks and large type (3.40:1 on paper) */
  --accent-ink: #b8361a;      /* small text (5.06:1 on paper) */
  --accent-on-deep: #ff7a59;  /* on ink (6.94:1) */
  --accent-tint: #fde3da;     /* the ledger only */
  --deep: var(--ink);
}

/* ---------- Owner glyphs: ownership by shape and label, never by colour ---------- */
.own { display: inline-block; flex: 0 0 auto; width: 11px; height: 11px; margin-right: 6px; border: 1.5px solid currentColor; vertical-align: -1px; }
.own.sup { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.own.oem { background: linear-gradient(90deg, transparent 50%, currentColor 50%); }
.own.shr { background: currentColor; }
.owner-tag { display: inline-flex; align-items: center; font: 700 11px/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
/* The shortage itself: the one thing the accent marks */
.obj { display: inline; padding: 1px 6px; background: var(--accent); color: var(--ink); font-weight: 650; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- 4W orientation ---------- */
.four-w { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.w-panel { position: relative; min-height: 380px; padding: 30px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.w-panel h3 { margin: 52px 0 32px; font-size: clamp(30px, 3.5vw, 52px); font-weight: 600; line-height: .96; letter-spacing: -.055em; }
.panel-label { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid currentColor; font: 11px var(--mono); letter-spacing: .1em; }
.panel-label b { font-size: 12px; }
.people { display: flex; gap: 10px; }
.person { flex: 1; padding: 17px 14px; border: 1px solid var(--line); background: var(--white); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 20px; border-radius: 50%; background: var(--ink); color: var(--white); font: 11px var(--mono); }
.person p { margin: 0; }
.person b { display: block; font-size: 13px; }
.person small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.person em { display: block; margin-top: 12px; font-style: normal; font-size: 15px; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; }
.w-what { grid-column: span 2; min-height: auto; }
.w-wide { grid-column: span 2; }
.backbone { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 52px; }
.backbone span { display: flex; align-items: center; gap: 12px; font-size: clamp(17px, 1.9vw, 27px); font-weight: 700; letter-spacing: -.035em; }
.backbone span b { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid var(--ink); border-radius: 50%; font: 11px var(--mono); }
.backbone i { font-style: normal; color: var(--muted); font-size: 30px; }
/* The "why" panel is about the scattered response, so it is the one dark card here */
.dark-card { background: var(--ink); color: var(--paper); }
.consequence { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 30px; text-align: center; }
.consequence span, .consequence strong { font-size: 20px; }
.consequence i { font-style: normal; color: var(--muted-on-ink); }
.consequence strong { padding: 8px 14px; background: var(--white); color: var(--ink); }
.w-when { background: var(--paper-2); }
.context-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.context-cloud span { padding: 8px 12px; border: 1px solid var(--ink); border-radius: 2px; background: rgba(255, 255, 255, .5); font: 14px/1.3 var(--sans); }
.annotation { position: absolute; right: 30px; bottom: 26px; margin: 0; font: 12px/1.35 var(--mono); text-align: right; transform: rotate(-3deg); }

/* ---------- The disconnect: fragments that never meet. Dashed = off the record. ---------- */
.fragments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.fragment { position: relative; min-height: 300px; padding: 26px; border: 1px dashed rgba(255, 255, 255, .34); background: var(--ink-2); }
.fragment .label { color: var(--muted-on-ink); }
.fragment h3 { margin: 46px 0 10px; font-size: 27px; font-weight: 600; letter-spacing: -.04em; line-height: 1.02; }
.fragment p { margin: 0; color: var(--text-on-ink); font-size: 15px; line-height: 1.5; }
.fragment .q { position: absolute; left: 26px; right: 26px; bottom: 24px; padding-top: 14px; border-top: 1px dashed rgba(255, 255, 255, .28); color: var(--white); font: 600 15px/1.35 var(--sans); }
.fragment:not(:last-child)::after {
  content: "re-explained"; position: absolute; z-index: 2; right: -32px; top: 50%; padding: 4px 6px; background: var(--white); color: var(--ink);
  font: 700 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; transform: translateY(-50%) rotate(-90deg); white-space: nowrap;
}
.js .fragments.reveal .fragment { transition: transform var(--t-reveal) var(--ease); }
.js .fragments.reveal:not(.is-visible) .fragment:nth-child(odd) { transform: translateY(10px) rotate(-.6deg); }
.js .fragments.reveal:not(.is-visible) .fragment:nth-child(even) { transform: translateY(-8px) rotate(.5deg); }

/* ---------- The five-question ledger: the recurring record ---------- */
.ledger { width: 100%; border-collapse: collapse; background: var(--white); color: var(--ink); font-size: 14px; line-height: 1.4; }
.ledger caption { caption-side: top; padding: 14px 16px 12px; border: 1px solid var(--ink); border-bottom: 0; background: var(--accent-tint); text-align: left; }
.ledger caption span { display: block; color: var(--accent-ink); font: 700 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.ledger caption b { display: block; margin-top: 4px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.ledger tbody { border: 1px solid var(--ink); }
.ledger th, .ledger td { padding: 11px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.ledger th { width: 44%; font-weight: 650; }
.ledger th b { display: inline-block; min-width: 24px; color: var(--muted); font: 700 11px/1.6 var(--mono); }
.ledger td { position: relative; }
.ledger td small { display: block; margin-top: 4px; color: var(--muted); font: 600 11px/1.35 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.ledger .open td { color: var(--muted); }
.ledger .open th, .ledger .open td { border-top-style: dashed; }
.ledger .open td::before { content: "— "; }
.ledger .src { display: inline-block; margin: 0 6px 4px 0; padding: 3px 7px; border: 1px dashed currentColor; font: 700 11px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.ledger-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 0; padding: 10px 14px; border: 1px solid var(--ink); border-top: 0; background: var(--white); color: var(--muted); font: 13px/1.45 var(--sans); }
.ledger-foot b { color: var(--ink); }
/* A row the story has just answered settles in: an orange underline sweeps, then rests as ink */
.ledger .is-new td::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; background: var(--ink); }
.js .reveal .ledger .is-new td::after { transform: scaleX(0); transform-origin: left; }
.js .reveal.is-visible .ledger .is-new td::after { animation: ledgerSettle 1.2s var(--ease) .2s both; }
@keyframes ledgerSettle { 0% { transform: scaleX(0); background: var(--accent); } 55% { transform: scaleX(1); background: var(--accent); } 100% { transform: scaleX(1); background: var(--ink); } }
/* Before the room: five answers, four places, no owner — dashed and on ink */
.ledger.is-before { background: transparent; color: var(--white); }
.ledger.is-before caption { border-color: var(--line-on-ink); background: var(--ink-2); }
.ledger.is-before caption span { color: var(--muted-on-ink); }
.ledger.is-before tbody { border: 1px dashed rgba(255, 255, 255, .34); }
.ledger.is-before th, .ledger.is-before td { border-top: 1px dashed rgba(255, 255, 255, .22); }
.ledger.is-before th b { color: var(--muted-on-ink); }
.ledger.is-before td { color: var(--text-on-ink); }
.ledger.is-before .src { color: var(--white); }
.ledger.is-before + .ledger-foot { border: 1px dashed rgba(255, 255, 255, .34); border-top: 0; background: transparent; color: var(--muted-on-ink); }
/* Sealed: the room is closed and the record stays readable. The shortage is kept, outlined. */
.ledger.is-sealed caption { background: var(--paper-2); }
.ledger.is-sealed caption span { color: var(--ink); }
.ledger.is-sealed .obj { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.ledger-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--ink); border-top: 0; background: var(--white); }
.ledger-switch .label { color: var(--muted); font-size: 11px; }
.ledger-switch .segmented button { min-height: 36px; padding: 0 12px; font-size: 13px; }
.ledger .rights { display: block; margin-top: 6px; }
.ledger .rights .pill { padding: 4px 8px; font-size: 11px; }
.ledger-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 12px; padding: 12px 16px; border: 1px solid var(--ink); background: var(--white); font-size: 14px; }
.ledger-line > b { font: 700 11px/1 var(--mono); letter-spacing: .06em; }
.ledger-line > span:last-child { color: var(--muted); font: 700 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- The anchored record: reading column + the ledger beside it ---------- */
.anchored { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px; align-items: start; }
.anchored > .full { grid-column: 1 / -1; }
.anchor { position: sticky; top: calc(var(--portfolio-shell-offset, 0px) + var(--header) + 20px); }

/* The record below 1100px: a strip pinned under the header (five cells, filled once on
   the record, the first one the shortage), opening the ledger in a bottom sheet. */
.ledger-chip { display: none; }
.chip-cells { display: flex; gap: 4px; }
.chip-cells i { position: relative; display: grid; place-items: center; width: 30px; height: 24px; border: 1px solid var(--ink); font: 700 11px/1 var(--mono); font-style: normal; }
.chip-cells .is-on { background: var(--ink); color: var(--white); }
.chip-cells .is-on.is-object { background: var(--accent); color: var(--ink); }
.chip-cells .is-open { border-style: dashed; color: var(--muted); }
.chip-cells .is-new::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--ink); }
.ledger-sheet { position: fixed; inset: auto 0 0; width: min(680px, 100%); max-width: 100%; max-height: min(88vh, 820px); margin: 0 auto; padding: 0; border: 1px solid var(--ink); border-bottom: 0; background: var(--paper); color: var(--ink); overflow: auto; overscroll-behavior: contain; }
.ledger-sheet::backdrop { background: rgba(23, 24, 22, .46); }
.ledger-sheet[open] { animation: sheetSettle var(--t-reveal) var(--ease) both; }
@keyframes sheetSettle { from { opacity: 0; transform: translateY(var(--reveal-distance)); } }
.sheet-bar { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper); }
.sheet-handle { width: 40px; height: 4px; background: var(--line-strong); }
.sheet-close { min-height: 40px; padding: 0 14px; border: 1px solid var(--ink); background: var(--white); color: var(--ink); font: 600 14px/1 var(--sans); cursor: pointer; }
.sheet-close:hover { background: var(--ink); color: var(--white); }
.sheet-body { padding: 14px 14px calc(18px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1100px) {
  .anchored.has-chip { display: flex; flex-direction: column; gap: 24px; }
  .anchored.has-chip > .anchor { display: none; }
  .ledger-chip {
    position: sticky; z-index: 20; top: calc(var(--portfolio-shell-offset, 0px) + var(--header) + 8px);
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; width: 100%; padding: 10px 14px 12px; border: 1px solid var(--ink); background: var(--white); color: var(--ink);
    font: inherit; text-align: left; cursor: pointer; transition: background var(--t-hover);
  }
  .ledger-chip:hover { background: var(--paper); }
  .chip-label { color: var(--muted); font: 700 11px/1.25 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
  .chip-count { font-size: 14px; }
  .chip-count b { font-weight: 650; }
  .chip-open { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
}
@media (max-width: 700px) {
  /* Phones: one compact row. The full caption is in the sheet and in the button's name. */
  .ledger-chip { gap: 8px 10px; padding: 8px 12px 10px; }
  .ledger-chip .chip-more { display: none; }
  .ledger-chip .chip-cells { gap: 3px; }
  .ledger-chip .chip-cells i { width: 26px; height: 22px; }
  .ledger-chip .chip-cells .is-new::after { bottom: -5px; }
}
@media (prefers-reduced-motion: reduce) { .ledger-sheet[open] { animation: none; } }

/* ---------- Lanes and the room plan ---------- */
.lanes-figure { margin-bottom: 70px; padding: 22px; border: 1px solid var(--line-strong); background: var(--white); }
.lanes-figure .scroller { overflow-x: auto; }
.lanes-figure svg { width: 100%; min-width: 680px; height: auto; }
.lanes-figure figcaption { display: grid; grid-template-columns: minmax(180px, .34fr) 1fr; gap: 40px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.lanes-figure figcaption p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.55; }
.lanes-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--muted); font: 14px/1.4 var(--sans); }
.lanes-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lanes-legend svg { min-width: 0; width: auto; }
/* Phones: the lanes turn vertical. Time runs down the spine, and each step carries its owner glyph.
   Above phone width the same list is the diagram's text equivalent. */
.lanes-list { margin: 0; padding: 0; list-style: none; }
@media (min-width: 701px) { .lanes-list { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
@media (max-width: 700px) {
  .lanes-figure .scroller { display: none; }
  .lanes-list { position: relative; display: grid; gap: 20px; padding-left: 22px; }
  .lanes-list::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--ink); }
  .lanes-list > li { position: relative; display: grid; gap: 8px; }
  .lanes-list > li::before { content: ""; position: absolute; left: -22px; top: 2px; width: 11px; height: 11px; border: 1.5px solid var(--ink); background: var(--white); }
  .lanes-list .move { color: var(--muted); font: 700 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
  .lane-node { position: relative; padding: 10px 12px; border: 1.5px solid var(--ink); background: var(--white); }
  .lane-node.is-off { border: 1.5px dashed var(--muted); background: transparent; color: var(--muted); }
  .lane-node:has(.lane-obj) { padding-left: 24px; }
  .lane-who { display: block; font: 700 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
  .lane-node p { margin: 4px 0 0; color: inherit; font-size: 15px; line-height: 1.4; }
  .lane-obj { position: absolute; left: 5px; top: 5px; bottom: 5px; width: 8px; background: var(--accent); }
  .lane-obj.is-outlined { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
  .lane-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .lanes-list .lane-note { margin: 0; color: var(--muted); font-size: 14px; }
}
.room-plan { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: center; margin-bottom: 40px; }
.room-plan svg { width: 100%; height: auto; }
.room-plan p { margin: 0 0 12px; color: var(--text); font-size: 16px; line-height: 1.55; }
.room-plan .demo-note { font-size: 14px; }

/* ---------- Decision glyphs ---------- */
.g-form i { left: 14px; right: 14px; height: 9px; border: 1px solid var(--ink); background: var(--white); }
.g-form i:nth-child(1) { top: 6px; } .g-form i:nth-child(2) { top: 24px; } .g-form i:nth-child(3) { top: 42px; right: 42px; }
.g-chat i { width: 54px; height: 22px; border: 1px solid var(--ink); border-radius: 12px; background: var(--white); }
.g-chat i:nth-child(1) { left: 4px; top: 4px; } .g-chat i:nth-child(2) { right: 4px; top: 22px; background: var(--paper-2); } .g-chat i:nth-child(3) { left: 14px; top: 40px; width: 40px; }
.g-rows i { left: 0; width: 44px; height: 9px; background: var(--accent); }
.g-rows i:nth-child(1) { top: 10px; } .g-rows i:nth-child(2) { top: 24px; } .g-rows i:nth-child(3) { top: 38px; }
.g-rows i:nth-child(4) { left: 56px; top: 6px; width: 34px; height: 48px; border: 2px solid var(--ink); background: var(--white); }
.g-rows i:nth-child(4)::before { content: "→"; position: absolute; left: -16px; top: 12px; color: var(--ink); font-style: normal; font-weight: 700; }
.g-edit i { width: 40px; height: 52px; top: 6px; border: 1px solid var(--ink); background: var(--white); }
.g-edit i:nth-child(1) { left: 6px; } .g-edit i:nth-child(2) { right: 6px; }
.g-edit i:nth-child(3) { left: 30px; top: 22px; width: 32px; height: 20px; border-radius: 50%; background: var(--muted); border: 0; }
.g-split i { width: 38px; height: 52px; top: 6px; border: 1px solid var(--ink); background: var(--white); }
.g-split i:nth-child(1) { left: 4px; } .g-split i:nth-child(2) { right: 4px; }
.g-split i:nth-child(3) { left: 45px; top: 0; width: 2px; height: 64px; background: var(--ink); border: 0; }
.g-owned i { width: 40px; height: 52px; top: 6px; border: 1px solid var(--ink); background: var(--white); }
.g-owned i:nth-child(1) { left: 4px; background: linear-gradient(90deg, var(--ink) 50%, var(--white) 50%) 0 0 / 100% 6px no-repeat, var(--white); }
.g-owned i:nth-child(2) { right: 4px; background: linear-gradient(90deg, var(--white) 50%, var(--ink) 50%) 0 0 / 100% 6px no-repeat, var(--white); }
.g-owned i:nth-child(3) { left: 30px; top: 26px; width: 32px; height: 1px; border: 0; border-top: 1px dashed var(--ink); background: transparent; }
.g-feed i { left: 16px; width: 60px; height: 11px; border: 1px solid var(--ink); background: var(--white); }
.g-feed i:nth-child(1) { top: 2px; } .g-feed i:nth-child(2) { top: 18px; } .g-feed i:nth-child(3) { top: 34px; } .g-feed i:nth-child(4) { top: 50px; }
.g-tabs i { top: 16px; height: 44px; left: 6px; right: 6px; border: 1px solid var(--ink); background: var(--white); }
.g-tabs i:nth-child(1) { top: 4px; left: 6px; right: auto; width: 24px; height: 13px; background: var(--ink); }
.g-tabs i:nth-child(2) { top: 4px; left: 34px; right: auto; width: 24px; height: 13px; }
.g-tabs i:nth-child(3) { top: 4px; left: 62px; right: auto; width: 24px; height: 13px; }
.g-split-view i:nth-child(1) { left: 0; top: 4px; width: 58px; height: 56px; border: 1px solid var(--ink); background: var(--white); }
.g-split-view i:nth-child(2) { right: 0; top: 4px; width: 30px; height: 56px; border: 1px solid var(--ink); background: var(--paper-2); }
.g-split-view i:nth-child(3) { left: 8px; top: 14px; width: 42px; height: 7px; background: var(--ink); }
.g-split-view i:nth-child(4) { left: 8px; top: 28px; width: 34px; height: 7px; background: var(--line-strong); }

/* ---------- What the room carries forward ---------- */
.context-chain { display: flex; align-items: stretch; gap: 0; margin-top: 14px; border: 1px solid var(--line-strong); background: var(--white); }
.context-chain span, .context-chain strong { flex: 1; padding: 16px 18px; border-right: 1px solid var(--line); font-size: 14px; }
.context-chain span::before { content: attr(data-n); display: block; margin-bottom: 8px; color: var(--muted); font: 11px var(--mono); }
.context-chain strong { flex: 1.2; border-right: 0; background: var(--paper-2); }

/* ---------- Lifecycle: the closed-state spec beside the closed room ---------- */
.spec-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 70px; }
.spec-pair figure { margin: 0; padding: 18px; border: 1px solid var(--ink); background: var(--white); }
.spec-pair img { border: 1px solid var(--line); }
.spec-pair figcaption { margin-top: 12px; color: var(--text); font-size: 14px; line-height: 1.5; }
.closed-record { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px; align-items: start; margin-bottom: 70px; }
.closed-record figure { margin: 0; padding: 18px; border: 1px solid var(--line-strong); background: var(--white); }
.closed-record figure img { border: 1px solid var(--line); }
.closed-record figcaption { margin-top: 12px; color: var(--text); font-size: 14px; line-height: 1.5; }
.closed-record .reflection-list article { grid-template-columns: 56px 1fr 1.1fr; padding-block: 24px; }
.closed-record .reflection-list h3 { font-size: clamp(24px, 2.4vw, 34px); }

/* ---------- Full study only ---------- */
.hier-demo { margin-top: 48px; border: 1px solid var(--line); background: var(--white); }
.hier-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 20px 22px; }
.hier-row b { display: block; font-size: 19px; letter-spacing: -.02em; }
.hier-row span { color: var(--muted); font-size: 14px; }
.hier-toggle { min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); background: transparent; font-weight: 650; cursor: pointer; }
.hier-toggle[aria-expanded="true"] { background: var(--ink); color: var(--white); }
.hier-children { border-top: 1px solid var(--line); background: var(--paper); }
.hier-children > div { display: grid; grid-template-columns: 1.2fr 1fr 1fr 90px; gap: 16px; padding: 12px 22px 12px 54px; border-bottom: 1px solid var(--line); font-size: 15px; }
.hier-children > div.head { color: var(--muted); font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.hier-children strong { color: var(--ink); text-align: right; }
.hier-children p { margin: 0; padding: 14px 22px; color: var(--text); font-size: 15px; }
.access-model { margin-top: 48px; border: 1px solid var(--line); background: var(--white); }
.model-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-bottom: 1px solid var(--line); }
.model-controls label { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-right: 1px solid var(--line); color: var(--muted); font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.model-controls label:last-child { border-right: 0; }
.model-controls select { min-height: 44px; padding: 0 10px; border: 1px solid var(--ink); background: var(--white); color: var(--ink); font: 600 15px var(--sans); letter-spacing: 0; text-transform: none; }
.model-result { display: grid; grid-template-columns: 1.3fr 1fr; }
.model-result > div { padding: 24px 22px; border-right: 1px solid var(--line); }
.model-result .status { display: inline-block; padding: 6px 10px; border: 1px solid var(--positive); color: var(--positive); font: 700 11px/1 var(--mono); }
.model-result .status.is-blocked { border-color: var(--critical); color: var(--critical); }
.model-result .status.is-closed { border-color: var(--ink); background: var(--ink); color: var(--white); }
.model-result h4 { margin: 16px 0 8px; font-size: 22px; font-weight: 620; letter-spacing: -.03em; }
.model-result p { margin: 0; color: var(--text); font-size: 16px; line-height: 1.55; }
.model-result dl { margin: 0; padding: 12px 22px; }
.model-result dl div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.model-result dl div:last-child { border-bottom: 0; }
.model-result dt { font-weight: 600; }
.model-result dd { margin: 0; font: 700 12px var(--mono); }
.closure-model { margin-top: 48px; border: 1px solid var(--line-on-ink); }
.closure-model .desk-top p { margin: 0; color: var(--text-on-ink); font-size: 15px; }
.sim-rooms { display: grid; grid-template-columns: 1fr 1fr; }
.sim-rooms article { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-right: 1px solid var(--line-on-ink); }
.sim-rooms article:last-child { border-right: 0; }
.sim-rooms span { color: var(--muted-on-ink); font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.sim-rooms strong { font-size: 26px; letter-spacing: -.03em; }
.sim-rooms strong.is-closed { color: var(--white); }
.sim-rooms button { align-self: flex-start; min-height: 42px; padding: 0 14px; border: 1px solid var(--white); background: transparent; color: var(--white); font-weight: 600; cursor: pointer; }
.sim-rooms button:disabled { border-color: var(--line-on-ink); color: var(--muted-on-ink); cursor: default; }
.watch-result { padding: 22px; border-top: 1px solid var(--line-on-ink); background: var(--ink-3); }
.watch-result h4 { margin: 10px 0 8px; font-size: 22px; font-weight: 620; letter-spacing: -.03em; }
.watch-result p { margin: 0; color: var(--text-on-ink); font-size: 16px; line-height: 1.55; }
.watch-choice { padding: 18px 22px; border-top: 1px solid var(--line-on-ink); }
.watch-choice label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.watch-choice p { margin: 8px 0 0; color: var(--text-on-ink); font-size: 15px; }
.quiet-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-on-ink); background: transparent; color: var(--white); cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .fragments { grid-template-columns: 1fr 1fr; }
  .fragment::after { display: none !important; }
  .anchored { grid-template-columns: minmax(0, 1fr); }
  .anchor { position: static; }
}
@media (max-width: 1000px) {
  .four-w { grid-template-columns: 1fr; }
  .w-what, .w-wide { grid-column: auto; }
  .people { flex-direction: column; }
  .backbone { flex-wrap: wrap; }
  .spec-pair, .closed-record, .room-plan { grid-template-columns: 1fr; }
  .lanes-figure figcaption { grid-template-columns: 1fr; gap: 10px; }
  .model-controls { grid-template-columns: 1fr; }
  .model-controls label { border-right: 0; border-bottom: 1px solid var(--line); }
  .model-result { grid-template-columns: 1fr; }
  .model-result > div { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .w-panel { padding: 22px; min-height: 0; }
  .w-panel h3 { margin: 36px 0 24px; }
  .annotation { position: static; margin-top: 28px; text-align: left; transform: none; }
  .backbone { flex-direction: column; align-items: flex-start; }
  .backbone i { transform: rotate(90deg); margin-left: 6px; }
  .fragments { grid-template-columns: 1fr; }
  .fragment { min-height: 250px; }
  .context-chain { flex-direction: column; }
  .context-chain span { border-right: 0; border-bottom: 1px solid var(--line); }
  .ledger th { width: auto; }
  .ledger th, .ledger td { display: block; border-top: 0; }
  .ledger tr { display: block; border-top: 1px solid var(--line); }
  .ledger.is-before tr { border-top: 1px dashed rgba(255, 255, 255, .22); }
  .ledger th { padding-bottom: 2px; }
  .ledger td { padding-top: 0; }
  .ledger .is-new td::after { bottom: 2px; }
  .ledger-line { grid-template-columns: 1fr; gap: 6px; }
  .sim-rooms { grid-template-columns: 1fr; }
  .sim-rooms article { border-right: 0; border-bottom: 1px solid var(--line-on-ink); }
  .hier-children > div { grid-template-columns: 1fr 1fr; padding-left: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal .ledger .is-new td::after, .js .reveal.is-visible .ledger .is-new td::after { animation: none; transform: none; background: var(--ink); }
  .js .fragments.reveal .fragment { transform: none !important; transition: none; }
}
@media (pointer: coarse) { .ledger-chip, .sheet-close, .quiet-button, .sim-rooms button { min-height: 44px; } }

/* ==========================================================================
   Visual story pass (2026-10-01). Mechanics borrowed from the GenX, o9 and NLP
   references (chapter sequence, entry points, architecture as a plan, one object
   followed end to end), drawn in this dialect's own terms: rows and lanes, orange
   only for the shortage, dark only while the story is scattered, and "settle".
   ========================================================================== */

/* ---------- Chapter marks: each chapter opens with a small drawing in rows and lanes.
   It settles once as it reveals; its resting state is the finished drawing. ---------- */
.section-head .chapter-id { align-self: start; }
.section-head .chapter-id .section-no { margin: 12px 0 0; }
.chapter-mark { display: block; width: min(100%, 232px); height: auto; margin-top: 30px; overflow: visible; }
.chapter-mark :is(.cm-row, .cm-glyph, .cm-person) { fill: var(--white); stroke: var(--ink); stroke-width: 1.5; }
.chapter-mark .cm-row.is-dashed { fill: none; stroke-dasharray: 4 3; }
.chapter-mark .cm-row.is-strong { stroke-width: 2.5; }
.chapter-mark .cm-tab { fill: var(--white); stroke: var(--ink); stroke-width: 1.2; }
.chapter-mark :is(.cm-half, .cm-glyph.is-filled, .cm-tab.is-filled) { fill: var(--ink); }
.chapter-mark .cm-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.chapter-mark .cm-line.is-dashed { stroke-dasharray: 4 4; }
.chapter-mark .cm-line:is(.is-gate, .is-seal) { stroke-width: 3; }
.chapter-mark .cm-lane { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.chapter-mark .cm-tick { fill: none; stroke: var(--ink); stroke-width: 1; }
.chapter-mark .cm-obj { fill: var(--accent); }
.chapter-mark .cm-obj.is-outlined { fill: none; stroke: var(--accent); stroke-width: 2.5; }
/* On the dark chapters the same drawing is set in paper on ink. */
.ink .chapter-mark :is(.cm-row, .cm-glyph, .cm-person, .cm-tab) { fill: var(--ink-2); stroke: var(--white); }
.ink .chapter-mark .cm-row.is-dashed { fill: none; stroke: var(--muted-on-ink); }
.ink .chapter-mark :is(.cm-line, .cm-tick) { stroke: var(--white); }
.ink .chapter-mark .cm-lane { stroke: var(--line-on-ink); }
.ink .chapter-mark :is(.cm-half, .cm-glyph.is-filled, .cm-tab.is-filled) { fill: var(--white); }
.ink .chapter-mark .cm-obj { fill: var(--accent-on-deep); }
.ink .chapter-mark .cm-obj.is-outlined { fill: none; stroke: var(--accent-on-deep); }
/* Settle: each piece arrives a few pixels off, or tilted, and comes to rest. Nothing loops. */
.js .chapter-mark .cm-s {
  opacity: 0; transform: translate(var(--tx, 0px), var(--ty, 8px)) rotate(var(--r, 0deg));
  transform-box: fill-box; transform-origin: center;
  transition: opacity var(--t-reveal) var(--ease) var(--d, 0ms), transform var(--t-reveal) var(--ease) var(--d, 0ms);
}
.js .chapter-mark.is-visible .cm-s { opacity: 1; transform: none; }
/* 08 only: the shortage crosses the five moves once and rests on the last, outlined. */
.js .chapter-mark .cm-travel { opacity: 0; transform-box: fill-box; }
.js .chapter-mark.is-visible .cm-travel { animation: cmTravel 1.2s var(--ease) .38s both; }
@keyframes cmTravel {
  0% { opacity: 1; transform: translateX(-144px); fill: var(--accent); }
  75% { fill: var(--accent); }
  100% { opacity: 1; transform: none; fill: transparent; }
}

/* ---------- Figure captions for the new diagrams: a mono label, then a sentence ---------- */
:is(.evidence-fig, .entry-fig, .plan-fig, .film) figcaption { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 1.5; }
:is(.evidence-fig, .entry-fig, .plan-fig, .film) figcaption b { margin-right: 8px; color: var(--ink); font: 700 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* ---------- 01 The problem: the statement the closing chapter answers ---------- */
.statement-block { margin-bottom: clamp(56px, 7vw, 96px); }

/* ---------- 02 The people: three roles, each holding one piece (still dark: still scattered) ---------- */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role { display: flex; flex-direction: column; min-width: 0; padding: 26px; border: 1px solid var(--line-on-ink); background: var(--ink-2); }
.role-head { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line-on-ink); }
.role-head .avatar { flex: 0 0 36px; margin: 0; background: var(--white); color: var(--ink); }
.role h3 { margin: 6px 0 0; font-size: clamp(24px, 2.2vw, 30px); font-weight: 620; letter-spacing: -.035em; line-height: 1.05; }
.role-ask { margin: 26px 0 0; color: var(--white); font-size: clamp(21px, 2vw, 27px); font-weight: 560; letter-spacing: -.03em; line-height: 1.12; }
.role-ask span { display: block; margin-bottom: 8px; color: var(--muted-on-ink); font: 700 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.role dl { margin: 26px 0 0; }
.role dl div { padding: 12px 0; border-top: 1px solid var(--line-on-ink); }
/* Off the record is dashed, on the record is solid: the same rule as the ledger. */
.role dl .was { border-top: 1px dashed rgba(255, 255, 255, .34); }
.role dl .now { border-top: 1.5px solid var(--white); }
.role dt { color: var(--muted-on-ink); font: 700 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.role dl .now dt { color: var(--white); }
.role dd { margin: 6px 0 0; color: var(--text-on-ink); font-size: 16px; line-height: 1.5; }
.pressure { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.pressure .label { margin-right: 10px; }
.pressure span { padding: 8px 12px; border: 1px dashed rgba(255, 255, 255, .34); border-radius: 2px; color: var(--text-on-ink); font-size: 14px; line-height: 1.3; }
.roles-note { margin-top: 18px; }
.roles-note p { max-width: 80ch; margin: 0; color: var(--muted-on-ink); font-size: 14px; line-height: 1.5; }

/* ---------- 03 The evidence: inputs → five questions → where the room answers them ---------- */
.evidence-fig { margin-block: 0; }
.ev-grid { display: grid; grid-template-columns: minmax(0, .92fr) 48px minmax(0, 1.5fr); border: 1px solid var(--line-strong); background: var(--white); }
.ev-col { min-width: 0; padding: 26px; }
.ev-head { margin: 0 0 14px; color: var(--ink); font: 700 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.ev-inputs ol { margin: 0; padding: 0; list-style: none; }
.ev-inputs li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.ev-inputs li > b { color: var(--muted); font: 700 11px/1.9 var(--mono); }
.ev-inputs strong { display: block; font-size: 16px; font-weight: 650; }
.ev-inputs small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.ev-arrow { display: grid; place-items: center; border-inline: 1px solid var(--line); color: var(--ink); font-size: 22px; }
.ev-answers { display: flex; flex-direction: column; }
.ev-heads { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.ev-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 12px 0; border-top: 1px solid var(--line); }
.ev-q { display: grid; align-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ev-q li { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border: 1px solid var(--ink); background: var(--white); font-size: 16px; font-weight: 600; line-height: 1.25; }
.ev-q b { color: var(--muted); font: 700 11px/1 var(--mono); }
.ev-obj { flex: 0 0 auto; width: 12px; height: 12px; background: var(--accent); }
.ev-zone { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 14px 18px; border: 1px solid var(--line-strong); background: var(--paper); }
.ev-zone::before { content: "→"; position: absolute; top: 50%; right: calc(100% + 7px); color: var(--ink); font-size: 16px; line-height: 1; transform: translateY(-50%); }
.ev-zone .label { color: var(--muted); }
.ev-zone strong { margin-top: 6px; font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.ev-zone small { margin-top: 4px; color: var(--text); font-size: 14px; line-height: 1.45; }

/* ---------- 04 The approach: five moves, each adding to one record ---------- */
.moves { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 90px; padding: 0; list-style: none; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line-strong); }
.moves li { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 22px 18px 22px 0; }
.moves li + li { padding-left: 18px; border-left: 1px solid var(--line); }
.moves li > b { color: var(--muted); font: 700 11px/1 var(--mono); }
.moves strong { font-size: clamp(21px, 2.1vw, 29px); font-weight: 620; letter-spacing: -.04em; line-height: 1.02; }
.moves p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.45; }
.moves .adds { display: grid; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.moves .adds small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.moves .chip-cells i { width: 26px; height: 22px; }
/* The record once the room closes: the shortage kept, outlined. */
.chip-cells .is-on.is-object.is-sealed { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); color: var(--ink); }
.principles { margin-top: 90px; }
.principles ol { margin: 16px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.principles li { display: grid; grid-template-columns: 56px minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.principles li > b { color: var(--muted); font: 700 12px/1 var(--mono); }
.principles li strong { font-size: clamp(22px, 2.5vw, 34px); font-weight: 600; letter-spacing: -.04em; line-height: 1.06; }
.principles li span { color: var(--text); font-size: 15px; line-height: 1.5; }
.principles li a { display: inline-block; margin-left: 4px; color: var(--ink); font-weight: 650; white-space: nowrap; }

/* ---------- 05 Entry points: three ways in, one room, one way out that keeps watching ---------- */
.entry-fig { margin-block: 0; }
.entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, .82fr) 96px minmax(0, .5fr); align-items: stretch; }
.entry-routes { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.route { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; padding: 16px 18px; border: 1px solid var(--line-strong); background: var(--white); }
.route-key { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font: 700 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.route-key b { display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--ink); color: var(--ink); }
.route-key span { display: inline-flex; align-items: center; }
.route strong { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.route p { margin: 0; color: var(--text); font-size: 15px; line-height: 1.45; }
.entry-lines { width: 100%; height: 100%; overflow: visible; }
.entry-lines path { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.entry-room { align-self: center; min-width: 0; padding: 24px; border: 2px solid var(--ink); background: var(--white); }
.entry-room > strong { display: block; margin: 8px 0 16px; font-size: clamp(26px, 2.6vw, 36px); font-weight: 620; letter-spacing: -.04em; line-height: 1; }
.entry-carries, .entry-reuse { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.entry-carries { margin-bottom: 12px; }
:is(.entry-carries, .entry-reuse) .label { flex-basis: 100%; margin-bottom: 2px; color: var(--muted); }
.entry-carries .obj { font-size: 14px; }
.entry-tag { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--ink); border-radius: 2px; font-size: 13px; font-weight: 600; }
.entry-reuse b { padding: 4px 9px; border: 1px dashed var(--ink); border-radius: 2px; font: 500 13px/1.2 var(--sans); }
.entry-exit { position: relative; align-self: center; height: 1.5px; margin: 0 6px 0 0; }
/* The connector is drawn by a pseudo-element, so the label above it reads against the paper. */
.entry-exit::before { content: ""; position: absolute; inset: 0; background: var(--ink); }
.entry-exit::after { content: ""; position: absolute; right: -6px; top: 50%; border-style: solid; border-width: 5px 0 5px 7px; border-color: transparent transparent transparent var(--ink); transform: translateY(-50%); }
.entry-exit span { position: absolute; left: 50%; bottom: 10px; width: 88px; color: var(--muted); font: 700 11px/1.3 var(--mono); letter-spacing: .08em; text-align: center; text-transform: uppercase; transform: translateX(-50%); }
.entry-watch { align-self: center; min-width: 0; padding: 18px; border: 1px solid var(--line-strong); background: var(--white); }
.entry-watch strong { display: block; margin: 8px 0 6px; font-size: 17px; font-weight: 650; line-height: 1.2; }
.entry-watch p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.45; }
.scope-equation.is-object { margin-top: 40px; }
.scope-equation.is-object > i { color: var(--ink); }
.scope-equation.is-object .result { background: var(--white); }
.scope-equation.is-object .result .obj { display: inline-block; padding: 4px 8px; font-size: 20px; }
.scope-note { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-top: 14px; }
.scope-note p { max-width: 72ch; margin: 0; color: var(--text); font-size: 15px; line-height: 1.5; }
.scope-note span { color: var(--muted); font: 700 11px/1.9 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- 06 The turn: the room as a plan, in two arrangements ---------- */
.plan-fig { width: min(var(--wrap), 980px); margin-bottom: 72px; }
.plan-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.plan-canvas { padding: clamp(10px, 2vw, 22px); border: 1px solid var(--line-strong); background: var(--paper); }
.plan-svg { width: 100%; height: auto; }
.plan-svg text { fill: var(--ink); font-family: var(--sans); }
.plan-svg .p-title { font-size: 13px; font-weight: 600; }
.plan-svg .p-h { font-size: 14px; font-weight: 650; }
.plan-svg .p-obj { font-size: 11px; font-weight: 650; }
.plan-svg .p-small { font-size: 12px; }
.plan-svg .p-muted { fill: var(--muted); font-size: 12px; }
.plan-svg :is(.p-zone, .p-btn, .p-seg, .p-chip) { font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; }
.plan-svg .p-zone { fill: var(--muted); }
.plan-svg .p-seg.is-on { fill: var(--white); }
/* Numbered tags follow the site's annotation rule: ink, with a white halo and a white number. */
.plan-svg .p-tag rect { fill: var(--ink); stroke: #fff; stroke-width: 2; }
.plan-svg .p-tag text { fill: #fff; font-family: var(--mono); font-size: 11px; font-weight: 700; text-anchor: middle; }
.plan-svg :is(.p-first, .p-revised) { transform-box: fill-box; transition: opacity var(--t-reveal) var(--ease), transform var(--t-reveal) var(--ease); }
.plan-fig[data-state="revised"] .p-first { opacity: 0; transform: translateY(-6px); }
.plan-fig[data-state="first"] .p-revised { opacity: 0; transform: translateY(10px); }
.compare-lede { margin-bottom: 18px; }
.compare-lede p { max-width: 72ch; margin: 0; color: var(--text); font-size: 16px; line-height: 1.55; }

/* ---------- 08 Follow the shortage: the film, then the five moves one at a time ---------- */
.film.wrap { width: min(var(--wrap), 1120px); margin-bottom: 20px; }
.film-frame { box-shadow: none; }
.film video { display: block; width: 100%; height: auto; aspect-ratio: 1440 / 900; background: var(--paper-2); }
.film-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0 0; padding: 0; list-style: none; border: 1px solid var(--line-strong); background: var(--white); }
.film-stages li + li { border-left: 1px solid var(--line); }
.film-stages button { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background var(--t-hover) var(--ease); }
.film-stages button:hover { background: var(--paper); }
.film-stages i { color: var(--muted); font: 700 11px/1 var(--mono); font-style: normal; }
.film-stages span { font-size: 14px; font-weight: 650; }
.film-stages small { color: var(--muted); font: 11px/1 var(--mono); }
.film-stages button[aria-current="true"] { background: var(--ink); color: var(--white); }
.film-stages button[aria-current="true"] :is(i, small) { color: var(--muted-on-ink); }
.film-then { margin: 48px auto 18px; color: var(--ink); font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.03em; }
.step-record { display: grid; justify-items: start; gap: 10px; margin: 4px 0 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.step-record .label { color: var(--muted); }
.step-record-text { margin: 0; color: var(--text); font-size: 15px; line-height: 1.45; }
.step-record .obj { font-size: 14px; }
.step-record .obj.is-sealed { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------- 09 and 10: notes, the reflection head, and the bookend ---------- */
.boundary-note { margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sub-display { margin: 0; font-size: clamp(34px, 4.4vw, 60px); font-weight: 580; letter-spacing: -.055em; line-height: .96; text-wrap: balance; }
.sub-display em { font-style: normal; color: var(--accent); }
.reflection-head { margin-top: 110px; margin-bottom: 36px; }
.reflection-head .section-no { margin-bottom: 18px; }
/* The closing statement answers chapter 01's: four places became one room. */
.bookend { margin-top: 110px; padding-top: 34px; border-top: 1px solid var(--line-strong); }
.bookend-note { max-width: 52ch; margin: 28px 0 0; color: var(--text); font-size: 19px; line-height: 1.5; }

/* ---------- Responsive, for the pass above ---------- */
@media (max-width: 1100px) {
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .entry-routes { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
  .entry-lines { display: none; }
  .entry-room { position: relative; margin-top: 46px; }
  .entry-room::before { content: "↓"; position: absolute; left: 50%; top: -36px; color: var(--ink); font-size: 22px; line-height: 1; transform: translateX(-50%); }
  .entry-exit { height: auto; margin: 16px 0; background: none; text-align: center; }
  .entry-exit::before, .entry-exit::after { display: none; }
  .entry-exit span { position: static; display: inline-block; width: auto; transform: none; }
  .entry-exit span::before { content: "↓ "; color: var(--ink); }
}
@media (max-width: 1000px) {
  .roles { grid-template-columns: minmax(0, 1fr); }
  .ev-grid { grid-template-columns: minmax(0, 1fr); }
  .ev-arrow { min-height: 44px; border-inline: 0; border-block: 1px solid var(--line); }
  .ev-arrow span { display: inline-block; transform: rotate(90deg); }
  .moves { grid-template-columns: minmax(0, 1fr); }
  .moves li, .moves li + li { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; row-gap: 6px; padding: 18px 0; border-left: 0; }
  .moves li + li { border-top: 1px solid var(--line); }
  .moves li > b { grid-row: span 3; padding-top: 6px; }
  .moves .adds { grid-column: 2; margin-top: 6px; }
  .principles li { grid-template-columns: 40px minmax(0, 1fr); }
  .principles li span { grid-column: 2; }
  .film-stages { grid-template-columns: minmax(0, 1fr); }
  .film-stages li + li { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 700px) {
  .entry-routes { grid-template-columns: minmax(0, 1fr); }
  .ev-col { padding: 20px; }
  .ev-heads { display: none; }
  .ev-group { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 14px 0; }
  .ev-zone::before { content: "↓"; top: auto; right: auto; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); }
  /* Phones: the plan scales to fit. The shapes carry the change; the caption carries the words. */
  .plan-bar .segmented { width: 100%; }
  .plan-bar .segmented button { flex: 1 1 0; }
  .scope-note { display: block; }
  .bookend-note { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .chapter-mark .cm-s { opacity: 1; transform: none; transition: none; }
  .js .chapter-mark .cm-travel, .js .chapter-mark.is-visible .cm-travel { opacity: 1; animation: none; }
  .plan-svg :is(.p-first, .p-revised) { transition: none; }
}
@media (pointer: coarse) { .principles li a { padding-block: 10px; } }
