@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: light;
  --bg: #f5f4ee;
  --surface: #ffffff;
  --soft: #eeeee5;
  --ink: #242e26;
  --muted: #626e61;
  --border: #dedfd4;
  --accent: #355c37;
  --accent-hover: #294b2b;
  --tint: #edf3e4;
  --tint-ink: #36562c;
  --second: #915534;
  --error-bg: #fff1e6;
  --error-ink: #8d4d25;
  --success-bg: #eaf3e1;
  --success-ink: #34582b;
  --sidebar: 292px;
  --radius: 18px;
  --shadow: 0 4px 22px #293f2610;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181e1a;
  --surface: #222a24;
  --soft: #2c352c;
  --ink: #e9eee2;
  --muted: #b0bbaa;
  --border: #3d493b;
  --accent: #b9d796;
  --accent-hover: #d0e7b6;
  --tint: #303f2b;
  --tint-ink: #ccdfb7;
  --second: #e8b18b;
  --error-bg: #402f22;
  --error-ink: #efc096;
  --success-bg: #2b402b;
  --success-ink: #c3e3a9;
  --shadow: 0 4px 22px #00000015;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Golos Text', system-ui, sans-serif; font-size: 18px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 28px; font-weight: 600; letter-spacing: -.6px; }
h3 { font-size: 21px; font-weight: 600; }
p { margin-bottom: 20px; }
strong { font-weight: 600; }
svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex-shrink: 0; }
::selection { background: var(--accent); color: var(--bg); }
.skip-link { position: fixed; left: 20px; top: -100px; padding: 12px 20px; background: var(--surface); border: 2px solid var(--accent); border-radius: 10px; z-index: 100; }
.skip-link:focus { top: 15px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 30px 20px 22px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 13px; margin: 0 9px 35px; font-size: 27px; font-weight: 700; letter-spacing: -1px; line-height: 1.2; }
.brand-icon { width: 43px; height: 48px; border-radius: 12px; background: var(--tint); color: var(--accent); display: grid; place-items: center; }
.brand-icon svg { width: 29px; height: 29px; }
.brand-sub { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1.2px; font-weight: 500; margin-top: 7px; }
.overview-link { display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 500; border-radius: 10px; padding: 13px 15px; min-height: 50px; }
.overview-link.active { background: var(--tint); color: var(--tint-ink); }
.sidebar-heading { font-size: 11px; letter-spacing: 1.2px; color: var(--muted); margin: 27px 14px 12px; }
.nav-item { display: flex; gap: 12px; align-items: center; padding: 11px 12px; margin: 3px 0; font-size: 14px; line-height: 1.5; color: var(--muted); border-radius: 10px; min-height: 52px; }
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item.active { background: var(--tint); color: var(--tint-ink); font-weight: 500; }
.nav-number { width: 27px; height: 27px; border: 1px solid var(--border); border-radius: 50%; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.nav-item.done .nav-number { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.sidebar-bottom { padding: 30px 13px 0; margin-top: auto; }
.sidebar-progress { display: flex; justify-content: space-between; font-size: 14px; }
.sidebar-progress strong { color: var(--accent); }
.progress-track { height: 6px; background: var(--soft); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.progress-track > div { height: 100%; background: var(--accent); transition: width .3s; }
#side-count { font-size: 13px; margin: 8px 0 16px; color: var(--muted); }
.local-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 0; padding-top: 15px; border-top: 1px solid var(--border); }
.page-shell { margin-left: var(--sidebar); }
.topbar { height: 86px; padding: 0 42px; display: flex; justify-content: space-between; align-items: center; gap: 18px; border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 22px; }
.dictionary-link { display: flex; align-items: center; gap: 8px; font-size: 15px; min-height: 44px; }
.theme-toggle { border: 1px solid var(--border); padding: 10px 15px; min-height: 46px; border-radius: 12px; background: var(--surface); display: flex; align-items: center; gap: 9px; font-size: 14px; }
.theme-toggle:hover { border-color: var(--accent); }
.icon-button { border: 1px solid var(--border); background: var(--surface); padding: 10px; border-radius: 10px; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.menu-toggle { display: none; }
main { max-width: 1210px; padding: 43px 42px 0; margin: auto; min-height: calc(100vh - 190px); }
main:focus { outline: none; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: 1.5px; font-weight: 500; margin-bottom: 20px; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.hero-copy { padding: 42px 0 37px 38px; }
.hero h1 { font-size: clamp(35px, 3.3vw, 49px); font-weight: 600; line-height: 1.15; letter-spacing: -1.8px; margin-bottom: 22px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 390px; line-height: 1.8; margin-bottom: 27px; }
.primary-button { background: var(--accent); color: var(--bg); border: 1px solid transparent; border-radius: 12px; min-height: 56px; padding: 15px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 28px; font-size: 16px; font-weight: 500; line-height: 1.5; transition: background .15s; }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled { background: var(--soft); color: var(--muted); border-color: var(--border); }
.hero-note { font-size: 13px; color: var(--muted); margin-top: 18px; }
.coffee-scene { background: var(--tint); padding: 25px 20px; display: flex; flex-direction: column; justify-content: center; gap: 26px; border-radius: 170px 0 0 0; margin-top: 20px; }
.scene-caption { text-align: center; font-size: 10px; letter-spacing: 1.8px; color: var(--tint-ink); }
.storefronts { display: flex; align-items: end; justify-content: center; gap: 14px; }
.shop { width: 46%; max-width: 155px; border-radius: 13px 13px 0 0; background: #e1c6a1; border: 1px solid #b9a485; color: #36452d; position: relative; }
.shop-b { background: #dce2ca; border-color: #a4b494; transform: translateY(9px); }
.shop-sign { text-align: center; font-size: 19px; letter-spacing: 2px; font-weight: 700; padding: 18px 4px 14px; }
.shop-sign span { display: block; font-size: 9px; font-weight: 400; letter-spacing: .3px; margin-top: 3px; }
.awning { background: repeating-linear-gradient(90deg, #57724a 0, #57724a 15px, #f4e9d6 15px, #f4e9d6 30px); height: 25px; margin: 0 -4px; border-radius: 3px 3px 7px 7px; border: 1px solid #5e7345; box-shadow: 0 5px 6px #20381616; }
.shop-b .awning { background: repeating-linear-gradient(90deg, #a27050 0, #a27050 15px, #f4e9d6 15px, #f4e9d6 30px); border-color: #a27050; }
.shop-window { margin: 16px 13px 18px; padding: 13px 3px; min-height: 105px; border: 3px solid #7c8e69; border-radius: 35px 35px 0 0; display: flex; align-items: center; flex-direction: column; background: #f2ebd8; gap: 9px; }
.shop-b .shop-window { border-color: #9f795b; }
.shop-window span { text-align: center; font-size: 8px; line-height: 1.5; }
.shop-window svg { width: 33px; height: 33px; }
.shop-step { height: 7px; background: #849572; margin: 0 -5px -2px; border-radius: 2px; }
.shop-b .shop-step { background: #b4977b; }
.scene-bottom { display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 12px; color: var(--tint-ink); margin-top: 5px; }
.scene-bottom > span:nth-child(2) { font-size: 25px; }
.course-intro { padding: 38px 0 33px; }
.course-intro h2 { font-size: 25px; margin-bottom: 16px; }
.course-intro > p { color: var(--muted); font-size: 17px; line-height: 1.85; max-width: 850px; }
.intro-points { display: flex; gap: 24px; flex-wrap: wrap; color: var(--accent); font-size: 13px; margin-top: 24px; }
.intro-points strong { color: var(--ink); font-size: 14px; margin-left: 7px; font-weight: 500; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 4px 0 22px; }
.section-header h2 { margin: 0; }
.section-header > span { font-size: 13px; color: var(--muted); }
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.lesson-card { display: flex; flex-direction: column; padding: 27px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; transition: border-color .15s, box-shadow .15s; }
.lesson-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 21px; }
.card-number { display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); width: 43px; height: 43px; border-radius: 12px; font-size: 17px; }
.card-status { font-size: 13px; color: var(--muted); }
.card-status.done { color: var(--accent); }
.lesson-kicker { color: var(--muted); font-size: 13px; margin-bottom: 9px; }
.lesson-card h3 { font-size: 23px; letter-spacing: -.5px; margin-bottom: 12px; }
.lesson-card p { color: var(--muted); font-size: 16px; line-height: 1.8; margin-bottom: 22px; }
.card-bottom { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--border); padding-top: 17px; margin-top: auto; font-size: 12px; color: var(--muted); }
.card-bottom > span:last-child { font-size: 19px; color: var(--accent); line-height: 1; }
.model-note { display: flex; align-items: start; gap: 15px; margin: 31px 0 0; padding: 22px; border: 1px solid var(--border); border-radius: 14px; }
.model-note svg { color: var(--accent); margin-top: 3px; }
.model-note p { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.85; }
.model-note strong { color: var(--ink); }
footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: auto; max-width: 1210px; padding: 38px 42px; color: var(--muted); font-size: 12px; }
.footer-brand { font-size: 17px; font-weight: 600; letter-spacing: -.5px; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); font-size: 15px; margin-bottom: 25px; }
.back-link:hover, .lesson-pagination a:hover, .dictionary-link:hover { color: var(--accent); }
.lesson-title { font-size: clamp(33px, 3.2vw, 46px); max-width: 900px; font-weight: 600; letter-spacing: -1.4px; margin-bottom: 12px; }
.lesson-subtitle { font-size: 19px; color: var(--muted); line-height: 1.7; margin-bottom: 29px; }
.lesson-outline { display: flex; gap: 12px; margin-bottom: 30px; flex-wrap: wrap; }
.lesson-outline a { font-size: 14px; color: var(--muted); border: 1px solid var(--border); background: var(--surface); padding: 10px 15px; border-radius: 10px; min-height: 44px; }
.lesson-outline a:hover { border-color: var(--accent); color: var(--accent); }
.lesson-layout { max-width: 860px; }
.reading-panel, .experiment, .quiz-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 35px; margin-bottom: 27px; scroll-margin-top: 25px; min-width: 0; }
.section-label { font-size: 12px; font-weight: 500; letter-spacing: 1.4px; color: var(--accent); margin-bottom: 16px; }
.context { font-size: 20px; line-height: 1.8; padding-bottom: 26px; border-bottom: 1px solid var(--border); margin-bottom: 31px; }
.reading-section + .reading-section { margin-top: 32px; }
.reading-section h2 { font-size: 25px; margin-bottom: 16px; }
.reading-section p { font-size: 18px; color: var(--muted); line-height: 1.95; }
.reading-section strong { color: var(--ink); }
.reading-section p:last-child { margin-bottom: 0; }
.insight { background: var(--tint); color: var(--tint-ink); padding: 23px; border-radius: 12px; margin-top: 30px; }
.insight > span { font-size: 13px; font-weight: 600; display: block; margin-bottom: 8px; }
.insight p { font-size: 17px; line-height: 1.85; margin: 0; }
.experiment h2, .quiz-panel h2 { font-size: 28px; margin-bottom: 17px; }
.intro { color: var(--muted); font-size: 17px; line-height: 1.9; }
.lab-task { padding: 19px 21px; border: 1px dashed var(--border); border-radius: 12px; margin: 23px 0 28px; }
.lab-task strong { font-size: 14px; }
.lab-task p { font-size: 16px; line-height: 1.8; color: var(--muted); margin: 5px 0 0; }
.choice-group { border: 0; padding: 0; margin: 22px 0; min-width: 0; }
.choice-group legend { font-size: 16px; font-weight: 500; margin-bottom: 10px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 15px 0; }
.choice-group .choice-row { margin: 0; }
.secondary-button { background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 11px; padding: 13px 18px; min-height: 52px; font-size: 16px; line-height: 1.6; }
.secondary-button:hover { border-color: var(--accent); }
.secondary-button.selected { background: var(--tint); color: var(--tint-ink); border-color: var(--accent); }
.secondary-button:disabled { color: var(--muted); background: var(--soft); opacity: .7; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 25px 0 20px; }
.result-box { padding: 21px; border-radius: 12px; background: var(--soft); border: 1px solid transparent; }
.result-box > span { display: block; color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.result-box strong { font-size: 33px; font-weight: 600; color: var(--accent); line-height: 1.4; }
.result-box small { font-size: 14px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.best-answer { background: var(--tint); border-color: var(--accent); }
.feedback { background: var(--soft); border-radius: 12px; padding: 21px 23px; font-size: 16px; color: var(--ink); line-height: 1.9; margin-top: 22px; }
.feedback.success { background: var(--success-bg); color: var(--success-ink); }
.feedback.error { background: var(--error-bg); color: var(--error-ink); }
.matrix-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 13px; line-height: 1.8; margin: 22px 0 10px; }
.matrix-legend > span { display: flex; align-items: center; gap: 6px; }
.matrix-legend > span:last-child { width: 100%; }
.matrix-legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend-a { background: var(--accent); }
.legend-b { background: var(--second); }
.matrix-wrap { width: 100%; }
.matrix { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 6px; font-size: 15px; }
.matrix caption { text-align: left; font-size: 12px; color: var(--muted); padding: 3px 6px 13px; }
.matrix th { font-size: 14px; color: var(--muted); font-weight: 500; padding: 11px 5px; line-height: 1.55; overflow-wrap: anywhere; }
.matrix th:first-child { width: 28%; text-align: left; }
.matrix td { padding: 0; }
.matrix-cell { border: 1px solid var(--border); background: var(--soft); padding: 19px 7px; width: 100%; border-radius: 12px; display: flex; justify-content: center; align-items: center; gap: 10px; min-height: 79px; }
.matrix-cell:hover, .matrix-cell.selected { border-color: var(--accent); background: var(--tint); }
.payoff-a, .payoff-b { font-size: 24px; font-weight: 600; }
.payoff-a { color: var(--accent); }
.payoff-b { color: var(--second); }
.payoff-divider { color: var(--muted); font-size: 16px; }
.slider-label { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 16px; font-weight: 500; margin: 30px 0 12px; }
.slider-label output { font-size: 26px; color: var(--accent); min-width: 66px; text-align: right; }
input[type="range"] { width: 100%; height: 36px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.slider-ends { display: flex; justify-content: space-between; gap: 15px; font-size: 12px; color: var(--muted); }
.sim-caption { color: var(--muted); font-size: 14px; line-height: 1.8; margin-top: 16px; }
.decision-tree { margin: 25px 0; }
.tree-start { padding: 17px; text-align: center; background: var(--tint); color: var(--tint-ink); border-radius: 12px; font-size: 17px; font-weight: 500; }
.tree-branches { display: grid; grid-template-columns: .65fr 1.35fr; gap: 16px; padding-top: 30px; }
.tree-node { position: relative; background: var(--soft); border: 1px solid var(--border); border-radius: 12px; padding: 17px; text-align: center; }
.tree-node::before { content: ''; position: absolute; width: 1px; height: 30px; background: var(--border); left: 50%; top: -31px; }
.tree-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.tree-node > strong { font-size: 23px; font-weight: 500; }
.tree-outcomes { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px 23px; }
.tree-outcomes > div { display: flex; flex-direction: column; font-size: 13px; gap: 7px; }
.tree-outcomes strong { font-size: 20px; font-weight: 500; }
.experiment h3 { margin: 27px 0 15px; }
.round-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; font-weight: 500; margin-top: 25px; }
.text-button { background: none; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; font-size: 14px; padding: 10px 0; min-height: 44px; }
summary { cursor: pointer; font-size: 15px; color: var(--accent); padding: 12px 0; min-height: 44px; }
.round-history { margin-top: 15px; }
.history-table { overflow-x: auto; }
.history-table table { width: 100%; border-collapse: collapse; font-size: 14px; white-space: nowrap; }
.history-table td, .history-table th { padding: 11px 9px; border-bottom: 1px solid var(--border); text-align: left; }
.history-table th { color: var(--muted); font-weight: 400; }
.quiz-question { font-size: 18px; line-height: 1.9; margin-bottom: 23px; }
.quiz-options { display: grid; gap: 12px; }
.quiz-option { display: flex; gap: 15px; align-items: center; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; font-size: 17px; line-height: 1.8; }
.quiz-option:hover { border-color: var(--accent); }
.option-letter { width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); font-size: 13px; }
.quiz-option.correct { background: var(--success-bg); border-color: var(--accent); }
.quiz-option.wrong { background: var(--error-bg); border-color: var(--error-ink); }
.transfer-panel { padding: 2px 10px 3px; margin-bottom: 15px; }
.transfer-panel p { font-size: 17px; line-height: 1.9; color: var(--muted); }
.finish-row { display: flex; flex-direction: column; align-items: start; gap: 13px; border-top: 1px solid var(--border); padding-top: 22px; }
.finish-row p { font-size: 14px; line-height: 1.8; color: var(--muted); margin: 0; }
.lesson-pagination { display: flex; justify-content: space-between; gap: 18px; margin-top: 30px; font-size: 14px; color: var(--muted); }
.lesson-pagination a { display: inline-flex; align-items: center; min-height: 44px; }
.case-panel { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
.case-panel h3 { font-size: 23px; }
.final-count { padding: 15px 20px; background: var(--tint); color: var(--tint-ink); border-radius: 12px; font-size: 16px; margin-bottom: 0; }
.completion { border-radius: var(--radius); background: var(--tint); color: var(--tint-ink); padding: 30px; margin-top: 26px; }
.completion h2 { font-size: 26px; }
.completion p { font-size: 17px; margin: 0; }
.glossary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 30px; }
.glossary-item { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); padding: 28px; }
.glossary-item h2 { font-size: 23px; }
.glossary-item p { color: var(--muted); font-size: 17px; line-height: 1.9; margin: 0; }
.reset-link { margin-top: 25px; color: var(--muted); }
.toast { position: fixed; bottom: 25px; left: calc(50% + var(--sidebar)/2); transform: translate(-50%, 130px); max-width: calc(100% - 35px); padding: 16px 23px; background: var(--ink); color: var(--bg); font-size: 15px; border-radius: 12px; z-index: 80; box-shadow: var(--shadow); transition: transform .2s; width: max-content; }
.toast.visible { transform: translate(-50%, 0); }
.mobile-overlay { display: none; }
.noscript-note { position: fixed; bottom: 20px; left: 20px; right: 20px; padding: 20px; background: var(--surface); border: 1px solid var(--border); z-index: 90; }

@media (min-width: 1600px) {
  :root { --sidebar: 310px; }
  .sidebar { padding-left: 26px; padding-right: 26px; }
  .hero-copy { padding: 48px 0 45px 42px; }
  .hero h1 { font-size: 50px; }
}
@media (max-width: 1190px) {
  :root { --sidebar: 265px; }
  .sidebar { padding: 26px 14px 20px; }
  .brand { font-size: 25px; }
  .nav-item { font-size: 13px; gap: 10px; }
  .topbar { padding: 0 30px; }
  main { padding: 33px 30px 0; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 32px 30px 0; }
  .hero h1 { font-size: 42px; }
  .hero p { max-width: 580px; font-size: 18px; }
  .coffee-scene { border-radius: 0; padding: 25px 30px 18px; margin: 18px 0 0; gap: 16px; }
  .storefronts { gap: 26px; }
  .shop { max-width: 175px; }
  .shop-window { min-height: 80px; margin: 12px 16px; flex-direction: row; justify-content: center; gap: 12px; }
  .scene-bottom { margin: 0; }
  .lesson-card { padding: 23px; }
  .lesson-card h3 { font-size: 22px; }
  .course-grid { gap: 16px; }
  .intro-points { gap: 12px 20px; }
  .breadcrumb > span { display: none; }
  .topbar { justify-content: end; }
  .reading-panel, .experiment, .quiz-panel { padding: 28px; }
  footer { padding: 35px 30px; }
}
@media (max-width: 950px) {
  :root { --sidebar: 280px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .sidebar .nav-item { font-size: 14px; }
  .mobile-overlay.visible { display: block; position: fixed; inset: 0; background: #08130cb0; z-index: 35; }
  body.menu-open { overflow: hidden; }
  .page-shell { margin-left: 0; }
  .menu-toggle { display: grid; }
  .breadcrumb > span { display: block; }
  .topbar { justify-content: space-between; height: 78px; }
  .hero { grid-template-columns: 1.15fr 1fr; }
  .hero-copy { padding: 35px 0 30px 30px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 16px; }
  .hero .primary-button { font-size: 14px; gap: 16px; padding: 14px 17px; }
  .hero-note { font-size: 11px; }
  .coffee-scene { margin-top: 15px; border-radius: 140px 0 0; padding: 25px 15px; gap: 24px; }
  .storefronts { gap: 12px; }
  .shop-sign { font-size: 17px; padding-top: 17px; }
  .shop-sign span { font-size: 8px; }
  .shop-window { flex-direction: column; margin: 14px 11px; min-height: 110px; gap: 9px; }
  .scene-caption { font-size: 8px; letter-spacing: 1px; }
  .lesson-layout { max-width: 850px; }
  .toast { left: 50%; }
}
@media (max-width: 650px) {
  body { font-size: 17px; }
  .topbar { padding: 0 18px; height: 74px; gap: 10px; }
  .breadcrumb > span { display: none; }
  .header-actions { gap: 16px; }
  .dictionary-link { font-size: 14px; gap: 6px; }
  .dictionary-link svg { width: 20px; }
  .theme-toggle { padding: 10px; min-width: 45px; }
  .theme-toggle span { display: none; }
  main { padding: 27px 18px 0; }
  .eyebrow { font-size: 10px; letter-spacing: 1.1px; margin-bottom: 17px; }
  .hero { grid-template-columns: 1fr; border-radius: 17px; }
  .hero-copy { padding: 28px 23px 0; }
  .hero h1 { font-size: clamp(32px, 8.5vw, 42px); letter-spacing: -1.2px; }
  .hero p { font-size: 17px; line-height: 1.8; }
  .hero .primary-button { font-size: 16px; width: 100%; }
  .hero-note { font-size: 12px; text-align: center; }
  .coffee-scene { border-radius: 0; margin-top: 24px; padding: 24px 18px 18px; gap: 18px; }
  .scene-caption { font-size: 9px; }
  .storefronts { gap: 22px; }
  .shop { max-width: 143px; }
  .shop-sign { font-size: 17px; padding: 13px 4px; }
  .shop-window { min-height: 84px; margin: 12px; flex-direction: row; gap: 7px; }
  .shop-window svg { width: 25px; height: 25px; }
  .shop-window span { font-size: 7px; }
  .scene-bottom { font-size: 12px; }
  .course-intro { padding: 30px 0; }
  .course-intro h2 { font-size: 24px; }
  .course-intro > p { font-size: 17px; }
  .intro-points { flex-direction: column; gap: 12px; }
  .intro-points strong { font-size: 15px; }
  .section-header { flex-direction: column; align-items: start; gap: 9px; margin-bottom: 20px; }
  .section-header h2 { font-size: 27px; }
  .section-header > span { font-size: 14px; }
  .course-grid, .glossary-grid { grid-template-columns: 1fr; }
  .lesson-card { padding: 24px; }
  .lesson-card h3 { font-size: 24px; }
  .lesson-card p { font-size: 17px; }
  .lesson-kicker { font-size: 14px; }
  .card-bottom { font-size: 13px; }
  .card-top { margin-bottom: 19px; }
  .card-status { font-size: 14px; }
  .model-note { padding: 20px 18px; gap: 12px; }
  .model-note p { font-size: 14px; }
  footer { padding: 28px 18px; align-items: start; }
  footer > span { max-width: 190px; text-align: right; font-size: 11px; }
  .back-link { font-size: 15px; margin-bottom: 18px; }
  .lesson-title { font-size: 33px; letter-spacing: -1px; }
  .lesson-subtitle { font-size: 17px; margin-bottom: 23px; }
  .lesson-outline { gap: 8px; margin-bottom: 23px; }
  .lesson-outline a { font-size: 13px; padding: 10px 12px; }
  .reading-panel, .experiment, .quiz-panel { padding: 25px 20px; border-radius: 15px; margin-bottom: 22px; }
  .section-label { font-size: 11px; letter-spacing: 1.1px; }
  .context { font-size: 18px; line-height: 1.9; padding-bottom: 24px; margin-bottom: 28px; }
  .reading-section h2 { font-size: 24px; line-height: 1.35; }
  .reading-section p { font-size: 18px; line-height: 1.9; }
  .insight { padding: 20px; margin-top: 25px; }
  .insight p { font-size: 17px; }
  .experiment h2, .quiz-panel h2 { font-size: 26px; }
  .intro { font-size: 17px; }
  .lab-task { padding: 17px; }
  .lab-task p { font-size: 16px; }
  .choice-row { gap: 10px; }
  .secondary-button { font-size: 16px; padding: 12px 15px; }
  .result-grid { gap: 10px; margin-top: 21px; }
  .result-box { padding: 16px 13px; }
  .result-box > span { font-size: 13px; margin-bottom: 9px; }
  .result-box strong { font-size: 30px; }
  .result-box small { display: block; font-size: 13px; }
  .feedback { padding: 19px 17px; font-size: 16px; line-height: 1.85; }
  .matrix { border-spacing: 4px; }
  .matrix th { font-size: 12px; padding: 10px 2px; }
  .matrix th:first-child { width: 30%; }
  .matrix-cell { padding: 17px 3px; border-radius: 9px; gap: 5px; min-height: 68px; }
  .payoff-a, .payoff-b { font-size: 23px; }
  .payoff-divider { font-size: 13px; }
  .matrix caption { font-size: 11px; }
  .matrix-legend { font-size: 12px; gap: 7px 10px; }
  .matrix-legend > span { width: 100%; }
  .slider-label { font-size: 16px; align-items: start; }
  .slider-label output { font-size: 25px; }
  .slider-ends { font-size: 11px; }
  .tree-branches { grid-template-columns: 1fr; gap: 26px; }
  .tree-label { font-size: 15px; }
  .tree-outcomes { gap: 20px; }
  .tree-outcomes > div { font-size: 13px; }
  .round-heading { font-size: 15px; flex-wrap: wrap; }
  .text-button { font-size: 13px; }
  .history-table table { font-size: 12px; }
  .history-table td, .history-table th { padding: 9px 5px; }
  .quiz-question { font-size: 18px; }
  .quiz-option { font-size: 17px; padding: 16px 13px; gap: 12px; }
  .option-letter { width: 27px; height: 27px; font-size: 12px; }
  .finish-row .primary-button { width: 100%; font-size: 16px; gap: 15px; }
  .finish-row p { font-size: 14px; }
  .lesson-pagination { gap: 15px; font-size: 13px; margin-top: 21px; }
  .glossary-item { padding: 25px; }
  .glossary-item h2 { font-size: 24px; }
  .glossary-item p { font-size: 18px; }
  .completion { padding: 25px; }
  .toast { font-size: 14px; max-width: calc(100% - 30px); }
}
@media (max-width: 370px) {
  main { padding-left: 12px; padding-right: 12px; }
  .reading-panel, .experiment, .quiz-panel { padding-left: 16px; padding-right: 16px; }
  .lesson-outline a { font-size: 12px; padding: 10px 9px; }
  .payoff-a, .payoff-b { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
