/* ==========================================================================
   Wilderness First Aid — shared design system
   One stylesheet for the landing page, all 14 lessons, and the final exam.
   Light theme, responsive, printable, accessible.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;

  /* brand */
  --primary: #1B4F8A;
  --primary-strong: #143C69;
  --primary-contrast: #FFFFFF;
  --accent: #2C7BE5;
  --link: #1A5FC2;

  /* neutrals */
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #EEF2F7;
  --surface-3: #E3E9F1;
  --text: #1E293B;
  --text-muted: #5A6B80;
  --text-faint: #8A97A8;
  --border: #D8E0EA;
  --border-strong: #B9C5D3;

  /* semantic */
  --danger: #B42318; --danger-bg: #FEF3F2; --danger-border: #F4B6B0;
  --warning: #B54708; --warning-bg: #FFF7ED; --warning-border: #F7C58C;
  --info: #1D4ED8; --info-bg: #EFF5FF; --info-border: #B6CCF5;
  --success: #157347; --success-bg: #EFFBF3; --success-border: #A9DFBE;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-base: 17px;
  --lh: 1.65;

  /* shape + motion */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
  --ease: 160ms ease;

  /* layout */
  --content-w: 780px;
  --site-w: 1160px;
  --toc-w: 240px;
  --nav-h: 56px;
}


/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 640px) { :root { --fs-base: 16px; } }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
p { margin: 0 0 1em; }
ul, ol { margin: 0.25em 0 1.1em 1.35em; padding: 0; }
li { margin-bottom: 0.4em; }
li > ul, li > ol { margin-top: 0.4em; margin-bottom: 0.4em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }
img, svg, video { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.skip-link { position: absolute; left: 8px; top: -48px; background: var(--primary); color: var(--primary-contrast); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 1000; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--site-w); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  background: var(--primary); color: var(--primary-contrast);
  border: 1px solid transparent; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95em; text-decoration: none; cursor: pointer;
  transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
.btn:hover { background: var(--primary-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--primary); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 0.875em; }
.btn.lg { min-height: 52px; padding: 14px 26px; font-size: 1.05em; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Site navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 200;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .wrap { display: flex; align-items: center; gap: 16px; min-height: var(--nav-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; color: var(--text); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand .brand-sub { font-weight: 500; color: var(--text-muted); font-size: 0.85em; }
.site-nav .nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.site-nav .nav-links a { color: var(--text-muted); text-decoration: none; padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.95em; }
.site-nav .nav-links a:hover, .site-nav .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.lesson-pos { color: var(--text-muted); font-size: 0.9em; white-space: nowrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-muted); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
@media (max-width: 640px) {
  .brand .brand-sub, .site-nav .nav-links .hide-sm, .lesson .lesson-pos { display: none; }
  .site-nav .wrap { gap: 8px; }
  .brand { min-width: 0; font-size: 0.95em; }
  .brand > span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
  .site-nav .nav-links a { padding: 8px 8px; font-size: 0.9em; }
  .site-nav .nav-links { gap: 0; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.9em; }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: grid; gap: 12px; }
.site-footer a { color: var(--text-muted); }
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer .foot-disclaimer { max-width: 70ch; }

/* ---------- Generic components ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin: 18px 0; box-shadow: var(--shadow-sm);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h3, .card h4 { margin-top: 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin: 18px 0; }
.card-grid .card { margin: 0; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78em; font-weight: 650; line-height: 1.6; vertical-align: middle; background: var(--surface-3); color: var(--text-muted); }
.badge-red, .tag-red { background: var(--danger-bg); color: var(--danger); }
.badge-green, .tag-green { background: var(--success-bg); color: var(--success); }
.badge-blue, .tag-blue { background: var(--info-bg); color: var(--info); }
.badge-orange, .tag-orange { background: var(--warning-bg); color: var(--warning); }

.alert { position: relative; border: 1px solid; border-left-width: 5px; border-radius: var(--radius); padding: 14px 18px; margin: 20px 0; background: var(--surface-2); border-color: var(--border); }
.alert > :last-child { margin-bottom: 0; }
.alert ul, .alert ol { margin-bottom: 0.4em; }
.alert-title { font-weight: 700; font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger); }
.alert-danger .alert-title, .alert-danger > strong:first-child { color: var(--danger); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); border-left-color: var(--warning); }
.alert-warning .alert-title, .alert-warning > strong:first-child { color: var(--warning); }
.alert-info { background: var(--info-bg); border-color: var(--info-border); border-left-color: var(--info); }
.alert-info .alert-title, .alert-info > strong:first-child { color: var(--info); }
.alert-success { background: var(--success-bg); border-color: var(--success-border); border-left-color: var(--success); }
.alert-success .alert-title, .alert-success > strong:first-child { color: var(--success); }

.table-wrapper { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table-wrapper table { margin: 0; border: 0; }
table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.92em; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th { background: var(--surface-2); color: var(--text); font-weight: 650; text-align: left; padding: 11px 14px; border-bottom: 2px solid var(--border-strong); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
@media (max-width: 720px) {
  .lesson-content table:not(.table-wrapper table) { display: block; overflow-x: auto; white-space: normal; }
}

/* ---------- Lesson content components ---------- */
.key-points { background: var(--primary); color: var(--primary-contrast); border-radius: var(--radius-lg); padding: 22px 24px; margin: 28px 0; }
.key-points h3, .key-points h4 { color: inherit; margin: 0 0 12px; font-size: 1.05em; text-transform: uppercase; letter-spacing: 0.06em; }
.key-points ul { margin: 0 0 0 1.2em; }
.key-points li { margin-bottom: 8px; }
.key-points a { color: inherit; }
.key-point { position: relative; padding: 6px 0 6px 28px; }
.key-point::before { content: "✓"; position: absolute; left: 4px; top: 6px; font-weight: 800; }
.key-points .key-point + .key-point { border-top: 1px solid color-mix(in srgb, var(--primary-contrast) 18%, transparent); }

.objective-list, .objectives ul { list-style: none; margin: 0 0 1em; padding: 0; }
.objective-list li, .objectives li { position: relative; padding: 10px 14px 10px 42px; border-radius: var(--radius-sm); background: var(--info-bg); border: 1px solid var(--info-border); margin-bottom: 8px; }
.objective-list li::before, .objectives li::before { content: "✓"; position: absolute; left: 14px; top: 10px; color: var(--info); font-weight: 800; }
.objectives { margin: 18px 0; }
.objectives h4 { margin-bottom: 10px; }

.mnemonic-box { background: var(--info-bg); border: 1px solid var(--info-border); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0; }
.mnemonic-box h4, .mnemonic-box h3 { color: var(--info); margin-bottom: 12px; }
.mnemonic-row, .mnemonic-item { display: flex; gap: 12px; margin-bottom: 8px; align-items: flex-start; }
.mnemonic-letter { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-contrast); font-weight: 800; font-size: 1.05em; }
.mnemonic-text { padding-top: 5px; }
.mnemonic-text strong { color: var(--primary); }
.mnemonic-item { padding-top: 0; line-height: 36px; }
.mnemonic-item .mnemonic-letter { line-height: 1; }

.glossary dt, .glossary .term { font-weight: 700; color: var(--primary); margin-top: 14px; }
.glossary dd, .glossary .definition { margin: 2px 0 0 0; color: var(--text); }
.glossary-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.glossary-item:last-child { border-bottom: 0; }
.glossary-item .term { font-weight: 700; color: var(--primary); margin: 0 0 2px; }
.glossary-item .definition { margin: 0; }
.glossary-term { padding: 12px 0; border-bottom: 1px solid var(--border); }
.glossary-term:last-child { border-bottom: 0; }
.glossary-term strong { color: var(--primary); }

/* Scenarios — two markup families exist:
   (a) .scenario-case > .scenario-header + .scenario-body   (card)
   (b) .scenario > .scenario-title + .scenario-case (text)  */
.scenario, .scenario-case { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 20px 0; box-shadow: var(--shadow-sm); overflow: hidden; }
.scenario { padding: 20px 22px; }
.scenario .scenario-case { background: var(--surface-2); border: 0; border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 14px; box-shadow: none; }
.scenario-title, .scenario-header { font-weight: 700; font-size: 1.05em; }
.scenario-title { color: var(--primary); margin: 0 0 12px; }
.scenario-header { background: var(--primary); color: var(--primary-contrast); padding: 12px 20px; }
.scenario-body { padding: 18px 20px; }
.scenario-body p { margin-bottom: 10px; }
.scenario-body > :last-child { margin-bottom: 0; }

.btn-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; margin-top: 8px; background: var(--surface); color: var(--primary); border: 1px solid var(--border-strong); border-radius: var(--radius); font-weight: 600; font-size: 0.92em; cursor: pointer; transition: background var(--ease); }
.btn-toggle:hover { background: var(--surface-2); }
.btn-toggle::before { content: "▸"; transition: transform var(--ease); }
.btn-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.discussion { margin-top: 14px; padding: 16px 18px; background: var(--success-bg); border: 1px solid var(--success-border); border-left: 4px solid var(--success); border-radius: var(--radius-sm); }
.discussion > :last-child { margin-bottom: 0; }
.discussion ul, .discussion ol { margin-left: 1.2em !important; }

/* ---------- Lesson page layout ---------- */
.lesson-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.lesson-head .wrap { padding-top: 36px; padding-bottom: 32px; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--text-muted); font-size: 0.88em; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 12px; }
.eyebrow .dot::before { content: "·"; margin-right: 14px; color: var(--text-faint); }
.lesson-head h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.5rem); margin-bottom: 10px; max-width: 26ch; }
.lesson-head .lead { font-size: 1.08em; color: var(--text-muted); max-width: 64ch; margin: 0; }
.lesson-head .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.lesson-body { display: grid; grid-template-columns: var(--toc-w) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 32px; }
.lesson-toc { position: sticky; top: calc(var(--nav-h) + 16px); }
.lesson-toc .toc-label { font-size: 0.75em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin: 0 0 10px 12px; }
.tablist { display: flex; flex-direction: column; gap: 2px; }
.tab {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font-weight: 500; font-size: 0.95em; cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--primary); font-weight: 650; border-color: var(--border); box-shadow: var(--shadow-sm); }
.tab .tab-n { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 999px; font-size: 0.75em; font-weight: 700; background: var(--surface-3); color: var(--text-muted); }
.tab[aria-selected="true"] .tab-n { background: var(--primary); color: var(--primary-contrast); }
.tab.visited .tab-n { background: var(--success-bg); color: var(--success); }
.tab.visited[aria-selected="true"] .tab-n { background: var(--primary); color: var(--primary-contrast); }
.toc-progress { margin: 14px 12px 0; font-size: 0.8em; color: var(--text-faint); }
.toc-progress .bar { height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.toc-progress .bar > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 300ms ease; }

.lesson-content { max-width: var(--content-w); min-width: 0; }
.section { display: none; }
.section.active { display: block; animation: fade-in 220ms ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.section > h2:first-child, .section > .section-title:first-child { margin-top: 0; }
.lesson-content h2, .section-title { font-size: 1.65em; margin: 1.4em 0 0.6em; padding-bottom: 0.35em; border-bottom: 1px solid var(--border); color: var(--text); }
.lesson-content h3, .subsection-title { font-size: 1.25em; margin: 1.5em 0 0.5em; color: var(--text); }
.lesson-content h4 { font-size: 1em; margin: 1.3em 0 0.4em; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }
.section-title, .subsection-title { font-weight: 700; line-height: 1.25; }

.section-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.section-nav .btn { flex: 1 1 auto; }
.section-nav .btn.next { justify-content: space-between; }

.lesson-footer-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 48px; padding: 18px 0; border-top: 1px solid var(--border); }
.lesson-footer-nav .next { justify-self: end; }
.lesson-footer-nav .home { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.lesson-footer-nav .home:hover { color: var(--text); }
@media (max-width: 560px) {
  .lesson-footer-nav { grid-template-columns: 1fr; }
  .lesson-footer-nav .btn { width: 100%; justify-self: stretch; white-space: normal; text-align: center; }
  .lesson-footer-nav .home { text-align: center; order: 3; }
}

/* Tablet / mobile: TOC becomes a sticky horizontal strip under the nav */
@media (max-width: 900px) {
  .lesson-body { display: block; padding-top: 0; }
  .lesson-toc { position: sticky; top: var(--nav-h); z-index: 150; margin: 0 -24px 24px; padding: 8px 24px; background: var(--bg); border-bottom: 1px solid var(--border); }
  .lesson-toc .toc-label { display: none; }
  .tablist { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px; scroll-snap-type: x proximity; }
  .tablist::-webkit-scrollbar { display: none; }
  .tab { width: auto; flex: none; white-space: nowrap; padding: 7px 12px; border-radius: 999px; border-color: var(--border); background: var(--surface); scroll-snap-align: start; }
  .tab[aria-selected="true"] { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
  .tab[aria-selected="true"] .tab-n { background: color-mix(in srgb, var(--primary-contrast) 22%, transparent); color: var(--primary-contrast); }
  .toc-progress { margin: 8px 2px 0; }
  .toc-progress .label { display: none; }
}
@media (max-width: 640px) {
  .lesson-toc { margin: 0 -16px 20px; padding: 8px 16px; }
  .lesson-head .wrap { padding-top: 24px; padding-bottom: 22px; }
}

/* ---------- Quiz ---------- */
.quiz-intro { color: var(--text-muted); }
.quiz-question { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin: 18px 0; box-shadow: var(--shadow-sm); }
.quiz-question .q-text { font-weight: 650; font-size: 1.02em; margin: 0 0 14px; }
.quiz-question .q-text .q-n { color: var(--text-faint); margin-right: 6px; }
.quiz-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 0.97em; cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}
.quiz-option .opt-l { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 0.8em; color: var(--text-muted); }
.quiz-option:hover:not([disabled]) { border-color: var(--accent); background: var(--info-bg); }
.quiz-option[disabled] { cursor: default; }
.quiz-option.correct { border-color: var(--success); background: var(--success-bg); }
.quiz-option.correct .opt-l { background: var(--success); color: #fff; }
.quiz-option.incorrect { border-color: var(--danger); background: var(--danger-bg); }
.quiz-option.incorrect .opt-l { background: var(--danger); color: #fff; }
.quiz-option[disabled]:not(.correct):not(.incorrect) { opacity: 0.6; }
.explanation { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.94em; border-left: 4px solid; }
.explanation.correct-exp { background: var(--success-bg); border-color: var(--success); color: var(--text); }
.explanation.incorrect-exp { background: var(--danger-bg); border-color: var(--danger); color: var(--text); }
.explanation strong { font-weight: 700; }
.score-banner { text-align: center; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin: 24px 0; box-shadow: var(--shadow-sm); }
.score-banner h3 { font-size: 2em; margin: 0 0 4px; color: var(--primary); }
.score-banner p { color: var(--text-muted); margin: 0; }
.score-banner .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- Landing page ---------- */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--primary-strong) 0%, var(--primary) 55%, var(--accent) 130%); color: #fff; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 85% 20%, rgba(255,255,255,0.12), transparent 60%); pointer-events: none; }
.hero .wrap { position: relative; padding-top: 72px; padding-bottom: 72px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 48px; align-items: center; }
.hero .pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.25); padding: 5px 12px; border-radius: 999px; font-size: 0.82em; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.2rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 18px; color: #fff; text-wrap: balance; max-width: 18ch; }
.hero .lead { font-size: 1.15em; opacity: 0.92; max-width: 56ch; margin-bottom: 28px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .btn { background: #fff; color: var(--primary-strong); border-color: #fff; }
.hero .btn:hover { background: #EAF1FB; }
.hero .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.hero .btn.secondary:hover { background: rgba(255,255,255,0.12); }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hero-stats .stat { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: var(--radius); padding: 16px 18px; }
.hero-stats .stat-num { display: block; font-size: 1.9em; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.hero-stats .stat-label { font-size: 0.85em; opacity: 0.85; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; gap: 32px; padding-top: 52px; padding-bottom: 52px; } }
@media (max-width: 480px) { .hero-stats { grid-template-columns: 1fr 1fr; gap: 10px; } .hero-stats .stat { padding: 12px 14px; } }

.section-block { padding: 56px 0 0; }
.section-block h2 { font-size: 1.75em; margin-bottom: 6px; }
.section-block .sub { color: var(--text-muted); margin-bottom: 28px; max-width: 64ch; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.step .n { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 999px; background: var(--primary); color: var(--primary-contrast); font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 1.05em; margin-bottom: 6px; }
.step p { color: var(--text-muted); margin: 0; font-size: 0.95em; }

.progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 26px; margin-top: -36px; position: relative; z-index: 2; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; }
.progress-card h2 { font-size: 1.15em; margin-bottom: 4px; }
.progress-card p { color: var(--text-muted); margin: 0 0 12px; font-size: 0.95em; }
.progress-bar-container { background: var(--surface-3); border-radius: 999px; height: 10px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--success)); border-radius: 999px; transition: width 500ms ease; }
.progress-label { font-size: 0.85em; color: var(--text-muted); margin-top: 8px; }
@media (max-width: 640px) { .progress-card { grid-template-columns: 1fr; margin-top: 0; } .progress-card .btn { width: 100%; } }

.group-head { display: flex; align-items: baseline; gap: 12px; margin: 32px 0 14px; }
.group-head h3 { font-size: 1.1em; margin: 0; }
.group-head span { color: var(--text-faint); font-size: 0.88em; }
.group-head:first-of-type { margin-top: 0; }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lesson-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; overflow: hidden; transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease); }
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); text-decoration: none; }
.card-top { display: flex; gap: 14px; padding: 18px 18px 12px; align-items: flex-start; }
.card-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--primary); color: var(--primary-contrast); font-weight: 750; }
.card-meta h3 { font-size: 1em; margin-bottom: 3px; }
.card-meta p { font-size: 0.88em; color: var(--text-muted); margin: 0; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 14px; }
.card-tags .tag { font-size: 0.72em; font-weight: 650; padding: 2px 8px; border-radius: 999px; }
.card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: 0.82em; color: var(--text-muted); }
.card-arrow { color: var(--accent); font-weight: 700; font-size: 1.1em; }
.card-completed { border-color: var(--success-border); }
.card-completed .card-num { background: var(--success); color: #fff; }
.card-score { font-weight: 700; color: var(--success); background: var(--success-bg); padding: 2px 8px; border-radius: 999px; }

.exam-cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 30px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; box-shadow: var(--shadow-sm); }
.exam-cta h2 { font-size: 1.4em; margin-bottom: 6px; }
.exam-cta p { color: var(--text-muted); margin: 0; }
.exam-cta .status { margin-top: 8px; font-weight: 650; color: var(--success); }
@media (max-width: 640px) { .exam-cta { grid-template-columns: 1fr; } .exam-cta .btn { width: 100%; } }

.mnemonic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.mnemonic-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.mnemonic-card h3 { font-size: 1.1em; color: var(--primary); margin-bottom: 8px; letter-spacing: 0.02em; }
.mnemonic-card dl { margin: 0; font-size: 0.88em; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.mnemonic-card dt { font-weight: 800; color: var(--text); }
.mnemonic-card dd { margin: 0; color: var(--text-muted); }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; color: var(--text-faint); font-size: 1.3em; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--text-muted); margin: 0 0 16px; }

.notice { display: flex; gap: 14px; align-items: flex-start; background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--radius); padding: 14px 18px; color: var(--text); }
.notice strong { color: var(--warning); }
.notice p { margin: 0; font-size: 0.95em; }

/* ---------- Exam page ---------- */
.exam-main { max-width: 868px; }
body.exam .lesson-head .wrap { max-width: 868px; }
.exam-q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin: 16px 0; box-shadow: var(--shadow-sm); }
.exam-q .stem { font-weight: 650; margin-bottom: 12px; }
.exam-q .stem .qnum { color: var(--text-faint); margin-right: 4px; }
.section-divider { margin: 34px 0 6px; font-size: 0.78em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.exam-q .opt { margin-bottom: 8px;  display: flex; align-items: flex-start; gap: 12px; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); transition: border-color var(--ease), background var(--ease); }
.exam-q .opt:hover { border-color: var(--accent); background: var(--info-bg); }
.exam-q .opt:has(input:checked) { border-color: var(--primary); background: var(--info-bg); }
.exam-q input[type="radio"] { margin-top: 4px; accent-color: var(--primary); flex: none; }
.name-row label { display: block; font-weight: 650; margin-bottom: 8px; }
.name-row input[type="text"] { width: 100%; max-width: 420px; font: inherit; padding: 10px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.name-row input[type="text"]:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); outline-offset: 0; }
.name-error { display: none; color: var(--danger); font-size: 0.9em; margin-top: 8px; font-weight: 600; }
.name-row.error .name-error { display: block; }
.name-row.error input[type="text"] { border-color: var(--danger); }
.submit-bar { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.status { font-weight: 700; font-size: 1.1em; margin-top: 6px; }
.status.pass { color: var(--success); }
.status.fail { color: var(--danger); }
.missed-list { margin: 0; padding-left: 1.2em; }
.missed-list li { margin-bottom: 10px; }
.missed-list .why { display: block; color: var(--text-muted); font-size: 0.92em; margin-top: 3px; }
.prev-banner { display: none; background: var(--info-bg); border: 1px solid var(--info-border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.prev-banner.show { display: block; }
.prev-banner .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.record { background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius-lg); padding: 36px 32px; margin: 24px 0; text-align: center; position: relative; }
.record-badge { display: inline-block; background: var(--primary); color: var(--primary-contrast); padding: 4px 14px; border-radius: 999px; font-size: 0.75em; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 18px; }
.record h2 { font-size: 1.6em; margin-bottom: 4px; }
.record-sub { color: var(--text-muted); margin-bottom: 22px; }
.record-name { font-size: 1.6em; font-weight: 750; color: var(--primary); margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
.record-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.record .fact-label { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; }
.record .fact-value { font-size: 1.15em; font-weight: 700; margin-top: 2px; }
.record-note { font-size: 0.88em; color: var(--text-muted); max-width: 60ch; margin: 0 auto; }
@media (max-width: 520px) { .record-facts { grid-template-columns: 1fr; } .record { padding: 26px 18px; } }

/* ---------- Print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --surface-3: #e8e8e8; --text: #000; --text-muted: #333; --border: #bbb; }
  body { font-size: 11.5pt; }
  .site-nav, .site-footer, .lesson-toc, .section-nav, .lesson-footer-nav, .no-print, .skip-link, .btn-toggle { display: none !important; }
  .lesson-body { display: block; }
  .section { display: block !important; page-break-before: always; animation: none; }
  .section:first-of-type { page-break-before: auto; }
  .discussion { display: block !important; }
  .card, .scenario, .scenario-case, .quiz-question, table { box-shadow: none; break-inside: avoid; }
  .key-points { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
  .record { break-inside: avoid; }
  body.exam * { visibility: hidden; }
  body.exam #record-block, body.exam #record-block * { visibility: visible; }
  body.exam #record-block { position: absolute; left: 0; top: 0; width: 100%; margin: 0; border-radius: 0; }
}
