/* Leadership 100–600 course site. One stylesheet, no external fonts (works offline). */

:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --surface-2: #f1eee7;
  --ink: #1c222a;
  --muted: #56606d;
  --line: #d8d4ca;
  --accent: #1d5c88;
  --accent-ink: #ffffff;
  --accent-soft: #e3edf5;
  --ent: #8a4a0c;
  --ent-soft: #fbefdf;
  --draft-bg: #fff3d6;
  --draft-line: #c98a12;
  --focus: #b3470a;
  --flag-rt: #1e6b3a;
  --flag-mx: #1d5c88;
  --flag-pb: #8a4a0c;
  --flag-cn: #6a3d8f;
  --fig-fill: #eef3f7;
  --fig-fill-2: #f6f2ea;
  --fig-stroke: #6b88a0;
  --fig-line: #46525f;
  --fig-l0: #e3edf5;
  --fig-l1: #f3e8d6;
  --fig-l2: #e5efe6;
  --fig-l3: #ece6f2;
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 2px 8px rgba(20, 24, 30, .05);
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111519;
    --surface: #182027;
    --surface-2: #1f2830;
    --ink: #e7eaee;
    --muted: #a7b1bd;
    --line: #34404c;
    --accent: #84bde8;
    --accent-ink: #0d1a24;
    --accent-soft: #1b2e3d;
    --ent: #f1b76d;
    --ent-soft: #33261a;
    --draft-bg: #3a2e14;
    --draft-line: #d9a339;
    --focus: #ffb37a;
    --flag-rt: #7fd39a;
    --flag-mx: #84bde8;
    --flag-pb: #f1b76d;
    --flag-cn: #c9a6ec;
    --fig-fill: #1f2d39;
    --fig-fill-2: #29251f;
    --fig-stroke: #7fa3c0;
    --fig-line: #b8c3cf;
    --fig-l0: #1f2d39;
    --fig-l1: #33291c;
    --fig-l2: #1f3324;
    --fig-l3: #2c2338;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111519;
  --surface: #182027;
  --surface-2: #1f2830;
  --ink: #e7eaee;
  --muted: #a7b1bd;
  --line: #34404c;
  --accent: #84bde8;
  --accent-ink: #0d1a24;
  --accent-soft: #1b2e3d;
  --ent: #f1b76d;
  --ent-soft: #33261a;
  --draft-bg: #3a2e14;
  --draft-line: #d9a339;
  --focus: #ffb37a;
  --flag-rt: #7fd39a;
  --flag-mx: #84bde8;
  --flag-pb: #f1b76d;
  --flag-cn: #c9a6ec;
  --fig-fill: #1f2d39;
  --fig-fill-2: #29251f;
  --fig-stroke: #7fa3c0;
  --fig-line: #b8c3cf;
  --fig-l0: #1f2d39;
  --fig-l1: #33291c;
  --fig-l2: #1f3324;
  --fig-l3: #2c2338;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.22; font-weight: 700; letter-spacing: -.005em; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); margin: .2rem 0 .6rem; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.65rem); margin: 2.2rem 0 .7rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li + li { margin-top: .35rem; }
.small { font-size: .875rem; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; gap: .75rem; min-height: 3.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--serif); font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.brand-mark { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 1rem; }
.site-nav ul { list-style: none; display: flex; gap: .2rem; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav li + li { margin: 0; }
.site-nav a { display: block; padding: .4rem .6rem; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.search-form { margin-left: auto; }
.search-form input { width: 11rem; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; font-size: .95rem; }
.theme-toggle, .nav-toggle { font: inherit; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .6rem; cursor: pointer; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .site-header { position: static; }
  .nav-toggle { display: inline-block; margin-left: auto; }
  .site-nav { display: none; width: 100%; order: 5; padding-bottom: .5rem; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .search-form { margin-left: 0; order: 4; flex: 1 1 100%; padding-bottom: .5rem; }
  .search-form input { width: 100%; }
}

main { padding-top: 1.2rem; padding-bottom: 3rem; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 1.5rem 0; }

/* Common pieces */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .6rem; }
.crumbs a { color: var(--muted); }
.kicker { font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--muted); margin: 0; font-weight: 600; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 46rem; }
.dateline { color: var(--muted); margin-top: -.3rem; }
.button { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: .55rem 1rem; border-radius: 8px; text-decoration: none; font-weight: 600; font: inherit; cursor: pointer; }
.button.ghost { background: transparent; color: var(--accent); }
.link-button { background: none; border: none; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-family: var(--sans); vertical-align: middle; letter-spacing: .02em; }
.badge.draft { background: var(--draft-bg); border-color: var(--draft-line); color: var(--ink); }
.flag { display: inline-flex; gap: .3rem; align-items: center; font-size: .8rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; border: 1.5px solid currentColor; font-family: var(--sans); white-space: nowrap; }
.flag-research-tested { color: var(--flag-rt); }
.flag-mixed { color: var(--flag-mx); }
.flag-practice-based { color: var(--flag-pb); }
.flag-conceptual { color: var(--flag-cn); }
.strand { display: inline-block; font-size: .8rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); font-family: var(--sans); }
.strand-enterprise { background: var(--ent-soft); border-color: var(--ent); }
.badges { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .2rem 0 1rem; }
.draft-banner { background: var(--draft-bg); border: 1px solid var(--draft-line); border-left-width: 6px; border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; font-size: .97rem; }
.callout { background: var(--accent-soft); border-left: 5px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.2rem; margin: 1rem 0 1.5rem; font-size: 1.08rem; }
.callout.core { font-size: 1.12rem; }
.unit-meta { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .7rem 0 .2rem; margin: 0 0 1rem; font-size: .97rem; }
.unit-meta p { margin: 0 0 .5rem; white-space: pre-wrap; }
.illus-note { font-size: .92rem; color: var(--muted); }

/* Unit layout */
.unit-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.unit { max-width: 48rem; min-width: 0; }
.toc { display: none; }
@media (min-width: 1100px) {
  .unit-layout { grid-template-columns: minmax(0, 48rem) 15rem; }
  .toc { display: block; position: sticky; top: 4.5rem; align-self: start; max-height: calc(100vh - 6rem); overflow: auto; font-size: .9rem; padding-left: 1rem; border-left: 1px solid var(--line); }
  .toc ol { list-style: none; padding: 0; }
  .toc li + li { margin-top: .25rem; }
  .toc a { color: var(--muted); text-decoration: none; display: block; padding: .1rem .3rem; border-radius: 4px; }
  .toc a.active, .toc a:hover { color: var(--accent); background: var(--accent-soft); }
  .toc-mobile { display: none; }
}
.toc-title { font-weight: 700; margin: 0 0 .5rem; }
.toc-mobile { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin: 0 0 1rem; background: var(--surface); }
.toc-mobile summary { cursor: pointer; font-weight: 600; }
.sec { scroll-margin-top: 4.5rem; }
.sec h2 { border-top: 1px solid var(--line); padding-top: 1.4rem; }
.sec-questions ol li { margin-bottom: .5rem; }
.lead-sec { margin: 0 0 1rem; }
.xref { font-weight: 600; }
a.gloss { color: inherit; text-decoration: underline dotted var(--muted); text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a.gloss:hover { color: var(--accent); }
.lab-link { margin: 1rem 0; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.2rem; }
.prevnext a { display: block; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.prevnext a span { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.prevnext .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .prevnext { grid-template-columns: 1fr; } .prevnext .next { grid-column: 1; } }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--surface-2); font-family: var(--sans); font-size: .88rem; }
tbody tr:last-child > * { border-bottom: none; }
tbody th { font-weight: 600; }
table.studies td, table.studies th { min-width: 9rem; }
@media (max-width: 700px) {
  .table-wrap.stack { border: none; background: none; overflow: visible; }
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .8rem; background: var(--surface); padding: .3rem 0; }
  table.stack th, table.stack td { border: none; padding: .35rem .8rem; min-width: 0; }
  table.stack td::before { content: attr(data-label); display: block; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
  table.stack tbody th { font-size: 1.02rem; }
}

/* Reading guide */
.tier { font-family: var(--sans); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 1.4rem; }
ol.reading { list-style: none; padding: 0; }
ol.reading li { padding: .6rem 0; border-bottom: 1px dashed var(--line); }
ol.reading .cite { display: inline; }
ol.reading .note { display: block; color: var(--muted); margin-top: .2rem; font-size: .96rem; }
ol.reading a.doi, ol.reading a.src { font-size: .88rem; word-break: break-all; }
.dagger { font-weight: 700; cursor: help; }
.doi-note { font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8rem; margin-top: 1rem; }

/* Cards */
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .9rem; }
.cards li + li { margin: 0; }
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .35rem; }
.card > a { text-decoration: none; color: var(--ink); }
.card > a:hover .card-title { color: var(--accent); text-decoration: underline; }
.card-kicker { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.card-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.08rem; line-height: 1.3; margin-top: .15rem; }
.card-q { font-size: .93rem; color: var(--muted); margin: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: auto; font-size: .85rem; color: var(--muted); }
.unit-card[data-origin="authored"] { border-top: 3px solid var(--ent); }
.card[hidden] { display: none; }

/* Filters */
.filters { margin: .5rem 0 1rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .45rem; }
.chip-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; min-width: 4.8rem; }
.chip { font: inherit; font-size: .85rem; padding: .2rem .65rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.filter-status { font-size: .85rem; color: var(--muted); min-height: 1.2em; margin: 0; }

/* Home */
.hero { padding: 1.5rem 0 1rem; }
.hero h1 { font-size: clamp(2.2rem, 1.5rem + 3vw, 3.4rem); }
/* Version B: start panel, study paths, map */
.start-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1.2rem 0; box-shadow: var(--shadow); }
.start-panel h2 { margin: 0 0 .6rem; font-size: 1.25rem; }
.start-panel p { margin: .6rem 0 0; }
.start-options { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .7rem; }
.start-option { display: flex; flex-direction: column; gap: .3rem; height: 100%; box-sizing: border-box; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.start-option:hover, .start-option:focus-visible { border-color: var(--accent); }
.start-option .card-title { color: var(--accent); font-weight: 700; }
.start-option span:last-child { font-size: .92rem; color: var(--muted); }
.study-path { margin: 2rem 0 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.study-path h2 { margin-top: 0; font-size: 1.15rem; }
.study-path h3 { font-size: .95rem; margin: .2rem 0 .3rem; }
.study-path ul { margin: 0; padding-left: 1.1rem; }
.study-path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem 1.2rem; }
.level-check { margin: .4rem 0 1rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem 1.5rem; }
.path-list { padding-left: 1.4rem; }
.path-list li { margin: .35rem 0; }
.path-list .card-q { margin: .15rem 0 0; font-size: .92rem; color: var(--muted); }
.path-block h3 { margin-bottom: .2rem; }
.map-list { list-style: none; margin: 0; padding: 0; }
.map-list li { margin: 0 0 .45rem; overflow-wrap: anywhere; }
.map-note { min-height: 1.2em; }
.strand-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .6rem; }
.strand-list li { margin: 0; padding: .7rem .9rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.strand-list li strong { display: block; font-family: var(--serif); }
.strand-list li span { font-size: .93rem; color: var(--muted); }
.strand-list .strand-enterprise { border-color: var(--ent); background: var(--ent-soft); }
.egrid th, .egrid td { font-size: .9rem; }
.egrid td a { font-weight: 600; }
.planned { color: var(--muted); }
.level-switch ul, .jump ul, .az ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 1rem; }
.level-switch li + li, .jump li + li, .az li + li { margin: 0; }
.level-switch a, .az a { display: inline-block; min-width: 2.6rem; text-align: center; padding: .25rem .55rem; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--surface); }
.level-switch a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.jump a { display: inline-block; padding: .25rem .65rem; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-size: .9rem; }
.track-title { margin-top: 2.8rem; }
.track { margin-top: 1.5rem; }
.track-note { color: var(--muted); }
.enterprise-front { border-left: 4px solid var(--ent); padding-left: 1rem; margin: 1rem 0; }
.level-front, .closing { max-width: 52rem; }

/* Domain path */
ol.path { list-style: none; padding: 0; position: relative; }
.path-step { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.path-level { font-weight: 700; font-family: var(--serif); }
.path-title { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; }

/* Glossary */
dl.glossary { margin: 0 0 1rem; }
.g-item { padding: .6rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 5rem; }
.g-item:target { background: var(--accent-soft); }
.g-item dt { font-weight: 700; font-family: var(--serif); font-size: 1.05rem; }
.g-item dd { margin: .15rem 0 0; }
.g-where { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.g-item[hidden] { display: none; }

/* Search */
.search-big label { font-weight: 600; display: block; margin-bottom: .3rem; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; min-width: 0; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.results { list-style: none; padding: 0; }
.results li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.results .r-title { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.results .r-meta { font-size: .82rem; color: var(--muted); }
.results .r-snip { margin: .2rem 0 0; font-size: .95rem; }
mark { background: var(--draft-bg); color: inherit; padding: 0 .1em; border-radius: 2px; }

/* Figures */
.fig { margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.fig-svg { display: block; height: auto; }
.fig-narrow { display: none; }
@media (max-width: 640px) { .fig-wide { display: none; } .fig-narrow { display: block; } .fig { padding: .6rem; } }
.fig figcaption { font-size: .93rem; color: var(--ink); margin-top: .6rem; }
.fig-source { display: block; color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.fig-alt summary { cursor: pointer; color: var(--accent); font-size: .85rem; margin-top: .3rem; }
.fig-alt p { font-size: .9rem; color: var(--muted); }
.fig-illus { font-size: .8rem; font-weight: 700; color: var(--ent); text-transform: uppercase; letter-spacing: .06em; margin: .3rem 0 0; }
.fig-svg text { font-family: var(--sans); }
.fig-text { fill: var(--ink); }
.fig-note { fill: var(--muted); }
.fig-box { fill: var(--fig-fill); stroke: var(--fig-stroke); stroke-width: 1.3; }
.fig-layer-0 { fill: var(--fig-l0); }
.fig-layer-1 { fill: var(--fig-l1); }
.fig-layer-2 { fill: var(--fig-l2); }
.fig-layer-3 { fill: var(--fig-l3); }
.fig-cell { fill: var(--fig-fill); stroke: var(--fig-stroke); stroke-width: 1; }
.fig-cell-tr, .fig-cell-bl { fill: var(--fig-fill-2); }
.fig-cell-head { fill: var(--fig-fill-2); stroke: var(--fig-stroke); stroke-width: 1; }
.fig-line { stroke: var(--fig-line); stroke-width: 1.6; fill: none; }
.fig-arrowhead { fill: var(--fig-line); }
.fig-axis { stroke: var(--fig-line); stroke-width: 2.5; }
.fig-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.fig-bar { fill: var(--accent); }
.fig-curve { stroke: var(--accent); stroke-width: 3; fill: none; }
.fig-curve-2 { stroke: var(--ent); stroke-dasharray: 8 5; }
.fig-mark { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 4 4; }
.fig-labelbg { fill: var(--surface); }
.fig-sign { fill: var(--surface); stroke: var(--fig-line); stroke-width: 1.5; }
.fig-node-decision { fill: var(--accent); }
.fig-node-chance { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.fig-node-end { fill: var(--ent); }

/* Labs (shared) */
.lab { margin-top: 1rem; }
.lab fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem 1rem; margin: 0 0 1rem; background: var(--surface); }
.lab legend { font-weight: 700; padding: 0 .3rem; }
.lab label { display: block; font-weight: 600; font-size: .93rem; margin: .5rem 0 .2rem; }
.lab input[type="number"], .lab input[type="text"], .lab select, .lab textarea { font: inherit; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); width: 100%; max-width: 22rem; }
.lab textarea { max-width: 100%; min-height: 6rem; }
.lab input[type="range"] { width: 100%; max-width: 26rem; accent-color: var(--accent); }
.lab .out { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.lab .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.lab .note { font-size: .9rem; color: var(--muted); }
.lab .result { background: var(--accent-soft); border-radius: var(--radius); padding: .8rem 1rem; margin: .8rem 0; }

/* Print */
@media print {
  :root { --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #bbb; --accent: #000; --accent-soft: #f2f2f2; }
  .site-header, .site-footer, .toc, .toc-mobile, .prevnext, .crumbs, .filters, .theme-toggle, .lab-link, .fig-alt summary { display: none !important; }
  .fig-narrow { display: none !important; } .fig-wide { display: block !important; }
  .unit-layout { display: block; }
  body { font-size: 11pt; }
  a { color: #000; }
  ol.reading a.doi::after { content: ""; }
  .sec, .fig, tr, li { break-inside: avoid; }
  h2 { break-after: avoid; }
  .table-wrap { border: none; overflow: visible; }
  table.stack thead { position: static; width: auto; height: auto; clip: auto; }
  table.stack, table.stack tbody, table.stack tr { display: revert; }
  table.stack th, table.stack td { display: table-cell; }
  table.stack td::before { content: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
/* Version D: key sources, teaching materials, cross-reference */
.key-sources { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: .7rem .9rem; margin: .5rem 0 1rem; }
.key-sources ul { margin: .3rem 0; padding-left: 1.1rem; }
.key-sources li { margin: .3rem 0; }
.sec-teaching details.facilitator { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin-top: 1rem; background: var(--surface); }
.sec-teaching details.facilitator summary { cursor: pointer; font-weight: 700; }
table.crossref td { overflow-wrap: anywhere; }
.case-box { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: .7rem .9rem; margin: 1.2rem 0; }
.case-box ul { margin: .3rem 0; padding-left: 1.1rem; }
.case-tabs ol { display: flex; flex-wrap: wrap; gap: .4rem 1rem; list-style: none; padding: 0; margin: .5rem 0 1rem; }
.case-illustrates { font-style: italic; }
.case-version h3 { margin-top: 1.2rem; }
sup .fact-ref { font-size: .75em; text-decoration: none; padding: 0 .1em; }
.case-notes { margin: 1rem 0; font-size: .92rem; }
.case-notes li { margin: .25rem 0; overflow-wrap: anywhere; }

/* Progress saving: status line, continue banner and panel, level bars, My progress page */
.pg-status { margin: 0 0 .6rem; min-height: 1.4em; }
.pg-banner { background: var(--accent-soft); border: 1px solid var(--accent); border-left-width: 6px; border-radius: var(--radius); padding: .7rem 1rem; margin: 0 0 1rem; }
.pg-banner p { margin: 0 0 .5rem; }
.pg-banner-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.pg-banner .button { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.pg-resume .button { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.pg-level { margin: .5rem 0 .8rem; }
.pg-level-text { margin: 0 0 .3rem; font-size: .93rem; color: var(--muted); }
.pg-bar { height: .6rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.pg-bar > span { display: block; height: 100%; background: var(--accent); }
.pg-mark { display: inline-block; margin-left: .2rem; font-size: .85em; font-weight: 700; white-space: nowrap; }
.pg-mark-done { color: var(--flag-rt); }
.pg-mark-doing { color: var(--flag-pb); }
.progress-app { max-width: 52rem; }
.pg-total { font-weight: 600; }
.pg-tools { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 1rem 1rem; margin: 1.5rem 0; }
.pg-tools h2 { margin-top: 1rem; }
.pg-import { margin: .9rem 0 0; }
.pg-import label { display: block; font-weight: 600; margin-bottom: .3rem; }
.pg-import input[type="file"] { max-width: 100%; font: inherit; }
.pg-confirm { border: 1px solid var(--draft-line); background: var(--draft-bg); border-radius: var(--radius); padding: .7rem 1rem; margin-top: .8rem; }
.pg-confirm p { margin: 0 0 .5rem; }
.pg-message { margin: .8rem 0 0; min-height: 1.4em; font-weight: 600; }
.pg-message:focus { outline-offset: 4px; }
.pg-lessons { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.pg-lesson { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); margin: 0; }
.pg-lesson + .pg-lesson { margin-top: 0; }
.pg-lesson-status { color: var(--muted); font-size: .92rem; }
.pg-lesson.pg-done .pg-lesson-status { color: var(--flag-rt); font-weight: 600; }
.pg-lesson.pg-doing .pg-lesson-status { color: var(--flag-pb); font-weight: 600; }
.pg-level-sec h2 { margin-bottom: .3rem; }
@media print { .pg-banner, .pg-status { display: none !important; } }

/* Server mode: sign-in, account, admin, and the save-status line */
.sync-row { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sync-row .wrap { padding-top: .2rem; padding-bottom: .2rem; }
.sync-status { margin: 0; }
.sync-status:empty { display: none; }
.sync-on .pg-status { display: none; }
.auth-nav a { white-space: nowrap; }
.auth-box { max-width: 36rem; }
.auth-form p { margin: .7rem 0 0; }
.auth-form label, .admin-app label { display: block; font-weight: 600; margin-bottom: .25rem; }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"], .admin-app textarea {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); width: 100%; max-width: 26rem; box-sizing: border-box; }
.admin-app textarea { max-width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
.auth-check { display: inline-flex; align-items: center; gap: .45rem; margin: .2rem 1rem .2rem 0; }
.auth-check label, .admin-app .auth-check label { display: inline; margin: 0; font-weight: 400; }
.auth-check input { width: auto; }
.auth-alt { margin-top: 1.5rem; }
.auth-msg { min-height: 1.4em; font-weight: 600; margin: .8rem 0 0; }
.auth-err { min-height: 1.4em; font-weight: 600; margin: .4rem 0 0; color: var(--ent); }
.auth-dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
.auth-dl dt { font-weight: 600; }
.auth-dl dd { margin: 0; overflow-wrap: anywhere; }
.admin-app { max-width: 70rem; }
.admin-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 1rem 1rem; margin: 1.2rem 0; }
.admin-box h2 { margin-top: 1rem; }
.admin-app fieldset { border: 1px solid var(--line); border-radius: 6px; margin: .8rem 0 0; padding: .4rem .8rem .6rem; }
.admin-app legend { font-weight: 600; padding: 0 .3rem; }
.admin-csv { margin-top: 1rem; }
.admin-results ul { margin: .6rem 0 0; padding-left: 1.2rem; }
.ad-fail { color: var(--ent); }
.admin-app .table-wrap { position: relative; }
.admin-table { min-width: 52rem; }
.row-actions { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; margin-top: .5rem; }
.row-actions .button { padding: .3rem .7rem; font-size: .9rem; }
.row-actions-wrap summary { cursor: pointer; color: var(--accent); font-weight: 600; }
@media print { .sync-row, .auth-nav { display: none !important; } }
