/* Theme switcher: shared controls and the high-contrast daylight palette. */
.theme-toggle {
  width:100%; display:flex; align-items:center; gap:10px; margin:0 0 15px; padding:9px 10px;
  border:1px solid var(--border); border-radius:11px; color:var(--text-primary);
  background:rgba(255,255,255,.035); font:inherit; text-align:left; cursor:pointer;
  transition:background .2s ease,border-color .2s ease,transform .2s ease;
}
.theme-toggle:hover { border-color:var(--border-hover); background:rgba(255,255,255,.065); transform:translateY(-1px); }
.theme-toggle>.material-icons { width:32px; height:32px; display:grid; place-items:center; flex:none; border-radius:9px; color:var(--warning); background:rgba(213,174,82,.1); font-size:19px; }
.theme-toggle-copy { min-width:0; }
.theme-toggle-copy b,.theme-toggle-copy small { display:block; }
.theme-toggle-copy b { font-size:.75rem; }
.theme-toggle-copy small { overflow:hidden; margin-top:2px; color:var(--text-muted); font-size:.58rem; text-overflow:ellipsis; white-space:nowrap; }

:root[data-theme="light"] {
  color-scheme:only light;
  --bg-primary:#f7f8f5 !important;
  --bg-secondary:#edf1ed !important;
  --bg-card:#ffffff !important;
  --bg-card-hover:#f2f6f3 !important;
  --bg-lighter:#e4ebe7 !important;
  --bg-dark:#d3ddd7 !important;
  --text-primary:#1f2925 !important;
  --text-secondary:#52615b !important;
  --text-muted:#718079 !important;
  --accent:#b5652a !important;
  --accent-2:#c87535 !important;
  --accent-3:#b5652a !important;
  --success:#287a50 !important;
  --danger:#b84e49 !important;
  --warning:#a9672e !important;
  --border:#d8e1dc !important;
  --border-hover:#d8a06e !important;
  --shadow:0 8px 24px rgba(31,41,37,.09);
  --workshop-charcoal:#ffffff;
  --workshop-dark:#f1f5f9;
}

html[data-theme="light"] body {
  color:var(--text-primary);
  background-color:var(--bg-primary) !important;
  background-image:none!important;
}
html[data-theme="light"] body::before { display:none; background:none; }
html[data-theme="light"] .sidebar { background:rgba(255,255,255,.97) !important; border-right-color:rgba(23,51,45,.12); box-shadow:8px 0 30px rgba(25,66,57,.07); }
html[data-theme="light"] .sidebar-brand,html[data-theme="light"] .sidebar-footer { border-color:rgba(23,51,45,.11); }
html[data-theme="light"] .sidebar-logo-name { color:#17332d!important; }
html[data-theme="light"] .sidebar-logo-sub,html[data-theme="light"] .sidebar-section-label { color:#71857f!important; }
html[data-theme="light"] .sidebar-link { color:#4d655f!important; }
html[data-theme="light"] .sidebar-logo-icon { color:#fff!important; background:#0369a1!important; box-shadow:3px 3px 0 rgba(3,105,161,.14)!important; }
html[data-theme="light"] .sidebar-link:hover { color:#172033!important; background:#f1f5f9!important; border-color:#e2e8f0!important; }
html[data-theme="light"] .sidebar-link.active { color:#075985!important; background:#e0f2fe!important; border-color:#bae6fd!important; }
html[data-theme="light"] .sidebar-link.active::before { background:#0284c7!important; box-shadow:none!important; }
html[data-theme="light"] .sidebar-link-icon,html[data-theme="light"] .sidebar-stat { background:rgba(15,118,110,.045); border-color:rgba(15,118,110,.08); }
html[data-theme="light"] .sidebar-link-icon { color:inherit!important; background:#f1f5f9!important; }
html[data-theme="light"] .sidebar-link.active .sidebar-link-icon { color:#0369a1!important; background:#bae6fd!important; box-shadow:none!important; }
html[data-theme="light"] .sidebar-link-badge { color:#fff!important; background:#e76443!important; }
html[data-theme="light"] .vocab-tools-header { background:linear-gradient(125deg,#fff,#f0f9ff); border-color:#dbe4ee; box-shadow:0 7px 22px rgba(15,23,42,.055); }
html[data-theme="light"] .vocab-tools-total { background:#fff; border-color:#dbe4ee; }
html[data-theme="light"] .vocab-topic-card { color:#0f172a; background:#fff; border-color:#dbe4ee; box-shadow:0 5px 18px rgba(15,23,42,.055); }
html[data-theme="light"] .vocab-topic-card.recommended { border-color:#f59e0b; background:#fff; }
html[data-theme="light"] .vocab-topic-number { color:#92400e; background:#fffbeb; border-color:#fde68a; }
html[data-theme="light"] .vocab-topic-progress i { background:#e2e8f0; }
html[data-theme="light"] .vocab-topic-actions button,html[data-theme="light"] .vocab-topic-actions label { color:#475569; background:#f8fafc; border-color:#dbe4ee; }
html[data-theme="light"] .vocab-topic-actions select { color:#0f172a; }
html[data-theme="light"] .vocab-topic-listen { color:#075985!important; background:#f0f9ff!important; border-color:#bae6fd!important; }
html[data-theme="light"] .vocab-topic-write { color:#166534!important; background:#f0fdf4!important; border-color:#bbf7d0!important; }
html[data-theme="light"] .vocab-topic-quiz { color:#92400e!important; background:#fffbeb!important; border-color:#fde68a!important; }
html[data-theme="light"] .theme-toggle { background:#f8fafc; border-color:#dbe4ee; box-shadow:none; }
html[data-theme="light"] .theme-toggle>.material-icons { color:#0369a1; background:#e0f2fe; }
html[data-theme="light"] .sidebar-toggle { color:#075e58; background:rgba(255,255,255,.97); border-color:rgba(15,118,110,.25); }

html[data-theme="light"] .page,html[data-theme="light"] .passport-dashboard { background-color:transparent; }
html[data-theme="light"] .card { color:var(--text-primary); background:#ffffff; box-shadow:0 6px 20px rgba(15,23,42,.07); }
html[data-theme="light"] .card:hover { border-color:rgba(15,118,110,.28); }
html[data-theme="light"] .btn { background:rgba(255,255,255,.9); }
html[data-theme="light"] .btn:hover { background:#f2fbf9; border-color:rgba(15,118,110,.38); }
html[data-theme="light"] .btn-primary { color:#fff; background:#0369a1; box-shadow:0 4px 13px rgba(3,105,161,.2); }
html[data-theme="light"] input[type="text"],html[data-theme="light"] input[type="number"],html[data-theme="light"] input[type="date"],html[data-theme="light"] input[type="email"],html[data-theme="light"] input[type="password"],html[data-theme="light"] textarea,html[data-theme="light"] select { color:var(--text-primary); background:#fff; }
html[data-theme="light"] select option { color:#17332d; background:#fff; }
html[data-theme="light"] table,html[data-theme="light"] tbody tr { border-color:rgba(57,76,70,.12); }
html[data-theme="light"] tbody tr:hover { background:rgba(184,137,49,.055); }

/* Beginner path and practice surfaces. */
html[data-theme="light"] .bp-hero { background:#ffffff; border-color:#dbe4ee; box-shadow:0 10px 30px rgba(15,23,42,.08); }
html[data-theme="light"] .bp-hero h1 { color:#0f172a; }
html[data-theme="light"] .bp-hero::after { color:rgba(3,105,161,.035); }
html[data-theme="light"] .bp-eyebrow { color:#ea580c; }
html[data-theme="light"] .bp-hero p b { color:#0369a1; }
html[data-theme="light"] .bp-progress-card { background:#f8fafc; border-color:#dbe4ee; box-shadow:none; }
html[data-theme="light"] .bp-progress-ring { background:conic-gradient(#0284c7 var(--bp-progress),#e2e8f0 0); }
html[data-theme="light"] .bp-progress-ring::after { background:#fff; }
html[data-theme="light"] .bp-stages-primary { border-color:#dbe4ee; background:#f8fafc; box-shadow:0 10px 30px rgba(15,23,42,.07); }
html[data-theme="light"] .bp-stages-head .bp-title>.material-icons { color:#fff; background:#0369a1; }
html[data-theme="light"] .bp-stages-kicker { color:#ea580c; }
html[data-theme="light"] .bp-stages-summary { border-color:#bae6fd; background:#e0f2fe; }
html[data-theme="light"] .bp-stages-summary b { color:#075985; }
html[data-theme="light"] .bp-stage { border-color:#dbe4ee; background:#fff; box-shadow:0 4px 13px rgba(15,23,42,.05); }
html[data-theme="light"] .bp-stage.recommended { border-color:#38bdf8; background:#ffffff; box-shadow:inset 4px 0 0 #0284c7,0 7px 20px rgba(3,105,161,.08); }
html[data-theme="light"] .bp-stage-number { color:#0369a1; border-color:#bae6fd; background:#e0f2fe; }
html[data-theme="light"] .bp-stage-heading span { color:#c2410c; background:#ffedd5; }
html[data-theme="light"] .bp-stage-preview { background:#f8fafc; }
html[data-theme="light"] .bp-stage-preview-head { padding-bottom:12px; border-bottom:1px solid #e2e8f0; }
html[data-theme="light"] .bp-stage-word-grid { gap:10px; }
html[data-theme="light"] .bp-stage-word { background:#fff; border-color:#e2e8f0; box-shadow:0 2px 8px rgba(15,23,42,.035); }
html[data-theme="light"] .bp-stage-word:hover { border-color:#bfdbfe; box-shadow:0 5px 15px rgba(3,105,161,.07); }
html[data-theme="light"] .bp-stage-word-example { background:rgba(63,118,86,.07); }
html[data-theme="light"] .bp-stage-actions { border-color:#dbe4ee; background:#f8fafc; }
html[data-theme="light"] .bp-stage-count-wrap,html[data-theme="light"] .bp-stages-primary .bp-stage-count { color:var(--text-primary); background:#fff; }
html[data-theme="light"] .bp-stage-action-memory { color:#166534; background:#f0fdf4!important; border-color:#bbf7d0!important; }
html[data-theme="light"] .bp-stage-action-memory:hover { color:#14532d; background:#dcfce7!important; border-color:#86efac!important; }
html[data-theme="light"] .bp-stage-action-quiz { color:#fff; background:#0369a1!important; border-color:#0369a1!important; box-shadow:0 3px 10px rgba(3,105,161,.18); }
html[data-theme="light"] .bp-stage-action-quiz:hover { color:#fff!important; background:#075985!important; border-color:#075985!important; }
html[data-theme="light"] .bp-stage-progress em.learned { background:#f59e0b; }
html[data-theme="light"] .bp-stage-progress em.mastered { background:#16a05d; }
html[data-theme="light"] .bp-stage-progress>span b { color:#92400e; }
html[data-theme="light"] .bp-stage.done .bp-stage-progress>span b { color:#166534; }
html[data-theme="light"] .bp-pos-card,html[data-theme="light"] .bp-pos-reading>div { background:#fff; }
html[data-theme="light"] .bp-foundation-link { color:var(--text-primary); background:#fff; border-color:#dbe4ee; }
html[data-theme="light"] .bp-foundation-link:hover { background:#f0f9ff; border-color:#7dd3fc; }
html[data-theme="light"] .bp-tense-overview button { background:#fff; border-color:#e2e8f0; }
html[data-theme="light"] .bp-tense-overview button:hover { background:#f0f9ff; border-color:#7dd3fc; }
html[data-theme="light"] .bp-screen-controls,html[data-theme="light"] .bp-batch-question,html[data-theme="light"] .bp-batch-submit { background:rgba(255,255,255,.97); box-shadow:0 7px 22px rgba(25,66,57,.07); }
html[data-theme="light"] .bp-batch-input input,html[data-theme="light"] .bp-batch-choices label { background:#fff; }
html[data-theme="light"] .bp-batch-answer { background:#f0f6f4; }
html[data-theme="light"] .bp-batch-choices label.answer-correct,html[data-theme="light"] .bp-batch-input.answer-correct input { color:#28563d!important; background:rgba(63,118,86,.12)!important; }
html[data-theme="light"] .bp-batch-choices label.answer-correct span { color:#28563d; }
html[data-theme="light"] .bp-batch-choices label.answer-wrong,html[data-theme="light"] .bp-batch-input.answer-wrong input { color:#9c302f!important; background:rgba(180,62,56,.1)!important; }
html[data-theme="light"] .bp-batch-choices label.answer-wrong span { color:#9c302f; }

/* Common fixed dark surfaces across the remaining modules. */
html[data-theme="light"] .account-modal { background:rgba(39,48,44,.34); }
html[data-theme="light"] .account-dialog { color:var(--text-primary); background:#fff; box-shadow:0 24px 70px rgba(25,66,57,.2); }
html[data-theme="light"] .auth-form-panel { background:linear-gradient(165deg,#fff,#f8fbfc); }
html[data-theme="light"] .auth-heading h2 { color:#17332d; }
html[data-theme="light"] .auth-heading p:not(.auth-kicker),html[data-theme="light"] .auth-field-hint,html[data-theme="light"] .auth-session-note { color:#547069; }
html[data-theme="light"] .account-tabs { border-color:#dbe4ee; background:#f3f7f6; }
html[data-theme="light"] .account-tabs button { color:#547069; }
html[data-theme="light"] .account-tabs button:hover:not(:disabled) { color:#17332d; background:#e6f3f0; }
html[data-theme="light"] .auth-input-wrap { border-color:#cbdad7; background:#fff; }
html[data-theme="light"] .auth-input-wrap:focus-within { background:#fff; box-shadow:0 0 0 3px rgba(15,118,110,.14); }
html[data-theme="light"] .auth-input-wrap > .material-icons,html[data-theme="light"] .auth-password-toggle { color:#5b766f; }
html[data-theme="light"] .auth-input-wrap input,html[data-theme="light"] .account-dialog .auth-input-wrap input { color:#17332d; }
html[data-theme="light"] .auth-password-toggle:hover { color:#17332d; background:#eaf4f1; }
html[data-theme="light"] .account-check span,html[data-theme="light"] .account-sync-conflict p,html[data-theme="light"] .account-subscription { color:#47635c; }
html[data-theme="light"] .account-service-status { color:#166534; background:#f0fdf4; border-color:#bbf7d0; }
html[data-theme="light"] .account-service-status.unavailable { color:#854d0e; background:#fffbeb; border-color:#fde68a; }
html[data-theme="light"] .auth-mfa-intro { color:#174e63; background:#ecfeff; border-color:#a5f3fc; }
html[data-theme="light"] .auth-mfa-intro p { color:#28556a; }
html[data-theme="light"] .auth-session-note .material-icons { color:#0f766e; }
html[data-theme="light"] .toeic-full-test-shell,html[data-theme="light"] .toeic-full-test-header,html[data-theme="light"] .toeic-full-test-navigator { color:var(--text-primary); background:#f4f8f7; }
html[data-theme="light"] .passport-journey,html[data-theme="light"] .passport-utilities,html[data-theme="light"] .passport-departures { background:#e8efed; }
html[data-theme="light"] .departure-board { color:var(--text-primary); }
html[data-theme="light"] .departure-row { color:#f1eee5; }
html[data-theme="light"] .passport-gate,html[data-theme="light"] .passport-calendar-panel { background:#fff; color:var(--text-primary); }

/* Tenses hub: complete light palette. The module was originally designed only
   for a dark surface, so every structural layer needs an explicit light state. */
html[data-theme="light"] .tenses-hero {
  background:linear-gradient(135deg,#ffffff 0%,#f0f9ff 68%,#eff6ff 100%);
  border-color:#dbe4ee;
  box-shadow:0 8px 24px rgba(15,23,42,.06);
}
html[data-theme="light"] .tenses-hero::before {
  background:radial-gradient(circle,rgba(2,132,199,.1),transparent 70%);
}
html[data-theme="light"] .tenses-hero-text h1 {
  color:#0f172a;
  background:none;
  -webkit-background-clip:initial;
  background-clip:initial;
  -webkit-text-fill-color:currentColor;
}
html[data-theme="light"] .hero-stat {
  background:#fff;
  border-color:#dbe4ee;
  box-shadow:0 3px 12px rgba(15,23,42,.05);
  backdrop-filter:none;
}
html[data-theme="light"] .hero-stat-value.accent {
  color:#0369a1;
  text-shadow:none;
}

html[data-theme="light"] .tenses-sidebar,
html[data-theme="light"] .tenses-content-header,
html[data-theme="light"] .tenses-tabs,
html[data-theme="light"] .theory-section,
html[data-theme="light"] .quiz-wrapper {
  background:#fff;
  border-color:#dbe4ee;
  box-shadow:0 5px 18px rgba(15,23,42,.055);
  backdrop-filter:none;
}
html[data-theme="light"] .sidebar-header { border-bottom-color:#e2e8f0; }
html[data-theme="light"] .tenses-sidebar::-webkit-scrollbar-thumb { background:#cbd5e1; }
html[data-theme="light"] .tree-group-title:hover { background:#f1f5f9; }
html[data-theme="light"] .tree-items { border-left-color:#dbe4ee; }
html[data-theme="light"] .tree-lesson:hover {
  color:#0f172a;
  background:#f8fafc;
}
html[data-theme="light"] .tree-lesson.active {
  background:color-mix(in srgb,var(--group-color) 10%,#fff);
  box-shadow:inset 3px 0 0 var(--group-color);
}
html[data-theme="light"] .tree-lesson-dot { background:#cbd5e1; }

html[data-theme="light"] .tenses-tab { color:#475569; }
html[data-theme="light"] .tenses-tab:hover {
  color:#075985;
  background:#f0f9ff;
}
html[data-theme="light"] .tenses-tab.active {
  color:#fff;
  background:#0369a1;
  box-shadow:0 3px 10px rgba(3,105,161,.18);
}
html[data-theme="light"] .theory-section:hover { border-color:#bae6fd; }
html[data-theme="light"] .theory-section::before { box-shadow:none; }
html[data-theme="light"] .theory-section-badge {
  background:color-mix(in srgb,var(--section-color,var(--accent)) 9%,#fff);
}
html[data-theme="light"] .formula-card,
html[data-theme="light"] .usage-list li,
html[data-theme="light"] .signs-list li,
html[data-theme="light"] .tq-question,
html[data-theme="light"] .tq-option,
html[data-theme="light"] .tq-result-scorecard {
  background:#f8fafc;
  border-color:#e2e8f0;
}
html[data-theme="light"] .formula-content { color:#0f172a; }
html[data-theme="light"] .formula-notes { background:#f8fafc; border-color:#dbe4ee; }
html[data-theme="light"] .formula-notes>summary:hover { background:#f0f9ff; }
html[data-theme="light"] .formula-note-grid { border-top-color:#e2e8f0; }
html[data-theme="light"] .formula-note-item { background:#fff; border-color:#e2e8f0; }
html[data-theme="light"] .formula-note-item>code { color:#075985; background:#e0f2fe; }

html[data-theme="light"] .quiz-wrapper::before {
  background:linear-gradient(90deg,#0284c7,#6366f1,#16a05d);
}
html[data-theme="light"] .tq-progress-bar-wrap { background:#e2e8f0; }
html[data-theme="light"] .tq-progress-bar { background:linear-gradient(90deg,#0284c7,#6366f1); }
html[data-theme="light"] .tq-question { color:#0f172a; }
html[data-theme="light"] .tq-formula-hint { background:#fffbeb; border-color:#fde68a; }
html[data-theme="light"] .tq-formula-hint>summary:hover { background:#fef3c7; }
html[data-theme="light"] .tq-formula-hint>div { border-top-color:#fde68a; }
html[data-theme="light"] .tq-option { color:#1e293b; }
html[data-theme="light"] .tq-option-letter {
  color:#475569;
  background:#e2e8f0;
}
html[data-theme="light"] .tq-option:hover:not(:disabled) {
  color:#075985;
  background:#f0f9ff;
  border-color:#38bdf8;
  box-shadow:0 4px 12px rgba(3,105,161,.1);
}
html[data-theme="light"] .tq-option:hover:not(:disabled) .tq-option-letter {
  color:#fff;
  background:#0369a1;
}
html[data-theme="light"] .tq-option.correct {
  color:#166534;
  background:#f0fdf4;
  border-color:#22c55e;
}
html[data-theme="light"] .tq-option.correct .tq-option-letter { color:#fff; background:#16824f; }
html[data-theme="light"] .tq-option.wrong {
  color:#991b1b;
  background:#fef2f2;
  border-color:#ef4444;
}
html[data-theme="light"] .tq-option.wrong .tq-option-letter { color:#fff; background:#c2413b; }
html[data-theme="light"] .tq-feedback.success { background:#f0fdf4; border-color:#bbf7d0; }
html[data-theme="light"] .tq-feedback.error { background:#fef2f2; border-color:#fecaca; }
html[data-theme="light"] .tq-score-divider { background:#dbe4ee; }

@media (max-width:760px) {
  .theme-toggle { margin-bottom:12px; }
}

/* ============================================================
   SYSTEM THEME CONTRACT
   One warm apricot palette is shared by every learning module.
   Module styles may control layout, but not introduce a second brand color.
   ============================================================ */

body::before {
  background:radial-gradient(circle at 12% 0%,color-mix(in srgb,var(--accent) 7%,transparent),transparent 36%);
}

.sidebar {
  background:color-mix(in srgb,var(--bg-primary) 94%,transparent);
  border-right-color:var(--border);
}
.sidebar-brand,.sidebar-footer { border-color:var(--border); }
.sidebar-logo-icon {
  color:#fff;
  background:var(--accent);
  box-shadow:none;
}
.sidebar-link:hover {
  color:var(--text-primary);
  background:var(--bg-card-hover);
  border-color:var(--border);
}
.sidebar-link.active {
  color:var(--accent);
  background:color-mix(in srgb,var(--accent) 12%,transparent);
  border-color:color-mix(in srgb,var(--accent) 36%,var(--border));
}
.sidebar-link.active::before { box-shadow:none; }
.sidebar-link-icon,.sidebar-stat { background:var(--bg-card); }
.sidebar-link.active .sidebar-link-icon {
  color:var(--accent);
  background:color-mix(in srgb,var(--accent) 14%,transparent);
  box-shadow:none;
}

.page-title,
.section-title,
.tenses-hero-text h1,
.ytd-page .page-title,
.ytd-page .ytd-hero-title {
  color:var(--text-primary) !important;
  background:none !important;
  -webkit-background-clip:initial !important;
  background-clip:initial !important;
  -webkit-text-fill-color:currentColor !important;
  text-shadow:none !important;
}

.btn-primary,
.ielts-stage-filter.active,
.ielts-skill-filter.active,
.ielts-practice-mode.active,
.ielts-library-type.active,
.ielts-library-group.active,
.tenses-tab.active {
  color:#fff !important;
  border-color:var(--accent) !important;
  background:var(--accent) !important;
  box-shadow:none !important;
}
.btn-primary:hover,
.ielts-stage-filter.active:hover,
.ielts-skill-filter.active:hover,
.ielts-practice-mode.active:hover {
  border-color:var(--accent-2) !important;
  background:var(--accent-2) !important;
}

/* Shared hero treatment: quiet depth, no decorative purple/cyan gradients. */
.vocab-tools-header,
.bp-hero,
.tenses-hero,
.nr-hero,
.vf-hero,
.coach-hero,
.ielts-hero,
.resource-intro,
.toeic-hero,
.toeic-full-test-intro {
  color:var(--text-primary);
  border-color:var(--border) !important;
  background:linear-gradient(135deg,color-mix(in srgb,var(--accent) 9%,var(--bg-card)),var(--bg-card)) !important;
  box-shadow:none !important;
}

/* Primary surfaces. These selectors cover every module that previously fixed
   a navy surface and therefore broke in daylight mode. */
.card,
.resource-path-card,
.resource-card,
.source-audit-stat,
.source-audit-row,
.ielts-stat,
.ielts-toolbar,
.ielts-resource-card,
.ielts-practice-panel,
.ielts-practice-stage,
.ielts-writing-rule-detail,
.ielts-speaking-guidance-card,
.ielts-study-guidance-card,
.ielts-source-details,
.ielts-vocab-card,
.ielts-lesson-detail,
.ielts-pair-card,
.ielts-library-card,
.coach-dashboard-widget,
.coach-hero,
.coach-kpi,
.coach-settings,
.coach-performance,
.coach-plan-item,
.coach-history-item,
.coach-mistake-item,
.toeic-coach-summary > div,
.toeic-mode-toolbar,
.learning-header,
.learning-stat,
.learning-habit,
.learning-section,
.learning-task-grid > *,
.learning-tool-grid > *,
.learning-level-grid > *,
.learning-data-tools,
.nr-tool,
.nr-lesson,
.nr-practice,
.vf-lookup,
.vf-rule,
.vf-quiz-card,
.vf-table-card,
.toeic-full-test-shell,
.toeic-full-test-header,
.toeic-full-test-navigator,
.toeic-bank-stat,
.toeic-bank-quality,
.toeic-question-card,
.toeic-section-card {
  color:var(--text-primary);
  border-color:var(--border) !important;
  background:var(--bg-card) !important;
  box-shadow:none !important;
}

/* Secondary and inset surfaces. */
.resource-level,
.source-audit-search,
.ielts-search,
.ielts-practice-stats article,
.ielts-practice-options button,
.ielts-open-response,
.ielts-bilingual-prompt > div,
.ielts-bilingual-review > section,
.ielts-strategy-study-card,
.ielts-writing-rule-list button,
.ielts-lesson-list button,
.ielts-pair-terms > div,
.coach-part-track,
.toeic-category-progress-track,
.nr-hero-badges span,
.nr-example,
.nr-quick-notes div,
.nr-quiz-options button,
.vf-hero-stats div,
.vf-lookup-output,
.vf-lookup-output div,
.vf-rule-examples code,
.vf-quiz-options button,
.vf-table thead {
  color:var(--text-primary);
  border-color:var(--border) !important;
  background:var(--bg-secondary) !important;
}

.resource-filter:hover,
.source-audit-filter:hover,
.ielts-stage-filter:hover,
.ielts-skill-filter:hover,
.ielts-practice-mode:hover,
.ielts-library-type:hover,
.ielts-library-group:hover {
  color:var(--text-primary);
  background:var(--bg-card-hover);
}
.source-audit-number,
.ielts-resource-number,
.ielts-library-icon,
.vf-table-tab.active,
.vf-priority-btn.active {
  color:var(--accent) !important;
  border-color:color-mix(in srgb,var(--accent) 35%,var(--border)) !important;
  background:color-mix(in srgb,var(--accent) 12%,transparent) !important;
}
.resource-tags span,
.source-audit-fit,
.ielts-tags span,
.ielts-band {
  color:var(--text-secondary) !important;
}
.ielts-progress > span,
.ielts-practice-track i,
.nr-quiz-progress i,
.vf-quiz-bar i,
.learning-focus-progress i,
.coach-part-track i,
.toeic-progress > span {
  background:var(--accent) !important;
  box-shadow:none !important;
}
.ielts-writing-rule-list button.active,
.ielts-lesson-list button.active {
  color:var(--accent) !important;
  border-color:var(--accent) !important;
  background:color-mix(in srgb,var(--accent) 12%,transparent) !important;
}

html[data-theme="light"] .sidebar {
  background:color-mix(in srgb,var(--bg-card) 97%,transparent) !important;
  border-right-color:var(--border);
  box-shadow:8px 0 28px rgba(31,41,37,.06);
}
html[data-theme="light"] .sidebar-logo-name,
html[data-theme="light"] .sidebar-link:hover { color:var(--text-primary) !important; }
html[data-theme="light"] .sidebar-logo-sub,
html[data-theme="light"] .sidebar-section-label,
html[data-theme="light"] .sidebar-link { color:var(--text-secondary) !important; }
html[data-theme="light"] .sidebar-logo-icon { background:var(--accent) !important; }
html[data-theme="light"] .sidebar-link.active {
  color:var(--accent) !important;
  border-color:color-mix(in srgb,var(--accent) 30%,var(--border)) !important;
  background:color-mix(in srgb,var(--accent) 10%,var(--bg-card)) !important;
}
html[data-theme="light"] .sidebar-link.active::before,
html[data-theme="light"] .sidebar-link.active .sidebar-link-icon { color:var(--accent) !important; background:color-mix(in srgb,var(--accent) 13%,var(--bg-card)) !important; }
html[data-theme="light"] .sidebar-link.active::before { background:var(--accent) !important; }
html[data-theme="light"] .card:hover { border-color:var(--border-hover); }
html[data-theme="light"] .btn { background:var(--bg-card); }
html[data-theme="light"] .btn:hover { background:var(--bg-card-hover); border-color:var(--border-hover); }
html[data-theme="light"] .btn-primary { color:#fff; background:var(--accent); }
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="date"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  color:var(--text-primary);
  border-color:var(--border);
  background:var(--bg-card);
}

/* Dashboard focus card: its legacy design used white text on a dark navy
   gradient. Keep every nested label tied to the active theme so the right
   progress pane cannot become white-on-grey in daylight mode. */
.learning-focus {
  color:var(--text-primary) !important;
  border-color:var(--border) !important;
  background:var(--bg-card) !important;
  box-shadow:none !important;
}
.learning-focus-copy { background:var(--bg-card); }
.learning-focus-label { color:var(--accent) !important; }
.learning-focus h2 { color:var(--text-primary) !important; }
.learning-focus-copy > p { color:var(--text-secondary) !important; }
.learning-primary-action {
  color:#fff !important;
  border-color:var(--accent) !important;
  background:var(--accent) !important;
  box-shadow:none !important;
}
.learning-primary-action:hover { border-color:var(--accent-2) !important; background:var(--accent-2) !important; }
.learning-secondary-action {
  color:var(--text-secondary) !important;
  border-color:var(--border) !important;
  background:var(--bg-secondary) !important;
}
.learning-secondary-action:hover { color:var(--text-primary) !important; background:var(--bg-card-hover) !important; }
.learning-focus-progress {
  color:var(--text-primary);
  border-left-color:var(--border) !important;
  background:color-mix(in srgb,var(--accent) 7%,var(--bg-secondary)) !important;
}
.learning-level-icon {
  color:var(--accent) !important;
  border-color:color-mix(in srgb,var(--accent) 30%,var(--border)) !important;
  background:color-mix(in srgb,var(--accent) 11%,var(--bg-card)) !important;
}
.learning-focus-progress small,
.learning-focus-progress p,
.learning-mastered span { color:var(--text-secondary) !important; }
.learning-focus-progress > div:nth-child(2) > strong,
.learning-focus-progress p b,
.learning-mastered strong { color:var(--text-primary) !important; }
.learning-mastered { border-top-color:var(--border) !important; }
.learning-stat > .material-icons,
.learning-tool-grid .material-icons,
.learning-task-grid .departure-row > span:first-child {
  color:var(--accent) !important;
  background:color-mix(in srgb,var(--accent) 11%,var(--bg-card)) !important;
}
.learning-task-grid .departure-row:hover { border-color:var(--border-hover) !important; }
.learning-level-grid .passport-gate::after { color:color-mix(in srgb,var(--accent) 7%,transparent); }
.learning-level-grid .passport-gate.current {
  border-color:var(--border-hover) !important;
  background:color-mix(in srgb,var(--accent) 8%,var(--bg-card)) !important;
  box-shadow:inset 0 3px 0 var(--accent) !important;
}
.learning-level-grid .passport-gate.current .passport-gate-stamp { color:var(--accent) !important; }

/* passport.css is imported by workshop.css and historically assumed a dark
   canvas. The public footer must instead follow the current system theme. */
.public-footer {
  color:var(--text-muted) !important;
  border-top:1px solid var(--border) !important;
  background:transparent !important;
}
.public-footer span { color:var(--text-muted) !important; opacity:1; }
.public-footer a { color:var(--accent) !important; }
.public-footer a:hover { color:var(--accent-2) !important; text-decoration:underline; }

@media (max-width:860px) {
  .learning-focus-progress { border-top-color:var(--border) !important; }
  .learning-mastered { border-left-color:var(--border) !important; }
}
@media (max-width:560px) {
  .learning-mastered { border-top-color:var(--border) !important; }
}

@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; }
}

/* Dark palette refinement: neutral charcoal surfaces let the soft orange
   accent lead, while action controls stay calm instead of competing in blue,
   mint and purple. */
html:not([data-theme="light"]) .vocab-tools-header {
  background:var(--bg-card) !important;
  border-color:var(--border) !important;
}
html:not([data-theme="light"]) .vocab-tools-total,
html:not([data-theme="light"]) .vocab-topic-card {
  background:var(--bg-card) !important;
  border-color:var(--border) !important;
}
html:not([data-theme="light"]) .vocab-topic-card.recommended {
  background:color-mix(in srgb,var(--accent) 6%,var(--bg-card)) !important;
  border-color:color-mix(in srgb,var(--accent) 62%,var(--border)) !important;
}
html:not([data-theme="light"]) .vocab-topic-number {
  color:var(--accent) !important;
  border-color:color-mix(in srgb,var(--accent) 35%,var(--border)) !important;
  background:color-mix(in srgb,var(--accent) 11%,var(--bg-secondary)) !important;
}
html:not([data-theme="light"]) .vocab-topic-progress i {
  border-color:var(--border) !important;
  background:var(--bg-secondary) !important;
}
html:not([data-theme="light"]) .vocab-topic-progress i em {
  background:var(--accent) !important;
}
html:not([data-theme="light"]) .vocab-topic-actions button,
html:not([data-theme="light"]) .vocab-topic-actions label,
html:not([data-theme="light"]) .vocab-topic-listen,
html:not([data-theme="light"]) .vocab-topic-write,
html:not([data-theme="light"]) .vocab-topic-quiz {
  color:var(--text-secondary) !important;
  border-color:var(--border) !important;
  background:var(--bg-secondary) !important;
}
html:not([data-theme="light"]) .vocab-topic-actions button:hover,
html:not([data-theme="light"]) .vocab-topic-listen:hover,
html:not([data-theme="light"]) .vocab-topic-write:hover,
html:not([data-theme="light"]) .vocab-topic-quiz:hover {
  color:var(--accent) !important;
  border-color:var(--border-hover) !important;
  background:color-mix(in srgb,var(--accent) 9%,var(--bg-secondary)) !important;
}
html:not([data-theme="light"]) .vocab-topic-quiz {
  color:var(--accent) !important;
  border-color:color-mix(in srgb,var(--accent) 48%,var(--border)) !important;
}
html:not([data-theme="light"]) .coach-plan-icon.purple {
  color:var(--accent) !important;
  background:color-mix(in srgb,var(--accent) 12%,var(--bg-secondary)) !important;
}

/* Streak calendar: inactive days need a visible track in daylight mode;
   otherwise only today's outline is visible as a lonely empty square. */
html[data-ui="studio"] :is(.tenses-sidebar,.tenses-content-header,.tenses-tabs,.theory-section,.quiz-wrapper) {
  color:var(--text-primary); background:var(--bg-card) !important; border-color:var(--border) !important;
}

/* Streak calendar: inactive days need a visible track in daylight mode;
   otherwise only today's outline is visible as a lonely empty square. */
.streak-day {
  border:1px solid var(--border) !important;
  background:var(--bg-secondary) !important;
  box-shadow:none !important;
}
.streak-day.done {
  border-color:var(--accent) !important;
  background:var(--accent) !important;
  box-shadow:none !important;
}
.streak-day.today {
  outline:2px solid var(--accent-2) !important;
  outline-offset:2px;
  background:color-mix(in srgb,var(--accent) 18%,var(--bg-secondary)) !important;
}
