* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; scroll-padding-bottom: 130px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: var(--text-base)/1.65 var(--font-ui); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; }
body.has-dialog { overflow: hidden; }
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease); }
button:active:not(:disabled) { transform: scale(.96); }
button:disabled { cursor: not-allowed; opacity: .48; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.sidebar :focus-visible { outline-color: #a3e0c3; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.4; text-wrap: balance; }
h1 { font-size: var(--text-title); font-weight: 700; }
h2 { font-size: var(--text-lg); font-weight: 650; }
h3 { font-size: var(--text-base); font-weight: 650; }
p { text-wrap: pretty; }
small { font-size: var(--text-xs); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: 0 0 auto; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 100; padding: 12px 20px; background: var(--paper); color: var(--accent); }
.skip-link:focus { top: 10px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 28px 18px 20px; display: flex; flex-direction: column; background: var(--nav); color: var(--nav-text); overflow-y: auto; scrollbar-color: #7c939f var(--nav); }
.brand { color: white; text-decoration: none; display: flex; gap: 11px; align-items: center; min-height: 44px; padding: 0 10px; font-size: 16px; font-weight: 650; }
.brand-symbol { color: var(--nav-accent); width: 36px; height: 36px; flex: 0 0 36px; stroke-width: 2; }
.brand > span { min-width: 0; }
.brand small { display: block; font: 9px/2 var(--font-display); letter-spacing: .6px; color: #a5bac7; white-space: nowrap; }
.course-label { padding: 32px 12px 24px; }
.tiny-label, .eyebrow { font-size: 13px; font-weight: 650; letter-spacing: 1px; }
.course-label .tiny-label { color: #a3e0c3; font-family: var(--font-display); }
.course-label h2 { margin: 9px 0 5px; font-size: 19px; color: #fff; }
.course-label p { color: #a5bac7; font-size: 13px; }
.lesson-nav { display: grid; gap: 6px; }
.step-link { border: 1px solid transparent; background: transparent; display: flex; gap: 12px; align-items: center; text-align: left; min-height: 76px; width: 100%; padding: 12px; border-radius: var(--radius-sm); color: var(--nav-text); font-size: 14px; }
.step-link small { display: block; color: #a5bac7; font-size: 13px; margin-top: 2px; }
.step-number { width: 30px; height: 30px; border: 1px solid #546d7c; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font: 13px var(--font-display); }
.step-link.current { background: var(--nav-active); border-color: #527b7a; color: white; box-shadow: inset 3px 0 var(--nav-accent); }
.step-link.current .step-number { color: var(--nav); background: #a3e0c3; border-color: #a3e0c3; }
.step-link.current small { color: #c9dedb; }
.course-map { margin: 30px 12px 24px; border-top: 1px solid #3c5260; padding-top: 20px; font-size: 13px; }
summary { cursor: pointer; min-height: 44px; align-content: center; }
.course-map ol { padding: 0; list-style: none; display: grid; gap: 15px; }
.course-map li span { display: block; color: #a3e0c3; font-size: 13px; }
.course-map p { color: #a5bac7; }
.sidebar-note { display: flex; gap: 10px; align-items: center; margin-top: auto; border-top: 1px solid #3c5260; padding: 20px 8px 0; font-size: 13px; }
.sidebar-note strong { font-weight: 600; color: white; }
.sidebar-note p { margin-top: 3px; font-size: 13px; }
.mentor-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 9px; flex-shrink: 0; font-family: var(--font-display); }
.app-shell { margin-left: var(--sidebar); }
.topbar { height: 64px; padding: 0 40px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.breadcrumb { color: var(--muted); font-size: var(--text-sm); }
.breadcrumb span { margin: 0 12px; color: #91a09f; }
.breadcrumb strong { font-weight: 600; color: var(--ink); }
.text-button, .source-button { padding: 9px 0; border: 0; background: transparent; font-size: var(--text-sm); font-weight: 600; color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.text-button { padding-inline: 8px; }
.count { font: 12px var(--font-display); background: var(--canvas); color: var(--muted); border-radius: 4px; min-width: 22px; padding: 3px; }
main { max-width: 1280px; padding: 30px 40px 110px; margin: auto; outline: none; scroll-margin-top: 20px; }
.lesson-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 26px; }
.eyebrow { color: var(--accent); margin-bottom: 10px; font-size: 13px; }
.eyebrow span { margin-left: 7px; letter-spacing: 0; }
.intro { color: var(--muted); margin-top: 9px; }
.location { display: flex; align-items: baseline; gap: 8px; color: var(--muted); white-space: nowrap; font-size: 13px; }
#position-number { font: 35px/1 var(--font-display); color: var(--ink); }
.chapter-position { font: 35px/1 var(--font-display); color: var(--ink); }
.lesson-nav a { text-decoration: none; }
.teaching-note { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; font-size: 15px; }
.teaching-note strong { font-weight: 650; }
.note-index { font: 14px var(--font-display); color: var(--accent); width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #b6cfc3; border-radius: 50%; flex-shrink: 0; }
.workspace, .question-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.workspace-heading h2 { font-size: 17px; }
.badge { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); background: var(--canvas); border-radius: 5px; padding: 4px 8px; font-size: 13px; line-height: 1.5; }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.version-grid { display: grid; grid-template-columns: 1fr 72px 1fr; padding: 24px; align-items: center; }
.report-paper { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px 24px 10px; background: #fafbf9; }
.report-paper.revised { border-color: #99c4b6; background: #f4faf6; }
.report-top { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.document-icon { font-size: 20px; color: var(--muted); }
.version-label { margin-left: auto; font: 12px var(--font-display); background: #e7ece8; padding: 4px 7px; border-radius: 4px; }
.revised .version-label { background: #d8eee2; color: #135c45; }
.report-date { color: var(--muted); font-size: 13px; margin-top: 8px; }
.measurement { font: 52px/1.2 var(--font-display); font-variant-numeric: tabular-nums; margin: 16px 0 5px; white-space: nowrap; }
.measurement span { font-size: 18px; color: var(--muted); }
.revised .measurement { color: var(--accent); }
.report-paper > p:not(.report-date) { font-size: 14px; }
.report-rule { height: 1px; background: var(--line); margin: 18px 0 12px; }
.report-caption { min-height: 46px; color: var(--muted); }
.report-paper .source-button { width: 100%; justify-content: space-between; margin-top: 9px; }
.version-connector { text-align: center; color: var(--muted); font-size: 24px; }
.version-connector small { display: block; font-size: 13px; margin-top: 3px; }
.timeline-experiment { padding: 20px 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; }
.timeline-experiment .tiny-label { color: var(--accent); letter-spacing: 0; font-size: 13px; }
.timeline-experiment h3 { margin-top: 3px; font-size: 15px; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); background: var(--canvas); border-radius: 8px; }
.segmented button { border: 0; background: transparent; border-radius: 4px; padding: 9px 18px; min-height: 44px; font-size: 14px; }
.segmented button.selected { background: var(--ink); color: white; }
.timeline-result { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; background: var(--canvas); padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.timeline-result strong { font: 18px var(--font-display); white-space: nowrap; color: var(--accent); }
.insight { border-bottom: 1px solid var(--line); padding: 10px 0; margin-top: 12px; font-size: 14px; }
.insight summary { font-weight: 600; }
.insight p { max-width: 78ch; margin: 9px 0 15px; color: var(--muted); }
.lesson-footer { position: fixed; bottom: 0; left: var(--sidebar); right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 40px; background: var(--paper); border-top: 1px solid var(--line); box-shadow: var(--footer-shadow); }
.primary, .secondary { min-height: 46px; border-radius: var(--radius-sm); padding: 11px 20px; border: 1px solid var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; }
.primary { color: white; background: var(--accent); }
.secondary { background: transparent; color: var(--ink); border-color: #b6c3c5; }
.footer-note, .quiet { color: var(--muted); font-size: 13px; }
.concept-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.concept-tabs button { flex: 1; border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 12px; min-height: 48px; font-weight: 600; color: var(--muted); }
.concept-tabs button.selected { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.concept-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 28px 8px; min-height: 222px; }
.concept-detail .tiny-label { color: var(--muted); }
.concept-detail h2 { margin: 9px 0; }
.concept-detail p { font-size: 15px; }
.example { border-left: 2px solid var(--line); padding-left: 24px; }
blockquote { margin: 12px 0; font-size: 17px; font-weight: 550; }
form { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.question-panel form { padding: 24px; }
legend { width: 100%; font-size: 17px; line-height: 1.8; font-weight: 600; padding: 0; margin-bottom: 20px; }
.options { display: grid; gap: 10px; }
.options.compact { grid-template-columns: 1fr 1fr; }
.option { position: relative; display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; min-height: 78px; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
input[type="radio"], input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--accent); flex-shrink: 0; margin: 0; }
.option strong { display: block; font-size: 15px; font-weight: 600; }
.option small { display: block; color: var(--muted); margin-top: 2px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.hint { padding: 12px 16px; background: var(--warning-soft); color: var(--warning); font-size: 14px; margin-top: 16px; border-radius: var(--radius-sm); }
.feedback { margin-top: 18px; padding: 16px 18px; background: var(--accent-soft); border-left: 3px solid var(--accent); font-size: 14px; }
.feedback strong { display: block; margin-bottom: 5px; }
.feedback.review { background: var(--warning-soft); border-color: var(--warning); }
.feedback.error, .notice.error { background: var(--error-soft); color: var(--error); border-color: var(--error); }
.feedback small { display: block; color: var(--muted); margin-top: 8px; }
.simulation-grid { display: grid; grid-template-columns: 1fr 1fr; }
.simulation-controls { padding: 24px; }
.simulation-controls h3 { margin-bottom: 10px; }
.switch-row { position: relative; display: flex; gap: 16px; align-items: center; min-height: 78px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.switch-row small { display: block; color: var(--muted); }
.switch-row input { position: absolute; right: 0; width: 44px; height: 44px; opacity: 0; }
.switch { margin-left: auto; width: 42px; height: 24px; border-radius: 24px; background: #83949c; padding: 3px; flex-shrink: 0; transition: background-color var(--fast) var(--ease); }
.switch::before { content: ""; display: block; width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform var(--fast) var(--ease); }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::before { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 3px solid var(--accent); outline-offset: 4px; }
.evidence-options { margin: 22px 0 16px; }
.evidence-options legend { font-size: 14px; margin-bottom: 10px; }
.evidence-options label { display: flex; gap: 12px; align-items: center; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 14px; }
.evidence-options label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.evidence-options small { display: block; color: var(--muted); }
.simulation-output { padding: 26px; background: #f8faf8; border-left: 1px solid var(--line); border-radius: 0 0 var(--radius) 0; }
.simulation-output .tiny-label { color: var(--muted); }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 18px 0; font-size: 14px; }
.result-row strong { font-size: 13px; font-weight: 650; }
.state-unknown { color: var(--warning); background: var(--warning-soft); border-radius: 5px; padding: 4px 8px; }
.state-known { color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 4px 8px; }
.result-insight { margin-top: 22px; font-size: 14px; color: var(--muted); }
#simulation-message { font-size: 13px; color: var(--error); margin-top: 12px; }
.transfer-note { border-left: 3px solid #b5c9c1; padding: 6px 20px; margin: 24px 0 0; }
.transfer-note p { font-size: 14px; margin-top: 5px; }
.responsibility-flow { display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr; align-items: center; margin: 28px 0 32px; gap: 12px; }
.responsibility-flow > div { padding: 8px 0; }
.flow-number { color: var(--accent); font: 13px var(--font-display); }
.responsibility-flow h2 { margin: 10px 0; font-size: 18px; }
.responsibility-flow p { font-size: 14px; }
.responsibility-flow small { color: var(--muted); font-size: 13px; display: block; margin-top: 6px; }
.flow-arrow { color: var(--muted); font-size: 23px; }
.wiki-columns { display: grid; grid-template-columns: 1.6fr 1fr; }
.wiki-preview { padding: 24px; }
.preview-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.wiki-preview blockquote { min-height: 180px; font-size: 17px; line-height: 1.95; margin: 20px 0; }
.wiki-preview .quiet { margin-top: 10px; }
.manual-note { background: #faf8ef; border-left: 1px solid var(--line); padding: 28px 24px; border-radius: 0 0 var(--radius) 0; }
.manual-note h3 { margin: 18px 0 12px; }
.manual-note > p { font-size: 14px; }
.manual-note p.quiet { margin-top: 32px; font-size: 13px; }
.reason-label { display: block; font-size: 15px; font-weight: 600; margin: 26px 0 10px; }
.reason-label span { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }
textarea { display: block; width: 100%; resize: vertical; min-height: 132px; max-height: 500px; padding: 14px 16px; border: 1px solid #94a7ac; background: var(--paper); border-radius: var(--radius-sm); line-height: 1.7; font-size: 15px; color: var(--ink); }
textarea::placeholder { color: #63787f; }
.reason-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 7px; }
#character-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.review-strip { display: flex; gap: 16px; align-items: center; margin-top: 24px; padding: 0 8px; font-size: 14px; }
.review-strip p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.notice { padding: 20px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 20px 0; }
.notice button { margin-left: 12px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; width: min(780px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); color: var(--ink); background: var(--paper); box-shadow: 0 24px 90px rgb(0 0 0 / 20%); overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; animation: drawer-enter var(--enter) var(--ease); }
dialog::backdrop { background: rgb(12 30 41 / 50%); }
.dialog-heading { padding: 22px 26px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-shrink: 0; }
.dialog-heading .eyebrow { margin-bottom: 5px; }
.icon-button { border: 1px solid var(--line); background: var(--canvas); border-radius: 50%; min-width: 44px; min-height: 44px; font-size: 26px; line-height: 1; }
.source-content { overflow-y: auto; padding: 26px; scrollbar-color: #82969c #edf1ed; }
.source-content pre { font: 14px/1.95 var(--font-ui); white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; margin: 24px 0; }
.source-meta { color: var(--muted); font-size: 13px; }
.source-meta code { font: 12px/1.7 var(--font-code); overflow-wrap: anywhere; word-break: break-all; display: block; padding-top: 6px; }
.source-list { display: grid; gap: 10px; }
.source-list button { min-height: 70px; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--line); background: var(--canvas); border-radius: var(--radius-sm); text-align: left; }
.source-list small { display: block; color: var(--muted); }
@keyframes drawer-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Course orientation is a separate reading view within the existing hash routes. */
.course-lessons { display: grid; gap: 4px; margin: 18px 0 0; }
.course-lessons a { color: var(--nav-text); text-decoration: none; display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 9px 12px; font-size: 14px; border-radius: var(--radius-sm); }
.course-lessons a span { color: var(--nav-accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.course-lessons a:hover, .course-lessons a.current { color: white; background: var(--nav-active); }
.course-lessons a.current { box-shadow: inset 3px 0 var(--nav-accent); }
.overview-ready { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; }
.overview-ready a { color: var(--accent); min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; text-underline-offset: 4px; }
.learning-aim { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 18px 22px; margin: 22px 0 26px; }
.learning-aim dt { font-size: 13px; color: var(--accent); font-weight: 650; margin-bottom: 5px; }
.learning-aim dd { margin: 0; font-size: 15px; line-height: 1.8; }
.chapter-view { max-width: 1056px; margin-inline: auto; }
.chapter-header .overview-lead { margin-top: 0; }
.chapter-start-note { padding: 20px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.lesson-section { padding: 0; }
.lesson-section h2 { font-size: 25px; line-height: 1.5; }
.lesson-section > p { line-height: 1.9; max-width: 90ch; }
.lesson-section > p + p { margin-top: 14px; }
.lesson-concepts { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 32px; margin: 28px 0; }
.lesson-concepts div { border-top: 1px solid var(--line); padding-top: 16px; }
.lesson-concepts dt { font-size: 17px; font-weight: 650; }
.lesson-concepts dd { color: var(--muted); margin: 9px 0 0; font-size: 15px; line-height: 1.85; }
.lesson-counterexample { margin: 26px 0 0; padding: 20px 24px; border-left: 3px solid var(--warning); background: var(--warning-soft); }
.lesson-counterexample h3 { color: var(--warning); margin-bottom: 9px; }
.lesson-counterexample p { font-size: 15px; line-height: 1.85; }
.lesson-counterexample p + p { margin-top: 10px; }
.task-example { padding: 24px; margin: 26px 0; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); }
.task-example dl { margin: 16px 0 0; }
.task-example dl > div { display: grid; grid-template-columns: 104px 1fr; gap: 18px; padding-block: 10px; }
.task-example dt { font-size: 14px; font-weight: 600; }
.task-example dd { margin: 0; font-size: 15px; color: var(--muted); }
.task-example code, .lab-result code { font: 14px/1.8 var(--font-code); overflow-wrap: anywhere; }
.lab-form { padding: 24px; margin: 24px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.lab-choices { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin-bottom: 22px; }
.lab-choices legend { font-size: 15px; margin-bottom: 10px; }
.lab-choices label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 46px; padding: 10px 14px; font-size: 14px; cursor: pointer; }
.lab-choices label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.lab-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 4px 0 18px; font-size: 14px; cursor: pointer; }
.lab-result { margin-top: 18px; padding: 20px 24px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--paper); }
.lab-result.review { border-left-color: var(--warning); background: var(--warning-soft); }
.lab-result.error { border-left-color: var(--error); background: var(--error-soft); }
.lab-result strong { font-size: 17px; display: block; }
.lab-result p { font-size: 15px; line-height: 1.85; margin-top: 10px; }
.lab-result small { display: block; color: var(--muted); font-size: 13px; margin-top: 12px; }
.lab-result code { display: block; color: var(--accent); margin-top: 12px; }
.lesson-transfer { color: var(--muted); font-size: 14px; margin-top: 22px; padding-left: 18px; border-left: 2px solid var(--line); }
.verification-list, .group-list { padding-left: 20px; font-size: 14px; line-height: 2; overflow-wrap: anywhere; }
.chapter-reflection { margin-top: 28px; background: var(--accent-soft); padding: 24px; border-radius: var(--radius); }
.chapter-reflection .tiny-label { color: var(--accent); letter-spacing: 0; }
.chapter-reflection h3 { font-size: 19px; line-height: 1.65; margin: 14px 0; }
.chapter-reflection p { color: var(--muted); font-size: 14px; }
.chapter-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 28px; }
.chapter-actions a { text-decoration: none; }
.model-flow { display: flex; align-items: center; gap: 16px; padding: 24px; margin: 26px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.model-flow > div { flex: 1; }
.model-flow > div span { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.model-flow > span { color: var(--accent); font-size: 13px; }
.lab-table-scroll { overflow-x: auto; margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); scrollbar-color: #82969c #edf1ed; }
.lab-table { border-collapse: collapse; width: 100%; min-width: 700px; font-size: 13px; }
.lab-table caption { text-align: left; padding: 14px 16px; font-weight: 600; color: var(--muted); }
.lab-table th, .lab-table td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: left; line-height: 1.6; }
.lab-table th { background: var(--canvas); font-weight: 650; }
.lab-table td:nth-child(5) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.quantity-label { display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 600; margin-bottom: 22px; }
.quantity-label input { max-width: 240px; min-height: 46px; padding: 10px 14px; border: 1px solid #94a7ac; background: var(--paper); border-radius: var(--radius-sm); color: var(--ink); }
.lab-result .quantity-output { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--accent); }
@media (max-width: 800px) {
  .course-lessons { grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 10px; }
  .course-lessons a { padding: 8px 6px; gap: 6px; font-size: 13px; }
  .overview-mode .course-lessons { display: none; }
  .model-flow { flex-direction: column; align-items: stretch; gap: 18px; }
  .model-flow > span { align-self: center; }
  .chapter-header h1 { font-size: 30px; }
}
@media (max-width: 520px) {
  .learning-aim { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .lesson-section { padding: 0; }
  .lesson-section h2 { font-size: 22px; }
  .lesson-concepts { grid-template-columns: 1fr; gap: 20px; }
  .task-example, .lab-form, .lab-result, .chapter-reflection, .lesson-counterexample { padding: 20px 18px; }
  .task-example dl > div { grid-template-columns: 1fr; gap: 4px; }
  .lab-choices { gap: 8px; }
  .lab-choices label { padding-inline: 11px; }
  .chapter-header h1 { font-size: 28px; }
  .chapter-reflection h3 { font-size: 17px; }
}
.overview-link { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px; margin: 24px 0 0; color: var(--nav-text); text-decoration: none; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; }
.overview-link small { display: block; font-weight: 400; color: #c9dedb; margin-top: 4px; }
.overview-link.current { color: white; background: var(--nav-active); border-color: #527b7a; box-shadow: inset 3px 0 var(--nav-accent); }
.overview-link:hover { background: var(--nav-active); }
.course-map-link { display: flex; justify-content: space-between; align-items: center; color: var(--nav-text); text-decoration: none; min-height: 44px; }
.course-map-link:hover { color: white; text-decoration: underline; text-underline-offset: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 20px; }
.topbar-actions a { text-decoration: none; white-space: nowrap; }
.overview-mode main { padding-bottom: 64px; }
.course-overview { max-width: 1056px; margin-inline: auto; }
.overview-intro { padding: 12px 0 32px; }
.overview-intro h1 { font-size: clamp(32px, 3.3vw, 44px); line-height: 1.3; letter-spacing: -.025em; text-wrap: balance; }
.overview-lead { font-size: 19px; line-height: 1.85; margin-top: 22px; color: var(--muted); }
.overview-lead strong { color: var(--ink); font-weight: 600; }
.overview-audience { font-size: 14px; color: var(--muted); margin-top: 20px; max-width: 75ch; }
.overview-toc { display: flex; flex-wrap: wrap; column-gap: 26px; row-gap: 4px; border-block: 1px solid var(--line); padding: 8px 0; }
.overview-toc a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; text-underline-offset: 6px; }
.overview-toc a:hover { text-decoration: underline; }
.overview-section { padding: 48px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.overview-section:last-child { border-bottom: 0; padding-bottom: 0; }
.overview-section-heading { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.overview-index { flex: 0 0 22px; white-space: nowrap; font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 3px; }
.overview-section-heading .eyebrow { font-size: 12px; letter-spacing: 1.1px; margin-bottom: 7px; }
.overview-section h2 { font-size: 24px; line-height: 1.45; font-weight: 700; text-wrap: pretty; }
.overview-copy { max-width: 88ch; line-height: 1.85; }
.overview-copy strong { font-weight: 650; }
.overview-outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 28px 0; }
.overview-outcomes div { border-top: 2px solid var(--accent); padding-top: 15px; }
.overview-outcomes dt { font-size: 17px; font-weight: 650; }
.overview-outcomes dd { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.overview-goal-note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 18px 22px; }
.overview-goal-note strong { color: var(--accent); font-size: 14px; }
.overview-goal-note p { margin-top: 5px; }
.overview-example { display: grid; grid-template-columns: minmax(180px, .65fr) minmax(0, 1.65fr); gap: 42px; align-items: center; margin-top: 28px; }
.overview-inputs { position: relative; }
.overview-inputs .tiny-label { letter-spacing: 0; color: var(--muted); }
.overview-inputs ul { padding: 0; margin: 16px 0; list-style: none; }
.overview-inputs li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.overview-inputs li span { color: var(--accent); font-size: 12px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.overview-inputs > p:last-of-type { font-size: 13px; color: var(--muted); }
.overview-input-arrow { position: absolute; right: -29px; top: 46%; color: var(--accent); font-size: 22px; }
.overview-record { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.overview-record-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.overview-record-heading .tiny-label { color: var(--muted); font-size: 13px; letter-spacing: 0; }
.overview-record h3 { font-size: 19px; margin-top: 7px; }
.overview-record dl { margin: 0; padding: 0 24px; }
.overview-record dl > div { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.overview-record dl > div:last-child { border-bottom: 0; }
.overview-record dt { color: var(--accent); font-size: 14px; font-weight: 650; }
.overview-record dd { margin: 0; font-size: 15px; line-height: 1.8; }
.overview-record small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.overview-caption { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 18px; }
.overview-transfer { margin-top: 32px; }
.overview-transfer h3, .overview-terms h3 { font-size: 17px; }
.overview-transfer dl { margin: 16px 0; }
.overview-transfer dl > div { display: grid; grid-template-columns: 205px 1fr; gap: 22px; margin: 12px 0; }
.overview-transfer dt { font-size: 14px; font-weight: 600; }
.overview-transfer dd { margin: 0; color: var(--muted); font-size: 15px; }
.overview-transfer > p { color: var(--muted); font-size: 14px; }
.overview-roadmap { list-style: none; padding: 0; margin: 26px 0 0; }
.overview-roadmap li { display: flex; gap: 22px; padding: 20px 18px; border-bottom: 1px solid var(--line); }
.overview-roadmap li.roadmap-current { background: var(--accent-soft); border-radius: var(--radius-sm); border-bottom-color: transparent; }
.roadmap-marker { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 15px; background: var(--paper); color: var(--muted); }
.roadmap-current .roadmap-marker { background: var(--accent); color: white; border-color: var(--accent); }
.overview-roadmap h3 { font-size: 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.overview-roadmap p { margin-top: 5px; font-size: 15px; }
.overview-roadmap small { display: block; color: var(--muted); margin-top: 5px; font-size: 13px; }
.overview-terms { margin-top: 32px; }
.overview-terms dl { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; margin: 20px 0; }
.overview-terms dt { font-size: 15px; font-weight: 650; }
.overview-terms dd { font-size: 15px; color: var(--muted); margin: 6px 0 0; line-height: 1.8; }
.overview-terms > p { font-size: 14px; color: var(--muted); padding-top: 16px; border-top: 1px solid var(--line); }
.overview-correction { display: flex; align-items: center; gap: 26px; margin: 28px 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.correction-values { font-size: 30px; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.correction-values span { color: var(--muted); font-size: 20px; }
.overview-correction h3 { font-size: 17px; margin-bottom: 8px; }
.overview-correction p { font-size: 15px; color: var(--muted); line-height: 1.85; }
.overview-exercises { margin: 0; }
.overview-exercises > div { display: grid; grid-template-columns: 195px 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.overview-exercises dt { font-size: 15px; font-weight: 600; }
.overview-exercises a { color: var(--accent); display: inline-flex; min-height: 44px; gap: 10px; align-items: center; text-decoration: none; }
.overview-exercises a:hover { text-decoration: underline; text-underline-offset: 4px; }
.overview-exercises dd { margin: 0; font-size: 15px; color: var(--muted); align-self: center; }
.overview-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 26px 0; }
.overview-roles > div { border-top: 2px solid var(--line); padding-top: 18px; }
.overview-roles h3 { font-size: 18px; }
.overview-roles ul { padding-left: 19px; color: var(--muted); font-size: 15px; line-height: 2; }
.overview-boundary { font-size: 14px; color: var(--muted); padding: 18px 0; border-block: 1px solid var(--line); }
.overview-next { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding-top: 32px; }
.overview-next h3 { font-size: 19px; }
.overview-next p { color: var(--muted); font-size: 14px; margin-top: 8px; }
.overview-next a { text-decoration: none; flex-shrink: 0; }

@media (max-width: 1150px) {
  .overview-example { grid-template-columns: 1fr; gap: 24px; }
  .overview-inputs ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .overview-input-arrow { display: none; }
  .overview-outcomes { gap: 20px; }
  .topbar-actions { gap: 10px; }
}
@media (max-width: 800px) {
  .overview-link { margin-top: 14px; min-height: 48px; padding: 8px 10px; }
  .overview-link small { display: none; }
  .overview-mode .course-label, .overview-mode .lesson-nav { display: none; }
  .overview-mode main { padding-bottom: 40px; }
  .overview-intro { padding-top: 4px; }
  .overview-transfer dl > div { grid-template-columns: 180px 1fr; }
  .topbar-actions { gap: 4px; }
  .topbar .breadcrumb { min-width: 0; }
}
@media (max-width: 520px) {
  .overview-intro h1 { font-size: 29px; }
  .overview-lead { font-size: 17px; margin-top: 18px; }
  .wide-break { display: none; }
  .overview-toc { column-gap: 18px; }
  .overview-toc a { font-size: 13px; }
  .overview-section { padding: 34px 0; }
  .overview-section h2 { font-size: 21px; }
  .overview-section-heading { gap: 10px; }
  .overview-outcomes, .overview-terms dl, .overview-roles { grid-template-columns: 1fr; gap: 20px; }
  .overview-outcomes { margin: 24px 0; }
  .overview-goal-note { padding: 17px 18px; }
  .overview-inputs ul { grid-template-columns: 1fr; }
  .overview-record-heading { padding: 20px 18px; align-items: flex-start; }
  .overview-record-heading .badge { flex-shrink: 0; }
  .overview-record dl { padding-inline: 18px; }
  .overview-record dl > div { grid-template-columns: 1fr; gap: 6px; }
  .overview-transfer dl > div, .overview-exercises > div { grid-template-columns: 1fr; gap: 5px; }
  .overview-transfer dl > div { padding-block: 9px; }
  .overview-roadmap li { padding: 18px 12px; gap: 14px; }
  .overview-roadmap h3 { font-size: 17px; gap: 8px; }
  .overview-correction { display: block; padding: 20px 18px; }
  .correction-values { display: block; margin-bottom: 13px; }
  .overview-next { align-items: stretch; flex-direction: column; gap: 20px; }
  .overview-next a { align-self: flex-start; }
  .topbar-actions .text-button { padding-inline: 4px; }
  body:not(.overview-mode) .topbar .breadcrumb { max-width: 160px; }
}
@media (hover: hover) and (pointer: fine) {
  .primary:hover:not(:disabled) { background: var(--accent-hover); }
  .secondary:hover:not(:disabled), .source-list button:hover, .option:hover { background: #edf3ef; }
  .step-link:hover:not(.current) { background: #1f3947; }
  .text-button:hover, .source-button:hover { text-decoration: underline; text-underline-offset: 4px; }
}
@media (max-width: 1150px) {
  :root { --sidebar: 220px; --text-title: 29px; }
  main { padding: 28px 24px 110px; }
  .topbar { padding: 0 24px; }
  .sidebar { padding-inline: 12px; }
  .brand { padding-inline: 5px; font-size: 14px; }
  .brand small { font-size: 9px; }
  .version-grid { padding: 20px; grid-template-columns: 1fr 48px 1fr; }
  .report-paper { padding: 18px 18px 10px; }
  .measurement { font-size: 43px; }
  .simulation-controls, .simulation-output { padding: 20px; }
  .lesson-footer { padding-inline: 24px; }
}
@media (max-width: 800px) {
  .sidebar { position: static; width: auto; padding: 16px; overflow: visible; }
  .brand { font-size: 16px; }
  .course-label { padding: 18px 4px 12px; }
  .course-label .tiny-label, .course-label p, .course-map, .sidebar-note, .step-link small { display: none; }
  .course-label h2 { font-size: 15px; margin: 0; }
  .lesson-nav { display: flex; gap: 6px; }
  .step-link { justify-content: center; padding: 8px 4px; min-height: 48px; width: auto; flex: 1; gap: 7px; }
  .step-link > span:last-child { display: none; }
  .step-number { width: 26px; height: 26px; font-size: 13px; }
  .app-shell { margin-left: 0; }
  .topbar { height: 62px; padding: 0 20px; }
  .breadcrumb { font-size: 13px; }
  .breadcrumb span { margin-inline: 6px; }
  .topbar .text-button { font-size: 13px; gap: 5px; }
  .topbar svg, .count { display: none; }
  main { padding: 24px 20px 120px; }
  .lesson-footer { left: 0; }
  .lesson-heading { margin-bottom: 22px; }
  .location { display: none; }
  .concept-detail { min-height: auto; padding: 24px 0; gap: 22px; }
  .wiki-columns { grid-template-columns: 1fr; }
  .manual-note { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
}
@media (max-width: 520px) {
  :root { --text-title: 26px; }
  h1 { line-height: 1.45; }
  .intro { font-size: 14px; }
  .teaching-note { align-items: flex-start; font-size: 14px; gap: 10px; }
  .note-index { width: 26px; height: 26px; font-size: 13px; }
  .workspace-heading { padding: 17px 18px; flex-wrap: wrap; gap: 9px; }
  .workspace-heading h2 { font-size: 16px; }
  .version-grid { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .version-connector { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; }
  .version-connector > span { transform: rotate(90deg); }
  .version-connector small { margin: 0; }
  .report-paper { padding: 18px 20px 10px; }
  .report-caption { min-height: auto; }
  .measurement { font-size: 46px; margin-top: 12px; }
  .timeline-experiment { grid-template-columns: 1fr; padding: 18px; gap: 14px; }
  .segmented { justify-self: start; }
  .timeline-result { align-items: flex-start; flex-direction: column; gap: 7px; }
  .concept-detail, .simulation-grid { grid-template-columns: 1fr; }
  .example { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 18px; }
  .options.compact { grid-template-columns: 1fr; }
  .question-panel form { padding: 20px 18px; }
  legend { font-size: 16px; }
  .option { padding: 13px 14px; }
  .option strong { font-size: 14px; }
  .simulation-output { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
  .responsibility-flow { grid-template-columns: 1fr; gap: 6px; margin: 16px 0 24px; }
  .responsibility-flow > div { border-left: 2px solid #b5c9c1; padding: 4px 20px; }
  .responsibility-flow h2 { margin: 5px 0; }
  .flow-arrow { transform: rotate(90deg); justify-self: start; margin-left: 18px; }
  .wiki-preview { padding: 20px 18px; }
  .wiki-preview blockquote { min-height: 220px; font-size: 16px; }
  .wiki-preview .primary { width: 100%; padding-inline: 10px; font-size: 13px; }
  .reason-label span { display: block; margin: 4px 0 0; }
  .reason-meta { font-size: 13px; }
  .review-strip { align-items: flex-start; }
  .lesson-footer { flex-wrap: wrap; gap: 10px; padding: 12px 20px 10px; }
  .footer-note { order: 3; width: 100%; text-align: center; font-size: 13px; }
  .primary, .secondary { padding-inline: 14px; gap: 8px; }
  .source-content { padding: 20px; }
  .dialog-heading { padding: 18px 20px; }
  .dialog-heading h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button, .switch, .switch::before { transition: none; }
  button:active:not(:disabled) { transform: none; }
  dialog[open] { animation: none; }
}
