:root {
  --bg: #f6f3ec; --surface: #fffdf8; --ink: #1d2128; --muted: #5a606b; --line: #ddd6c8;
  --brand: #1f4e5f; --brand-ink: #ffffff; --amber: #8a5a00;
  --pass: #1e6b3a; --warn: #8a5a00; --fail: #a8261f; --verify: #4b3fa8;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(30,40,50,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12161b; --surface: #1a2027; --ink: #e9ecef; --muted: #a7b0bb; --line: #2c343e;
  --brand: #7cc3d6; --brand-ink: #0c1a20; --amber: #f0b950;
  --pass: #6fd08f; --warn: #f0b950; --fail: #ff8a80; --verify: #b3a8ff; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #12161b; --surface: #1a2027; --ink: #e9ecef; --muted: #a7b0bb; --line: #2c343e;
  --brand: #7cc3d6; --brand-ink: #0c1a20; --amber: #f0b950; --pass: #6fd08f; --warn: #f0b950; --fail: #ff8a80; --verify: #b3a8ff; color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 Inter, system-ui, sans-serif; }
a { color: var(--brand); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 9; }
.sr-filters { position: absolute; width: 0; height: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .14em; color: var(--ink); text-decoration: none; }
.logo { width: 30px; height: 30px; color: var(--brand); display: inline-flex; } .logo svg { width: 100%; height: 100%; }
nav { display: flex; gap: 4px; flex-wrap: wrap; } nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; }
nav a[aria-current] { color: var(--ink); background: var(--bg); }

.hero { padding: 48px 0 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }
h1 { font: 650 clamp(30px, 4.4vw, 52px)/1.08 Fraunces, Georgia, serif; margin: 0 0 16px; max-width: 22ch; letter-spacing: -.01em; }
h1 em { font-style: normal; color: var(--brand); display: block; }
h2 { font: 650 26px/1.2 Fraunces, Georgia, serif; margin: 4px 0 6px; } h3 { font-size: 18px; margin: 0 0 8px; } h4 { margin: 10px 0 6px; font-size: 14px; }
.lead { font-size: 18px; max-width: 68ch; color: var(--muted); }
.stages { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.stages li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stages b { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.stages strong { display: block; }

.work { padding-bottom: 64px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 16px 0; box-shadow: var(--shadow); }
.card.sub { box-shadow: none; }
.card-h p { color: var(--muted); margin: 4px 0 0; }
.step { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 0; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.row input { flex: 1 1 220px; margin: 0; width: auto; }
.btn { font: 600 15px Inter, system-ui, sans-serif; border-radius: 10px; padding: 10px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 3px 8px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.loading::after { content: ''; display: inline-block; width: .8em; height: .8em; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.loading::after { animation: none; } * { scroll-behavior: auto !important; } }
.btn.tog[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.samples { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.muted { color: var(--muted); font-size: 14px; }

.progress { margin: 8px 0 0; padding-left: 22px; } .progress li { color: var(--muted); } .progress li.now { color: var(--ink); font-weight: 600; } .progress li.done { text-decoration: line-through; }
.stop { border-left: 5px solid var(--warn); } .stop.blocked { border-left-color: var(--fail); }
.qs li { margin: 4px 0; }

.stage { margin-top: 28px; }
.sumbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid currentColor; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; background: var(--surface); }
.chip b { font-weight: 800; }
.chip.pass { color: var(--pass); } .chip.warn { color: var(--warn); } .chip.fail { color: var(--fail); } .chip.verify { color: var(--verify); border-style: dashed; }
.issues { list-style: none; padding: 0; margin: 6px 0; font-size: 14px; } .issues li { padding: 5px 0 5px 10px; border-left: 3px solid; margin: 4px 0; }
.issues li.fail { border-color: var(--fail); } .issues li.warn { border-color: var(--warn); } .issues li.verify { border-color: var(--verify); border-left-style: dashed; }
.issues li b { margin-right: 4px; }
.issues li.fail b { color: var(--fail); } .issues li.warn b { color: var(--warn); } .issues li.verify b { color: var(--verify); }
.ok-line { margin: 6px 0; }
.review { border-left: 5px solid var(--brand); }
details > summary { cursor: pointer; font-weight: 600; }

.slide-edit .se-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.slide-edit .num { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 700; flex: none; }
.slide-edit .role { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--brand); }
.slide-edit .job { color: var(--muted); font-size: 14px; }
.title-in { font: 650 20px/1.3 Fraunces, Georgia, serif; }
.idea { color: var(--muted); font-size: 14px; font-style: italic; }
.notes-g { font-size: 14px; color: var(--muted); }
.verify { list-style: none; padding: 0; margin: 4px 0; } .verify li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1.5px dashed var(--verify); border-radius: 8px; padding: 6px 10px; margin: 4px 0; font-size: 14px; }
.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); z-index: 3; }

.concepts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.concept .mini { margin: 12px 0; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.sw { display: inline-flex; gap: 5px; align-items: center; } .chipc { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.contrast { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; } .contrast caption { text-align: left; color: var(--muted); padding-bottom: 4px; }
.contrast th, .contrast td { text-align: left; padding: 4px 6px; border-top: 1px solid var(--line); }

.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.tools .theme { display: inline-flex; gap: 6px; align-items: center; margin: 0; } .tools .theme select { margin: 0; width: auto; }
.deckgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.checklist { position: sticky; top: 76px; margin: 0; } .checks { list-style: none; padding: 0; } .checks li { margin: 8px 0; }
.checks .chip { border-radius: 10px; white-space: normal; }
.deckview { display: grid; gap: 22px; }
.sframe { margin: 0; } .sframe figcaption { font-size: 14px; margin-top: 8px; }
.deckview.squint .slide { filter: blur(3px); } .deckview.grey .slide { filter: grayscale(1); } .deckview.deut .slide { filter: url(#deut); }
.deckview.squint.grey .slide { filter: blur(3px) grayscale(1); }
.deckview.nonotes .notes { display: none; }
@media (max-width: 900px) { .deckgrid { grid-template-columns: 1fr; } .checklist { position: static; } }

/* ── the slide itself: a 13.333 × 7.5 in canvas; 1in = 7.5cqw ─────────────── */
.slide { position: relative; width: 100%; aspect-ratio: 13.333 / 7.5; container-type: inline-size; background: var(--s-bg); color: var(--s-ink);
  font-family: var(--s-bf); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.slide[data-state="fail"] { outline: 3px solid var(--fail); outline-offset: 3px; }
.slide[data-state="verify"] { outline: 3px dashed var(--verify); outline-offset: 3px; }
.abs { position: absolute; }
.kicker { font-size: 1.25cqw; font-weight: 700; letter-spacing: .2em; color: var(--s-muted); white-space: nowrap; }
.title { font: 700 3.125cqw/1.12 var(--s-hf); color: var(--s-ink); overflow: hidden; }
.body ol { margin: 0; padding-left: 1.2em; } .body li { margin: 0 0 1.1cqw; }
.body.with-viz { font-size: 2.08cqw; line-height: 1.3; } .body.solo { font-size: 2.5cqw; line-height: 1.3; }
.body li::marker { color: var(--s-accent); font-weight: 700; }
.turn { border: 0.16cqw dashed var(--s-accent); border-radius: 0.8cqw; font-size: 1.46cqw; display: flex; align-items: center; padding: 0 1.2cqw; gap: .4em; }
.turn b { color: var(--s-accent); letter-spacing: .1em; }
.spine { display: flex; border-top: 0.08cqw solid var(--s-muted); padding-top: 0.6cqw; }
.spine span { flex: 1; font-size: 1.04cqw; color: var(--s-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: .5em; position: relative; }
.spine span.cur { color: var(--s-ink); font-weight: 700; text-decoration: underline; }
.spine span.cur::before { content: ''; position: absolute; left: 0; right: .6em; top: -1.1cqw; height: 0.6cqw; background: var(--s-accent); }
.cover-title { font: 700 4.17cqw/1.08 var(--s-hf); display: flex; align-items: flex-end; }
.bar { background: var(--s-accent); }
.cover-obj { font-size: 2.08cqw; line-height: 1.35; } .cover-obj b { color: var(--s-accent); }
.cover-dest { font-size: 1.67cqw; font-style: italic; color: var(--s-muted); }

.viz { display: flex; font-size: 1.77cqw; }
.viz .lab { font-weight: 600; }
.viz-sequence { flex-direction: column; justify-content: center; gap: 0.2cqw; }
.viz-sequence .step { display: flex; align-items: center; gap: 1.4cqw; border: 0.16cqw solid var(--s-accent2); border-radius: 0.8cqw; padding: 0.9cqw 1.2cqw; background: var(--s-bg); }
.viz-sequence .num { flex: none; width: 4.2cqw; height: 4.2cqw; border-radius: 50%; background: var(--s-accent); color: var(--s-bg); display: grid; place-items: center; font-weight: 800; }
.viz-sequence .arrow { text-align: left; padding-left: 2.2cqw; line-height: 1; color: var(--s-ink); font-weight: 700; }
.viz-relationship { align-items: center; gap: 1.4cqw; }
.viz-relationship .causes { flex: 1.1; display: flex; flex-direction: column; gap: 1cqw; }
.viz-relationship .cause { border: 0.16cqw solid var(--s-accent2); border-radius: 0.8cqw; padding: 1cqw; text-align: center; font-weight: 600; }
.viz-relationship .fan { font-size: 4cqw; font-weight: 700; }
.viz-relationship .outcome { flex: 1; background: var(--s-accent); color: var(--s-bg); border: 0.2cqw solid var(--s-ink); border-radius: 1cqw; padding: 2.2cqw 1cqw; text-align: center; font-weight: 800; font-size: 1.9cqw; }
.viz-comparison { gap: 1.8cqw; align-items: center; }
.viz-comparison .col { min-height: 60%; justify-content: center; }
.viz-comparison .col { flex: 1; border: 0.2cqw solid var(--s-accent); border-radius: 1cqw; display: flex; flex-direction: column; align-items: center; padding: 1.6cqw 1cqw; gap: 1.2cqw; text-align: center; }
.viz-comparison .col.alt { border-style: dashed; border-color: var(--s-accent2); }
.viz-comparison .mark { font-size: 3.4cqw; color: var(--s-accent); line-height: 1; } .viz-comparison .col.alt .mark { color: var(--s-ink); }
.viz-pattern { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 1.8cqw; align-content: center; }
.viz-pattern .tile { border: 0.16cqw solid var(--s-accent2); border-radius: 1cqw; display: flex; flex-direction: column; align-items: center; gap: 1cqw; padding: 1.4cqw 0.8cqw; text-align: center; }
.viz-pattern .mono { width: 6cqw; height: 6cqw; border-radius: 50%; background: var(--s-accent); color: var(--s-bg); display: grid; place-items: center; font-weight: 800; font-size: 2.6cqw; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }

/* casebook + instructions pages */
.doc h2 { margin-top: 40px; } .doc table.t { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); }
.doc table.t th, .doc table.t td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc table.t th { background: var(--bg); }
.tablewrap { overflow-x: auto; }
.doc pre { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 13.5px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; }
.kpis div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; } .kpis b { display: block; font: 650 28px Fraunces, Georgia, serif; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.diff del { color: var(--fail); } .diff ins { color: var(--pass); text-decoration: none; font-weight: 600; }
@media print { .top, .foot, .tools, .row, .checklist { display: none; } .slide { break-inside: avoid; box-shadow: none; } }
.doc .deckview { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.concept.chosen { outline: 3px solid var(--brand); }
