:root {
  color-scheme: dark;
  --canvas: #101114;
  --nav: #141519;
  --surface: #1a1b21;
  --surface-raised: #22232b;
  --surface-hover: #282a34;
  --ink: #f0f0f5;
  --muted: #a5a8b7;
  --subtle: #9397a9;
  --line: #30323e;
  --accent: #b7a6ff;
  --accent-fill: #aa97f4;
  --accent-dark: #201a35;
  --blue: var(--accent);
  --radius: 14px;
}
* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; scrollbar-color: #444653 #15161a; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif; line-height: 1.75; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button, a, summary, input { touch-action: manipulation; }
:is(button,a,input,summary,select,textarea):focus-visible { outline: 2px solid #d6caff; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 2.5vw, 2.45rem); font-weight: 650; line-height: 1.4; letter-spacing: -.045em; }
h2 { font-size: 1.3rem; font-weight: 600; line-height: 1.55; letter-spacing: -.025em; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { overflow-wrap: anywhere; }
small, .small { font-size: .875rem; color: var(--muted); }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.skip-link { position: fixed; top: -90px; left: 12px; z-index: 100; padding: 9px 17px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; padding: 29px 16px 20px; background: var(--nav); border-right: 1px solid #292b34; display: flex; flex-direction: column; z-index: 20; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); font-size: 1.24rem; font-weight: 650; margin: 0 12px 35px; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand small { display: block; font-size: .875rem; color: var(--subtle); font-weight: 400; margin-top: 1px; }
.nav-item { display: flex; align-items: center; gap: 13px; color: var(--muted); padding: 11px 14px; min-height: 47px; border-radius: 8px; font-size: .9375rem; margin: 5px 0; transition: color .15s, background .15s; }
.nav-item > .icon { color: #989dad; }
.nav-item:hover { background: #202129; color: var(--ink); text-decoration: none; }
.nav-item.active { background: #282438; color: #ded4ff; box-shadow: inset 0 0 0 1px #423859; }
.nav-item.active > .icon { color: #c4b5ff; }
.course-nav { padding-top: 10px; padding-bottom: 10px; }
.nav-item small { display: block; font-size: .875rem; color: #9a9bae; margin-top: 1px; }
.nav-course-icon { display: grid; place-items: center; }
.nav-label { font-size: .875rem; color: var(--subtle); margin: 28px 14px 10px; }
.sidebar-foot { display: flex; gap: 10px; margin-top: auto; padding: 22px 8px 1px; border-top: 1px solid #2c2e37; font-size: .875rem; color: var(--muted); }
.sidebar-foot > div { line-height: 1.8; }
.sidebar-foot > div > span { color: var(--subtle); }
.foot-icon { width: 26px; height: 26px; border-radius: 50%; background: #242735; color: #b2b9cf; display: grid; place-items: center; flex-shrink: 0; margin-top: 3px; }
.foot-icon .icon { width: 15px; height: 15px; }
.page { margin-left: 232px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 38px; border-bottom: 1px solid #292b34; background: #121317; font-size: .875rem; color: var(--muted); }
.breadcrumb, .top-actions { display: flex; align-items: center; gap: 16px; }
.breadcrumb strong { font-weight: 500; color: #dbdce6; }
.breadcrumb-divider { color: #666b80; }
.top-actions { gap: 23px; }
.text-button { display: inline-flex; gap: 8px; align-items: center; padding: 8px 10px; border: 0; background: transparent; color: var(--muted); min-height: 40px; font-size: .875rem; border-radius: 6px; }
.text-button:hover { color: var(--ink); background: var(--surface-raised); }
.text-button .icon { width: 17px; height: 17px; }
.menu-toggle { display: none; }
main { max-width: 1360px; padding: 36px 38px 52px; margin: auto; min-height: calc(100vh - 155px); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.page-heading p { max-width: 800px; color: var(--muted); margin-top: 10px; font-size: .9375rem; line-height: 1.85; }
.eyebrow { font-size: .875rem; font-weight: 500; color: var(--subtle); letter-spacing: .02em; margin-bottom: 8px; }
.page-heading .eyebrow { color: #c0b1ec; margin-bottom: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; font-size: .9375rem; font-weight: 500; white-space: nowrap; border: 1px solid #424450; border-radius: 8px; color: #e2e1ec; background: #262731; transition: background .15s, border-color .15s, box-shadow .15s; }
.button:hover { text-decoration: none; border-color: #707084; background: #30313d; }
.button.primary { background: var(--accent-fill); border-color: #b8a7fc; color: #1c1630; font-weight: 650; box-shadow: 0 2px 12px #9d83f01c; }
.button.primary:hover { background: #c3b0ff; border-color: #d1c0ff; }
.heading-action { color: #d0c9e8; background: #24212f; border-color: #494156; }
.heading-action .icon { width: 18px; height: 18px; }
.overview-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 21px; }
.today-panel { display: flex; flex-direction: column; padding: 24px 26px; border: 1px solid #3d354d; border-radius: var(--radius); background: radial-gradient(ellipse at 0 0, #2c244540, transparent 70%), var(--surface); }
.panel-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.panel-top .eyebrow { margin: 0; color: #c2b6db; }
.duration { display: flex; align-items: center; gap: 7px; font-size: .875rem; color: #c7c1d8; background: #292533; border: 1px solid #42384e; border-radius: 6px; padding: 3px 9px; }
.duration .icon { width: 15px; height: 15px; }
.today-panel h2 { margin: 15px 0 12px; font-size: 1.4rem; }
.today-list { padding: 0; list-style: none; margin: 0 0 17px; }
.today-list li + li { border-top: 1px solid #32303d; }
.today-row { display: flex; gap: 14px; align-items: center; color: var(--ink); padding: 13px 0; border-radius: 7px; }
.today-row:hover { text-decoration: none; background: #292634; }
.task-number { color: #aa9fc3; font-size: .875rem; font-variant-numeric: tabular-nums; padding-left: 3px; }
.today-row > div { min-width: 0; flex: 1; }
.today-row strong { font-size: 1rem; font-weight: 600; }
.today-row p { color: var(--muted); font-size: .875rem; margin-top: 3px; line-height: 1.7; }
.task-time { color: #e2dfee; font-size: 1.3rem; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
.task-time small { font-size: .875rem; margin-left: 5px; font-weight: 400; color: #aba3be; }
.today-bottom { display: flex; align-items: center; justify-content: space-between; gap: 17px; margin-top: auto; padding-top: 16px; border-top: 1px solid #35303f; }
.today-bottom > span { color: var(--muted); font-size: .875rem; }
.readiness-panel { padding: 24px 26px; background: #1a1b21; border: 1px solid var(--line); border-radius: var(--radius); }
.progress-overview { display: flex; align-items: center; gap: 25px; margin: 20px 0 24px; }
.progress-ring { width: 112px; height: 112px; flex-shrink: 0; padding: 6px; border-radius: 50%; background: conic-gradient(from -90deg, #b7a6ff var(--progress), #34303f 0); }
.progress-ring > div { height: 100%; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.progress-ring strong { font-size: 2rem; font-weight: 550; line-height: 1.25; font-variant-numeric: tabular-nums; }
.progress-ring strong small { font-size: .9375rem; margin-left: 3px; color: #bbb0d5; }
.progress-ring > div > span { font-size: .875rem; color: var(--muted); margin-top: 5px; }
.progress-copy > strong { font-size: 1.5rem; font-weight: 550; font-variant-numeric: tabular-nums; }
.progress-copy > strong > span { color: #a9a3b7; font-weight: 400; }
.progress-copy p { margin-top: 6px; font-size: .875rem; color: var(--muted); line-height: 1.8; }
.readiness-note { border-top: 1px solid var(--line); padding-top: 18px; }
.note-label { display: block; color: #d5b482; font-size: .875rem; margin-bottom: 6px; }
.readiness-note strong { display: block; font-size: 1rem; font-weight: 550; }
.readiness-note p { font-size: .875rem; color: var(--muted); margin: 7px 0 9px; line-height: 1.8; }
.readiness-note a { font-size: .875rem; }
.section { margin-top: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 16px; }
.section-head .eyebrow { margin-bottom: 3px; }
.section-head > a, .section-head > span { font-size: .875rem; }
.section-head > span { color: var(--muted); }
.course-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.course-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); color: var(--ink); transition: border-color .15s, background .15s; }
.course-card:hover { text-decoration: none; background: #20212a; border-color: var(--course); }
.course-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.course-symbol { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; background: color-mix(in srgb,var(--course) 11%,#1b1b22); color: var(--course); border: 1px solid color-mix(in srgb,var(--course) 25%,#2c2d38); }
.course-symbol .icon { width: 21px; height: 21px; }
.course-code { font-size: .875rem; color: var(--course); font-variant-numeric: tabular-nums; display: block; margin-bottom: 4px; }
.course-card h3 { font-size: 1.22rem; font-weight: 600; }
.exam-name { color: #cecdd9; font-size: .9375rem; margin-top: 2px; }
.course-scope { color: var(--muted); font-size: .875rem; margin-top: 13px; min-height: 50px; line-height: 1.8; }
.course-bottom { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: space-between; margin-top: 19px; color: #bbb8ca; font-size: .875rem; }
.course-rail { height: 3px; background: #34343f; border-radius: 2px; overflow: hidden; margin-top: 10px; }
.course-rail span { height: 100%; display: block; background: var(--course); }
.badge { display: inline-flex; border: 1px solid #3a3b48; border-radius: 5px; padding: 2px 8px; background: #262730; color: #cbc7d7; font-size: .875rem; white-space: nowrap; }
.badge.know { background: #1c342d; color: #a1dbc5; border-color: #3c6355; }
.badge.wrong { background: #3b242b; color: #f0b0ba; border-color: #71414b; }
.badge.unsure { background: #362d20; color: #ecc891; border-color: #665638; }
.three-rules { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; background: transparent; border-top: 1px solid var(--line); padding: 23px 0 0; }
.three-rules article { position: relative; padding-left: 34px; }
.rule-index { position: absolute; top: 1px; left: 0; font-size: .875rem; color: #a695cc; font-variant-numeric: tabular-nums; }
.three-rules b { font-weight: 550; }
.three-rules p { font-size: .875rem; margin-top: 7px; color: var(--muted); line-height: 1.85; }
.scope-notice { display: flex; gap: 14px; padding: 17px 20px; border: 1px solid #574b35; background: #27231d; border-radius: 10px; margin-bottom: 25px; }
.notice-mark { width: 22px; height: 22px; flex-shrink: 0; margin-top: 3px; border: 1px solid #b79764; border-radius: 50%; color: #e0bc82; font-size: .875rem; line-height: 20px; text-align: center; font-weight: 600; }
.scope-notice strong { font-size: .9375rem; color: #e3c89e; font-weight: 550; }
.scope-notice p { color: #c5bcae; font-size: .9375rem; margin-top: 5px; line-height: 1.8; }
.scope-details { margin-top: 8px; }
.scope-details summary { color: #d9bc93; font-size: .875rem; min-height: 32px; padding: 3px 0; cursor: pointer; }
.scope-details summary::before { content: '＋ '; }
.scope-details[open] summary::before { content: '− '; }
.scope-details > p { margin-top: 9px; }
.tabs { display: flex; gap: 5px; padding: 5px; background: #18191f; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 26px; overflow-x: auto; width: fit-content; max-width: 100%; }
.tabs button { border: 1px solid transparent; background: transparent; color: #acabbc; white-space: nowrap; min-height: 42px; padding: 8px 17px; border-radius: 6px; font-size: .9375rem; }
.tabs button:hover { color: var(--ink); background: #24242d; }
.tabs button[aria-selected=true] { color: #e0d5ff; border-color: #4b405f; background: #30293e; font-weight: 550; }
.blocks { display: grid; gap: 12px; }
.study-block { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.study-block:has(> details[open]) { border-color: #565069; }
.study-block > details > summary { display: flex; align-items: center; gap: 18px; cursor: pointer; list-style: none; padding: 20px 23px; }
.study-block > details > summary:hover { background: #22232c; }
.study-block > details > summary::after { content: '+'; margin-left: 7px; color: #b6a8d3; font-size: 1.4rem; line-height: 1; }
.study-block > details[open] > summary::after { content: '−'; }
.block-index { color: var(--accent); font-size: .9375rem; align-self: flex-start; padding-top: 2px; font-variant-numeric: tabular-nums; }
.study-block summary strong { font-size: 1.05rem; font-weight: 550; }
.study-block summary small { display: block; margin-top: 4px; }
.block-time { margin-left: auto; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.block-body { border-top: 1px solid var(--line); padding: 25px 30px 24px 63px; }
.recognize { font-size: .9375rem; margin-bottom: 19px; color: #d1ccd9; }
.recognize b { display: block; color: var(--muted); font-size: .875rem; font-weight: 500; margin-bottom: 4px; }
.formula { background: #252338; color: #e1dbfa; border: 1px solid #413950; border-left: 3px solid #ae98e7; padding: 17px 20px; border-radius: 0 8px 8px 0; font-family: "Cambria Math", "Segoe UI", "Microsoft JhengHei", sans-serif; overflow-wrap: anywhere; line-height: 2; margin-bottom: 23px; }
.steps { padding-left: 25px; margin: 14px 0 22px; color: #d8d5e1; }
.steps li { padding-left: 7px; margin: 11px 0; overflow-wrap: anywhere; line-height: 1.95; }
.steps li::marker { color: #a895d0; }
.example { margin: 23px 0; padding: 16px 20px; border: 1px solid #3b3b48; border-radius: 8px; background: #202128; }
.example > summary { color: #c6b7ec; font-size: .9375rem; font-weight: 550; cursor: pointer; }
.example > summary::before { content: '+ '; }
.example[open] > summary::before { content: '− '; }
.example > p { margin-top: 15px; color: #d8d5e1; }
.answer { background: #1f302c; color: #cceadd; border: 1px solid #35584a; border-left: 3px solid #80b8a0; padding: 16px 20px; border-radius: 0 8px 8px 0; line-height: 1.95; margin: 18px 0; overflow-wrap: anywhere; }
.pitfalls { font-size: .9375rem; margin-top: 21px; color: #d9bf97; }
.pitfalls b { font-weight: 550; }
.pitfalls ul { padding-left: 23px; margin: 8px 0 18px; }
.pitfalls li { margin-top: 5px; }
.source-refs { display: flex; flex-wrap: wrap; gap: 9px 20px; font-size: .875rem; margin: 17px 0; }
.source-refs a { color: #beb0db; text-decoration: underline; text-decoration-color: #61566f; text-underline-offset: 4px; }
.done-check { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; font-size: .9375rem; color: #cbc6d9; cursor: pointer; }
input[type=checkbox] { width: 19px; height: 19px; accent-color: #b59ef1; flex-shrink: 0; }
.sheet-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.formula-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; }
.formula-card h3 { color: #c6b5ef; margin-bottom: 10px; }
.formula-card p { line-height: 1.95; color: #dfdce9; }
.visual-intro { margin-bottom: 20px; color: var(--muted); font-size: .9375rem; }
.lesson-frame { display: block; width: 100%; height: 1500px; background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; }
.source-list { display: grid; gap: 13px; }
.source-card { display: flex; justify-content: space-between; align-items: center; gap: 25px; border: 1px solid var(--line); border-radius: 10px; padding: 23px 24px; background: var(--surface); }
.source-card > div { min-width: 0; }
.source-card .eyebrow { color: #b3a8c6; }
.source-card p { font-size: .9375rem; color: var(--muted); margin: 8px 0; }
.source-card .button { flex-shrink: 0; }
.practice-toolbar { display: flex; align-items: flex-end; gap: 17px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 21px; border: 1px solid var(--line); border-radius: 10px; background: #1a1b21; }
.practice-toolbar label { display: flex; flex-direction: column; gap: 7px; font-size: .875rem; color: var(--muted); }
select { max-width: 100%; min-height: 44px; padding: 9px 32px 9px 12px; border: 1px solid #4a4657; border-radius: 7px; color: #e6e1f2; background: #24242e; }
.practice-warning { background: #27231d; border: 1px solid #574b35; border-radius: 8px; padding: 15px 19px; color: #d6c4a7; font-size: .9375rem; margin-bottom: 20px; }
.practice-stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 25px; color: var(--muted); font-size: .875rem; margin: 22px 0; }
.question-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 26px 30px; margin: 18px 0; }
.question-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 10px; }
.question-head .eyebrow { margin: 0; color: #bfaada; }
.question-card h2 { font-size: 1.28rem; }
.question-prompt { margin: 15px 0 23px; line-height: 1.95; color: #dfdbe8; }
.scratch-label { display: block; font-size: .875rem; color: var(--muted); margin-bottom: 9px; }
textarea { display: block; resize: vertical; width: 100%; min-height: 107px; padding: 13px 15px; background: #14151b; border: 1px solid #464453; border-radius: 8px; color: var(--ink); font-size: 1rem; line-height: 1.9; transition: border-color .15s; }
textarea::placeholder { color: #9395a7; }
textarea:focus { border-color: #a395c9; }
.question-answer { margin-top: 21px; }
.question-answer > summary { min-height: 44px; padding: 8px 0; color: #c6b5f0; font-size: .9375rem; font-weight: 550; cursor: pointer; }
.question-answer > summary::before { content: '+ '; }
.question-answer[open] > summary::before { content: '− '; }
.self-assess { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.self-assess > span { font-size: .875rem; color: var(--muted); margin-right: 7px; }
.assess { background: #262731; border: 1px solid #464551; border-radius: 7px; padding: 7px 15px; min-height: 42px; color: #d0cadf; font-size: .9375rem; }
.assess:hover { background: #33313e; }
.assess[aria-pressed=true] { background: #353044; border-color: #ad94d9; color: #e1d5ff; box-shadow: inset 0 0 0 1px #ad94d9; }
.assess.know[aria-pressed=true] { background: #253d34; border-color: #7eac98; color: #c3e8d9; box-shadow: none; }
.assess.wrong[aria-pressed=true] { background: #402b33; border-color: #c68b99; color: #f0c6d0; box-shadow: none; }
.empty-state { padding: 48px 25px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.empty-state p { color: var(--muted); margin-top: 9px; }
.plan-note { background: #24212f; border: 1px solid #484055; border-left: 3px solid #aa95d6; border-radius: 0 8px 8px 0; padding: 18px 24px; margin-bottom: 30px; }
.plan-note strong { color: #d8c9ee; font-weight: 550; }
.plan-note p { color: #bcb4ca; font-size: .9375rem; margin-top: 7px; }
.timeline { display: grid; gap: 26px; }
.plan-day { display: grid; grid-template-columns: 145px minmax(0,1fr); gap: 27px; }
.day-label { color: #c7b9e4; font-size: 1.05rem; font-weight: 550; padding-top: 18px; }
.day-body { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 23px 25px; }
.day-body h2 { font-size: 1.2rem; margin-bottom: 17px; }
.plan-task { display: flex; align-items: flex-start; gap: 14px; border-top: 1px solid var(--line); padding: 16px 0; }
.plan-task > input { margin-top: 5px; }
.plan-task > div { flex: 1; min-width: 0; }
.plan-task > div > div { display: flex; gap: 18px; justify-content: space-between; }
.plan-task strong { font-weight: 550; }
.plan-task span { font-size: .875rem; color: #b6a9c8; white-space: nowrap; }
.plan-task p { color: var(--muted); font-size: .9375rem; margin-top: 6px; }
.plan-task > a { margin: 3px 0 0 10px; font-size: .875rem; }
.page-foot { padding: 23px 38px; border-top: 1px solid #2b2c35; font-size: .875rem; color: var(--subtle); max-width: 1360px; margin: auto; line-height: 1.9; }
.library-section + .library-section { margin-top: 46px; }
#toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); z-index: 50; max-width: 90vw; padding: 12px 22px; background: #353044; color: #eee5ff; border: 1px solid #776489; border-radius: 8px; box-shadow: 0 8px 25px #0006; font-size: .9375rem; }
#toast[hidden] { display: none; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.error-card { width: min(100%, 540px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 40px; }
.error-card p { color: var(--muted); margin: 16px 0 28px; }
summary::-webkit-details-marker { display: none; }
@media(min-width:1500px) { .sidebar { width: 248px; padding-left: 22px; padding-right: 22px; } .page { margin-left: 248px; } main { padding-top: 43px; } }
@media(max-width:1200px) {
  .sidebar { width: 212px; padding-left: 12px; padding-right: 12px; }
  .page { margin-left: 212px; }
  main { padding: 30px 26px 45px; }
  .topbar { padding: 0 26px; }
  .course-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .course-scope { min-height: 0; }
  .overview-grid { grid-template-columns: 1.45fr 1fr; }
  .today-panel, .readiness-panel { padding: 22px; }
  .progress-overview { gap: 17px; }
  .progress-ring { width: 96px; height: 96px; }
  .today-bottom > span { display: none; }
  .today-bottom { justify-content: flex-end; }
  .heading-action { display: none; }
}
@media(max-width:850px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s; width: 238px; }
  .nav-open .sidebar { transform: translateX(0); }
  .page { margin-left: 0; }
  .topbar { height: 65px; padding: 0 20px; gap: 13px; }
  .menu-toggle { display: grid; place-items: center; background: #27242f; border: 1px solid #494050; border-radius: 7px; min-width: 40px; min-height: 40px; padding: 8px; color: #d7c9f0; }
  .breadcrumb { margin-right: auto; gap: 10px; }
  .top-actions { gap: 8px; }
  .top-actions .semester { display: none; }
  main { padding: 29px 22px 43px; }
  .page-heading { flex-wrap: wrap; gap: 18px; }
  .overview-grid { grid-template-columns: 1.45fr 1fr; }
  .three-rules { gap: 18px; }
  .plan-day { grid-template-columns: 120px minmax(0,1fr); gap: 16px; }
  .page-foot { padding: 22px; }
  .nav-open .menu-toggle { position: fixed; left: 249px; top: 12px; z-index: 30; }
  .nav-open .page::before { content: ''; position: fixed; inset: 0 0 0 238px; background: #0009; backdrop-filter: blur(3px); z-index: 19; }
}
@media(max-width:670px) {
  .overview-grid { grid-template-columns: 1fr; }
  .readiness-panel { padding: 23px; }
  .progress-ring { width: 104px; height: 104px; }
  .progress-overview { margin: 16px 0 20px; gap: 25px; }
  .today-bottom { justify-content: space-between; }
  .today-bottom > span { display: block; }
}
@media(max-width:620px) {
  main { padding: 25px 16px 36px; }
  h1 { font-size: 1.75rem; letter-spacing: -.04em; }
  h2 { font-size: 1.2rem; }
  .breadcrumb > span:first-child, .breadcrumb-divider { display: none; }
  .topbar { padding: 0 16px; }
  .top-actions .text-button { padding: 8px; }
  .page-heading { margin-bottom: 23px; gap: 16px; }
  .page-heading > .button { width: 100%; }
  .today-panel { padding: 20px; }
  .today-panel h2 { font-size: 1.2rem; margin-top: 16px; }
  .today-row { gap: 12px; padding: 14px 0; }
  .task-time { padding-left: 2px; font-size: 1.15rem; }
  .task-time small { margin-left: 3px; }
  .today-bottom { justify-content: stretch; }
  .today-bottom > span { display: none; }
  .today-bottom .button { width: 100%; }
  .course-grid { gap: 12px; }
  .course-card { padding: 17px 15px; border-radius: 11px; }
  .course-card h3 { font-size: 1.15rem; }
  .course-top { margin-bottom: 14px; }
  .course-symbol { width: 33px; height: 33px; }
  .course-bottom { gap: 6px; margin-top: 16px; }
  .course-scope { min-height: 50px; }
  .section-head { gap: 15px; align-items: flex-start; }
  .section-head > span { max-width: 130px; text-align: right; }
  .three-rules { grid-template-columns: 1fr; gap: 23px; }
  .scope-notice { padding: 15px; gap: 11px; }
  .tabs { gap: 2px; padding: 4px; }
  .tabs button { font-size: .9375rem; padding: 8px 11px; }
  .study-block > details > summary { gap: 12px; padding: 17px 15px; }
  .block-time { display: none; }
  .block-body { padding: 21px 18px; }
  .formula { padding: 14px 16px; }
  .steps { padding-left: 20px; }
  .steps li { padding-left: 3px; }
  .sheet-grid { grid-template-columns: 1fr; }
  .formula-card { padding: 20px; }
  .source-card { display: block; padding: 21px; }
  .source-card .button { margin-top: 16px; }
  .practice-toolbar { padding: 17px; gap: 14px; }
  .practice-toolbar label { width: 100%; }
  .practice-toolbar select { width: 100%; }
  .practice-stats { gap: 6px 15px; }
  .practice-stats > span:last-child { width: 100%; }
  .question-card { padding: 23px 19px; }
  .plan-day { display: block; }
  .day-label { margin-bottom: 10px; padding-top: 0; }
  .day-body { padding: 21px 17px; }
  .plan-task { gap: 10px; }
  .plan-task > div > div { flex-wrap: wrap; gap: 7px; }
  .plan-task > a { margin-left: 0; }
  .lesson-frame { height: 2150px; }
  .brand { margin-bottom: 25px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print {
  :root { color-scheme: light; --ink: #111; --muted: #444; --line: #aaa; --subtle: #444; --accent: #222; --surface: #fff; }
  body { color: #111; background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .tabs, .page-heading > .button, .self-assess, textarea, .scratch-label, .done-check, .source-refs, .page-foot, .practice-toolbar, #toast, .lesson-frame { display: none !important; }
  .page { margin: 0; }
  main { max-width: none; padding: 0; }
  .page-heading { margin-bottom: 15px; }
  .question-card, .study-block, .formula-card, .plan-day { break-inside: avoid; }
  .formula, .answer, .scope-notice, .scope-notice p, .scope-notice strong, .plan-note, .plan-note p, .plan-note strong, .today-panel, .readiness-panel, .course-card, .example, .steps, .recognize, .question-prompt, .formula-card p { color: #111; background: #fff; border-color: #888; }
  .course-grid, .sheet-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .three-rules { grid-template-columns: repeat(3,minmax(0,1fr)); }
  a, .pitfalls, .exam-name, .scope-details summary, .course-bottom, .task-time { color: #222; }
  .progress-ring { background: #ccc; }
}
