/* The only palette source for home, IELTS practice and word dictation. */
:root {
  color-scheme: light;
  --ui-bg: #f5f8f5;
  --ui-surface: #fcfdfb;
  --ui-input: #f8fbf6;
  --ui-sidebar: #eaf1eb;
  --ui-text: #263e30;
  --ui-muted: #586b5b;
  --ui-accent: #2f6d50;
  --ui-accent-hover: #24583f;
  --ui-on-accent: #ffffff;
  --ui-soft: #e4eee4;
  --ui-selected: #d6e7d7;
  --ui-line: #c4d1c3;
  --ui-border-strong: #8da78e;
  --ui-focus: #367456;
  --ui-track: #dde6d9;
  --ui-success: #256b42;
  --ui-success-bg: #e5f2e8;
  --ui-error: #9c422f;
  --ui-error-bg: #f5e7e1;
  --ui-warning: #79571e;
  --ui-warning-bg: #f4eddb;
  --ui-highlight: #ffe28a;
  --ui-highlight-text: #263e30;
  --ui-shadow: #263e3007;
  --ui-review-note: #153b50;
  --ui-review-note-bg: #e4f4fa;
  --ui-review-note-line: #31758e;
  --ink: var(--ui-text); --muted: var(--ui-muted); --accent: var(--ui-accent);
  --green: var(--ui-accent); --line: var(--ui-line); --bg: var(--ui-bg);
  --surface: var(--ui-surface); --amber: var(--ui-warning); --blue: var(--ui-accent);
  --cherry: var(--ui-accent); --cherry-deep: var(--ui-accent-hover);
  --cosmos: var(--ui-soft); --cosmos-ink: var(--ui-text);
  color: var(--ui-text); background: var(--ui-bg);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ui-bg: #282828;
  --ui-surface: #333333;
  --ui-input: #2d2d2d;
  --ui-sidebar: #2b2b2b;
  --ui-text: #ededed;
  --ui-muted: #c0c0c0;
  --ui-accent: #bdc68e;
  --ui-accent-hover: #cdd5a2;
  --ui-on-accent: #202020;
  --ui-soft: #393939;
  --ui-selected: #454545;
  --ui-line: #555555;
  --ui-border-strong: #898989;
  --ui-focus: #d0d9a2;
  --ui-track: #454545;
  --ui-success: #a7e4b8;
  --ui-success-bg: #203c2a;
  --ui-error: #efb6a6;
  --ui-error-bg: #48332e;
  --ui-warning: #e0c58a;
  --ui-warning-bg: #403923;
  --ui-highlight: #ffeb00;
  --ui-highlight-text: #171717;
  --ui-shadow: #00000012;
  --ui-review-note: #e6f5ff;
  --ui-review-note-bg: #203946;
  --ui-review-note-line: #75b9d1;
}
body { color: var(--ui-text); background: var(--ui-bg); }
[hidden] { display: none!important; }
::selection { background: var(--ui-highlight); color: var(--ui-highlight-text); }
input,textarea { caret-color: var(--ui-accent); }
input[type="checkbox"],input[type="radio"],input[type="range"] { accent-color: var(--ui-accent); }
:where(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 3px; }
* { scrollbar-color: var(--ui-border-strong) var(--ui-bg); }
::-webkit-scrollbar-track { background: var(--ui-bg); }
::-webkit-scrollbar-thumb { background: var(--ui-border-strong); border-color: var(--ui-bg); }
.hub-navigation { background: var(--ui-surface); color: var(--ui-text); border-color: var(--ui-line); }
.hub-navigation nav { margin-left: auto; }
.theme-switch { display: flex; align-items: center; flex: 0 0 auto; gap: 2px; padding: 3px; border: 1px solid var(--ui-line); border-radius: 9px; background: var(--ui-bg); }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ui-muted); font: 600 12px/1.3 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif; white-space: nowrap; cursor: pointer; }
.theme-switch button:hover { background: var(--ui-soft); filter: none; }
.theme-switch button[aria-pressed="true"] { background: var(--ui-selected); border-color: var(--ui-border-strong); color: var(--ui-text); }
.theme-swatch { width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--ui-border-strong); }
.theme-swatch.light { background: #e4eee4; }
.theme-swatch.dark { background: #454545; }
.primary,.hub-submit,.sound,.play,.book-cover { background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-on-accent); }
.primary:hover:not(:disabled),.hub-submit:hover:not(:disabled),.play:hover:not(:disabled) { background: var(--ui-accent-hover); border-color: var(--ui-accent-hover); color: var(--ui-on-accent); filter: none; }
.sidebar,.student-head { background: var(--ui-sidebar); color: var(--ui-text); border-color: var(--ui-line); }
.sidebar .brand,.sidebar .brand small,.sidebar .nav button,.student-head .brand,.student-head .brand small { color: var(--ui-text); }
.sidebar .nav button.active,.sidebar .nav button:hover { background: var(--ui-selected); color: var(--ui-text); }
.sidebar-foot { color: var(--ui-muted); }
.student-head .link { color: var(--ui-accent); }
.task,.preview-banner { background: var(--ui-soft); border-color: var(--ui-line); color: var(--ui-text); }
.preview-banner .btn { color: var(--ui-text); }
.book-cover-brand,.book-cover-foot { color: var(--ui-on-accent); }
.tag,.badge,.avatar,.blank-number { background: var(--ui-soft); color: var(--ui-text); }
.tag.warn,.badge.amber,.notice.amber { background: var(--ui-warning-bg); color: var(--ui-warning); border-color: var(--ui-line); }
.error,.danger,.hub-login .hub-error { color: var(--ui-error); }
.feedback,.feedback.ok { background: var(--ui-soft); color: var(--ui-text); border-color: var(--ui-line); }
.feedback s { color: var(--ui-error); }
.choice-row:has(input:checked) { background: var(--ui-selected); border-color: var(--ui-accent); }
.player { background: var(--ui-soft); }
.source-sheet { color: var(--ui-text); }
.source-sheet img { background: #f7f8f4; padding: 8px; border-radius: 4px; }
html[data-theme="dark"] .source-sheet img { opacity: .88; }
#toast,#hub-notice { background: var(--ui-accent); color: var(--ui-on-accent); }
.hub-card.words .hub-icon,.hub-icon { background: var(--ui-soft); color: var(--ui-accent); }
.hub-eyebrow { display: none; }
@media(max-width:1120px) {
  .hub-navigation { gap: 10px 18px; }
  .hub-navigation nav { order: 3; flex: 1 1 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hub-navigation nav a { text-align: center; }
  .theme-switch { margin-left: auto; }
  .hub-preview-controls { order: 4; margin-left: auto; }
}
@media(max-width:480px) {
  .hub-navigation { padding: 10px 14px; gap: 8px; }
  .hub-home-link { font-size: 19px; }
  .hub-home-link span { display: block; font-size: 12px; }
  .theme-switch button { padding: 8px; font-size: 11px; gap: 5px; }
  .theme-swatch { width: 11px; height: 11px; }
  .theme-switch { padding: 2px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition: none!important; scroll-behavior: auto!important; } }
@media print {
  :root { color-scheme: light; --ui-bg: #fff; --ui-surface: #fff; --ui-text: #263e30; --ui-muted: #586b5b; --ui-accent: #2f6d50; --ui-on-accent: #fff; --ui-line: #c4d1c3; }
  .hub-navigation,.theme-switch { display: none!important; }
}

/* Both teaching modules use a left navigation and a single main task area. */
.shell { grid-template-columns: 200px minmax(0,1fr); }
.sidebar { padding: 28px 18px; }
.sidebar .brand { font: 28px/1.15 Georgia,serif; text-decoration: none; }
.sidebar .nav button { min-height: 48px; font-size: 14px; }
.sidebar .nav a { color: var(--ui-text); }
.topbar { height: auto; min-height: 68px; padding: 14px 30px; }
.main h1 { font-size: 28px; }
.assignment-box { position: static; max-width: 880px; padding: 26px; }
.assignment-box .count { color: var(--ui-text); margin: 16px 0; }
.assignment-box .count small { font: 14px -apple-system,BlinkMacSystemFont,sans-serif; color: var(--ui-muted); }
.assignment-chosen { max-height: 240px!important; border-block: 1px solid var(--ui-line); padding: 12px 0; margin-bottom: 20px; }
.assignment-chosen .row + .row { margin-top: 8px; }
.assignment-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.assignment-fields label { font-size: 14px; color: var(--ui-text); }
.assignment-fields label:first-child { grid-column: 1/-1; }
.assignment-fields input,.assignment-fields select { display: block; margin-top: 8px; min-height: 46px; font-size: 15px; }
.assignment-people { margin: 22px 0; }
.assignment-people summary { min-height: 44px; padding: 10px 0; font-size: 14px; cursor: pointer; }
.assignment-people .student-list { max-height: 250px; }
.assignment-people .student-list label { font-size: 14px; min-height: 36px; color: var(--ui-text); }
.assignment-actions .btn { width: auto; margin-top: 8px; min-height: 46px; font-size: 14px; }
.roster-tabs { margin-top: 0; }
.roster-tabs button,.import-methods button { min-height: 46px; padding-inline: 14px; }
.roster-filters input { flex: 1; max-width: 340px; }
.roster-filters select { min-width: 180px; }
.roster-assignment h2 { margin: 0; font-size: 19px; }
.roster-assignment-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.roster-assignment-fields label { margin: 0; flex: 1; min-width: 190px; font-size: 14px; }
.roster-assignment-fields label input,.roster-assignment-fields label select { display: block; width: 100%; margin-top: 7px; }
.roster-assignment-fields>.btn,.roster-assignment-fields>.link { flex: 0 0 auto; }
.roster-select-all,.roster-person { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; }
.roster-select-all input,.roster-person input { flex: 0 0 20px; }
.roster-person small { display: block; font-weight: 400; color: var(--ui-muted); }
.roster-import { max-width: 880px; }
.roster-import textarea { min-height: 210px; font-weight: 400; }
.roster-preview-list { max-height: 280px; overflow: auto; margin-top: 12px; }
.roster-import #recognition-status:empty { display: none; }
.roster-panel th:first-child { width: 70px; }
@media(max-width:980px) {
  .shell { display: block; }
  .sidebar { display: flex; position: static; height: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--ui-line); }
  .sidebar>.brand,.sidebar-foot { display: none!important; }
  .sidebar .nav { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; }
  .sidebar .nav button { white-space: nowrap; flex: 0 0 auto; padding: 10px 13px; min-height: 44px; font-size: 13px; }
  .mobile-nav { display: none; }
}
@media(max-width:700px) {
  .main h1 { font-size: 25px; }
  .topbar { padding: 12px 17px; min-height: 60px; }
  .assignment-box { padding: 20px; }
  .assignment-fields { grid-template-columns: 1fr; }
  .assignment-actions { align-items: stretch; }
  .assignment-actions .btn { width: 100%; }
  .roster-assignment-fields { display: grid; grid-template-columns: minmax(0,1fr); }
  .roster-assignment-fields label { min-width: 0; }
  .roster-filters input { max-width: none; }
  .roster-filters>* { min-width: 0; }
  .roster-select-all { font-size: 12px; }
  .import-methods { gap: 5px; }
  .import-methods button { padding-inline: 10px; font-size: 13px; }
  .student-card .row { gap: 5px; margin-top: 12px; }
}

.roster-select-all{min-height:44px}.assignment-chosen{font-size:14px!important}.assignment-people .student-list label{min-height:44px}

.roster-batch-shortcut{display:none}.roster-tabs{margin-top:8px}.roster-tabs~.roster-filters{margin-top:0}
@media(max-width:700px){.roster-filters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.roster-filters input{grid-column:1/-1;width:100%;min-width:0}.roster-filters select{width:100%;min-width:0;font-size:14px}.roster-filters .btn{white-space:nowrap;padding-inline:10px;font-size:13px}.main:has(.roster-tabs)>.title{margin-bottom:10px}.roster-tabs{margin-bottom:22px}.roster-batch-shortcut{position:fixed;bottom:max(12px,env(safe-area-inset-bottom));left:16px;right:16px;z-index:8;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border:1px solid var(--ui-border-strong);border-radius:10px;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 6px 18px var(--ui-shadow);font-size:14px}.roster-shortcut .btn{min-height:44px}.roster-panel{margin-bottom:90px}}

/* Shared teaching type scale. Keep browser zoom and comfortable touch targets. */
:root {
  --type-body: .9375rem;
  --type-title: 1.375rem;
  --type-section: 1.125rem;
  --type-label: .8125rem;
  --type-reading: 1rem;
  --type-word: 1.5rem;
  --type-score: 1.75rem;
}
body { font-size: var(--type-body); }
h1,.main h1,.title h1,.student-main h1,.practice h1,.esl-question h1 { font-size: var(--type-title); line-height: 1.4; letter-spacing: -.02em; text-wrap: balance; }
h2,.panel h2,.book-description h2,.esl-workbook h2,.esl-feedback h2 { font-size: var(--type-section); line-height: 1.5; }
h3 { font-size: 1rem; line-height: 1.5; }
button,input,select,textarea { font-size: var(--type-body); }
.btn,.nav button,.sidebar .nav button,.esl-nav a { font-size: .875rem; }
input:not([type=checkbox]):not([type=radio]),textarea { font-size: var(--type-reading); }
.small,small,.esl-meta { font-size: var(--type-label); }
.hub-hero h1,.hub-login-intro h1 { font-size: 1.875rem; line-height: 1.3; }
.hub-card h2 { font-size: 1.25rem; }
.hub-login h2 { font-size: var(--type-section); }
.sidebar .brand { font-size: 1.5rem; }
.student-head .brand { font-size: 1.5rem; }
.task h2 { font-size: 1.25rem; line-height: 1.5; }
.listen h2 { font-size: var(--type-section); }
.esl-term { font-size: var(--type-word); margin: 18px 0; line-height: 1.5; }
.esl-sentence,.esl-feedback .reference,.correct { font-size: 1.0625rem; line-height: 1.7; }
.esl-question input[type=text] { font-size: var(--type-reading); }
.choice-row { font-size: var(--type-body); }
.esl-scoreline { font-size: 1.25rem; }
.exam-score strong,.stat strong,.class-status strong { font-size: var(--type-score); }
.exam-score small,.class-status strong span { font-size: 1.125rem; }
.score { font-size: 2rem; }
.score small { font-size: 1rem; }
.source-sheet { font-size: .9375rem; line-height: 1.5; }
.source-sheet table { font-size: .875rem; }
.source-sheet .inline-answer { font-size: 1rem!important; }
.reference { font-size: var(--type-reading); }
.inline-analysis h2 { font-size: 1rem; }
.inline-analysis .phrase,.analysis .phrase,.analysis .grammar p { font-size: var(--type-body); line-height: 1.5; }
.book-entry { gap: 28px; padding: 20px 0; align-items: flex-start; }
.book-cover { width: 136px; min-height: 180px; padding: 16px; gap: 12px; }
.book-cover-title { font-size: 1.25rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.book-cover-brand { font-size: .625rem; }
.book-cover-foot { font-size: .5625rem; }
.book-description { min-width: 0; }
.book-description h2 { margin: 0 0 10px; overflow-wrap: anywhere; }
.book-description p { margin-bottom: 12px; }
.book-description .row { margin-top: 14px; }
.book-name-editor { margin-top: 12px; max-width: 620px; }
.book-name-editor summary { cursor: pointer; color: var(--ui-accent); min-height: 44px; display: list-item; padding: 10px 0; font-size: .875rem; text-underline-offset: 4px; }
.book-name-editor[open] { padding-bottom: 12px; }
.book-name-editor label { font-size: .875rem; margin-top: 6px; }
.book-name-editor input { width: 100%; }
.book-name-editor .error { margin: 8px 0; }
.esl-practice { padding-top: 24px; }
.esl-question { padding: 22px 0; }
.esl-topline { margin-bottom: 18px; }
.esl-study td:first-child strong { font-size: 1rem; }
.esl-nav a,.sidebar-foot,.topbar { overflow-wrap: anywhere; }
@media(max-width:700px) {
  .main h1,.title h1,.student-main h1,.practice h1,.esl-question h1 { font-size: 1.25rem; }
  .hub-hero h1,.hub-login-intro h1 { font-size: 1.625rem; }
  .esl-term { font-size: 1.375rem; }
  .esl-sentence { font-size: 1rem; }
  .book-entry { flex-direction: row; gap: 18px; }
  .book-cover { width: 96px; min-height: 146px; padding: 12px; border-radius: 3px 10px 10px 3px; }
  .book-cover-title { font-size: 1.0625rem; }
  .book-cover-brand { font-size: .5625rem; }
  .book-cover-foot { display: none; }
  .book-description { flex: 1; }
  .book-description h2 { font-size: 1.0625rem; }
  .book-description>.row { flex-direction: column; align-items: stretch; gap: 8px; }
  .book-name-editor form>.row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .book-name-editor .btn { padding-inline: 10px; }
  input:not([type=checkbox]):not([type=radio]),select,textarea { font-size: 1rem; }
  .esl-study td:first-child strong { font-size: 1.125rem; }
}
@media(max-width:380px) { .book-cover { width: 80px; min-height: 130px; padding: 10px; } .book-entry { gap: 14px; } }
