:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-soft: #eeefea;
  --ink: #20352e;
  --muted: #64736d;
  --line: #dce2d9;
  --accent: #21694e;
  --accent-strong: #174f3a;
  --accent-soft: #e5f1e9;
  --gold: #f2c56c;
  --wrong: #a74432;
  --wrong-soft: #fff0eb;
  --hint: #775721;
  --hint-soft: #fff7e1;
  --code: #172c26;
  --code-ink: #e1eee5;
  --shadow: 0 12px 45px rgb(35 55 43 / 5%);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14221d; --surface: #1c2e26; --surface-soft: #24382e;
  --ink: #e5eee6; --muted: #acbeb0; --line: #3b5043;
  --accent: #9ce1b5; --accent-strong: #b3edc6; --accent-soft: #243e30;
  --wrong: #ffb7a4; --wrong-soft: #452b24; --hint: #f0ce8c; --hint-soft: #3e3522;
  --code: #0e1a15; --code-ink: #e1eee5;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #14221d; --surface: #1c2e26; --surface-soft: #24382e;
    --ink: #e5eee6; --muted: #acbeb0; --line: #3b5043;
    --accent: #9ce1b5; --accent-strong: #b3edc6; --accent-soft: #243e30;
    --wrong: #ffb7a4; --wrong-soft: #452b24; --hint: #f0ce8c; --hint-soft: #3e3522;
    --code: #0e1a15; --code-ink: #e1eee5;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.65; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
a { color: var(--accent); text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, input, a, summary, .file-button { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--accent); }
main:focus { outline: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.1rem, 4vw, 3.5rem); line-height: 1.12; letter-spacing: -.055em; font-weight: 750; }
h2 { line-height: 1.25; letter-spacing: -.025em; }
h3 { line-height: 1.35; }
p { margin-bottom: 1rem; }
code, pre, .code-answer { font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
:not(pre) > code { font-size: .9em; background: var(--surface-soft); padding: .12em .32em; border-radius: 4px; overflow-wrap: anywhere; }
.small { font-size: .85rem; }
.muted { color: var(--muted); }
.eyebrow, .mini-label { display: block; font-size: .69rem; font-weight: 750; letter-spacing: .14em; color: var(--muted); }
.eyebrow { margin-bottom: .65rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; padding: .65rem 1rem; border: 1px solid transparent; border-radius: 11px; text-decoration: none; font-size: .88rem; font-weight: 650; line-height: 1.3; transition: transform .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { color: var(--surface); background: var(--accent); box-shadow: 0 3px 0 var(--accent-strong); border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-strong); }
.button-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.button-outline:hover:not(:disabled) { border-color: var(--accent); }
.button-quiet { background: transparent; color: var(--muted); }
.button-quiet:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); }
.button-danger { background: transparent; color: var(--wrong); border-color: var(--line); }
.button-large { min-height: 52px; padding: .8rem 1.6rem; font-size: 1rem; }
.skip-link { position: fixed; left: 20px; top: 12px; z-index: 20; background: var(--surface); padding: 12px; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.skip-link:focus { clip-path: none; opacity: 1; pointer-events: auto; }
.topbar { max-width: 1430px; margin: auto; min-height: 95px; padding: 18px 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.2rem; line-height: 1.3; }
.brand small { display: block; margin-top: 4px; font-size: .72rem; color: var(--muted); font-weight: 450; }
.brand-mark { display: grid; place-content: center; width: 47px; height: 47px; border-radius: 15px; background: #21694e; color: #fff; font-size: 1.65rem; letter-spacing: -.1em; position: relative; padding-right: 7px; }
.brand-mark span { position: absolute; right: 8px; bottom: 8px; color: var(--gold); }
.topbar-actions { display: flex; gap: 9px; align-items: center; }
.poc-badge { font-size: .61rem; letter-spacing: .1em; font-weight: 750; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; margin-right: 8px; white-space: nowrap; }
.workspace { display: grid; grid-template-columns: 286px minmax(0, 1fr); max-width: 1320px; margin: 0 auto; gap: 48px; padding: 34px 32px 60px; }
.sidebar { align-self: start; position: sticky; top: 24px; }
.sidebar-heading h2 { font-size: 1.13rem; margin-bottom: 22px; }
.nav-toggle { display: none; }
.chapter-progress { padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.chapter-progress > div { display: flex; justify-content: space-between; font-size: .78rem; margin-bottom: 8px; }
progress { display: block; width: 100%; height: 7px; appearance: none; border: 0; border-radius: 10px; overflow: hidden; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); border-radius: 10px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 10px; transition: width .2s; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 10px; }
.lesson-nav { display: grid; gap: 3px; }
.lesson-link { display: grid; grid-template-columns: 28px minmax(0, 1fr) 13px; gap: 10px; align-items: center; min-height: 49px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--muted); }
.lesson-link:hover { background: var(--surface-soft); }
.lesson-link[aria-current="step"] { background: var(--accent-soft); color: var(--accent); }
.lesson-number { width: 27px; height: 27px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: 8px; font-size: .68rem; font-weight: 700; background: var(--surface); }
.lesson-link.is-complete .lesson-number { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.lesson-link.is-manual .lesson-number { background: var(--hint-soft); border-color: var(--line); color: var(--hint); }
.chapter-picker { margin-bottom: 16px; }
.chapter-picker select { width: 100%; min-height: 44px; margin: 8px 0; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font: inherit; font-size: .78rem; }
.chapter-picker a { font-size: .75rem; }
#chapter-manual-count { display: block; margin-top: 7px; color: var(--muted); font-size: .72rem; }
.course-grid .chapter-card { display: flex; flex-direction: column; }
.chapter-card p { flex: 1; }
.chapter-card progress { margin: 2px 0 13px; }
.chapter-card-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .73rem; color: var(--muted); }
.chapter-lesson-list { display: grid; gap: 10px; }
.chapter-lesson-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.chapter-lesson-row:hover { border-color: var(--accent); }
.chapter-lesson-row strong { display: block; font-size: .88rem; }
.chapter-lesson-row small { display: block; color: var(--muted); font-size: .76rem; margin-top: 5px; }
.lesson-row-status { color: var(--muted); font-size: .72rem; }
.lesson-tools { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: -4px 0 22px; }
.lesson-tools > span { font-size: .76rem; color: var(--muted); }
.lesson-tools .button { flex-shrink: 0; }
.manual-pill { background: var(--hint-soft); color: var(--hint); margin-bottom: 20px; }
.manual-completion h2 { margin: 5px 0 16px; }
.completion-overview { margin-top: 20px; font-size: .8rem; }
@media (min-width: 821px) {
  .lesson-nav { max-height: calc(100vh - 350px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
.lesson-link-title { font-size: .79rem; font-weight: 600; line-height: 1.35; }
.lesson-link-title small { display: block; color: var(--muted); font-size: .65rem; font-weight: 400; margin-top: 3px; }
.review-dot { width: 7px; height: 7px; background: #bb862b; border-radius: 50%; }
.sidebar-note { margin-top: 23px; padding-top: 21px; border-top: 1px solid var(--line); font-size: .73rem; color: var(--muted); }
.sidebar-note p { margin: 9px 0; }
.sidebar-note a { font-weight: 600; font-size: .76rem; }
main { min-width: 0; padding-top: 10px; }
.hero { position: relative; padding: 21px 0 26px; }
.hero h1 { max-width: 630px; margin-bottom: 20px; }
.hero-description { max-width: 550px; color: var(--muted); font-size: 1.03rem; line-height: 1.75; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 25px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 5px 11px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .73rem; font-weight: 550; }
.hero-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.offline-hint { display: flex; align-items: center; gap: 7px; font-size: .74rem; color: var(--muted); }
.offline-hint::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 30px; }
.stat-card { padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.stat-card strong { display: block; font-size: 1.65rem; font-weight: 700; letter-spacing: -.055em; margin: 3px 0; }
.stat-card span { font-size: .75rem; color: var(--muted); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin: 27px 0 15px; }
.section-heading h2 { margin: 0; font-size: 1.15rem; }
.section-heading span { color: var(--muted); font-size: .74rem; }
.block-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.block-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 23px; }
.block-card h3 { font-size: 1rem; margin: 12px 0 8px; }
.block-card p { color: var(--muted); font-size: .84rem; margin-bottom: 16px; }
.block-card a { font-size: .83rem; font-weight: 650; }
.callout { padding: 18px 22px; border: 1px solid var(--line); border-radius: 13px; margin-top: 24px; font-size: .83rem; color: var(--muted); background: var(--surface-soft); }
.callout strong { color: var(--ink); }
.callout p:last-child { margin: 0; }
.lesson-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; }
.back-link { font-size: .76rem; text-decoration: none; color: var(--muted); }
.stage-track { display: flex; gap: 18px; font-size: .7rem; color: var(--muted); }
.stage-track .active { color: var(--accent); font-weight: 700; }
.lesson-header h1 { font-size: clamp(1.9rem, 3vw, 2.8rem); margin: 14px 0 14px; }
.lesson-goal { color: var(--muted); font-size: .97rem; margin-bottom: 26px; }
.lesson-header .eyebrow { margin-bottom: 0; }
.reading-card { background: var(--surface); border: 1px solid var(--line); border-radius: 19px; padding: 30px; box-shadow: var(--shadow); }
.reading-card p { font-size: .95rem; line-height: 1.85; }
.reading-card p:last-child { margin-bottom: 0; }
.code-block { margin: 22px 0; border: 1px solid #2b4237; background: var(--code); border-radius: 14px; overflow: hidden; color: var(--code-ink); }
.code-heading { padding: 9px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #2b4237; color: #b2c6b9; font-size: .66rem; letter-spacing: .055em; text-transform: uppercase; }
.code-block pre { margin: 0; padding: 20px; font-size: .82rem; line-height: 1.8; overflow-x: auto; tab-size: 4; white-space: pre; }
.token-string { color: #b8df91; }
.token-keyword { color: #88d4cf; }
.token-comment { color: #9aae9f; }
.token-number { color: #f2c56c; }
.example-caption { margin: -9px 0 20px; color: var(--muted); font-size: .78rem; }
.example-output { margin-bottom: 24px; font-size: .82rem; }
.example-output summary { color: var(--accent); cursor: pointer; font-weight: 600; }
.example-output pre { padding: 14px 18px; border-radius: 10px; background: var(--surface-soft); overflow: auto; font-size: .83rem; }
.key-points { list-style: none; padding: 0; margin: 0; }
.key-points li { position: relative; padding: 9px 0 9px 23px; font-size: .87rem; color: var(--muted); }
.key-points li::before { content: ""; position: absolute; top: 19px; left: 0; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.reading-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 24px; }
.reading-actions > span { font-size: .76rem; color: var(--muted); }
.source-link { margin: 18px 0; color: var(--muted); font-size: .74rem; }
.source-link a { color: var(--muted); }
.question-card { padding: 28px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.question-meter { display: flex; justify-content: space-between; align-items: center; font-size: .7rem; font-weight: 650; color: var(--muted); margin-bottom: 10px; }
.question-card progress { margin-bottom: 25px; height: 5px; }
.question-card h2 { font-size: 1.22rem; line-height: 1.55; margin-bottom: 22px; }
.question-card fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.choices { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 12px; padding: 15px 17px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 12px; cursor: pointer; font-size: .91rem; line-height: 1.6; }
.choice input { margin: 5px 0 0; accent-color: var(--accent); width: 16px; height: 16px; }
.choice:hover { background: var(--surface-soft); }
.choice:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.choice:has(input:disabled) { cursor: default; }
.text-answer { display: block; width: 100%; padding: 15px 17px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 11px; font-family: "Cascadia Code", Consolas, monospace; font-size: .95rem; }
.answer-label { display: block; margin-bottom: 9px; font-size: .81rem; font-weight: 600; }
.answer-help { color: var(--muted); font-size: .76rem; margin-top: 9px; }
.order-list { list-style: none; padding: 0; display: grid; gap: 10px; }
.order-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; }
.order-position { font-size: .72rem; font-weight: 700; color: var(--muted); }
.order-label { flex: 1; min-width: 0; font-size: .85rem; }
.order-controls { display: flex; gap: 4px; }
.order-controls button { min-width: 40px; min-height: 42px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); border-radius: 8px; }
.hint-list { border-radius: 11px; padding: 14px 18px; background: var(--hint-soft); color: var(--hint); margin-top: 20px; font-size: .85rem; }
.hint-list p { margin: 5px 0; }
.feedback { margin-top: 22px; padding: 19px 21px; border-radius: 12px; font-size: .89rem; }
.feedback h3 { font-size: 1rem; margin-bottom: 8px; }
.feedback p:last-child { margin: 0; }
.feedback.correct { background: var(--accent-soft); color: var(--accent); }
.feedback.wrong { background: var(--wrong-soft); color: var(--wrong); }
.feedback.revealed { background: var(--hint-soft); color: var(--hint); }
.feedback code { background: transparent; }
.question-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 25px; }
.question-help-actions { display: flex; gap: 3px; flex-wrap: wrap; }
.practice-note { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .75rem; color: var(--muted); margin-top: 15px; }
.practice-note button { font-size: .75rem; min-height: 36px; padding: 5px 0; }
.reading-reminder { margin-top: 18px; background: var(--surface-soft); border-radius: 13px; padding: 18px; font-size: .85rem; }
.reading-reminder p:last-child { margin: 0; }
.completion-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 38px; text-align: center; box-shadow: var(--shadow); }
.completion-mark { display: grid; place-content: center; width: 70px; height: 70px; margin: 0 auto 23px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); border-radius: 23px; font-size: 2rem; }
.completion-card h1 { font-size: 2.25rem; margin-bottom: 15px; }
.completion-card > p { color: var(--muted); }
.score-line { background: var(--surface-soft); border-radius: 13px; padding: 19px; margin: 24px 0; }
.score-line strong { display: block; font-size: 1.75rem; color: var(--accent); line-height: 1.4; }
.score-line span { color: var(--muted); font-size: .8rem; }
.takeaway { text-align: left; background: var(--hint-soft); color: var(--hint); padding: 20px; border-radius: 13px; margin: 22px 0; }
.takeaway strong { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 7px; }
.completion-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 25px; }
.site-footer { display: flex; justify-content: space-between; gap: 15px; max-width: 1256px; margin: 0 auto; padding: 23px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .71rem; }
.site-footer a { color: var(--muted); }
.notice { background: var(--hint-soft); color: var(--hint); padding: 17px 22px; border: 1px solid var(--line); border-radius: 12px; }
.storage-notice { max-width: 1256px; margin: 20px auto 0; font-size: .85rem; }
.pwa-bar { max-width: 1256px; margin: 18px auto 0; padding: 12px 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.pwa-bar strong { display: block; font-size: .81rem; }
.pwa-bar > div { min-width: 0; overflow-wrap: anywhere; }
.pwa-bar span { display: block; color: var(--muted); font-size: .72rem; }
.pwa-bar[data-ready="true"] strong { color: var(--accent); }
.pwa-bar[data-update="true"] { background: var(--hint-soft); }
.pwa-bar .button { white-space: nowrap; font-size: .76rem; }
.pwa-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
#pwa-dialog-status { font-size: .85rem; }
#pwa-release { margin-top: 14px; overflow-wrap: anywhere; }
dialog { width: min(600px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 30px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 100px rgb(0 0 0 / 20%); overflow: auto; }
dialog::backdrop { background: rgb(11 27 18 / 50%); }
.dialog-heading { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.dialog-heading h2 { font-size: 1.45rem; }
dialog > p { color: var(--muted); font-size: .9rem; }
.backup-summary { padding: 13px 16px; background: var(--surface-soft); border-radius: 10px; font-size: .85rem; margin: 20px 0; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.file-button { position: relative; cursor: pointer; overflow: hidden; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-button:focus-within { outline: 3px solid var(--accent); outline-offset: 4px; }
.import-message { color: var(--accent); font-size: .86rem; }
.import-message.error { color: var(--wrong); }
.reset-row { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .78rem; color: var(--muted); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 30px); padding: 12px 20px; background: var(--ink); color: var(--bg); border-radius: 12px; font-size: .85rem; box-shadow: var(--shadow); z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.loading { color: var(--muted); padding: 30px; }
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 249px minmax(0, 1fr); gap: 26px; padding: 26px; }
  .topbar { padding: 18px 26px; }
  .poc-badge { display: none; }
  .site-footer { margin: 0 26px; }
  .pwa-bar { margin: 16px 26px 0; }
  .stat-card { padding: 17px; }
}
@media (max-width: 820px) {
  .workspace { display: block; padding: 20px; }
  .sidebar { position: static; margin-bottom: 24px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
  .sidebar-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .sidebar-heading h2 { margin: 0; font-size: .97rem; }
  .sidebar-heading .eyebrow { margin-bottom: 5px; font-size: .59rem; }
  .nav-toggle { display: inline-flex; }
  .chapter-progress { padding: 0; margin: 14px 0 0; border: 0; }
  .chapter-progress > div { font-size: .69rem; margin-bottom: 5px; }
  .sidebar:not(.is-open) .lesson-nav, .sidebar:not(.is-open) .sidebar-note, .sidebar:not(.is-open) .chapter-picker { display: none; }
  .chapter-picker { margin-top: 15px; }
  .chapter-picker select { font-size: 1rem; }
  .lesson-nav { margin-top: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-note { margin-top: 15px; padding-top: 15px; }
  .topbar { padding: 16px 20px; min-height: 79px; }
  .brand { font-size: 1.02rem; }
  .brand small { display: none; }
  .brand-mark { width: 40px; height: 40px; font-size: 1.4rem; border-radius: 12px; }
  .brand-mark span { bottom: 7px; right: 7px; }
  .topbar-actions { gap: 1px; }
  #theme-button { font-size: .7rem; padding: 8px; }
  #backup-button { font-size: .74rem; padding: 8px 10px; }
  main { padding-top: 0; }
  .hero { padding-top: 5px; }
  .site-footer { margin: 0 20px; flex-direction: column; gap: 6px; }
  .storage-notice { margin: 14px 20px 0; }
  .pwa-bar { margin: 14px 20px 0; }
}
@media (max-width: 480px) {
  .workspace { padding: 17px; }
  .topbar { padding: 13px 17px; }
  .brand { gap: 8px; }
  h1 { font-size: 2.5rem; }
  .hero-description { font-size: .95rem; }
  .hero-meta { gap: 6px; }
  .pill { padding: 4px 9px; font-size: .67rem; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 15px 12px; }
  .stat-card .mini-label { font-size: .55rem; letter-spacing: .07em; }
  .stat-card strong { font-size: 1.5rem; }
  .stat-card span { font-size: .67rem; }
  .block-grid { grid-template-columns: 1fr; }
  .block-card { padding: 20px; }
  .reading-card, .question-card { padding: 21px 18px; border-radius: 15px; }
  .reading-card p { font-size: .91rem; }
  .lesson-header h1 { font-size: 2rem; }
  .stage-track { gap: 10px; font-size: .65rem; }
  .question-card h2 { font-size: 1.08rem; }
  .question-actions { flex-direction: column-reverse; align-items: stretch; }
  .question-actions > .button { width: 100%; }
  .question-help-actions { justify-content: center; }
  .reading-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .completion-card { padding: 28px 20px; }
  .completion-card h1 { font-size: 2rem; }
  .order-item { gap: 9px; padding: 9px; }
  .order-controls { flex-direction: column; }
  .order-controls button { min-height: 44px; min-width: 44px; }
  .pwa-bar { margin: 12px 17px 0; gap: 10px; }
  .pwa-bar span { font-size: .66rem; }
  .text-answer { font-size: 1rem; }
  .lesson-nav { grid-template-columns: 1fr; }
  .section-heading span { max-width: 120px; text-align: right; }
  dialog { padding: 22px; }
  .reset-row { align-items: flex-start; flex-direction: column; }
  .lesson-tools { gap: 10px; }
  .lesson-tools > span { font-size: .7rem; }
  .chapter-lesson-row { grid-template-columns: 27px minmax(0, 1fr); padding: 14px; }
  .lesson-row-status { grid-column: 2; }
  .chapter-card-footer { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
