:root {
  color-scheme: light;
  --canvas: #f4f7f7;
  --paper: #fff;
  --ink: #203139;
  --muted: #667781;
  --line: #dce4e6;
  --blue: #275f87;
  --blue-dark: #174663;
  --blue-soft: #eaf3f8;
  --teal: #13796e;
  --teal-soft: #e6f3ef;
  --coral: #bf6957;
  --coral-soft: #fcf1ed;
  --amber: #a46c22;
  --amber-soft: #fbf2e3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.55 "Segoe UI", Tahoma, Arial, sans-serif; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid #d79348; outline-offset: 3px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 282px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); z-index: 10; scrollbar-width: thin; }
.brand-row { display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand strong { font-weight: 800; color: var(--blue); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--blue-dark); color: #fff; border-radius: 6px; font-size: 21px; font-family: Georgia, serif; }
.icon-close { display: none; background: none; border: 0; color: var(--muted); font-size: 28px; line-height: 1; }
.sidebar-top { padding: 25px 22px 20px; }
.section-label, .page-eyebrow { color: var(--blue); font-size: 11px; line-height: 1.3; font-weight: 800; letter-spacing: 1.1px; }
.course-switch { margin: 10px 0 26px; border: 1px solid var(--line); border-radius: 6px; background: #f7fafb; width: 100%; padding: 11px 12px; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; font-weight: 700; font-size: 13px; }
.course-switch:hover { border-color: #a9c1cd; }
.course-switch span:last-child { color: var(--blue); }
.progress-label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
.progress-label strong { color: var(--ink); }
.progress-track { margin-top: 9px; height: 6px; width: 100%; background: #e5ecee; border-radius: 10px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--teal); border-radius: 10px; transition: width .25s; }
.storage-note { font-size: 11px; color: #7a8991; margin: 9px 0 0; }
.lesson-nav { padding: 0 12px 18px; }
.nav-group { margin-bottom: 17px; }
.nav-group-title { padding: 5px 12px 7px; color: #88969c; font-size: 11px; text-transform: uppercase; font-weight: 800; letter-spacing: .7px; }
.lesson-link { width: 100%; display: flex; gap: 11px; align-items: flex-start; padding: 8px 10px; margin: 1px 0; background: transparent; border: 0; border-radius: 6px; color: #53636b; text-align: left; font-size: 12.5px; line-height: 1.35; }
.lesson-link:hover { background: #f1f5f6; color: var(--ink); }
.lesson-link.active { background: var(--blue-soft); color: var(--blue-dark); font-weight: 700; }
.lesson-number { flex: 0 0 20px; color: #97a5aa; font-size: 11px; font-weight: 800; padding-top: 1px; }
.lesson-link.active .lesson-number { color: var(--blue); }
.lesson-link.complete .lesson-number { color: var(--teal); font-size: 14px; line-height: 1; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--line); padding: 11px 12px 18px; }
.sidebar-tool { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: transparent; padding: 7px 10px; text-align: left; color: var(--blue); font-size: 12px; font-weight: 650; border-radius: 5px; }
.sidebar-tool:hover { background: var(--blue-soft); }
.content-shell { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 65px; min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 38px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); }
.topbar-title { font-size: 11px; color: var(--blue-dark); font-weight: 800; letter-spacing: .7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title span:last-child { color: var(--muted); font-weight: 600; }
.topbar-separator { color: #b2c1c7; padding: 0 8px; }
.topbar-actions { display: flex; align-items: center; gap: 25px; white-space: nowrap; }
.topbar-actions button { border: 0; background: none; padding: 5px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.topbar-actions .all-courses-link { color: var(--blue); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.topbar-actions .all-courses-link:hover { text-decoration: underline; }
.topbar-actions button:hover { color: var(--blue); }
.status-badge { border: 1px solid #cee2dd; background: #f1f9f6; color: var(--teal); border-radius: 4px; padding: 4px 7px; font-size: 10px; font-weight: 800; letter-spacing: .3px; }
.menu-button { display: none; border: 0; background: none; color: var(--ink); padding: 4px; font-size: 20px; line-height: 1; }
main { flex: 1; min-width: 0; }
.site-footer { border-top: 1px solid var(--line); color: #7b8a92; font-size: 11px; padding: 20px 38px; display: flex; justify-content: space-between; gap: 20px; }
.menu-backdrop { display: none; }

/* Overview */
.overview-page, .lesson-page, .lab-page, .reference-page { max-width: 1320px; margin: 0 auto; padding: 38px 48px 78px; }
.overview-header { display: grid; grid-template-columns: 1fr minmax(320px, .92fr); gap: 46px; align-items: center; padding: 26px 0 44px; border-bottom: 1px solid var(--line); }
.overview-header h1 { margin: 4px 0 18px; font-family: Georgia, "Times New Roman", serif; font-size: 68px; line-height: 1.04; font-weight: 500; letter-spacing: 0; color: #1d343b; overflow-wrap: anywhere; }
.overview-header h1 em { color: var(--teal); font-style: normal; }
.overview-header p { max-width: 550px; color: #52656c; margin: 0 0 26px; font-size: 17px; line-height: 1.65; }
.primary-button { display: inline-flex; justify-content: center; align-items: center; gap: 25px; border: 1px solid var(--blue-dark); background: var(--blue-dark); color: #fff; border-radius: 5px; padding: 11px 17px; font-size: 13px; font-weight: 750; text-decoration: none; }
.primary-button:hover { background: #0c354e; color: #fff; }
.overview-visual { position: relative; min-height: 325px; padding: 28px 29px; background: #e7f0ef; border: 1px solid #d4e2df; border-radius: 7px; overflow: hidden; }
.overview-visual::after { content: ""; position: absolute; width: 1px; height: 195px; top: 54px; left: 65%; background: #a4bab7; }
.visual-label { color: #426c67; font-size: 10px; font-weight: 800; letter-spacing: .9px; }
.forest-axis { display: flex; justify-content: space-between; gap: 8px; color: #79908c; font-size: 10px; margin: 16px 0 17px 79px; }
.forest-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 11px; height: 45px; color: #53736e; font-size: 11px; }
.forest-line { height: 2px; position: relative; background: #537f7b; }
.forest-line i { position: absolute; width: 11px; height: 11px; top: 50%; transform: translate(-50%, -50%); background: var(--teal); border: 2px solid #e7f0ef; box-shadow: 0 0 0 1px var(--teal); }
.forest-line.a { width: 39%; margin-left: 23%; }
.forest-line.a i { left: 43%; }
.forest-line.b { width: 54%; margin-left: 26%; }
.forest-line.b i { left: 50%; }
.forest-line.c { width: 44%; margin-left: 40%; }
.forest-line.c i { left: 57%; }
.forest-bottom { border-top: 1px solid #cadaD7; margin-top: 16px; padding-top: 15px; color: #506e68; font-size: 12px; max-width: 295px; }
.overview-stats { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.overview-stats > div { flex: 1; padding: 22px 25px; border-right: 1px solid var(--line); display: flex; align-items: baseline; gap: 12px; }
.overview-stats > div:first-child { padding-left: 0; }
.overview-stats > div:last-child { border-right: 0; }
.overview-stats strong { color: var(--teal); font-size: 27px; font-weight: 750; }
.overview-stats span { color: var(--muted); font-size: 12px; }
.overview-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 46px 0 22px; }
.overview-section-heading h2, .overview-tools h2 { margin: 6px 0 0; font-family: Georgia, serif; font-size: 30px; font-weight: 500; line-height: 1.2; }
.overview-section-heading p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.overview-chapters { border-top: 1px solid var(--line); }
.chapter-row { min-height: 116px; display: grid; grid-template-columns: 62px 1fr 44px; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); padding: 18px 0; }
.chapter-index { align-self: start; padding-top: 4px; color: var(--coral); font-family: Georgia, serif; font-size: 24px; }
.chapter-row h3 { margin: 0 0 1px; font-size: 18px; line-height: 1.3; }
.chapter-row p { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.chapter-row span { color: #849198; font-size: 11px; font-weight: 650; }
.chapter-row button { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--paper); border-radius: 50%; font-size: 20px; color: var(--blue); }
.chapter-row button:hover { border-color: var(--blue); background: var(--blue-soft); }
.overview-tools { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 49px 0; border-bottom: 1px solid var(--line); }
.overview-tools h2 { font-size: 26px; }
.tool-links { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-links button { border: 1px solid #c7d8dc; background: white; border-radius: 5px; padding: 9px 12px; color: var(--blue-dark); font-size: 12px; font-weight: 700; display: flex; gap: 15px; align-items: center; }
.tool-links button:hover { background: var(--blue-soft); }
.reset-link { margin-top: 25px; border: 0; background: none; padding: 0; color: #788990; font-size: 12px; text-decoration: underline; }

/* Lesson */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; color: #93a0a6; font-size: 12px; margin-bottom: 36px; }
.breadcrumb button { border: 0; background: none; color: var(--blue); padding: 0; font-weight: 700; }
.breadcrumb strong { color: #667780; font-weight: 700; }
.lesson-header { display: flex; justify-content: space-between; gap: 35px; max-width: 1080px; margin-bottom: 39px; }
.lesson-header h1, .lab-heading h1, .reference-page h1 { max-width: 790px; margin: 11px 0 15px; font-family: Georgia, serif; font-size: 50px; line-height: 1.12; font-weight: 500; letter-spacing: 0; overflow-wrap: anywhere; }
.lesson-header p, .lab-heading p, .reference-page > p { max-width: 750px; margin: 0; font-size: 17px; line-height: 1.7; color: #54676e; }
.lesson-count { flex: 0 0 92px; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 92px; border: 1px solid var(--line); border-radius: 50%; color: #84939a; }
.lesson-count strong { color: var(--blue-dark); font-size: 28px; line-height: 1; font-weight: 600; font-family: Georgia, serif; }
.lesson-count span { font-size: 11px; margin-top: 3px; }
.lesson-columns { display: grid; grid-template-columns: minmax(0, 720px) minmax(200px, 270px); gap: clamp(35px, 5vw, 77px); align-items: start; }
.lesson-body { min-width: 0; }
.case-band { border-left: 4px solid var(--coral); background: var(--coral-soft); padding: 21px 25px 23px; }
.case-band .section-label { color: var(--coral); }
.case-band h2 { margin: 4px 0 5px; font-size: 18px; }
.case-band p { margin: 0; color: #5c514f; font-size: 15px; line-height: 1.6; }
.lesson-steps { margin: 32px 0 41px; }
.learning-step { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.learning-step:first-child { padding-top: 0; }
.step-marker { color: var(--teal); font-family: Georgia, serif; font-size: 22px; line-height: 1.2; }
.learning-step h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.learning-step p { margin: 0; color: #4f626a; line-height: 1.7; font-size: 15px; }
.lesson-aside { border-top: 2px solid var(--blue-dark); padding-top: 19px; }
.takeaway p { font-size: 18px; line-height: 1.5; font-family: Georgia, serif; margin: 13px 0 23px; color: #2d454b; }
.aside-tool { width: 100%; border: 1px solid #cadfdb; background: var(--teal-soft); border-radius: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding: 15px; text-align: left; margin-bottom: 25px; }
.aside-tool:hover { border-color: var(--teal); }
.aside-tool .section-label { color: var(--teal); }
.aside-tool strong { color: #255950; font-size: 13px; }
.aside-tool > span:last-child { color: var(--teal); font-size: 11px; font-weight: 700; }
.aside-sources { border-top: 1px solid var(--line); padding-top: 20px; }
.source-link { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.source-link:hover span { color: var(--blue); text-decoration: underline; }
.source-link span, .source-link small { display: block; }
.source-link span { font-weight: 700; font-size: 12px; }
.source-link small { font-size: 11px; color: #89969d; margin-top: 2px; }
.aside-sources p { font-size: 11px; line-height: 1.5; color: #91a0a5; }
.mobile-sources { display: none; }
.check-panel { border: 1px solid #cbdde0; background: white; border-radius: 7px; padding: 24px; }
.check-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.check-top span:last-child { font-size: 11px; color: var(--teal); font-weight: 800; }
.check-panel h2 { margin: 12px 0 20px; font-size: 19px; line-height: 1.45; }
.answer-options { display: grid; gap: 8px; }
.answer-option { width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfc; padding: 11px; color: var(--ink); font-size: 13px; }
.answer-option:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); }
.answer-option span { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border: 1px solid #c4d2d6; border-radius: 4px; color: var(--muted); font-size: 11px; font-weight: 800; }
.answer-option.correct { background: var(--teal-soft); border-color: #a7d4ca; }
.answer-option.correct span { background: var(--teal); color: white; border-color: var(--teal); }
.answer-option.incorrect { background: var(--coral-soft); border-color: #e8b9b1; }
.answer-option.incorrect span { background: var(--coral); color: white; border-color: var(--coral); }
.feedback { display: none; padding: 14px 15px; margin-top: 13px; border-radius: 5px; line-height: 1.55; font-size: 13px; }
.feedback.visible { display: block; }
.feedback.success { background: var(--teal-soft); color: #265d53; }
.feedback.try-again { background: var(--amber-soft); color: #785727; }
.feedback strong { margin-right: 4px; }
.lesson-pagination { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 30px 0; }
.lesson-pagination button, .lab-footer button { border: 0; background: none; color: var(--blue); font-weight: 750; font-size: 13px; padding: 5px 0; }
.lesson-pagination button:hover, .lab-footer button:hover { text-decoration: underline; }

/* Labs */
.lab-page { max-width: 1230px; }
.lab-heading { margin-bottom: 35px; }
.lab-heading h1 { max-width: 900px; }
.lab-layout { display: grid; grid-template-columns: minmax(280px, 350px) minmax(0, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lab-controls { padding: 29px 38px 30px 0; border-right: 1px solid var(--line); }
.lab-controls h2, .cat-form h2, .cat-output h2 { font-size: 17px; margin: 0 0 26px; }
.lab-slider { display: block; margin: 26px 0 34px; }
.lab-slider > span { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin-bottom: 12px; font-size: 13px; }
.lab-slider strong { font-weight: 650; }
.lab-slider output { color: var(--blue); font-weight: 800; font-variant-numeric: tabular-nums; }
.lab-slider input { width: 100%; accent-color: var(--teal); }
.lab-caution { color: #829098; font-size: 11px; line-height: 1.6; }
.lab-results { padding: 30px 0 36px 43px; }
.risk-row { display: grid; gap: 29px; margin: 29px 0 34px; }
.risk-row > div > span { display: inline-block; color: var(--muted); font-size: 12px; }
.risk-row strong { float: right; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.risk-track { clear: both; height: 22px; background: #e8eef0; margin-top: 7px; border-radius: 3px; overflow: hidden; }
.risk-track span { display: block; height: 100%; width: 20%; background: var(--coral); min-width: 1px; transition: width .16s; }
.risk-track.treatment span { background: var(--teal); }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-grid > div { padding: 17px 12px 17px 0; border-right: 1px solid var(--line); margin-right: 12px; }
.result-grid > div:last-child { border-right: 0; margin-right: 0; }
.result-grid span { display: block; font-size: 11px; color: var(--muted); min-height: 35px; }
.result-grid strong { display: block; color: var(--blue-dark); font-size: 27px; font-weight: 750; font-variant-numeric: tabular-nums; }
.interpretation { padding: 17px 20px; background: var(--blue-soft); color: #315a6f; border-left: 3px solid var(--blue); margin: 25px 0 0; font-size: 13px; line-height: 1.6; }
.lab-footer { padding: 23px 0; }
.matrix { display: grid; grid-template-columns: 65px repeat(2, minmax(0, 1fr)); margin: 18px 0 29px; gap: 5px; }
.matrix-head { color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; padding: 0 3px 5px; }
.matrix-label { display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.matrix-cell { min-height: 91px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: #f1f5f6; border-radius: 4px; }
.matrix-cell strong { font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.matrix-cell small { color: var(--muted); font-size: 10px; }
.matrix-cell.true-positive { background: var(--teal-soft); color: #246a5f; }
.matrix-cell.false-positive { background: var(--coral-soft); color: #9e594b; }
.matrix-cell.false-negative { background: var(--amber-soft); color: #8f621c; }
.matrix-cell.true-negative { background: var(--blue-soft); color: var(--blue-dark); }
.cat-layout { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr); gap: 50px; border-top: 1px solid var(--line); padding-top: 28px; }
.cat-form label { display: block; margin-bottom: 17px; font-size: 12px; color: #4f626a; font-weight: 700; }
.cat-form input, .cat-form textarea, .search-label input { display: block; width: 100%; margin-top: 6px; border: 1px solid #cbd8dc; background: white; border-radius: 5px; padding: 10px 11px; color: var(--ink); font-size: 13px; font-weight: 400; outline: none; }
.cat-form input:focus, .cat-form textarea:focus, .search-label input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.cat-form textarea { resize: vertical; }
.cat-output { border-left: 1px solid var(--line); padding-left: 42px; }
.cat-output h2 { margin: 7px 0 18px; }
.cat-output h3 { font-size: 14px; margin: 26px 0 10px; }
.pico-preview { border-top: 1px solid var(--line); }
.pico-preview div { display: flex; gap: 15px; border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 12px; }
.pico-preview strong { flex: 0 0 22px; color: var(--teal); }
.pico-preview span { color: #556871; overflow-wrap: anywhere; }
#searchDraft { display: block; min-height: 46px; white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: #eaf0f2; border-radius: 5px; color: #345361; font-size: 12px; }
.external-search { margin-top: 13px; }
.cat-checklist { border-top: 1px solid var(--line); margin-top: 28px; }
.cat-checklist label { display: flex; align-items: start; gap: 8px; color: #50616b; font-size: 12px; margin: 12px 0; }
.cat-checklist input { margin-top: 2px; accent-color: var(--teal); }

/* Reference views */
.reference-page { max-width: 940px; }
.reference-page h1 { margin-bottom: 12px; }
.search-label { display: block; margin: 36px 0 21px; color: var(--muted); font-size: 12px; font-weight: 700; }
.glossary-list, .source-directory { border-top: 1px solid var(--line); margin-top: 33px; }
.glossary-row { display: grid; grid-template-columns: 210px 1fr; gap: 28px; border-bottom: 1px solid var(--line); padding: 18px 0; }
.glossary-row h2 { margin: 0; font-size: 15px; }
.glossary-row p { margin: 0; color: #576a71; font-size: 13px; line-height: 1.6; }
.source-directory a { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding: 17px 0; text-decoration: none; color: var(--ink); }
.source-directory a:hover { color: var(--blue); }
.source-directory strong, .source-directory small { display: block; }
.source-directory strong { font-size: 15px; }
.source-directory small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.source-status { margin-top: 32px !important; padding: 17px 20px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: #765b33 !important; font-size: 12px !important; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 240px minmax(0, 1fr); }
  .brand-row { padding-left: 17px; padding-right: 17px; }
  .sidebar-top { padding-left: 16px; padding-right: 16px; }
  .overview-page, .lesson-page, .lab-page, .reference-page { padding-left: 33px; padding-right: 33px; }
  .lesson-columns { grid-template-columns: minmax(0, 1fr) 205px; gap: 32px; }
  .overview-header { gap: 27px; grid-template-columns: 1fr .9fr; }
  .overview-visual { padding: 23px; }
  .overview-header h1 { font-size: 55px; }
  .lesson-header h1, .lab-heading h1, .reference-page h1 { font-size: 43px; }
}

@media (max-width: 840px) {
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(315px, 88vw); max-width: none; height: 100dvh; transform: translateX(-102%); transition: transform .2s; box-shadow: 15px 0 40px rgba(20,44,50,.12); }
  .sidebar.open { transform: translateX(0); }
  .icon-close, .menu-button { display: block; }
  .menu-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(19,39,45,.28); z-index: 9; }
  body.menu-open { overflow: hidden; }
  .topbar { padding: 0 24px; gap: 14px; }
  .topbar-title { margin-right: auto; }
  .topbar-actions { gap: 14px; }
  .status-badge { display: none; }
  .overview-header { grid-template-columns: 1fr 1fr; }
  .lesson-columns { grid-template-columns: minmax(0, 1fr) 220px; }
}

@media (max-width: 680px) {
  body { font-size: 15px; }
  .topbar { height: 56px; min-height: 56px; padding: 0 16px; }
  .topbar-title { font-size: 10px; }
  .topbar-title span:last-child, .topbar-separator { display: none; }
  .topbar-actions { gap: 10px; }
  .topbar-actions button { font-size: 11px; }
  .overview-page, .lesson-page, .lab-page, .reference-page { padding: 26px 19px 52px; }
  .breadcrumb { margin-bottom: 23px; }
  .overview-header { display: block; padding: 18px 0 29px; }
  .overview-header h1 { font-size: 46px; }
  .overview-header p { font-size: 15px; }
  .overview-visual { margin-top: 30px; min-height: 287px; }
  .overview-visual::after { top: 50px; height: 174px; }
  .overview-stats > div { display: block; padding: 14px 12px; }
  .overview-stats > div:first-child { padding-left: 0; }
  .overview-stats strong { display: block; font-size: 23px; }
  .overview-stats span { display: block; font-size: 10px; line-height: 1.35; }
  .overview-section-heading { display: block; padding-top: 35px; }
  .overview-section-heading h2 { font-size: 26px; }
  .overview-section-heading p { margin-top: 6px; }
  .chapter-row { grid-template-columns: 37px 1fr 36px; gap: 10px; }
  .chapter-index { font-size: 21px; }
  .chapter-row h3 { font-size: 16px; }
  .chapter-row p { font-size: 12px; }
  .overview-tools { display: block; padding: 34px 0; }
  .overview-tools h2 { font-size: 24px; }
  .tool-links { margin-top: 20px; }
  .lesson-header { gap: 10px; margin-bottom: 29px; }
  .lesson-header h1, .lab-heading h1, .reference-page h1 { font-size: 37px; }
  .lesson-header p, .lab-heading p, .reference-page > p { font-size: 15px; }
  .lesson-count { display: none; }
  .lesson-columns { display: flex; flex-direction: column; gap: 13px; }
  .lesson-body, .lesson-aside { width: 100%; }
  .lesson-aside { order: -1; display: flex; flex-wrap: wrap; gap: 10px; border-top: 0; padding-top: 0; }
  .takeaway { flex: 1 1 100%; border-top: 2px solid var(--blue-dark); padding-top: 13px; }
  .takeaway p { font-size: 16px; margin: 7px 0 11px; }
  .aside-tool { margin-bottom: 0; }
  .aside-sources { display: none; }
  .mobile-sources { display: block; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 25px; padding: 10px 0; }
  .mobile-sources summary { color: var(--blue); font-size: 12px; font-weight: 750; cursor: pointer; }
  .case-band { padding: 16px 18px; }
  .learning-step { grid-template-columns: 35px 1fr; gap: 11px; padding: 20px 0; }
  .learning-step h2 { font-size: 17px; }
  .learning-step p { font-size: 14px; }
  .check-panel { padding: 17px; }
  .check-panel h2 { font-size: 17px; }
  .lab-layout, .cat-layout { display: block; }
  .lab-controls { border-right: 0; padding: 20px 0 8px; }
  .lab-results { border-top: 1px solid var(--line); padding: 25px 0; }
  .lab-slider { margin: 16px 0 25px; }
  .cat-output { border-left: 0; border-top: 1px solid var(--line); padding: 25px 0 0; margin-top: 20px; }
  .glossary-row { grid-template-columns: 1fr; gap: 4px; }
  .site-footer { display: block; padding: 17px 19px; }
  .site-footer span { display: block; margin-bottom: 4px; }
}

@media (max-width: 500px) {
  .topbar-title { display: none; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .all-courses-link { font-size: 11px; }
}

@media (max-width: 370px) {
  .overview-header h1 { font-size: 41px; }
  .lesson-header h1, .lab-heading h1, .reference-page h1 { font-size: 33px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
