:root {
  color-scheme: light;
  --ink: #203330;
  --secondary: #495b54;
  --paper: #f5f2e9;
  --card: #fffdf7;
  --line: #ced3c7;
  --rust: #963f2e;
  --moss: #3e6553;
  --pale: #eaf0e5;
  --gold: #ecc184;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.72 var(--sans); }
a { color: var(--moss); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--rust); }
button, select, input { font: inherit; }
button, select, label, summary, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b76235; outline-offset: 3px; }
:where(h2[tabindex="-1"], main):focus { outline: none; }
:where(h2, summary, h3, #app) { scroll-margin-top: 110px; }
.sr { position: absolute; height: 1px; width: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.28; font-weight: 600; text-wrap: pretty; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.24rem; }
h4 { margin-top: 1.4rem; font-size: 1rem; }
.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.container { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner, .brand, .top-nav { display: flex; align-items: center; }
.topbar-inner { min-height: 66px; justify-content: space-between; gap: 16px; }
.brand { gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; transform: rotate(-5deg); background: var(--ink); color: var(--card); font: 600 .83rem/1 Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .98rem; letter-spacing: .05em; }
.brand small { color: var(--secondary); font-size: .75rem; line-height: 1.2; }
.top-nav { gap: .25rem; }
.top-nav a, .jump-links a, .text-link, .footer a { min-height: 44px; display: inline-flex; align-items: center; }
.top-nav a { justify-content: center; min-width: 44px; padding: 0 .7rem; font-size: .93rem; text-decoration: none; color: var(--secondary); }
.top-nav a[aria-current="page"] { color: var(--rust); box-shadow: inset 0 -2px var(--rust); font-weight: 700; }
.footer { border-top: 1px solid var(--line); font-size: .87rem; color: var(--secondary); }
.footer .container { display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between; align-items: center; padding-block: 12px; }
.eyebrow, .overline { font-weight: 700; font-size: .88rem; letter-spacing: .055em; }
.eyebrow { color: var(--gold); }
.eyebrow span { padding-inline: .25em; opacity: .7; }
.overline { color: var(--rust); margin-bottom: .4rem; }
.page-head, .hero { color: var(--card); background: var(--ink); }
.page-head { padding-block: clamp(22px, 3.6vw, 44px); }
.page-head h1 { margin: .42rem 0 .5rem; font-size: clamp(1.9rem, 4vw, 3.45rem); line-height: 1.2; }
.page-head p:last-child { color: #d6dfcf; }
.hero { padding-block: clamp(45px, 7vw, 100px); }
.hero-inner { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 5%; }
.hero h1 { margin-top: 16px; font-size: clamp(2.7rem, 5vw, 4.7rem); }
.hero-lede { max-width: 32em; margin: 1.15rem 0 1.55rem; color: #dce2d6; font-size: 1.06rem; }
.hero-map { display: grid; place-items: center; }
.decision-orbit { width: min(100%, 315px); aspect-ratio: 1; border: 1px solid #74867a; border-radius: 50%; position: relative; }
.decision-orbit::before, .decision-orbit::after { content: ""; position: absolute; inset: 12%; border: 1px dashed #8d855d; border-radius: 50%; }
.decision-orbit::after { inset: 27%; border: 1px solid #927358; }
.orbit-center { position: absolute; inset: 34%; display: grid; place-content: center; text-align: center; background: var(--rust); border-radius: 50%; font: 600 1.22rem/1.2 var(--serif); }
.orbit-node { position: absolute; z-index: 1; padding: 3px 10px; border: 1px solid #78867a; background: var(--ink); font-size: .9rem; }
.orbit-node:nth-child(2), .orbit-node:nth-child(4) { left: 50%; transform: translateX(-50%); }
.orbit-node:nth-child(2) { top: 8%; }
.orbit-node:nth-child(3) { top: 45%; right: 1%; }
.orbit-node:nth-child(4) { bottom: 8%; }
.orbit-node:nth-child(5) { top: 45%; left: 1%; }
.actions, .lesson-controls, .jump-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border: 1px solid transparent; border-radius: 3px; font-weight: 650; font-size: .96rem; text-decoration: none; cursor: pointer; line-height: 1.45; }
.btn-primary { color: white; background: var(--rust); }
.btn-primary:hover { color: white; background: #783020; }
.btn-quiet { color: var(--card); background: transparent; border-color: #a6b6a7; }
.btn-quiet:hover { color: white; border-color: white; }
.btn-outline { color: var(--moss); background: transparent; border-color: #7c9483; }
.btn-outline:hover { background: var(--pale); }
.text-link { width: fit-content; font-weight: 650; }
.section { padding-block: clamp(24px, 4.5vw, 58px); }
.toc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.toc-card { padding: 22px; border: 1px solid var(--line); border-top: 3px solid var(--moss); background: var(--card); color: var(--ink); text-decoration: none; }
.toc-card h3 { display: flex; justify-content: space-between; }
.toc-card p { margin-top: .6rem; color: var(--secondary); }
.panel, .scope, .reading-stack > .sources { background: var(--card); border: 1px solid var(--line); border-radius: 5px; }
.panel { min-width: 0; padding: clamp(19px, 3.1vw, 36px); }
.panel > p:not(.overline), .panel > h3, .panel > .fold, .panel > .btn { margin-top: 1em; }
.panel h3 + p, .conclusion p { margin-top: .45em; }
.panel p, .fold-body { overflow-wrap: anywhere; }
.scope, .reading-stack > .sources { padding-inline: 20px; }
.stage-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; background: var(--line); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin-bottom: 16px; }
.stage-tabs button { min-height: 48px; display: flex; justify-content: center; align-items: center; gap: .5rem; padding: 6px; background: var(--card); color: var(--secondary); border: 0; cursor: pointer; font-size: .95rem; }
.stage-tabs button:focus-visible { outline-offset: -4px; }
.stage-tabs button[aria-current="step"] { background: var(--ink); color: var(--card); }
.step-num { display: grid; place-content: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font: .8rem/1 Georgia, serif; }
.lesson-layout, .practice-wrap { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, 1fr); align-items: start; gap: 18px; }
.side-panel { background: #eef1e7; }
.side-panel > h3 { margin-top: 0; }
.scene span { display: inline-block; background: var(--pale); color: var(--moss); font-size: .86rem; font-weight: bold; padding: 0 .42rem; margin-right: .4rem; }
.fold { border-top: 1px solid var(--line); }
.fold summary { min-height: 46px; padding: 10px 2px; color: var(--moss); font-weight: 650; cursor: pointer; }
.fold summary::marker { color: var(--moss); }
.fold[open] > summary { color: var(--ink); }
.fold-body { padding: 0 2px 15px; }
.fold-body p + p { margin-top: .75rem; }
.facts > div { padding: .45rem 0; }
.facts dt, .field-label { font-weight: 700; color: var(--moss); }
.ledger { padding: 18px 20px; margin: 16px 0 24px; background: var(--ink); color: var(--card); border-radius: 4px; }
.ledger figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: .45rem; font-family: var(--serif); font-size: 1.18rem; font-weight: 700; }
.ledger figcaption span { color: var(--gold); font: .85rem/1.5 var(--sans); }
.ledger dl > div { display: grid; grid-template-columns: 8em 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid #53665b; }
.ledger dt { color: #d8dfc9; }
.ledger dd { font-weight: 630; }
.conclusion { border-left: 3px solid var(--moss); padding: 13px 16px; margin-top: 1.2rem; background: var(--pale); }
.lesson-controls { margin-top: 1.3rem; }
.source-note, .citation-list { color: var(--secondary); font-size: .92rem; }
.citation-list { padding-left: 1.3rem; }
.citation-list li + li { margin-top: .45rem; }
.reading-stack { display: grid; gap: 18px; }
.jump-links { gap: 2px 18px; }
.jump-links a { font-weight: 650; }
.panel-heading { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.filter-label { display: inline-flex; align-items: center; gap: .5rem; color: var(--secondary); font-size: .92rem; }
select { min-height: 44px; appearance: none; padding: 5px 32px 5px 10px; background-color: var(--card);
  background-image: linear-gradient(45deg, transparent 50%, var(--moss) 50%), linear-gradient(135deg, var(--moss) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; color: var(--ink); border: 1px solid #849081; border-radius: 3px; }
.form-table { width: 100%; border-collapse: collapse; }
.form-table th, .form-table td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid var(--line); }
.form-table thead th { color: var(--card); background: var(--ink); font-size: .94rem; }
.form-table tbody th { min-width: 7.6em; color: var(--moss); }
.form-table small { display: block; font-size: .82rem; color: var(--secondary); font-weight: 400; }
.form-table tr:nth-child(even) { background: #f3f5ed; }
.field-label { display: none; }
.decision-list { padding-left: 1.75rem; }
.decision-list li, .answer-key li { padding-left: .2rem; margin: .55rem 0; }
.decision-list li::marker { color: var(--rust); font-weight: 750; }
.roles dl > div { display: grid; grid-template-columns: minmax(100px, 9rem) 1fr; gap: 16px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.roles dt { color: var(--moss); font-weight: 700; }
.roles dt small { display: block; color: var(--secondary); font-size: .85rem; font-weight: normal; }
.roles .source-note { margin-top: .75rem; }
.ownership-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 1.2rem; }
.ownership-grid > article { padding-left: 15px; border-left: 2px solid #a7b6a3; }
.question { font-size: 1.07rem; }
.options { display: grid; gap: .55rem; padding: 0; border: 0; margin: 1.15rem 0 0; min-inline-size: 0; }
.option { display: flex; align-items: center; gap: .75rem; min-height: 48px; padding: 8px 13px; border: 1px solid var(--line); background: var(--card); cursor: pointer; border-radius: 3px; }
.option:hover, .option:focus-within { border-color: var(--moss); }
.option input { accent-color: var(--moss); }
.option.correct { background: var(--pale); border-color: var(--moss); }
.option.wrong { background: #faece3; border-color: var(--rust); }
.feedback:not(:empty) { font-weight: 650; padding: 12px 14px; background: var(--paper); }
.feedback:empty { margin: 0 !important; }
.answer-key h3 { color: var(--moss); }
.answer-key ol { padding-left: 1.5rem; }
@media (max-width: 800px) {
  .lesson-layout, .practice-wrap { grid-template-columns: 1fr; }
  .container { width: calc(100% - 40px); }
  .hero-inner { gap: 22px; }
  .toc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .form-table, .form-table tbody, .form-table tbody tr, .form-table tbody th, .form-table td { display: block; }
  .form-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .form-table tbody tr { margin-bottom: 12px; border: 1px solid var(--line); }
  .form-table tr:nth-child(even) { background: var(--card); }
  .form-table tbody th { background: var(--pale); min-width: 0; }
  .form-table th, .form-table td { padding: 9px 12px; }
  .form-table td:last-of-type { border-bottom: 0; }
  .form-table small { display: inline-block; margin-inline-start: .65rem; }
  .field-label { display: block; margin-bottom: 2px; font-size: .88rem; }
  .ownership-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  :where(h2, h3, summary, #app) { scroll-margin-top: 96px; }
  .container { width: calc(100% - 28px); }
  .topbar-inner { min-height: 55px; gap: 4px; }
  .top-nav { gap: 0; }
  .top-nav a { padding: 0 4px; font-size: .88rem; }
  .brand { gap: 6px; }
  .brand small { display: none; }
  .brand-mark { width: 26px; height: 26px; font-size: .7rem; }
  .brand strong { font-size: .88rem; letter-spacing: 0; }
  .hero-inner { grid-template-columns: 1fr; }
  .decision-orbit { width: min(210px, 80%); }
  .hero h1 { font-size: 2.8rem; }
  .page-head { padding-block: 16px 18px; }
  .page-head h1 { font-size: 1.8rem; }
  .section { padding-block: 18px 26px; }
  .panel { padding: 16px; }
  .stage-tabs { margin-bottom: 10px; }
  .stage-tabs button { font-size: .86rem; gap: 3px; }
  .step-num { width: 17px; height: 17px; font-size: .73rem; }
  .ledger { padding: 13px; }
  .ledger dl > div { grid-template-columns: minmax(0, 6.1em) 1fr; gap: 8px; }
  .roles dl > div { grid-template-columns: minmax(0, 4.5em) 1fr; gap: 10px; }
  .jump-links { column-gap: 12px; }
  .filter-label { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .stage-tabs button { transition: background-color .15s ease, color .15s ease; }
  .ledger dd { animation: ink-in .18s ease-out; }
  @keyframes ink-in { from { opacity: .65; } to { opacity: 1; } }
}
