

:root {
  color-scheme: light;
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"PingFang SC","Segoe UI","Microsoft YaHei",sans-serif;
  font-synthesis:none;
  --background:#f0f2f5;--surface:#fff;--surface-grouped:#edf0f4;--timer-surface:#e9eef4;
  --surface-selected:#dce6f1;--surface-selected-hover:#d1ddeb;--secondary-action:#fff;
  --text-primary:#20242b;--text-secondary:#525d6d;--text-muted:#657183;
  --chapter-ink:#635087;--lecture-ink:#296b78;
  --border:#dce1e8;--control-border:#8793a4;--accent:#3f5e85;--accent-hover:#334e71;--on-accent:#fff;
  --success:#236747;--success-surface:#eaf5ee;--warning:#795118;--warning-surface:#fff3df;
  --error:#ad3030;--error-surface:#fff0ee;--disabled-surface:#eceff3;--disabled-text:#667080;
  --annotation-important:#b62d35;--annotation-unclear:#946100;--annotation-bookmark:#235f9e;--badge-amber:#e8bd59;--on-amber:#4b3300;
  --essay-red:#ad3030;--essay-yellow:#805300;--essay-green:#236747;
  --shadow:0 4px 24px #17233626;--radius-card:18px;--radius-action:12px;--radius-input:14px;
  --type-title:1.375rem;--type-section:1.0625rem;--type-body:1rem;--type-label:.9375rem;--type-meta:.875rem;
  --target:44px;--outline-width:clamp(336px,28vw,384px);
  color:var(--text-primary);background:var(--surface);
}
@media(prefers-color-scheme:dark){:root:not([data-appearance="light"]){
  color-scheme:dark;--background:#101216;--surface:#1b1f26;--surface-grouped:#282f39;--timer-surface:#2a323e;
  --surface-selected:#344b65;--surface-selected-hover:#3b5674;--secondary-action:#414e60;
  --text-primary:#f3f5f8;--text-secondary:#c3ccd9;--text-muted:#acb8c9;--border:#3e4856;--control-border:#8995a8;
  --chapter-ink:#ccb8ef;--lecture-ink:#97d3de;
  --accent:#a6bddc;--accent-hover:#c2d2e9;--on-accent:#0c2547;--success:#9bd8b6;--success-surface:#20392c;
  --warning:#f2d095;--warning-surface:#3c2e1b;--error:#ffb0ac;--error-surface:#3c2427;--disabled-surface:#2d3540;--disabled-text:#b4bfce;
  --annotation-important:#ffb9c3;--annotation-unclear:#f5cc74;--annotation-bookmark:#9dc6fa;--on-amber:#372403;
  --essay-red:#ffb0ac;--essay-yellow:#f5cc74;--essay-green:#9bd8b6;
  --shadow:0 4px 24px #0005;
}}
:root[data-appearance="dark"]{
  color-scheme:dark;--background:#101216;--surface:#1b1f26;--surface-grouped:#282f39;--timer-surface:#2a323e;
  --surface-selected:#344b65;--surface-selected-hover:#3b5674;--secondary-action:#414e60;
  --text-primary:#f3f5f8;--text-secondary:#c3ccd9;--text-muted:#acb8c9;--border:#3e4856;--control-border:#8995a8;
  --chapter-ink:#ccb8ef;--lecture-ink:#97d3de;
  --accent:#a6bddc;--accent-hover:#c2d2e9;--on-accent:#0c2547;--success:#9bd8b6;--success-surface:#20392c;
  --warning:#f2d095;--warning-surface:#3c2e1b;--error:#ffb0ac;--error-surface:#3c2427;--disabled-surface:#2d3540;--disabled-text:#b4bfce;
  --annotation-important:#ffb9c3;--annotation-unclear:#f5cc74;--annotation-bookmark:#9dc6fa;--on-amber:#372403;--shadow:0 4px 24px #0005;
  --essay-red:#ffb0ac;--essay-yellow:#f5cc74;--essay-green:#9bd8b6;
}
*{box-sizing:border-box}body{margin:0;font-size:var(--type-body);line-height:1.5;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}button{border:0;background:none;color:inherit;cursor:pointer;transition:background 140ms,color 140ms}
button:disabled{cursor:default}button,input,select,textarea{-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
svg{flex-shrink:0}button[hidden],[hidden]{display:none!important}
.page{min-height:100dvh;background:var(--surface)}
.app-shell{width:100%;height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--surface)}
.app-header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:64px;padding:6px 24px;border-bottom:1px solid var(--border);flex-shrink:0}
.header-left,.brand-group,.header-metrics,.header-right{display:flex;align-items:center}
.header-left{min-width:0;gap:28px}.brand-group{gap:4px;flex-shrink:0}.brand{display:flex;align-items:center;gap:10px;font-weight:600;white-space:nowrap}
.brand-toggle{padding:0 4px;min-height:44px;border-radius:12px}.brand-toggle:hover{background:var(--surface-grouped)}
.brand-mark{font-size:22px;letter-spacing:-.5px}.brand-divider{width:1px;height:18px;background:var(--border)}.brand-toggle>svg{color:var(--text-secondary)}
.header-metrics{gap:24px;font-size:var(--type-label);color:var(--text-secondary);flex-wrap:wrap}.header-metrics strong{font-weight:600;color:var(--text-primary);font-variant-numeric:tabular-nums;margin-left:4px}
.exam-countdown,.today-study{white-space:nowrap}.today-count{margin-left:12px}.today-count strong{margin-left:0;margin-right:2px}.header-right{gap:4px;flex-shrink:0}
.sync-status{display:flex;align-items:center;gap:6px;font-size:var(--type-meta);color:var(--text-secondary);white-space:nowrap}.sync-status.offline{color:var(--warning)}
.appearance-switch{width:64px;min-width:64px;height:44px;display:flex;align-items:center;justify-content:center;padding:6px;border-radius:12px}
.appearance-track{position:relative;display:block;width:52px;height:28px;overflow:hidden;border-radius:18px;background:#83c7e9;box-shadow:inset 0 0 0 1px #37769b38;transition:background-color 300ms ease}
.appearance-track>svg{position:absolute;inset:0;width:52px;height:28px;transition:opacity 220ms ease}.appearance-clouds{fill:#fff;opacity:.85}.appearance-stars{fill:#edf4ff;opacity:0}
.appearance-thumb{position:absolute;width:22px;height:22px;top:3px;left:3px;transform:translateX(0);transition:transform 360ms cubic-bezier(.22,.8,.25,1)}
.appearance-thumb>svg{position:absolute;inset:0;width:22px;height:22px;transition:opacity 200ms ease,transform 360ms ease}.appearance-sun{fill:#ffdb63;opacity:1}.appearance-moon{fill:#f4f7ff;opacity:0;transform:rotate(-30deg)}
.appearance-switch[aria-checked=true] .appearance-track{background:#28364e}.appearance-switch[aria-checked=true] .appearance-thumb{transform:translateX(24px)}.appearance-switch[aria-checked=true] .appearance-stars{opacity:1}.appearance-switch[aria-checked=true] .appearance-clouds,.appearance-switch[aria-checked=true] .appearance-sun{opacity:0}.appearance-switch[aria-checked=true] .appearance-moon{opacity:1;transform:rotate(0)}
.icon-button{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;padding:8px;color:var(--text-secondary);flex-shrink:0}
.icon-button:hover:not(:disabled),.settings-button:hover{background:var(--surface-grouped)}
.filter-wrap,.annotation-wrap{position:relative}.settings-button{width:44px;height:44px;min-width:44px;display:flex;align-items:center;justify-content:center;padding:10px;border-radius:12px;white-space:nowrap;color:var(--text-secondary)}
.subjects-reveal{display:grid;grid-template-rows:0fr;flex-shrink:0;transition:grid-template-rows 240ms ease}.subjects-reveal.open{grid-template-rows:1fr}.subjects-reveal>.subjects{min-height:0;overflow:hidden;transition:padding-block 240ms ease,opacity 180ms ease}.subjects-reveal:not(.open)>.subjects{padding-block:0;opacity:0;border-bottom:0}
.other-active.paused{color:var(--warning);background:var(--warning-surface)}.other-active.paused .live-dot{background:var(--warning)}
.has-timer-space{position:relative;z-index:30;background:var(--surface)}
.header-timer{min-width:0;display:flex;align-items:center;justify-content:flex-end;flex:1;visibility:hidden;opacity:0;transform:translateY(8px) scale(.985);transform-origin:right center;pointer-events:none;transition:opacity 140ms ease,transform 280ms ease,visibility 0s 140ms}
.header-timer.is-docked{visibility:visible;opacity:1;transform:none;pointer-events:auto;transition:opacity 140ms 200ms ease,transform 360ms cubic-bezier(.22,.8,.25,1),visibility 0s}
.header-timer-inner{display:flex;align-items:center;justify-content:flex-end;gap:16px;min-width:0}
.header-timer-context{display:flex;flex-direction:column;min-width:68px;max-width:160px;gap:1px}.header-timer-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;color:var(--text-secondary);line-height:1.4}.header-timer-digits{font-size:23px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.3;letter-spacing:-.4px}.header-timer-digits.muted{color:var(--text-secondary)}
.header-timer .timer-controls{display:flex;gap:6px;margin:0;flex-shrink:0}.header-timer .button{width:auto;min-height:44px;padding:10px 12px;font-size:15px;gap:6px}.header-timer .annotation-wrap>.button{min-width:74px}.header-timer .annotation-menu{z-index:60}
.header-timer .timer-controls>.button{width:auto;flex:0 0 auto}.header-timer .timer-controls>.annotation-wrap{flex:0 0 auto;min-width:74px}
.header-timer .button.secondary{background:var(--surface-grouped)}
.has-timer-space{gap:20px}.has-timer-space .header-left{gap:20px;flex-shrink:0}.has-timer-space .header-metrics{gap:16px;flex-wrap:nowrap;font-size:14px}
.timer-transfer,.timer-transfer-number{position:fixed;left:0;top:0;width:0;height:0;opacity:0;pointer-events:none;z-index:25}
.timer-transfer{background:var(--timer-surface);border-radius:16px}.timer-transfer-number{z-index:31;font-size:28px;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.3;letter-spacing:-.5px;white-space:nowrap;color:var(--text-primary)}
@media(prefers-reduced-motion:reduce){.subjects-reveal,.subjects-reveal>.subjects,.appearance-track,.appearance-track>svg,.appearance-thumb,.appearance-thumb>svg,.header-timer,.timer-slot>.compact-timer{transition:none!important}}
.popover,.filter-panel,.annotation-menu{position:absolute;z-index:50;background:var(--surface);border-radius:14px;box-shadow:var(--shadow);padding:6px}
.popover{right:0;top:calc(100% + 8px);min-width:220px}.popover>button{width:100%;min-height:44px;text-align:left;padding:12px;border-radius:10px;font-size:var(--type-label)}.popover>button:hover{background:var(--surface-selected)}
.subjects{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;padding:12px 16px;border-bottom:1px solid var(--border);flex-shrink:0}
.overall-progress .subject-track>span{background:var(--accent)}
.overall-progress:hover{background:var(--surface-grouped)}
.subject{display:flex;flex-direction:column;align-items:stretch;justify-content:center;min-height:92px;gap:10px;padding:14px 16px;border-radius:14px;background:var(--surface-grouped);color:var(--text-primary)}
.subject:hover,.subject.active:hover{background:var(--surface-selected-hover)}.subject.active{background:var(--surface-selected)}
.subject-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px;line-height:1.5}.subject-name{display:flex;align-items:center;gap:5px;font-size:var(--type-label);font-weight:600;white-space:nowrap}
.subject-top>strong{font-size:var(--type-meta);font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}.subject-track{height:5px;width:100%;background:var(--border);border-radius:5px;overflow:hidden}.subject-track>span{display:block;height:100%;border-radius:5px}.subject.active .subject-track>span{background:var(--accent)!important}
.subject-progress{font-size:var(--type-meta);color:var(--text-secondary);text-align:left;line-height:1.2}
.app-body{display:grid;grid-template-columns:var(--outline-width) minmax(0,1fr);flex:1;min-height:0}
.sidebar{display:flex;flex-direction:column;min-height:0;padding:10px 8px 8px 12px;background:var(--surface-grouped);border-right:1px solid var(--border)}
.sidebar-heading{display:flex;align-items:baseline;gap:8px;justify-content:space-between;font-size:var(--type-label);margin-right:8px;flex-shrink:0}.sidebar-heading strong{font-size:22px;font-weight:600;font-variant-numeric:tabular-nums}.sidebar-heading small{font-size:14px;font-weight:400;margin-left:3px}
.progress-track{height:5px;width:calc(100% - 8px);background:var(--border);border-radius:4px;overflow:hidden;margin:8px 8px 8px 0;flex-shrink:0}.progress-track>span{display:block;height:100%;background:var(--accent);border-radius:4px}
.progress-caption{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-right:8px;font-size:14px;color:var(--text-secondary);flex-shrink:0}.progress-caption b{font-weight:600;color:var(--text-primary)}
.outline-tools{display:flex;align-items:center;gap:0;margin:6px 8px 8px 0;flex-shrink:0}.outline-tool{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;flex:1;padding:8px 6px;border-radius:12px;font-size:14px;white-space:nowrap;color:var(--text-secondary)}
.outline-tool:hover,.outline-tools .icon-button.active{background:var(--surface-selected);color:var(--text-primary)}.filter-wrap{flex-shrink:0}.filter-wrap>.icon-button{position:relative}.filter-dot{position:absolute;top:8px;right:8px;width:5px;height:5px;border-radius:50%;background:var(--accent)}
.filter-panel{top:calc(100% + 4px);left:-44px;width:256px;padding:16px}.filter-panel label{display:flex;flex-direction:column;gap:8px;margin-bottom:12px;font-size:var(--type-label)}.filter-panel select{min-height:44px;width:100%;border:0;padding:8px 12px;border-radius:12px;background:var(--surface-grouped);color:var(--text-primary);font-size:var(--type-label)}.filter-panel .text-button{width:100%}
.search{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 12px;margin:0 8px 8px 0;border-radius:14px;background:var(--surface);color:var(--text-secondary);flex-shrink:0}.search:focus-within{outline:2px solid var(--accent);outline-offset:1px}.search input{min-height:44px;width:100%;min-width:0;background:none;border:0;outline:0;color:var(--text-primary);font-size:var(--type-label)}.search input::placeholder{color:var(--text-muted);opacity:1}.search button{min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center;padding:8px;margin-right:-8px}
.point-list{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--control-border) transparent}.outline-list{margin:0 -8px 0 -4px;padding:0 0 8px 4px;scroll-padding-block:64px 8px}.outline-chapter{margin-bottom:4px}
.outline-chapter-button,.outline-lecture-button{width:100%;display:flex;align-items:center;min-height:44px;gap:12px;padding:4px 8px;text-align:left;border-radius:14px;line-height:1.4}
.outline-chapter-button{position:sticky;top:0;z-index:2;background:var(--surface-grouped);font-size:16px;font-weight:600;color:var(--chapter-ink)}.outline-lecture-button{font-size:15px;font-weight:500;color:var(--lecture-ink)}
.chapter-label{color:var(--chapter-ink);font-weight:600}.lecture-label{color:var(--lecture-ink);font-weight:500}
.high-frequency-title{text-decoration-line:underline;text-decoration-thickness:1px;text-underline-offset:.18em;text-decoration-skip-ink:auto}
.point-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px 20px;flex-wrap:wrap}.point-title-row>h1{min-width:0;flex:1 1 220px;margin:0}.original-handbook-copy{flex:0 0 auto;min-height:40px;gap:7px;padding:9px 12px;font-size:14px;line-height:1.5;white-space:nowrap}.original-handbook-copy:disabled{cursor:default;opacity:.65}
.essay-badge{display:inline-flex;align-items:center;vertical-align:1px;white-space:nowrap;border:1px solid currentColor;border-radius:6px;padding:1px 4px;font-size:.8125rem;line-height:1.2;font-weight:500;text-decoration:none}
.essay-red{color:var(--essay-red)}.essay-yellow{color:var(--essay-yellow)}.essay-green{color:var(--essay-green)}
.repeat-badge{display:inline-flex;align-items:center;gap:3px;vertical-align:1px;white-space:nowrap;font-size:.8125rem;line-height:1.2;font-weight:600;text-decoration:none}.repeat-badge>svg{width:12px;height:12px;flex-shrink:0}.repeat-red{color:var(--essay-red)}.repeat-yellow{color:var(--essay-yellow)}
.outline-chapter-button>span,.outline-lecture-button>span{flex:1;min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}.outline-chapter-button>small,.outline-lecture-button>small{font-size:14px;font-weight:400;white-space:nowrap;color:var(--text-secondary);margin-left:4px}
.outline-chapter-button:hover,.outline-lecture-button:hover{background:var(--surface-selected)}.outline-chapter-button>svg,.outline-lecture-button>svg{width:16px;height:16px}
.point-row{position:relative;display:grid;grid-template-columns:22px minmax(0,1fr);align-items:center;column-gap:6px;padding:2px 0 2px 8px;border-radius:14px}.point-row:hover{background:var(--surface)}.point-row.selected{background:var(--surface-selected)}
.point-state{width:22px;min-height:44px;display:flex;align-items:center;justify-content:center;cursor:default}.state-circle{width:18px;height:18px;display:flex;align-items:center;justify-content:center;border:1.5px solid var(--control-border);border-radius:50%;color:var(--surface)}
.point-state.complete .state-circle{background:var(--success);border-color:var(--success)}.point-state.running .state-circle{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}.point-state.paused .state-circle,.point-state.marked-complete .state-circle{background:var(--badge-amber);border-color:var(--badge-amber);color:var(--on-amber)}
.point-select{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;min-height:44px;min-width:0;padding:0 12px 0 0;text-align:left}.point-title{font-size:16px;line-height:1.4;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;overflow-wrap:anywhere}.point-row.selected .point-title{font-weight:600}.point-meta{display:flex;align-items:center;justify-content:flex-end;gap:6px;font-size:14px;line-height:1.5;white-space:nowrap;color:var(--text-secondary);font-variant-numeric:tabular-nums}
.book-page{font-size:14px;color:var(--text-secondary);white-space:nowrap;font-weight:400;margin-left:4px}.search-empty{padding:24px 8px;text-align:center;font-size:var(--type-label);color:var(--text-secondary)}
.workspace{min-width:0;min-height:0;display:flex;flex-direction:column;padding:20px;overflow:hidden;scrollbar-width:thin;scrollbar-color:var(--control-border) transparent}.point-heading{flex-shrink:0;padding-inline:20px;margin-bottom:20px}.point-breadcrumb{display:flex;align-items:center;flex-wrap:wrap;gap:10px;line-height:1.6;font-size:14px;color:var(--text-secondary);margin-bottom:10px;font-variant-numeric:tabular-nums}
.completion-status{display:flex;align-items:center;gap:4px;margin-left:auto;padding:4px 8px;border-radius:8px;font-size:14px}.completion-status.done{color:var(--success);background:var(--success-surface)}h1{font-size:22px;font-weight:600;line-height:1.45;letter-spacing:-.3px;margin:0;overflow-wrap:anywhere}.lecture-subtitle{display:none;margin:8px 0 0;font-size:15px;line-height:1.6;color:var(--text-secondary)}
.other-active{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0;text-align:left;padding:12px 16px;margin-bottom:12px;border-radius:14px;background:var(--success-surface);color:var(--success);font-size:14px}.other-active>span{display:flex;align-items:center;gap:6px;min-width:0}.live-dot{width:6px;height:6px;flex-shrink:0;border-radius:50%;background:var(--success)}
.timer-panel{position:relative;flex-shrink:0;border-radius:18px;background:var(--timer-surface);padding:20px;overflow:visible}
.timer-topline{display:flex;align-items:center;justify-content:space-between;gap:12px;line-height:1.5}.metric-label{font-size:15px;font-weight:500}.timer-label{display:flex;align-items:center;gap:6px;font-size:14px;color:var(--text-secondary);white-space:nowrap}.status-dot{width:6px;height:6px;border-radius:50%;background:var(--text-muted)}.status-dot.running{background:var(--success)}
.timer-digits{font-size:44px;font-weight:600;line-height:1.25;letter-spacing:-1px;font-variant-numeric:tabular-nums;margin:12px 0 20px}.timer-digits.muted{color:var(--text-secondary)}
.time-details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.time-details>div{display:flex;flex-direction:column;gap:6px;min-width:0}.time-details span{font-size:14px;color:var(--text-secondary)}.time-details strong{font-size:15px;font-weight:500;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.timer-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:24px}.button{min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px;border-radius:12px;font-size:16px;font-weight:500;line-height:1.3;white-space:nowrap}.timer-controls>.button{width:100%;min-width:0}
.button.primary{background:var(--accent);color:var(--on-accent)}.button.primary:hover:not(:disabled){background:var(--accent-hover)}.button.secondary{background:var(--secondary-action);color:var(--text-primary);box-shadow:0 1px 3px #17233610}.button.secondary:hover:not(:disabled){background:var(--surface-selected)}.button:disabled{background:var(--disabled-surface);color:var(--disabled-text)}
.annotation-wrap{display:flex;min-width:0}.annotation-wrap>.button{width:100%}.annotation-menu{right:0;top:calc(100% + 8px);width:180px}.annotation-menu>button{width:100%;min-height:44px;display:flex;align-items:center;gap:12px;padding:10px 12px;text-align:left;border-radius:10px;font-size:15px}.annotation-menu>button>span{flex:1}.annotation-menu>button:hover,.annotation-menu>button[aria-pressed=true]{background:var(--surface-selected)}.annotation-menu>.clear-annotation{border-top:1px solid var(--border);border-radius:0;color:var(--text-secondary);margin-top:4px}
.annotation-important{color:var(--annotation-important)!important}.annotation-unclear{color:var(--annotation-unclear)!important}.annotation-bookmark{color:var(--annotation-bookmark)!important}
.pending-message{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;padding:12px 16px;margin-top:12px;border-radius:14px;background:var(--warning-surface);color:var(--warning);font-size:14px}.pending-message button{display:flex;align-items:center;gap:4px;min-height:44px;font-weight:600;white-space:nowrap}
.summary-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;flex-shrink:0;padding:20px;margin-bottom:20px;border-bottom:1px solid var(--border)}.summary-strip>div{display:flex;flex-direction:column;gap:6px}.summary-strip span{font-size:14px;color:var(--text-secondary)}.summary-strip strong{font-size:16px;font-weight:600;font-variant-numeric:tabular-nums}.summary-strip small{font-size:15px;font-weight:400;margin-left:3px}
.history{display:flex;flex-direction:column;flex:1;min-height:140px;padding-inline:20px}.section-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;margin-bottom:12px}h2{font-size:17px;line-height:1.5;font-weight:600;margin:0}.history-controls{display:flex;align-items:center;gap:12px}.segmented{display:flex;align-items:center;padding:4px;border-radius:14px;background:var(--timer-surface)}.segmented button{min-width:44px;min-height:44px;padding:8px 12px;border-radius:10px;font-size:14px;color:var(--text-secondary)}.segmented button.on{background:var(--surface);color:var(--text-primary);font-weight:600;box-shadow:0 1px 4px #17233628}
.text-button{display:flex;align-items:center;justify-content:center;gap:4px;min-height:44px;padding:8px 0;color:var(--accent);font-size:15px;font-weight:500}.record-list{flex:1;min-height:0;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--control-border) transparent}.record-day{margin:8px 0 4px;font-size:14px;font-weight:500;color:var(--text-secondary)}
.record-row{display:grid;grid-template-columns:minmax(0,1fr) auto 44px;align-items:center;gap:12px;padding:16px 0;border-bottom:1px solid var(--border)}.record-start{min-width:0}.record-range{font-size:16px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}.record-range>span{display:inline-block;margin:0 6px;font-weight:400;color:var(--text-secondary)}.record-topic,.record-note{margin-top:6px;font-size:14px;line-height:1.6;color:var(--text-secondary);overflow-wrap:anywhere}.record-totals{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.record-totals strong{font-size:16px;font-weight:600}.record-totals span{font-size:14px;white-space:nowrap;color:var(--text-secondary)}.empty-history{padding:16px;text-align:center;color:var(--text-secondary);font-size:16px}.empty-history p{margin:0}.load-more{width:100%;min-height:44px;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;font-size:15px;color:var(--accent)}
.toast{position:fixed;z-index:100;left:50%;bottom:24px;transform:translateX(-50%);max-width:calc(100% - 32px);padding:12px 16px;font-size:15px;line-height:1.6;background:var(--text-primary);color:var(--surface);border-radius:12px;box-shadow:var(--shadow)}
.record-dialog{width:520px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-y:auto;margin:auto;border:0;padding:24px;border-radius:18px;background:var(--surface);color:var(--text-primary);box-shadow:var(--shadow)}.record-dialog::backdrop{background:#10172566}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.dialog-heading h2{font-size:18px}
.field{display:flex;flex-direction:column;gap:8px;min-width:0;margin-bottom:16px}.field>span{font-size:15px;font-weight:500}.field small{font-size:14px;font-weight:400;color:var(--text-secondary);margin-left:4px}.field input,.field select,.field textarea{min-width:0;width:100%;min-height:44px;border:0;background:var(--surface-grouped);color:var(--text-primary);border-radius:14px;padding:12px;font-size:16px;line-height:1.5;resize:vertical}.field input::placeholder,.field textarea::placeholder{color:var(--text-muted);opacity:1}.field input[type=number]{width:150px}.field input[type=datetime-local]{font-size:15px;padding:10px}.field-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.effective-preview{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:12px 16px;background:var(--surface-grouped);border-radius:14px;margin-bottom:16px;font-size:15px}.effective-preview strong{font-size:16px;font-weight:600}
.dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:24px}.dialog-save{display:flex;gap:8px;margin-left:auto}.delete-button{min-height:44px;padding:8px 0;color:var(--error);font-size:15px;font-weight:500}.delete-confirm{display:flex;align-items:center;gap:12px;font-size:15px;width:100%}.delete-confirm>span{margin-right:auto;color:var(--error)}.delete-confirm button{min-height:44px;padding:8px;font-weight:600}.delete-confirm .danger{color:var(--error)}.form-error{font-size:15px;line-height:1.6;padding:12px;border-radius:14px;color:var(--error);background:var(--error-surface)}
.lecture-picker{position:relative;min-width:0;width:100%}.picker-trigger{width:100%;min-height:44px;display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:12px;border-radius:14px;background:var(--surface-grouped);font-size:16px;line-height:1.5;text-align:left}.picker-trigger>span{min-width:0;overflow-wrap:anywhere}.picker-trigger>svg{margin-top:3px}.picker-options{position:absolute;top:calc(100% + 6px);left:0;width:100%;max-height:280px;overflow-y:auto;padding:4px;border-radius:14px;background:var(--surface);box-shadow:var(--shadow);z-index:60}.picker-options>button{width:100%;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px;text-align:left;font-size:16px;line-height:1.5;border-radius:10px}.picker-options>button[aria-selected=true],.picker-options>button:hover{background:var(--surface-selected)}
.mobile-menu{display:none}
@media(min-width:721px) and (max-width:1000px){.header-left{gap:16px}.header-metrics{gap:16px}.header-right{gap:8px}.subject{padding:12px}.workspace{padding:16px}}
@media(min-width:721px) and (max-width:880px){:root{--outline-width:320px}.timer-controls{gap:8px}.timer-controls .button{padding-inline:6px}}
@media(min-width:721px) and (max-height:760px){.workspace{overflow-y:auto}.history{min-height:160px;flex:none}.record-list{max-height:240px}}
@media(max-width:720px){
  :root{--type-body:1.0625rem;--type-label:1rem;--type-meta:.875rem}
  .app-header{display:grid;grid-template-columns:1fr auto;gap:0 4px;padding:6px 12px 8px}.header-left{display:contents}.brand-group{grid-column:1;grid-row:1;gap:0}.brand-toggle{font-size:14px;padding:0;gap:5px}.brand-mark{font-size:18px}.brand-divider{display:none}.header-right{grid-column:2;grid-row:1;gap:0}.header-metrics{grid-column:1/-1;grid-row:2;justify-content:space-between;gap:8px;font-size:14px}.header-metrics strong{margin-left:2px}.theme-toggle>span{display:none}.settings-button{gap:4px;padding:8px}
  .subjects{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 12px}.subject{min-height:68px;padding:12px;gap:8px}.subject-name{font-size:15px}.subject-top>strong{font-size:14px}.subject-track{height:4px}.subject-progress{display:none}
  .overall-progress{grid-column:1/-1;min-height:52px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 16px;padding:9px 12px}.overall-progress .subject-top{display:contents}.overall-progress .subject-name{grid-column:1;grid-row:1}.overall-progress .subject-top>strong{grid-column:2;grid-row:1}.overall-progress .subject-track{grid-column:1/-1;grid-row:2}
  .app-body{display:block;position:relative}.mobile-menu{display:inline-flex}.sidebar{position:fixed;inset:0 auto 0 0;width:min(384px,100vw);z-index:41;transform:translateX(-100%);transition:transform 160ms;padding:10px 8px calc(8px + env(safe-area-inset-bottom)) 12px}.sidebar.open{transform:translateX(0)}.sidebar-heading{align-items:center}.sidebar-heading>strong{margin-left:auto}.sidebar-backdrop{position:fixed;inset:0;z-index:40;background:#10172566}
  .workspace{display:block;height:100%;overflow-y:auto;padding:20px 16px}.point-heading,.history{padding-inline:0}.lecture-subtitle{display:block}.timer-panel{padding:16px}.time-details{gap:12px}.timer-controls{gap:8px;margin-top:20px}.timer-controls .button{font-size:16px;gap:6px;padding-inline:6px}.annotation-menu{top:auto;bottom:calc(100% + 8px)}.summary-strip{padding:20px 0}.history{display:block}.record-list{overflow:visible}.history-controls{gap:8px}.segmented button{padding:8px}.record-range{font-size:15px;white-space:normal}.record-row{gap:8px}.record-totals strong{font-size:15px}.field-pair{grid-template-columns:1fr;gap:0}.field input[type=datetime-local]{font-size:16px}.record-dialog{padding:16px}.filter-panel select{font-size:16px}
}
@media(max-width:360px){.time-details{grid-template-columns:repeat(2,minmax(0,1fr))}.time-details>div:last-child{grid-column:1/-1}.record-row{grid-template-columns:minmax(0,1fr) 44px}.record-totals{grid-column:1;grid-row:2;align-items:flex-start;flex-direction:row;gap:12px}.edit-record{grid-column:2;grid-row:1/3}.sync-status{display:none}.timer-topline{gap:8px;flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}

.settings-dialog{width:440px;max-width:calc(100vw - 24px)}.settings-dialog .dialog-heading{margin-bottom:16px}.settings-section+.settings-section{margin-top:24px}.settings-section h3{font-size:15px;font-weight:600;margin:0 0 12px}.settings-section p{font-size:15px;line-height:1.6;color:var(--text-secondary);margin:0 0 12px}.settings-row{display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:12px;border-radius:12px;background:var(--surface-grouped);font-size:16px;text-align:left}.settings-row+.settings-row{margin-top:8px}.settings-row span{flex:1}.settings-row small{font-size:14px;color:var(--text-secondary)}.settings-row:hover{background:var(--surface-selected)}.settings-logout{color:var(--error)}.settings-row:disabled{color:var(--disabled-text);cursor:default}
/* Learning view: the legacy timer view keeps its existing layout. */
.learning-page{--lesson-blue:#2b628a;--lesson-purple:#6c4f8c;--lesson-orange:#95540d;--lesson-surface:#f4f6f9;--lesson-red:#a7353c}
:root[data-appearance="dark"] .learning-page{--lesson-blue:#9bcaf0;--lesson-purple:#d1b8ee;--lesson-orange:#efc18b;--lesson-surface:#252e3b;--lesson-red:#f3b1ba}
@media(prefers-color-scheme:dark){:root:not([data-appearance="light"]) .learning-page{--lesson-blue:#9bcaf0;--lesson-purple:#d1b8ee;--lesson-orange:#efc18b;--lesson-surface:#252e3b;--lesson-red:#f3b1ba}}
.learning-workspace{display:block;overflow-y:auto;padding:18px clamp(24px,3.4vw,64px) 36px;scroll-padding-top:20px}
.learning-workspace>.point-heading,.lesson-reader,.timer-slot,.compact-timer,.learning-workspace>.other-active,.learning-workspace>.pending-message{width:100%;max-width:1040px;margin-inline:auto}
.learning-workspace>.point-heading{padding:0;margin-top:20px;margin-bottom:12px}.learning-workspace h1{font-size:27px;line-height:1.45;letter-spacing:-.3px}.learning-workspace .point-breadcrumb{margin-bottom:8px}
.compact-timer{display:flex;position:relative;align-items:stretch;border-radius:16px;background:var(--timer-surface)}
.timer-slot{overflow:visible;overflow-anchor:none}.timer-slot>.compact-timer{opacity:1;visibility:visible;transform:none;transform-origin:center top;transition:opacity 140ms 200ms ease,transform 320ms cubic-bezier(.22,.8,.25,1),visibility 0s}
.timer-slot[data-docked=true]>.compact-timer{opacity:0;visibility:hidden;transform:translateY(-8px) scale(.985);pointer-events:none;transition:opacity 140ms ease,transform 240ms ease,visibility 0s 140ms}
.compact-timer .timer-panel{flex:1;min-width:0;display:grid;grid-template-columns:minmax(118px,1fr) auto;gap:0 24px;padding:12px 16px;background:none;border-radius:16px 0 0 16px}
.compact-timer .timer-topline{grid-column:1;grid-row:1;justify-content:flex-start;gap:14px}.compact-timer .metric-label{font-size:14px}.compact-timer .timer-label{font-size:13px}.compact-timer .status-dot{display:none}
.compact-timer .timer-digits{grid-column:1;grid-row:2;margin:1px 0 0;font-size:28px;line-height:1.4;letter-spacing:-.5px}
.compact-timer .time-details{display:none}.compact-timer .timer-controls{grid-column:2;grid-row:1/3;align-items:center;align-self:center;gap:8px;margin:0;display:flex}
.compact-timer .timer-controls .button{min-height:44px;padding:10px 14px;font-size:15px}.compact-timer .annotation-wrap>.button{min-width:74px}.compact-timer .annotation-menu{z-index:20}
.compact-history-button{font-size:14px;min-width:55px;padding:12px 14px;border-radius:0 16px 16px 0;color:var(--text-secondary)}.compact-history-button:hover{background:var(--surface-selected)}
.compact-timer .timer-controls>.button{width:auto;flex:none}.compact-timer .annotation-wrap{flex:none}.compact-timer .compact-history-button{flex:none}
.lesson-end-actions{width:100%;max-width:1040px;margin:28px auto 0;padding:18px 0 0;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:16px}
.lesson-end-time{display:flex;align-items:center;gap:12px;color:var(--text-secondary);font-size:14px}.lesson-end-time strong{font-size:21px;color:var(--text-primary);font-weight:600;font-variant-numeric:tabular-nums}.lesson-end-buttons{display:flex;align-items:center;gap:8px}.lesson-end-buttons .button{min-height:44px;min-width:88px;font-size:15px;padding:10px 16px}.lesson-end-actions .annotation-menu{top:auto;bottom:calc(100% + 8px)}
.lesson-end-buttons>.button,.lesson-end-buttons>.annotation-wrap{flex:0 0 auto}
.lesson-end-buttons .button.secondary{background:var(--surface-grouped)}
@media(max-width:720px){.lesson-end-actions{gap:12px;flex-wrap:wrap;padding-top:16px;margin-top:22px}.lesson-end-time{gap:10px}.lesson-end-time strong{font-size:20px}.lesson-end-buttons{flex:1;justify-content:flex-end;gap:6px}.lesson-end-buttons .button{min-width:74px;padding:10px;font-size:15px}}
.lesson-reader{font-size:17px;line-height:1.5;overflow-wrap:anywhere;color:var(--text-primary)}
.lesson-reader strong{font-weight:600;color:var(--lesson-red)}.lesson-reader mark{color:var(--lesson-orange);font-weight:600;background:none}.lesson-reader u{text-decoration-thickness:1px;text-underline-offset:4px}.lesson-reader code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.94em;word-break:break-word}
.lesson-lead{margin:0 0 16px;line-height:1.55;color:var(--text-secondary)}
.lesson-section{margin:0 0 20px}.lesson-section h2{display:flex;align-items:baseline;gap:12px;font-size:20px;line-height:1.4;font-weight:600;color:var(--lesson-blue);margin:0 0 8px}
.section-number{font-size:13px;line-height:1.5;font-variant-numeric:tabular-nums;letter-spacing:.04em;color:var(--text-muted);font-weight:500;min-width:21px}
.lesson-reader p{margin:6px 0}.lesson-reader ul,.lesson-reader ol{margin:6px 0;padding-left:25px}.lesson-reader li{padding-left:3px;margin:4px 0}
.lesson-steps li::marker{color:var(--lesson-purple);font-weight:600}.lesson-code{overflow-x:auto;white-space:pre;overflow-wrap:normal;line-height:1.55;font-size:15px;background:var(--lesson-surface);padding:13px 16px;border-radius:14px;margin:16px 0}.lesson-code code{color:var(--text-primary);word-break:normal}
.lesson-table-scroll{overflow-x:auto;max-width:100%;margin:12px 0;scrollbar-width:thin;border-radius:12px;background:var(--lesson-surface)}
.lesson-table{border-collapse:collapse;width:100%;min-width:420px;line-height:1.5;font-size:16px;text-align:left}.lesson-table th{background:var(--timer-surface);color:var(--text-primary);font-weight:600}.lesson-table th,.lesson-table td{padding:9px 13px;vertical-align:top;border-bottom:1px solid var(--border);text-align:left;min-width:90px}.lesson-table tbody tr:last-child td{border-bottom:0}.lesson-table td:first-child{font-weight:500}
.lesson-figure{margin:12px 0 14px;border-radius:14px;background:var(--lesson-surface);padding:8px 18px 10px;overflow:hidden}.lesson-figure>figcaption{display:flex;align-items:center;gap:12px;justify-content:space-between;font-size:15px;font-weight:600;line-height:1.6;margin:0 0 6px;color:var(--lesson-purple)}.lesson-figure>figcaption>span{flex:1}.lesson-figure>figcaption>.icon-button{margin-right:-7px}
.diagram-scroll{width:100%;overflow-x:auto;scrollbar-width:thin}.diagram-canvas{width:100%;min-width:520px;max-width:900px;margin-inline:auto}.diagram-canvas>svg{display:block;width:100%;height:auto;max-height:none}.figure-svg .diagram-canvas{background:var(--lesson-surface);border-radius:10px}.figure-caption{font-size:14px;line-height:1.5;color:var(--text-secondary);margin:8px 0 0!important}
.figure-flow .diagram-canvas{min-width:480px}.figure-address .diagram-canvas{min-width:480px}
.lesson-figure .diagram-canvas{min-width:740px}.figure-dialog{width:1200px;background:var(--surface);max-width:calc(100vw - 28px)}.figure-dialog .diagram-canvas{min-width:740px;max-width:1120px}.figure-dialog .dialog-heading{margin-bottom:12px}.figure-dialog h2{color:var(--text-primary);font-size:18px}.figure-dialog .figure-caption{font-size:15px}
.lesson-pitfalls{margin:8px 0 20px;padding:12px 16px;border-radius:14px;background:var(--warning-surface)}.lesson-pitfalls h2{color:var(--warning);font-size:17px;margin:0 0 6px}.lesson-pitfalls ul{margin:4px 0}.lesson-pitfalls li{font-size:16px;margin:4px 0}
.lesson-exercises{border-top:1px solid var(--border);padding-top:18px;margin-top:22px}.exercise-toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px}.exercise-toolbar h2{font-size:20px;display:flex;gap:12px;align-items:baseline}.exercise-toolbar h2>span{font-size:14px;font-weight:400;color:var(--text-secondary)}
.copy-actions{display:flex;align-items:center;position:relative;flex-shrink:0;background:var(--lesson-surface);border-radius:12px}.copy-actions>.button{background:none;box-shadow:none;padding:10px 12px;min-height:44px;font-size:14px;white-space:nowrap}.copy-actions>.icon-button{border-radius:0 12px 12px 0}.copy-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:12;padding:5px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow);min-width:205px}.copy-menu button{width:100%;min-height:44px;text-align:left;padding:10px 12px;border-radius:8px;font-size:15px;white-space:nowrap}.copy-menu button:hover{background:var(--surface-grouped)}
.exercise-card{padding:14px 0 20px;border-bottom:1px solid var(--border)}.exercise-card:last-child{border-bottom:0}.exercise-heading{display:flex;align-items:center;gap:12px;min-height:44px;margin-bottom:6px}.exercise-heading h3{display:flex;align-items:baseline;gap:12px;margin:0;font-size:15px;font-weight:500;color:var(--text-secondary);flex:1}.exercise-heading h3>span{font-size:18px;font-weight:600;color:var(--lesson-purple);font-variant-numeric:tabular-nums}.exercise-save-status{font-size:13px;color:var(--text-secondary)}
.exercise-stem{margin:4px 0 12px!important;line-height:1.5}.exercise-options{display:grid;gap:7px}.exercise-option{display:flex;align-items:flex-start;gap:13px;text-align:left;padding:10px 14px;border:1px solid transparent;border-radius:12px;background:var(--lesson-surface);font-size:16px;line-height:1.55;min-height:46px;width:100%}.exercise-option>span:nth-child(2){flex:1;min-width:0}.option-letter{font-weight:600;color:var(--text-secondary)}.exercise-option>svg{margin-top:6px}.exercise-option:hover:not(:disabled){background:var(--surface-selected)}.exercise-option.correct{background:var(--success-surface);border-color:var(--success);color:var(--success)}.exercise-option.incorrect{background:var(--error-surface);border-color:var(--error);color:var(--error)}.exercise-option.chosen .option-letter{color:inherit}.exercise-option:disabled{opacity:1}
.exercise-feedback{margin-top:10px;padding:12px 15px;border-radius:12px;font-size:16px;line-height:1.55;background:var(--lesson-surface)}.exercise-feedback>strong{display:flex;gap:8px;align-items:center;font-size:15px;color:inherit}.correct{color:var(--success)}.incorrect{color:var(--error)}.exercise-feedback p{color:var(--text-primary);margin:8px 0 0}.exercise-feedback details{margin-top:8px;color:var(--text-primary)}
.lesson-reader summary{cursor:pointer;list-style:none;min-height:44px;display:flex;align-items:center;gap:8px;font-size:15px;color:var(--text-secondary)}.lesson-reader summary::-webkit-details-marker{display:none}.lesson-reader summary:before{content:"›";display:inline-block;font-size:21px;font-weight:500;transform-origin:center}.lesson-reader details[open]>summary:before{transform:rotate(90deg)}.lesson-reader summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:5px}
.fill-answer{display:block;margin-top:16px}.fill-answer>span{display:block;font-size:14px;font-weight:500;color:var(--text-secondary);margin-bottom:7px}.fill-answer textarea{display:block;resize:vertical;width:100%;min-height:105px;max-height:450px;border:1px solid var(--control-border);background:var(--lesson-surface);padding:12px 15px;border-radius:12px;font-size:16px;line-height:1.8;color:var(--text-primary)}.standard-answer{padding:5px 0;margin-top:8px}.standard-answer>p{font-size:16px;line-height:1.55;background:var(--lesson-surface);padding:14px 17px;border-radius:12px}
.attempt-history{margin-top:8px}.attempt-history summary>span{font-size:13px;margin-left:auto}.attempt-history ul{list-style:none;padding:0;margin:0}.attempt-history li{display:grid;grid-template-columns:110px minmax(0,1fr) auto;gap:12px;padding:8px 0;border-top:1px solid var(--border);font-size:14px;line-height:1.7;margin:0}.attempt-history time{color:var(--text-secondary);font-variant-numeric:tabular-nums}.attempt-history li>b{font-size:13px;font-weight:500}.attempt-history li>span{max-height:100px;overflow-y:auto}
.exercise-sync-error{display:flex;justify-content:space-between;gap:12px;align-items:center;background:var(--warning-surface);color:var(--warning);border-radius:12px;padding:8px 14px;font-size:14px}.exercise-sync-error .text-button{color:inherit}
.lesson-loading,.lesson-load-error{max-width:1040px;margin:28px auto;color:var(--text-secondary);font-size:16px}.lesson-load-error .text-button{padding-inline:0}.settings-row{text-decoration:none}
.learning-history-dialog{width:640px}.learning-history-dialog .history{padding:0;min-height:160px}.learning-history-dialog .record-list{max-height:60dvh;overflow:auto}.history-dialog-close{display:flex;justify-content:flex-end;margin-top:-8px;margin-right:-8px}
@media(min-width:361px) and (max-width:720px){.compact-timer .timer-panel{grid-template-columns:minmax(84px,1fr) auto}}
@media(min-width:1500px){.learning-page{--outline-width:400px}.learning-workspace{padding-inline:60px}}
@media(max-width:1080px) and (min-width:721px){.learning-workspace{padding:16px 22px 40px}.compact-timer .timer-panel{gap:0 12px;padding:10px 12px}.compact-timer .timer-controls{gap:6px}.compact-timer .timer-controls .button{padding:10px;font-size:14px;gap:5px}.compact-timer .timer-label{display:none}.compact-history-button{padding:10px;min-width:45px}}
@media(max-width:720px){.learning-workspace{padding:14px 17px 40px}.learning-workspace h1{font-size:24px}.learning-workspace>.point-heading{margin-top:18px}.compact-timer .timer-panel{gap:0 10px;padding:10px 12px}.compact-timer .metric-label{font-size:13px}.compact-timer .timer-label{display:none}.compact-timer .timer-digits{font-size:25px}.compact-timer .timer-controls{gap:6px}.compact-timer .timer-controls .button{min-width:42px;padding:10px;font-size:14px;gap:5px}.compact-timer .timer-controls .button>svg{display:none}.compact-timer .annotation-wrap>.button{min-width:58px}.compact-history-button{padding:10px;min-width:44px;font-size:13px}.lesson-reader{font-size:17px;line-height:1.5}.lesson-section{margin-bottom:18px}.lesson-section h2{font-size:19px;gap:10px}.lesson-table{font-size:15px;min-width:440px}.lesson-table th,.lesson-table td{padding:8px 11px}.lesson-figure{margin-inline:-3px;padding:13px 12px 9px}.diagram-canvas{min-width:560px}.lesson-pitfalls{padding:15px 17px}.exercise-toolbar{gap:8px}.exercise-toolbar h2{font-size:18px;gap:7px}.exercise-toolbar h2>span{font-size:13px}.copy-actions>.button{font-size:13px;gap:5px;padding:10px}.copy-actions>.icon-button{min-width:36px;padding:7px}.exercise-option{font-size:16px;padding:12px 14px}.exercise-feedback{padding:13px 15px}.attempt-history li{grid-template-columns:90px minmax(0,1fr) auto;gap:7px;font-size:13px}}
@media(max-width:360px){.compact-timer .timer-panel{grid-template-columns:1fr;padding:10px 11px}.compact-timer .timer-topline{grid-row:1}.compact-timer .timer-digits{grid-row:2}.compact-timer .timer-controls{grid-column:1;grid-row:3;margin-top:8px;display:grid;grid-template-columns:repeat(3,1fr)}.compact-history-button{align-self:stretch}.copy-actions>.button>svg{display:none}.exercise-toolbar h2>span{display:none}}

/* Natural diagram sizing: content width, with readable labels instead of stretching. */
.lesson-figure{width:calc(var(--diagram-width) + 36px);max-width:100%;margin-inline:auto}
.lesson-figure .diagram-canvas{width:min(100%,var(--diagram-width));min-width:calc(var(--diagram-width) - 8px);max-width:var(--diagram-width)}
.figure-dialog{--expanded-diagram-width:min(1120px,calc(var(--diagram-width) * 1.4));width:calc(var(--expanded-diagram-width) + 48px);max-width:calc(100vw - 32px)}
.figure-dialog .diagram-canvas{width:var(--expanded-diagram-width);min-width:var(--expanded-diagram-width);max-width:var(--expanded-diagram-width)}
.figure-dialog .dialog-heading{position:sticky;top:0;z-index:1;background:var(--surface)}

/* Deep teaching pilots: semantic color and spacing are scoped to the new presentation. */
.lesson-reader[data-presentation="deep"]{--deep-blue:#245f91;--deep-blue-bg:#e9f2fc;--deep-green:#246c4b;--deep-green-bg:#e7f3eb;--deep-orange:#945414;--deep-orange-bg:#fff0df;--deep-purple:#715094;--deep-purple-bg:#f0eafa;--deep-red:#aa3d4d;--deep-red-bg:#fbe9ed;--deep-gray:#536176;--deep-gray-bg:#edf0f5;line-height:1.55}
:root[data-appearance="dark"] .lesson-reader[data-presentation="deep"]{--deep-blue:#aed6fc;--deep-blue-bg:#263d53;--deep-green:#a4debd;--deep-green-bg:#263f36;--deep-orange:#f6cb98;--deep-orange-bg:#493b2b;--deep-purple:#d9bfef;--deep-purple-bg:#3c324c;--deep-red:#f6b8c4;--deep-red-bg:#4b303c;--deep-gray:#c5d2e2;--deep-gray-bg:#303c4d}
@media(prefers-color-scheme:dark){:root:not([data-appearance="light"]) .lesson-reader[data-presentation="deep"]{--deep-blue:#aed6fc;--deep-blue-bg:#263d53;--deep-green:#a4debd;--deep-green-bg:#263f36;--deep-orange:#f6cb98;--deep-orange-bg:#493b2b;--deep-purple:#d9bfef;--deep-purple-bg:#3c324c;--deep-red:#f6b8c4;--deep-red-bg:#4b303c;--deep-gray:#c5d2e2;--deep-gray-bg:#303c4d}}
.lesson-reader[data-presentation="deep"] [data-tone="blue"]{--tone:var(--deep-blue);--tone-bg:var(--deep-blue-bg)}
.lesson-reader[data-presentation="deep"] [data-tone="green"]{--tone:var(--deep-green);--tone-bg:var(--deep-green-bg)}
.lesson-reader[data-presentation="deep"] [data-tone="orange"]{--tone:var(--deep-orange);--tone-bg:var(--deep-orange-bg)}
.lesson-reader[data-presentation="deep"] [data-tone="purple"]{--tone:var(--deep-purple);--tone-bg:var(--deep-purple-bg)}
.lesson-reader[data-presentation="deep"] [data-tone="red"]{--tone:var(--deep-red);--tone-bg:var(--deep-red-bg)}
.lesson-reader[data-presentation="deep"] [data-tone="gray"]{--tone:var(--deep-gray);--tone-bg:var(--deep-gray-bg)}
.lesson-reader[data-presentation="deep"] .lesson-lead{font-size:17px;color:var(--text-primary);margin:0 0 23px;line-height:1.55}
.lesson-reader[data-presentation="deep"] .lesson-section{margin:0 0 26px}
.lesson-reader[data-presentation="deep"] .lesson-section>h2{color:var(--tone,var(--deep-blue));gap:12px;margin:0 0 11px;font-size:21px;line-height:1.5;align-items:baseline}
.lesson-reader[data-presentation="deep"] .section-number{color:var(--tone,var(--deep-blue));background:var(--tone-bg,var(--deep-blue-bg));padding:3px 6px;border-radius:7px;min-width:29px;text-align:center;font-size:13px;flex-shrink:0;align-self:flex-start;margin-top:2px}
.lesson-reader[data-presentation="deep"] p{margin:8px 0;line-height:1.55}
.lesson-reader[data-presentation="deep"] .lesson-callout{padding:13px 17px;margin:14px 0;background:var(--tone-bg,var(--deep-blue-bg));border-radius:14px;color:var(--text-primary)}
.lesson-reader[data-presentation="deep"] .lesson-callout h3{font-size:17px;line-height:1.5;color:var(--tone,var(--deep-blue));font-weight:600;margin:0 0 7px}
.lesson-reader[data-presentation="deep"] .lesson-callout p{margin:6px 0}
.lesson-reader[data-presentation="deep"] .lesson-callout p:last-child{margin-bottom:0}
.lesson-reader[data-presentation="deep"] .lesson-keypoints{margin:11px 0 13px;padding-left:27px;list-style:decimal}
.lesson-reader[data-presentation="deep"] .lesson-keypoints>li{padding-left:4px;margin:7px 0;line-height:1.55}
.lesson-reader[data-presentation="deep"] .lesson-keypoints>li::marker{color:var(--lesson-blue);font-weight:600;font-variant-numeric:tabular-nums}
.lesson-reader[data-presentation="deep"] u{text-decoration-thickness:1.5px;text-underline-offset:4px}
.lesson-reader[data-presentation="deep"] .lesson-figure{margin-top:16px;margin-bottom:16px;padding-top:9px;padding-bottom:11px}
.lesson-reader[data-presentation="deep"] .lesson-figure>figcaption{font-size:16px;color:var(--tone,var(--deep-purple));font-weight:600}
.lesson-reader[data-presentation="deep"] .figure-caption{font-size:15px;line-height:1.55}
.lesson-reader[data-presentation="deep"] .lesson-table{font-size:16px;line-height:1.6}
.lesson-reader[data-presentation="deep"] .lesson-table th,.lesson-reader[data-presentation="deep"] .lesson-table td{padding:10px 13px;min-width:90px}
.lesson-reader[data-presentation="deep"] .lesson-table th[data-tone],.lesson-reader[data-presentation="deep"] .lesson-table td[data-tone]{background:var(--tone-bg);color:var(--text-primary)}
.lesson-reader[data-presentation="deep"] .lesson-table th[data-tone]{color:var(--tone)}
.lesson-reader[data-presentation="deep"] .lesson-table[data-columns="2"]{min-width:0;table-layout:fixed}
.lesson-reader[data-presentation="deep"] .lesson-table[data-columns="2"] th:first-child{width:36%}
.lesson-reader[data-presentation="deep"] .lesson-table[data-columns="2"] th,.lesson-reader[data-presentation="deep"] .lesson-table[data-columns="2"] td{min-width:0;overflow-wrap:anywhere}
@media(max-width:720px){.lesson-reader[data-presentation="deep"] .lesson-section>h2{font-size:20px}.lesson-reader[data-presentation="deep"] .lesson-table th,.lesson-reader[data-presentation="deep"] .lesson-table td{padding:9px 10px}.lesson-reader[data-presentation="deep"] .lesson-callout{padding:12px 14px}.lesson-reader[data-presentation="deep"] .lesson-figure{padding-inline:12px}}
/* Mathematical notation and the requested chapter/method split only.
   All application layout and controls come from the copied 408 stylesheets. */
.subjects{grid-template-columns:repeat(4,minmax(0,1fr))}
.subjects .solution-flow-entry{align-items:center;gap:6px;font-size:var(--type-label);font-weight:600;color:var(--accent)}
.math-outline-chapter{margin-bottom:2px}
.chapter-unit-row{grid-template-columns:20px minmax(0,1fr) 28px;align-items:center;min-height:36px;padding-block:0;border-radius:9px}
.chapter-unit-row>.point-select{align-self:stretch;min-height:36px;padding:3px 6px 3px 0;column-gap:6px}
.chapter-unit-row>.point-select .point-title{font-size:15px;line-height:1.4;font-weight:600;color:var(--chapter-ink)}
.chapter-unit-row .point-state{width:20px;min-height:30px}
.chapter-unit-row .point-meta{font-size:12px}
.chapter-fold-button{width:28px;min-width:28px;height:30px;min-height:30px;padding:5px;align-self:center}
.math-method-row{padding:0 0 0 calc(28px + var(--method-depth,0)*9px);min-height:32px;align-items:center;grid-template-columns:minmax(0,1fr) 28px;border-radius:8px}
.math-method-row>.point-select{display:flex;align-items:center;align-self:stretch;min-height:32px;padding:2px 6px 2px 0;font-size:14px;line-height:1.4}
.math-method-row .point-title{font-size:inherit;line-height:1.4}
.math-method-row.method-selected{background:var(--surface-selected)}
.math-exercises-row .point-title{display:flex;align-items:center;gap:8px;font-weight:600;color:var(--chapter-ink)}
.math-exercises-row .point-title svg{flex-shrink:0}
.math-method-row.method-level-1 .point-title{font-weight:600;color:var(--chapter-ink)}
.math-method-row.method-level-2 .point-title{color:var(--lecture-ink)}
.method-annotation{flex-shrink:0;margin-right:0;align-self:center}
.method-flag{width:28px;min-width:28px;height:28px;min-height:28px;padding:5px;opacity:.35;border-radius:7px}
.point-row:hover .method-flag,.method-flag:focus-visible,.method-flag.has-mark{opacity:1}
.method-annotation .annotation-menu{right:0;top:calc(100% + 4px);bottom:auto;width:205px;max-width:70vw}
.annotation-context{font-size:12px;color:var(--text-muted);padding:8px 10px 9px;line-height:1.5;max-width:230px;border-bottom:1px solid var(--border);margin-bottom:3px}
.math-summary{font-size:17px;line-height:1.75}
.math-lesson-reader .math-summary strong{color:inherit}
.math-summary-block{margin:9px 0 12px;scroll-margin-top:90px;min-width:0}
.math-summary-heading{margin:26px 0 10px;scroll-margin-top:90px}
.math-summary-heading>:is(h2,h3,h4,h5){font-size:18px;line-height:1.6;font-weight:650;margin:0}
.math-summary-heading.math-level-1>:is(h2,h3,h4,h5){font-size:20px}
.math-summary-heading.math-level-3>:is(h2,h3,h4,h5),.math-summary-heading.math-level-4>:is(h2,h3,h4,h5){font-size:17px}
.math-summary-heading.math-level-1,[data-ink="7030A0"],[data-ink="8A2EB2"]{color:#7030a0}
.math-summary-heading.math-level-2,[data-ink="185AA6"],[data-ink="1261C9"]{color:#185aa6}
.math-summary-heading.math-level-3,[data-ink="127447"],[data-ink="238636"]{color:#127447}
.math-summary-heading.math-level-4,[data-ink="B65A00"]{color:#b65a00}
[data-ink="A63246"]{color:#a63246}
[data-ink="666666"]{color:var(--text-muted);font-size:.88em}
:root[data-appearance="dark"] .math-level-1,:root[data-appearance="dark"] [data-ink="7030A0"],:root[data-appearance="dark"] [data-ink="8A2EB2"]{color:#d2b7ef}
:root[data-appearance="dark"] .math-level-2,:root[data-appearance="dark"] [data-ink="185AA6"],:root[data-appearance="dark"] [data-ink="1261C9"]{color:#a1c9fa}
:root[data-appearance="dark"] .math-level-3,:root[data-appearance="dark"] [data-ink="127447"],:root[data-appearance="dark"] [data-ink="238636"]{color:#9bd8b6}
:root[data-appearance="dark"] .math-level-4,:root[data-appearance="dark"] [data-ink="B65A00"]{color:#f0c089}
:root[data-appearance="dark"] [data-ink="A63246"]{color:#ffb0bb}
.math-fragment{display:contents}
.math-fragment p{margin:8px 0}
math{font-family:math;font-size:1.08em;line-height:normal}
annotation{display:none}
.math-display{text-align:center;padding:6px 0 9px}
math[display="block"]{display:block;max-width:100%;padding:8px 0}
.math-summary-block{max-width:100%;overflow-x:auto;overflow-y:hidden;padding-block:6px;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.math-summary .table-scroll{overflow-x:auto;max-width:100%;margin:14px 0}
.math-summary table{border-collapse:collapse;width:100%;font-size:15.5px;line-height:1.75}
.math-summary td{border:1px solid var(--border);padding:10px 12px;min-width:90px;vertical-align:top}
.math-summary tr:first-child td{background:var(--surface-grouped);font-weight:600}
.book-figure{display:block;max-width:min(100%,380px);max-height:340px;width:auto;height:auto;object-fit:contain;margin:14px 0;cursor:zoom-in;background:white;border-radius:4px}
.exercise-stem{max-width:100%;overflow-x:auto;line-height:1.85}
.exercise-heading h3>.original-example-number{font-size:16px;min-width:auto;white-space:nowrap;background:none;color:var(--subject-color);padding:0 12px 0 0}
.math-exercise .exercise-heading{gap:8px}
.math-exercise .exercise-heading h3{min-width:0;flex-wrap:wrap;column-gap:8px;row-gap:2px}
.exercise-question-actions{display:flex;align-items:center;gap:4px;margin-left:auto;flex-shrink:0}
.exercise-question-actions .exercise-save-status{white-space:nowrap}
.exercise-copy-button.copied{color:var(--success)}
.exercise-option .option-letter{font-family:ui-monospace,monospace;flex:0 0 27px;width:27px;text-align:center}
.math-exercise .exercise-option{align-items:center;min-width:0;min-height:44px;padding:3px 12px;line-height:1.45}
.exercise-option>span:nth-child(2){display:block;min-width:0;overflow-x:auto;overflow-y:hidden;padding-block:6px;line-height:1.45;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.math-exercise .exercise-option>span:nth-child(2) :is(p,div){margin:0;line-height:inherit}
.math-exercise .exercise-option>span:nth-child(2) p+p{margin-top:3px}
.math-exercise .exercise-option>svg{margin-top:0;flex-shrink:0}
.exercise-option>span:nth-child(2) math{display:inline-block;vertical-align:middle;max-width:none}
.exercise-option>span:nth-child(2) math[display="block"]{display:block;width:max-content;min-width:100%;padding:0}
.exam-practice .exercise-option>span:nth-child(2):has(math){padding-block-end:10px}
.math-practice-hint,.math-related-practice,.math-question-note,.math-all-backups{margin:12px 0}
.math-practice-hint>summary,.math-related-practice>summary,.math-question-note>summary,.math-all-backups>summary{cursor:pointer;color:var(--text-secondary);font-size:14px;line-height:1.6;padding:5px 0}
.math-practice-hint p,.math-question-note p{font-size:14px;line-height:1.75;margin:8px 0}
.math-related-practice>summary>span{margin-left:8px;font-size:12px;color:var(--text-muted)}
.math-related-row{display:grid;grid-template-columns:84px 1fr;gap:5px 10px;text-align:left;width:100%;padding:11px 0;border-bottom:1px solid var(--border);font-size:14px;line-height:1.65}
.math-related-row b{font-weight:600;color:var(--subject-color)}
.math-related-row small{grid-column:2;color:var(--text-muted);font-size:12px}
.math-self-grade{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:14px 0 5px;font-size:14px;color:var(--text-secondary)}
.math-self-grade button,.exercise-choice-marks button{padding-inline:10px;border-radius:8px}
:is(.math-self-grade,.exercise-choice-marks) button[aria-pressed="true"]{background:var(--surface-selected)}
.math-self-grade .self-grade-correct{color:var(--success)}
.math-self-grade .self-grade-incorrect{color:var(--error)}
.math-self-grade .self-grade-review{color:var(--warning)}
.exercise-choice-marks{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.exercise-choice-marks .choice-unknown{color:var(--error)}
.exercise-choice-marks .choice-review,.attempt-history .choice-review,.exercise-feedback.choice-review{color:var(--warning)}
.exercise-choice-marks button:disabled{color:var(--text-muted)}
.exercise-feedback.choice-review{background:var(--warning-surface)}
.desktop-outline-toggle{display:none}
@media(min-width:721px){
  .app-header{padding-inline-start:8px}
  .header-left .desktop-outline-toggle{display:inline-flex}
  .app-body.outline-hidden{grid-template-columns:minmax(0,1fr)}
  .app-body.outline-hidden>.sidebar{display:none}
}
.standard-answer>div{font-size:16px;line-height:1.85;overflow-x:auto}
.standard-answer>div p{margin:9px 0}
.math-answer-content h4{font-size:15px;line-height:1.6;margin:16px 0 7px;color:var(--text-secondary)}
.math-answer-content>div:first-child h4{margin-top:5px}
.math-answer-hint{padding-bottom:10px;border-bottom:1px solid var(--border)}
.math-answer-note{margin-top:16px;padding:10px 13px;background:var(--warning-surface);border-radius:8px;font-size:14px}
.math-answer-content .math-derivation{margin:15px 0;max-width:100%;overflow-x:auto;text-align:left}
.math-derivation mtable[columnalign="right left"]>mtr>mtd:first-child{text-align:right}
.math-derivation mtable[columnalign="right left"]>mtr>mtd:nth-child(2),.math-derivation mtable[columnalign="left"]>mtr>mtd{text-align:left}
.math-extra-dialog{width:min(900px,calc(100vw - 28px));max-width:900px;max-height:88dvh;padding:22px}
.math-extra-dialog .exercise-card{margin:0;border:0;padding:10px 0}
.math-image-dialog{background:white;color:#20242b}
.math-large-image{max-width:100%;max-height:73dvh;display:block;object-fit:contain;margin:auto}
.word-tab{white-space:pre}
.question-search-results{padding:0 8px 12px 0}
.question-search-results h3{display:flex;align-items:center;justify-content:space-between;font-size:13px;color:var(--text-secondary);padding:10px 8px}
.question-search-results h3 span{font-weight:400}
.question-search-results>p{font-size:14px;color:var(--text-secondary);padding:12px 8px;line-height:1.6}
.question-search-result{display:block;text-align:left;width:100%;padding:12px 10px;border-radius:10px;border-bottom:1px solid var(--border)}
.question-search-result:hover,.question-search-result:focus-visible{background:var(--surface-selected)}
.question-search-result strong{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;line-height:1.6}
[data-subject="S"]{--question-ink:#127447}
[data-subject="X"]{--question-ink:#7030a0}
[data-subject="G"]{--question-ink:#185aa6}
:root[data-appearance="dark"] [data-subject="S"]{--question-ink:#9bd8b6}
:root[data-appearance="dark"] [data-subject="X"]{--question-ink:#d2b7ef}
:root[data-appearance="dark"] [data-subject="G"]{--question-ink:#a1c9fa}
.question-search-result strong,.wrongbook-question strong{color:var(--question-ink)}
.question-search-result small{font-size:12px;color:var(--text-muted);font-weight:400}
.question-search-result>span{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin-top:5px;font-size:13px;line-height:1.6;color:var(--text-secondary);overflow-wrap:anywhere}
.exercise-card.question-search-target{border-color:var(--subject-color)}
.exercise-card:focus{outline:none}
.exercise-card:focus-visible{outline:2px solid var(--subject-color);outline-offset:3px}
.wrongbook-dialog{width:1120px;max-width:calc(100vw - 32px);height:min(850px,calc(100dvh - 32px));padding:0;overflow:hidden}
.wrongbook-dialog[open]{display:flex;flex-direction:column}
.wrongbook-dialog>.dialog-heading{margin:0;padding:20px 22px 12px;border-bottom:1px solid var(--border);flex-shrink:0}
.wrongbook-dialog>.dialog-heading p{font-size:13px;color:var(--text-secondary);margin-top:6px;line-height:1.6}
.wrongbook-filters{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 22px;border-bottom:1px solid var(--border);flex-shrink:0}
.wrongbook-filters .segmented{flex-shrink:0}
.wrongbook-filters select{min-height:44px;padding:6px 10px;font-size:14px;border:1px solid var(--border);border-radius:10px;color:var(--text-primary);background:var(--surface)}
.wrongbook-search{flex:1;margin:0;min-width:170px;background:var(--surface-grouped)}
.wrongbook-body{display:grid;grid-template-columns:300px minmax(0,1fr);flex:1;min-height:0}
.wrongbook-list{min-height:0;overflow-y:auto;border-right:1px solid var(--border);padding:8px}
.wrongbook-row{border-bottom:1px solid var(--border);border-radius:10px;padding:4px 8px 6px}
.wrongbook-row.selected{background:var(--surface-selected)}
.wrongbook-question{display:block;text-align:left;width:100%;padding:10px 0 4px;overflow-wrap:anywhere}
.wrongbook-question strong,.wrongbook-question>span,.wrongbook-question>small{display:block;font-size:14px;line-height:1.7}
.wrongbook-question>span,.wrongbook-question>small{font-size:12px;color:var(--text-secondary)}
.wrongbook-question p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:1.7;color:var(--text-secondary);margin-top:5px}
.wrongbook-row-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--text-muted)}
.wrongbook-row-actions .text-button{display:flex;align-items:center;gap:5px;min-height:40px}
.wrongbook-row-actions small{font-size:12px}
.wrongbook-detail{min-width:0;overflow-y:auto;padding:16px 24px;overscroll-behavior:contain}
.wrongbook-detail[data-subject]{--subject-color:var(--question-ink)}
.wrongbook-mobile-back{display:none}
.wrongbook-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--text-secondary);font-size:13px;line-height:1.6;margin-bottom:12px}
.wrongbook-detail-heading>.text-button{display:flex;align-items:center;gap:5px;white-space:nowrap;min-height:44px}
.wrongbook-detail-heading>.wrongbook-back{display:none}
.wrongbook-reader .exercise-card{margin-top:0}
.wrongbook-placeholder{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;font-size:14px;color:var(--text-muted);text-align:center;line-height:1.8}
@media(max-width:720px){
  .learning-page .app-header{min-height:56px;padding:6px 8px;grid-template-rows:44px}
  .learning-page .app-header .header-metrics{display:none}
  .wrongbook-dialog{width:calc(100vw - 16px);max-width:none;height:calc(100dvh - 16px);max-height:none;border-radius:14px}
  .wrongbook-dialog>.dialog-heading{padding:12px 14px 8px}
  .wrongbook-dialog>.dialog-heading p{font-size:12px}
  .wrongbook-filters{padding:8px 12px;gap:8px}
  .wrongbook-filters .segmented{flex:1;display:flex}
  .wrongbook-filters .segmented button{flex:1;font-size:14px;white-space:nowrap}
  .wrongbook-filters select{max-width:115px;font-size:16px}
  .wrongbook-search{flex-basis:100%}
  .wrongbook-search input{font-size:16px}
  .wrongbook-body{display:block;overflow:hidden}
  .wrongbook-list{height:100%;border:0;padding:6px 12px}
  .wrongbook-detail{display:none;height:100%;padding:12px 14px}
  .wrongbook-body.has-selection .wrongbook-list{display:none}
  .wrongbook-body.has-selection .wrongbook-detail{display:block}
  .wrongbook-detail-heading{flex-wrap:wrap;gap:5px 12px}
  .wrongbook-detail-heading>.wrongbook-back{display:none}
  .wrongbook-detail-heading>span{order:2;width:100%}
  .wrongbook-dialog.has-selected-question>.wrongbook-filters,.wrongbook-dialog.has-selected-question>.dialog-heading p{display:none}
  .wrongbook-dialog.has-selected-question>.dialog-heading h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .wrongbook-mobile-back{display:flex;align-items:center;gap:7px;min-height:40px;font-size:15px}
  .wrongbook-dialog.has-selected-question>.dialog-heading{padding:6px 12px;min-height:56px}
}
@media(max-width:720px){.math-method-row>.point-select{font-size:13px}.math-summary{font-size:16px}.math-summary-heading h2{font-size:17px}.math-summary-heading.math-level-1 h2{font-size:19px}.math-extra-dialog{padding:16px}.math-related-row{grid-template-columns:70px 1fr}.exercise-heading h3>.original-example-number{font-size:15px;padding-right:9px}}
@media(max-width:720px){
  .subjects{gap:6px;padding-inline:8px}
  .subjects .subject{min-height:70px;gap:4px;padding:6px}
  .subjects .subject-top{flex-direction:column;align-items:flex-start;gap:1px}
  .subjects .subject-name,.subjects .solution-flow-entry{font-size:13px}
  .subjects .subject-name svg{display:none}
  .subjects .subject-top>strong,.subjects .subject-progress{font-size:12px}
  .subjects .subject-progress{display:block;white-space:nowrap}
}

/* Keep the question entry visible even when chapter methods are collapsed. */
.math-question-group-heading{grid-template-columns:minmax(0,1fr) 28px}
.math-question-links .math-method-row{padding-left:46px;grid-template-columns:minmax(0,1fr)}
.math-question-links .point-title{font-size:13px;color:var(--text-secondary)}
.chapter-question-area>h2{margin:32px 0 12px;font-size:22px}
.math-past-papers{margin-top:30px;border-top:1px solid var(--border);padding-top:18px}
.math-past-papers>h3{font-size:20px;margin:0 0 12px}
.past-paper-subsection{margin:24px 0 12px}
.past-paper-subsection>h4{font-size:16px;color:var(--lecture-ink);margin:0 0 12px}
.past-paper-method-link{font-size:14px;color:var(--subject-color);text-decoration:underline;text-underline-offset:3px}
.past-paper-empty{font-size:14px;line-height:1.7;color:var(--text-secondary)}

.exercise-toolbar>h3{display:flex;align-items:center;gap:10px;font-size:20px;margin:0}.exercise-toolbar>h3>span,.math-past-papers>h3>small{font-size:13px;font-weight:400;color:var(--text-secondary)}

.past-paper-cross-link{grid-template-columns:minmax(100px,150px) minmax(0,1fr)}

/* A worked solution is read in steps; alternative methods have their own start. */
.math-exercise .worked-solution{font-size:16px;line-height:1.8}
.math-exercise .worked-solution p{margin:9px 0;line-height:1.8}
.math-exercise .worked-solution strong{color:inherit}
.math-exercise .worked-solution h5{font-size:16px;font-weight:600;line-height:1.6;margin:20px 0 8px;color:var(--lesson-blue)}
.math-exercise .worked-solution .solution-method>:first-child{margin-top:8px}
.math-answer-content .worked-solution .solution-method-title{font-size:17px;font-weight:600;line-height:1.6;color:var(--lesson-purple);margin:8px 0 14px}
.worked-solution .solution-method+.solution-method{border-top:1px solid var(--border);margin-top:26px;padding-top:18px}
.worked-solution math[display="block"]{max-width:100%;overflow-x:auto;overflow-y:hidden;text-align:left;padding-block:7px;margin:8px 0;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.math-exercise .worked-solution li{margin:7px 0;line-height:1.8}
.exam-equation-scroll{display:block;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.exam-equation-scroll>math[display="block"]{width:max-content;min-width:100%;max-width:none;overflow:visible}

.past-paper-mark{display:inline-flex;align-items:center;gap:4px;padding-left:7px;border-radius:8px;color:var(--text-secondary);white-space:nowrap}
.past-paper-mark select{min-height:44px;padding:0 2px 0 0;border:0;border-radius:6px;color:inherit;background:var(--surface);font-size:15px;cursor:pointer}
.past-paper-mark select:disabled{cursor:default}
.exam-practice{width:1080px;height:min(840px,calc(100dvh - 32px));max-width:calc(100vw - 32px);max-height:none;padding:0;overflow:hidden}
.exam-practice[open]{display:flex;flex-direction:column}
.exam-practice-header{justify-content:space-between;flex-shrink:0;margin:0;padding:6px 14px;border-bottom:1px solid var(--border);gap:8px}
.exam-practice-header h2{flex:1}
.exam-year{min-height:44px;padding:4px 8px;border:1px solid var(--control-border);border-radius:9px;background:var(--surface-grouped);color:var(--text-primary);font-size:16px}
.exam-practice-body{display:grid;grid-template-columns:minmax(0,1fr);flex:1;min-height:0}
.exam-practice-body.with-sheet{grid-template-columns:225px minmax(0,1fr)}
.exam-navigator,.exam-practice-reader{min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.exam-navigator{background:var(--surface-grouped);border-right:1px solid var(--border);padding:16px 12px}
.exam-navigator-progress{display:flex;align-items:baseline;justify-content:space-between;gap:6px;font-size:13px;color:var(--text-secondary);white-space:nowrap}
.exam-navigator-progress strong{font-weight:600;color:var(--text-primary)}
.exam-section h3{margin:14px 0 6px;color:var(--text-secondary);font-size:13px;font-weight:500}
.exam-number-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.exam-number{position:relative;display:grid;place-items:center;min-width:0;min-height:40px;padding:0;border:1px solid var(--border);border-radius:8px;background:var(--surface);font-size:14px;font-variant-numeric:tabular-nums}
.exam-number:hover,.exam-number.answered{background:var(--surface-selected)}
.exam-number[aria-current]{border-color:var(--accent);color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);font-weight:700}
.exam-number-check,.exam-number-flag{position:absolute;right:2px;bottom:2px}
.exam-number-check{color:var(--success)}
.exam-number-flag{top:2px;bottom:auto}
.exam-practice-reader{padding:12px 23px 20px;--subject-color:var(--question-ink)}
.exam-practice-reader .exercise-card{padding-top:0}
.exam-practice-footer{display:flex;flex-shrink:0;align-items:center;justify-content:space-between;gap:8px;padding:0 19px;border-top:1px solid var(--border)}
.exam-practice-footer .text-button{min-width:70px}
.exam-practice-footer .text-button:disabled{opacity:.46}
.exam-practice-empty{display:grid;justify-items:center;align-content:center;gap:12px;flex:1;padding:20px;color:var(--text-secondary);text-align:center}
.exam-practice-empty p{margin:0}
.exam-practice-toast{position:absolute;bottom:52px;pointer-events:none}
.exam-session{display:flex;flex-direction:column;flex:1;min-height:0}
.exam-session[hidden]{display:none}
.exam-view-controls,.exam-actions,.exam-mode,.exam-filters,.exam-question-buttons,.exam-history{display:flex;align-items:center;gap:6px}
.exam-actions{margin-left:auto;justify-content:flex-end}
.exam-view-controls{flex-wrap:wrap}
.exam-practice .exam-year{min-height:38px;font-size:15px}
.exam-mode{gap:2px;padding:2px;border-radius:9px;background:var(--surface-grouped)}
.exam-mode button,.exam-filters button{min-height:34px;padding:4px 9px;border-radius:7px;white-space:nowrap;font-size:14px;color:var(--text-secondary)}
.exam-mode button[aria-pressed="true"],.exam-filters button[aria-pressed="true"]{background:var(--surface-selected);color:var(--text-primary);font-weight:600}
.exam-mode button:hover,.exam-filters button:hover{color:var(--text-primary)}
.exam-filters{margin-top:9px;gap:2px}
.exam-sheet-empty{font-size:14px;color:var(--text-secondary)}
.exam-count,.exam-result{font-size:13px;white-space:nowrap;color:var(--text-secondary)}
.exam-result b{font-variant-numeric:tabular-nums;color:var(--text-primary)}
.exam-countdown{font-size:16px;font-weight:650;font-variant-numeric:tabular-nums;padding:4px;white-space:nowrap}
.exam-submit{min-height:37px;padding:6px 11px;border-radius:8px;background:var(--accent);color:var(--on-accent);font-size:14px;font-weight:600;white-space:nowrap}
.exam-submit:hover:not(:disabled){background:var(--accent-hover)}
.exam-submit:disabled,.exam-toolbar-button:disabled{opacity:.5}
.exam-practice .exam-icon{height:38px;min-height:38px;width:38px}
.exam-toolbar-button.text-button{min-height:38px;padding-inline:5px;white-space:nowrap;font-size:14px}
.exam-status-banner{display:flex;align-items:center;gap:12px;flex-wrap:wrap;flex-shrink:0;background:var(--surface-grouped);padding:6px 12px;border-bottom:1px solid var(--border);font-size:14px}
.exam-status-banner .text-button{min-height:33px}
.exam-check-list{display:block}
.exam-check-list p{margin:0 0 5px}
.exam-check-list>div{display:flex;gap:5px;flex-wrap:wrap}
.exam-check-list .exam-number{min-width:35px;min-height:34px;padding-inline:4px}
.exam-confirm span{flex:1 1 180px}
.exam-practice-empty h2{font-size:21px;margin:0;color:var(--text-primary)}
.exam-practice-empty p{line-height:1.6}
.exam-practice-footer .exam-toggle-numbers{color:var(--text-primary);font-size:14px;white-space:nowrap}
.exam-mock-question .exercise-option.chosen:not(.correct):not(.incorrect){border-color:var(--accent);background:var(--surface-selected)}
.exam-question-buttons,.exam-history{flex-wrap:wrap;gap:6px 13px}
.exam-submitted-answer{display:grid;gap:5px;margin:12px 0;white-space:pre-wrap;overflow-wrap:anywhere}
.exam-submitted-answer strong{font-size:14px;color:var(--text-secondary)}
.exam-note,.exam-history{margin-top:12px;border-top:1px solid var(--border)}
.exam-note p{margin:0 0 8px;white-space:pre-wrap;overflow-wrap:anywhere}
.exam-note label{display:grid;gap:5px;margin-top:10px}
.exam-note textarea{width:100%;max-width:100%;padding:8px;border:1px solid var(--control-border);border-radius:8px;background:var(--surface);color:var(--text-primary);font:inherit;resize:vertical}
.exam-note label~button{display:inline-flex;margin-right:14px}
.exam-history{padding-top:8px;font-size:14px;color:var(--text-secondary)}
.exam-review-memory{margin-top:14px;padding:4px 11px 8px;border-left:3px solid var(--accent);background:var(--surface-grouped);border-radius:4px}
.exam-review-memory p{margin:4px 0!important}
.exam-review-links .text-button{min-height:36px;text-align:left;justify-content:flex-start}
.exam-lesson-reader{flex:1}
.exam-lesson-heading h2{flex:0 1 auto;text-align:right;font-size:17px}
.exam-lesson-heading .text-button{flex-shrink:0}
.exam-expanded-image{display:grid;justify-items:start;gap:6px;margin:10px 0}
.exam-expanded-image img{width:min(100%,520px);background:white}


@media(max-width:720px){
  .exam-practice{width:100%;max-width:none;height:100dvh;border-radius:0}
  .exam-practice-header{padding:4px 8px;gap:4px 6px;flex-wrap:wrap}
  .exam-view-controls,.exam-actions{gap:3px}
  .exam-practice .exam-year{font-size:16px}
  .exam-practice .exam-icon{min-height:40px;height:40px;width:39px}
  .exam-note textarea{font-size:16px}
  .exam-practice-body{display:flex;flex-direction:column}
  .exam-navigator{display:none;max-height:47dvh;flex-shrink:0;padding:9px 12px;border-right:0;border-bottom:1px solid var(--border)}
  .exam-navigator.expanded{display:block}
  .exam-number-grid{grid-template-columns:repeat(auto-fit,minmax(40px,1fr))}
  .exam-number{min-height:44px}
  .exam-practice-reader{flex:1;padding:8px 12px 14px}
  .exam-practice-footer{padding:0 12px env(safe-area-inset-bottom)}
  .math-exercise .exercise-heading:has(.past-paper-mark){flex-wrap:wrap;gap:0 8px}
  .math-exercise .exercise-heading:has(.past-paper-mark) h3{min-width:min(100%,190px)}
  .past-paper-mark select{font-size:16px}
}

@media(max-width:360px){
  .exam-view-controls .exam-year{padding-inline:6px}
  .exam-view-controls .exam-mode button{padding-inline:7px;font-size:13px}
  .exam-view-controls .appearance-switch{width:54px;min-width:54px;padding-inline:1px}
}
.flow-exercise-note{border-inline-start:3px solid var(--subject-color,var(--accent));padding:6px 12px;margin-bottom:12px;background:var(--surface-grouped);border-radius:0 8px 8px 0}
.flow-exercise-link{display:inline-flex;gap:8px;align-items:center}
.flow-exercise-link span{font-size:12px;color:var(--text-secondary)}
.solution-flow-dialog{width:1080px;height:min(810px,calc(100dvh - 24px));padding:0;overflow:hidden}
.solution-flow-dialog[open]{display:flex;flex-direction:column}
.solution-flow-dialog>.dialog-heading{padding:9px 16px;margin:0;border-bottom:1px solid var(--border)}
.solution-flow-status{padding:16px 0;color:var(--text-secondary)}
.solution-flow-dialog>.solution-flow-status{padding-inline:16px}
.solution-flow-toolbar{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 12px;border-bottom:1px solid var(--border)}
.solution-flow-subjects{display:flex;align-items:center;gap:3px;min-width:0}
.solution-flow-subjects button,.solution-flow-directory-toggle{min-height:40px;padding:4px 10px;border-radius:8px;color:var(--text-secondary);font-size:14px;white-space:nowrap}
.solution-flow-subjects [aria-pressed="true"]{background:var(--surface-selected);color:var(--accent);font-weight:600}
.solution-flow-directory-toggle{display:none}
.solution-flow-layout{display:grid;grid-template-columns:minmax(190px,24%) minmax(0,1fr);flex:1;min-height:0}
.solution-flow-directory,.solution-flow-body{min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.solution-flow-directory{padding:5px 7px 12px;border-inline-end:1px solid var(--border);background:var(--surface-grouped)}
.solution-flow-directory h3{margin:10px 7px 2px;color:var(--text-secondary);font-size:13px;line-height:1.4}
.solution-flow-directory ul{list-style:none;margin:0;padding:0}
.solution-flow-directory button{display:block;width:100%;min-height:36px;padding:6px 8px;border-radius:7px;text-align:left;line-height:1.45}
.solution-flow-directory button:hover,.solution-flow-directory button[aria-current]{background:var(--surface-selected);color:var(--accent)}
.solution-flow-directory button[aria-current]{font-weight:600}
.solution-flow-body{padding:14px 16px}
.solution-flow-content h3{margin:0 0 6px;font-size:20px}
.solution-flow-origin{color:var(--text-secondary);margin:0 0 8px}
.solution-flow-origin strong{color:var(--accent)}
.solution-flow-art{position:relative;max-width:100%;margin:0 auto}
.solution-flow-art img{width:100%;height:auto;display:block}
.solution-flow-desktop{padding:8px;background:white;border:1px solid var(--border);border-radius:8px}
.solution-flow-overlay{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.solution-flow-overlay rect{fill:#c18a1610;stroke:#a66a09;stroke-width:.58}
.solution-flow-mobile{display:none}
.solution-flow-examples{margin-top:16px}
.solution-flow-examples h4{margin:0 0 6px}
.solution-flow-examples h4 small{color:var(--text-secondary);font-weight:400}
.solution-flow-examples ul{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,255px),1fr));gap:6px}
.solution-flow-examples a{display:flex;align-items:center;gap:6px;min-height:44px;padding:6px 8px;background:var(--surface-grouped);border:1px solid transparent;border-radius:8px;color:var(--text-primary);text-decoration:none;line-height:1.4}
.solution-flow-examples a:hover,.solution-flow-examples a[aria-current]{border-color:var(--accent)}
.solution-flow-examples a strong,.solution-flow-examples a small,.solution-flow-examples a svg{flex:none}
.solution-flow-examples a small{color:var(--accent);font-size:11px}
.solution-flow-examples a svg{margin-left:auto;color:var(--text-secondary)}
.solution-flow-download{display:inline-flex;align-items:center;gap:6px;margin-top:10px}
@media(max-width:720px){
  .solution-flow-dialog>.dialog-heading{padding:5px 10px}
  .solution-flow-toolbar{padding:3px 6px}
  .solution-flow-subjects button,.solution-flow-directory-toggle{min-height:44px;padding-inline:5px;font-size:13px}
  .solution-flow-directory-toggle{display:inline-flex;align-items:center;gap:3px;color:var(--accent)}
  .solution-flow-directory-toggle[aria-expanded="true"] svg:last-child{transform:rotate(180deg)}
  .solution-flow-layout{display:flex;flex-direction:column}
  .solution-flow-directory{display:none;border-inline-end:0;border-bottom:1px solid var(--border)}
  .solution-flow-directory[data-expanded="true"]{display:block;flex:0 1 46%;max-height:46%}
  .solution-flow-directory button{min-height:42px}
  .solution-flow-body{flex:1;padding:12px}
  .solution-flow-desktop{display:none}
  .solution-flow-mobile{display:block}
  .flow-step-body{margin:0 0 5px;font-size:15px;line-height:1.55}
  .flow-step[data-kind="?"]>.flow-step-body{font-weight:600}
  .flow-step-children{margin-left:2px;padding-left:8px;border-left:2px solid var(--border)}
  .flow-branch{margin:5px 0;background:var(--surface-grouped);border-radius:7px}
  .flow-branch summary,.flow-full-art summary{padding:8px;min-height:40px;cursor:pointer}
  .flow-branch summary small{margin-inline-start:6px;color:var(--accent)}
  .flow-branch>.flow-step{padding:0 8px 6px}
  .flow-branch[data-selected]{box-shadow:inset 0 0 0 1px var(--accent)}
  .flow-result,.flow-warning{padding:8px 10px;margin:8px 0;line-height:1.55;border-radius:7px;background:var(--surface-grouped)}
  .flow-warning{background:var(--warning-surface);color:var(--warning)}
  .flow-image-scroll{max-width:100%;overflow-x:auto;background:white;border:1px solid var(--border);border-radius:8px}
  .flow-image-scroll .solution-flow-art{max-width:none}
}

/* Topic library */
.topic-library{min-height:100dvh;background:var(--background)}
.topic-topbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:14px;height:58px;padding:0 clamp(12px,3vw,40px);background:var(--surface);border-bottom:1px solid var(--border)}
.topic-topbar a,.topic-controls{display:inline-flex;align-items:center;gap:7px}
.topic-back{color:var(--text-secondary);font-size:.88rem;text-decoration:none;min-height:44px}
.topic-back:hover{color:var(--accent)}
.topic-topname{border-inline-start:1px solid var(--border);padding-inline-start:14px;font-weight:700}
.topic-controls{margin-inline-start:auto}
.topic-menu{display:none}
.topic-layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:clamp(24px,3vw,44px);max-width:1336px;margin:auto;padding:32px clamp(16px,3.5vw,44px) 64px}
.topic-directory{position:sticky;top:83px;max-height:calc(100dvh - 105px);align-self:start;overflow:auto;padding-right:14px;border-inline-end:1px solid var(--border)}
.topic-directory :is(h2,h3){color:var(--text-secondary);margin:4px 0 8px;padding-left:10px;font-size:.8rem;font-weight:650}
.topic-directory h3{margin-top:19px}
.topic-directory a{display:block;border-radius:7px;padding:8px 10px;color:var(--text-primary);text-decoration:none;font-size:.88rem}
.topic-directory a span{color:var(--text-secondary);display:inline-block;margin-right:3px;min-width:2.35em;font-variant-numeric:tabular-nums}
.topic-directory .topic-directory-topic{font-size:.98rem;font-weight:700}
.topic-directory a[aria-current],.topic-directory a:hover{background:var(--surface-selected)}
.topic-content{min-width:0}
.topic-content [id]{scroll-margin-top:76px}
.topic-content :is(h2,h3):focus{outline:none}
.topic-intro{margin-bottom:32px}
.topic-intro h1{font-size:clamp(1.7rem,4vw,2.5rem);margin:4px 0 9px;letter-spacing:-.04em;line-height:1.22}
.topic-intro p{margin:0;color:var(--text-secondary)}
.topic-intro .topic-subject{color:var(--success);font-size:.88rem;font-weight:650}
.topic-downloads{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.topic-downloads a,.topic-example-heading a{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:5px 11px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--accent);text-decoration:none;font-size:.88rem;white-space:nowrap}
.topic-downloads a:hover,.topic-example-heading a:hover{border-color:var(--accent)}
.topic-content h2{font-size:1.25rem;margin:0 0 14px}
.topic-map{border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:18px}
.topic-map-root{position:relative;margin:0 auto 23px;width:fit-content;padding:6px 14px;border-radius:8px;border:1px solid var(--success);background:var(--success-surface);color:var(--success);font-weight:700}
.topic-map-root::after{position:absolute;content:"";top:100%;left:50%;height:13px;border-left:1px solid var(--control-border)}
.topic-map ul{list-style:none;padding:0;margin:0}
.topic-map-tree{position:relative;display:grid;grid-template-columns:1.1fr .9fr 1fr;gap:12px}
.topic-map-tree::before{content:"";position:absolute;top:-10px;left:18.5%;right:16.7%;border-top:1px solid var(--control-border)}
.topic-map-lane{min-width:0}
.topic-map-lane>h3{position:relative;margin:0 0 8px;padding:6px 8px;border-radius:7px;text-align:center;background:var(--surface-selected);font-size:.95rem}
.topic-map-lane>h3::before{position:absolute;content:"";left:50%;bottom:100%;height:10px;border-left:1px solid var(--control-border)}
.topic-map-branch{padding:8px;margin-bottom:8px;text-align:center;border:1px solid var(--border);border-radius:8px}
.topic-map-branch h4{margin:0;font-size:.875rem}
.topic-map-branch>svg{display:block;margin:4px auto;color:var(--success)}
.topic-map-action p{margin:0;font-size:.84rem;line-height:1.52;color:var(--text-secondary)}
.topic-map-links{display:flex;justify-content:center;gap:4px;flex-wrap:wrap;margin-top:5px}
.topic-map-links a{display:inline-flex;align-items:center;min-height:35px;padding:0 9px;border-radius:6px;color:var(--accent);font-size:.83rem;text-underline-offset:3px}
.topic-map-links a:hover{background:var(--surface-selected)}
.topic-examples{margin-top:31px}
.topic-example{padding:13px 16px;margin:0 0 9px;background:var(--surface);border:1px solid var(--border);border-radius:10px}
.topic-example:target{border-color:var(--accent)}
.topic-example-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.topic-example-heading h3{margin:0;font-size:1.06rem}
.topic-example-heading h3 span{margin-right:.35em;color:var(--success);white-space:nowrap}
.topic-example summary{cursor:pointer;width:fit-content;padding:9px 0;color:var(--accent);font-size:.9rem}
.topic-solution-body{line-height:1.68;overflow-wrap:anywhere;max-width:760px}
.topic-solution-body h4{margin:17px 0 5px;color:var(--accent);font-size:1rem}
.topic-solution-body .topic-answer{border-inline-start:3px solid var(--success);background:var(--success-surface);padding:6px 12px;font-weight:600}
.topic-solution-body .topic-alternate{margin-top:20px;padding-top:12px;border-top:1px solid var(--border)}
.topic-solution-body .exam-equation-scroll{width:100%}
.topic-solution-body math{overflow-wrap:normal}
.topic-solution-body p:has(> .exam-equation-scroll:only-child){margin:0}
@media(max-width:840px){
  .topic-menu{display:inline-flex}
  .topic-layout{display:block;padding-top:20px}
  .topic-directory{display:none;position:static;padding:8px;margin-bottom:20px;border:1px solid var(--border);border-radius:10px;background:var(--surface);max-height:none}
  .topic-directory[data-open=true]{display:block}
}
@media(max-width:600px){
  .topic-topbar{gap:8px}.topic-topname{padding-inline-start:8px}
  .topic-layout{padding-inline:12px}.topic-map{padding:12px}
  .topic-map-tree{grid-template-columns:minmax(0,1fr);gap:10px}
  .topic-map-root{margin-bottom:12px}
  .topic-map-tree::before,.topic-map-lane:not(:first-child)>h3::before{display:none}
  .topic-map-lane>h3{margin-bottom:5px}
  .topic-map-branch{margin-bottom:5px}
  .topic-example{padding:9px 11px}.topic-example-heading a{font-size:.82rem;padding-inline:7px}
  .topic-map-links a{min-height:44px}.topic-example summary{min-height:44px}
}
.topic-header-entry{text-decoration:none;gap:5px;white-space:nowrap;font-size:.875rem}
.solution-flow-download + .solution-flow-download{margin-inline-start:14px}
@media(max-width:600px){.topic-header-entry span{display:none}}
.exam-trends-page{min-height:100dvh;background:var(--background);color:var(--text-primary)}
.exam-trends-header{background:var(--surface);border-bottom:1px solid var(--border)}
.exam-trends-header>div,.exam-trends-content{max-width:1120px;margin-inline:auto}
.exam-trends-header>div{display:flex;align-items:center;gap:10px;min-height:64px;padding:7px 22px}
.exam-trends-header a{text-decoration:none}
.exam-trends-header h1{flex:1;margin:0;font-size:clamp(1.2rem,3.2vw,1.55rem);line-height:1.3}
.exam-trends-content{padding:22px 22px 48px}
.exam-trends-subjects,.exam-trends-toggle{display:flex;gap:3px;padding:3px;border-radius:10px;background:var(--surface-grouped)}
.exam-trends-subjects{max-width:460px;margin-bottom:14px}
.exam-trends-subjects button,.exam-trends-toggle button{padding:5px 10px;border-radius:7px;color:var(--text-secondary);white-space:nowrap;font-weight:600}
.exam-trends-subjects button{flex:1;min-height:42px}
.exam-trends-toggle button{min-height:36px;font-size:.875rem}
.exam-trends-subjects button:hover,.exam-trends-toggle button:hover{background:var(--surface-selected)}
.exam-trends-subjects button[aria-pressed="true"]{background:var(--accent);color:var(--on-accent)}
.exam-trends-toggle button[aria-pressed="true"]{background:var(--surface);color:var(--text-primary);box-shadow:0 0 0 1px var(--border)}
.exam-trends-panel{padding:18px;background:var(--surface);border:1px solid var(--border);border-radius:14px}
.exam-trends-heading,.exam-trends-controls{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin-bottom:12px}
.exam-trends-heading h2{margin:0;font-size:1.12rem}
.exam-trends-heading p,.exam-trends-note{margin:4px 0 0;color:var(--text-secondary);font-size:.875rem}
.exam-trends-note{margin-top:12px}
.exam-trends-year{display:flex;align-items:center;gap:7px;color:var(--text-secondary);font-size:.875rem}
.exam-trends-year select{width:auto;min-height:38px;padding:4px 8px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text-primary)}
.exam-trends-table-scroll{overflow-x:auto;border:1px solid var(--border);border-radius:10px;scrollbar-width:thin}
.exam-trends-table-scroll table{width:100%;border-collapse:separate;border-spacing:0;font-size:.875rem;font-variant-numeric:tabular-nums}
.exam-trends-table-scroll th,.exam-trends-table-scroll td{padding:5px 6px;border-bottom:1px solid var(--border);text-align:center}
.exam-trends-table-scroll thead th,.exam-trends-table-scroll tfoot th,.exam-trends-table-scroll tfoot td{background:var(--surface-grouped);font-weight:650}
.exam-trends-table-scroll thead th{padding-block:9px;white-space:nowrap}
.exam-trends-table-scroll :is(tbody,tfoot):last-child tr:last-child>*{border-bottom:0}
.exam-trends-chapters{min-width:610px}
.exam-trends-chapters :is(th,td):not(:first-child){min-width:48px}
.exam-trends-chapters tr>:first-child{position:sticky;left:0;z-index:1;width:30%;min-width:145px;text-align:left;border-inline-end:1px solid var(--border)}
.exam-trends-chapters tbody th{background:var(--surface)}
.exam-trends-chapter{display:flex;align-items:baseline;gap:6px;width:100%;min-height:36px;padding:5px 3px;border-radius:6px;text-align:left;font-weight:600;line-height:1.35}
.exam-trends-chapter small{font-size:.75rem;font-weight:500;color:var(--text-secondary);white-space:nowrap}
.exam-trends-count,.exam-trends-aux{min-height:34px;min-width:34px;padding:3px 6px;border-radius:7px;font-weight:650}
.exam-trends-count,.exam-trends-main-tag{background:var(--surface-selected);color:var(--accent)}
.exam-trends-aux,.exam-trends-aux-tag{background:var(--surface-grouped);color:var(--text-secondary)}
.exam-trends-count:hover,.exam-trends-aux:hover,.exam-trends-chapter:hover{box-shadow:inset 0 0 0 1px var(--accent)}
.exam-trends-dash{color:var(--text-muted)}
.exam-trends-questions{min-width:488px}
.exam-trends-questions :is(th,td):nth-child(n+4){text-align:left;padding-inline:8px}
.exam-trends-questions :is(th,td):nth-child(-n+3){white-space:nowrap}
.exam-trends-related-chapter+.exam-trends-related-chapter{margin-top:5px}
.exam-trends-main-tag,.exam-trends-aux-tag{display:inline-block;padding:1px 4px;border-radius:4px;font-size:.75rem;font-weight:650}
.exam-trends-detail{width:min(560px,calc(100vw - 24px));padding:18px 20px}
.exam-trends-detail h3{margin:14px 0 6px;font-size:.9rem}
.exam-trends-detail ul{margin:0;padding:0;list-style:none}
.exam-trends-detail li{padding:6px 0 9px;border-bottom:1px solid var(--border)}
.exam-trends-detail li p{margin:2px 0 0;color:var(--text-secondary);font-size:.875rem}
.exam-trends-detail-row{display:flex;align-items:baseline;justify-content:space-between;gap:6px 14px;flex-wrap:wrap;color:var(--text-secondary);font-size:.875rem}
.exam-trends-detail a{display:inline-flex;align-items:center;gap:3px;min-height:32px;color:var(--accent);text-underline-offset:3px}
.exam-trends-detail .exam-trends-lesson-link{margin-top:10px}
@media(max-width:600px){
  .exam-trends-header>div{min-height:56px;padding-inline:10px}
  .exam-trends-content{padding:12px 8px 28px}
  .exam-trends-subjects{max-width:none;margin-bottom:10px}
  .exam-trends-panel{padding:10px 8px}
  .exam-trends-chapters tr>:first-child{width:136px;min-width:136px}
  .exam-trends-chapter{display:grid;gap:1px}
  .exam-trends-toggle button{padding-inline:7px}
}

/* Shared study-site controls. Lesson text, annotations and exam content keep their own styles. */
.study-toolbar {
  --toolbar-control: 36px;
  --toolbar-gap: 6px;
  --toolbar-radius: 8px;
  align-items: center;
  gap: var(--toolbar-gap);
}
.study-toolbar :is(.icon-button, .settings-button) {
  min-width: var(--toolbar-control);
  min-height: var(--toolbar-control);
  height: var(--toolbar-control);
  width: auto;
  padding: 0 9px;
  border-radius: var(--toolbar-radius);
}
.study-toolbar :is(.icon-button, .settings-button) > svg { width: 18px; height: 18px; }
.study-toolbar :is(.icon-button, .settings-button, .appearance-switch, .brand-toggle):focus-visible,
.settings-row:focus-visible { outline: 2px solid var(--success); outline-offset: 2px; }
.study-toolbar .appearance-switch { height: var(--toolbar-control); border-radius: var(--toolbar-radius); }
.study-toolbar :is(h1, h2, .topic-topname, .brand-toggle, .brand-mark) {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}
.study-toolbar .brand-mark { color: var(--success); }
.study-toolbar :is(.brand-group, .header-right, .topic-controls, .exam-actions) { gap: var(--toolbar-gap); }
.app-header.study-toolbar { min-height: 54px; padding-block: 8px; }
.study-toolbar .brand-toggle { min-height: var(--toolbar-control); gap: var(--toolbar-gap); border-radius: var(--toolbar-radius); }
.study-toolbar .brand-divider { height: 16px; }
.topic-topbar.study-toolbar { min-height: 54px; height: auto; padding-block: 8px; }
.topic-topbar.study-toolbar .topic-topname { padding: 0; border: 0; margin: 0; }
.topic-topbar .topic-back.icon-button { color: var(--text-secondary); }
.exam-trends-header > .study-toolbar { min-height: 54px; padding-block: 8px; }
.exam-practice-header.study-toolbar { min-height: 52px; padding-block: 7px; }
.exam-practice-header.study-toolbar .exam-practice-title { flex: none; white-space: nowrap; }
.exam-practice-header.study-toolbar .exam-view-controls { margin-inline-start: 6px; }
.exam-lesson-heading.study-toolbar h2 { flex: 1; text-align: start; }
.settings-dialog { padding: 16px 18px 20px; }
.settings-dialog > .study-toolbar { justify-content: flex-start; margin-bottom: 12px; }
.settings-section + .settings-section { margin-top: 16px; }
.settings-section h3 { font-size: 14px; margin-bottom: 8px; }
.settings-section p { font-size: 14px; margin-bottom: 8px; }
.settings-dialog .settings-row { gap: 8px; min-height: 40px; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.settings-dialog a.settings-row { color: var(--text-primary); }
.settings-row:not(:disabled):hover { background: var(--surface-selected); }
.settings-row:active:not(:disabled) { background: var(--surface-selected-hover); }
.settings-row + .settings-row { margin-top: 6px; }

.study-icp { display: none; }
:root[data-show-icp] { --study-icp-height: calc(28px + env(safe-area-inset-bottom)); }
:root[data-show-icp] .study-icp {
  display: grid;
  min-height: var(--study-icp-height);
  place-items: center;
  padding: 2px 10px env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.study-icp a { color: var(--text-secondary); text-underline-offset: 3px; }
.study-icp a:hover { color: var(--success); }
:root[data-show-icp] .app-shell { height: calc(100dvh - var(--study-icp-height)); }
:root[data-show-icp] :is(.page, .topic-library, .exam-trends-page) { min-height: calc(100dvh - var(--study-icp-height)); }
:root[data-show-icp] .login-page { position: relative; padding-bottom: calc(24px + var(--study-icp-height)); }
:root[data-show-icp] .login-page .study-icp { position: absolute; inset: auto 0 0; }

@media(max-width:720px) {
  .app-header.study-toolbar,
  .learning-page .app-header.study-toolbar,
  .topic-topbar.study-toolbar,
  .exam-trends-header > .study-toolbar,
  .exam-practice-header.study-toolbar { padding-inline: 10px; }
  .learning-page .app-header.study-toolbar { grid-template-rows: 36px; }
  .app-header.study-toolbar .brand-toggle { gap: 4px; }
  .app-header.study-toolbar .header-right { gap: 6px; }
  .study-toolbar .topic-header-entry { padding-inline: 9px; }
  .exam-session > .exam-practice-header.study-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .exam-practice-header.study-toolbar .exam-actions { grid-area: 1 / 3; }
  .exam-practice-header.study-toolbar .exam-view-controls { grid-column: 1 / -1; margin-inline-start: 0; }
  .exam-view-controls .exam-count { margin-inline-start: 2px; }
}
@media(max-width:360px) {
  .app-header.study-toolbar .sync-status { max-width: 16px; overflow: hidden; }
  .app-header.study-toolbar .brand-toggle > span { font-size: 14px; }
  .app-header.study-toolbar .brand-toggle { gap: 3px; }
  .app-header.study-toolbar .appearance-switch { width: 54px; min-width: 54px; padding-inline: 1px; }
}
.login-page{min-height:100dvh;display:flex;align-items:center;justify-content:center;background:var(--background);padding:24px}
.login-card{width:100%;max-width:380px;background:var(--surface);border-radius:18px;padding:32px}
.login-description{color:var(--text-secondary);font-size:15px;margin:10px 0 28px}
.login-card .field{margin-bottom:20px}.login-card .field input{font-size:16px}
.login-card form>.button{width:100%;margin-top:4px}
#login-status{font-size:15px;line-height:1.5;color:var(--error);margin:0 0 16px}#login-status:empty{display:none}
.connection-error{max-width:420px;margin:15dvh auto;padding:24px;font-size:16px}
