/* Brand refresh: colors sampled from the approved 小闪 icon. */
html[data-theme="cartoon"] {
  --bg: #f3f8ee;
  --surface: #fffefa;
  --ink: #263a30;
  --muted: #738579;
  --line: #dfe9dc;
  --green: #168b59;
  --green2: #e3f4e9;
  --leaf: #329c61;
  --lime: #f2cf4b;
  --gold: #d9972c;
  --red: #c75e54;
  --mode-library: #4b9a70;
  --mode-learn: #198855;
  --mode-dictation: #d69a31;
  --mode-wash: #eff7e9;
  --coach-tint: #e0f2e5;
  --coach-tint2: #f8f8e9;
  --coach-orbit: #2b9b6528;
  --coach-shadow: #24634318;
  --shadow: 0 12px 30px #345d3b12;
}

html[data-theme="cartoon"] body {
  background-image:
    radial-gradient(ellipse at 92% 10%, #f3d95722 0 54px, transparent 57px),
    radial-gradient(ellipse at 4% 37%, #57b87818 0 170px, transparent 174px),
    linear-gradient(145deg, #f6f9f0, #f0f7ed 58%, #f7f8ed);
}

html[data-theme="cartoon"] .topbar {
  background: #f8fbf2eF;
  border-bottom-color: var(--line);
}

html[data-theme="cartoon"] .hero {
  background: linear-gradient(125deg, #15965a 0%, #148452 56%, #087969 100%);
  border-radius: 27px;
  box-shadow: 0 6px 0 #126e4b24;
}

html[data-theme="cartoon"] .hero .eyebrow { color: #f6df72; }
html[data-theme="cartoon"] .hero p { color: #e1f2e5; }
html[data-theme="cartoon"] .btn-primary {
  border-color: #168b59;
  background: #168b59;
  box-shadow: 0 4px 0 #0b6745 !important;
}
html[data-theme="cartoon"] .btn-primary:hover { background: #11784d; }
html[data-theme="cartoon"] .btn-lime {
  background: #f3d65d;
  border-color: #f3d65d;
  color: #33472f;
}
html[data-theme="cartoon"] .tab.active { background: #e3f4e9; }
html[data-theme="cartoon"] .tab-center { background: #168b59; }
html[data-theme="cartoon"] .tab.active .tab-center { color: #ffe36a; }
html[data-theme="cartoon"] .mode-choice-library { --choice-color: #4b9a70; }
html[data-theme="cartoon"] .mode-choice-learn { --choice-color: #198855; }
html[data-theme="cartoon"] .mode-choice-dictation { --choice-color: #d69a31; }
html[data-theme="cartoon"] .mode-hero-art::after { border-color: #d8ebda; color: #168b59; }
html[data-theme="cartoon"] .mistake-banner { background: linear-gradient(120deg, #17633f, #18845a); }
html[data-theme="cartoon"] .bubble.user { background: #dff3e9; }
html[data-theme="cartoon"] .mic-btn { background: #168b59; }
html[data-theme="cartoon"] .mic-btn.listening { background: #c75e54; }
html[data-theme="cartoon"] .theme-preview-cartoon { background: #e2f3e7; }
html[data-theme="cartoon"] .theme-preview-cartoon i { background: #168b59; }
html[data-theme="cartoon"] .theme-preview-cartoon i:nth-child(2) { background: #f2cf4b; }
html[data-theme="cartoon"] .theme-preview-cartoon i:nth-child(3) { background: #52ad73; }

html[data-theme="cartoon"] :is(.word-letter, .quick-icon, .stat-icon, .scan-sigil,
  .coach-avatar, .settings-entry-icon, .account-entry-icon, .task-entry-icon) {
  background-color: #e5f3e8;
  color: #168b59;
}
html[data-theme="cartoon"] .quick-card:nth-child(2) .quick-icon,
html[data-theme="cartoon"] .stat:nth-child(2) .stat-icon,
html[data-theme="cartoon"] .stat:nth-child(3) .stat-icon {
  background: #fff4d7;
  color: #b77c1f;
}
html[data-theme="cartoon"] .quick-card:nth-child(3) .quick-icon {
  background: #fff0e5;
  color: #be7544;
}
html[data-theme="cartoon"] .quick-card:nth-child(4) .quick-icon {
  background: #e5f3ee;
  color: #398e70;
}
html[data-theme="cartoon"] :is(.answer-input, .text-input, .select-input):focus,
html[data-theme="cartoon"] :is(input, select, textarea):focus {
  border-color: #61b47b;
  box-shadow: 0 0 0 3px #dff2e5;
}
html[data-theme="cartoon"] .modal-close { background: #e5f1e5; color: #4f6957; }
html[data-theme="cartoon"] .toast { background: #214a34; }

/* Keep the special points surfaces in the same leaf-green family. */
html[data-theme="cartoon"] :is(.points-balance-card, .points-summary-card) {
  border-color: #d6eadb;
  background: linear-gradient(125deg, #e3f4e8, #fff9e6);
}

/* Give the green, garden, and eye-care themes distinct color identities. */
html[data-theme="garden"] {
  --bg: #fbf2e8;
  --surface: #fffdfa;
  --ink: #49372f;
  --muted: #8a7163;
  --line: #eddbca;
  --green: #ad6848;
  --green2: #f7e6d7;
  --leaf: #bd8a4d;
  --lime: #e8c56f;
  --gold: #c78635;
  --red: #bd655b;
  --mode-library: #b98153;
  --mode-learn: #ad6848;
  --mode-dictation: #718a9a;
  --mode-wash: #fbf0e4;
  --coach-tint: #f6e5d5;
  --coach-tint2: #fff8ed;
  --coach-orbit: #ad684822;
  --coach-shadow: #70452f14;
  --shadow: 0 12px 30px #70452f12;
}
html[data-theme="garden"] body {
  background-image: radial-gradient(ellipse at 92% 8%, #e8c56f38 0 70px, transparent 73px),
    linear-gradient(145deg, #fff9f2, #f8eee3 60%, #fff7ed);
}
html[data-theme="garden"] .topbar { background: #fff9f2ed; border-bottom-color: var(--line); }
html[data-theme="garden"] .hero { background: linear-gradient(125deg, #bd8054, #986247); color: #fffdf5; }
html[data-theme="garden"] .btn-primary { background: #ad6848; border-color: #ad6848; box-shadow: 0 4px 0 #814c36 !important; }
html[data-theme="garden"] .tab.active { background: #f7e6d7; }
html[data-theme="garden"] .theme-preview-garden { background: #fbede0; }
html[data-theme="garden"] .theme-preview-garden i { background: #ad6848; }
html[data-theme="garden"] .theme-preview-garden i:nth-child(2) { background: #bd8a4d; }
html[data-theme="garden"] .theme-preview-garden i:nth-child(3) { background: #e8c56f; }

html[data-theme="eye-care"] {
  --bg: #edf0f7;
  --surface: #fbfbfe;
  --ink: #343b52;
  --muted: #777f98;
  --line: #dfe2ed;
  --green: #69779f;
  --green2: #e8ebf6;
  --leaf: #858eaf;
  --lime: #d9deef;
  --gold: #a59472;
  --red: #b87583;
  --mode-library: #7188ae;
  --mode-learn: #7f82ae;
  --mode-dictation: #8899a4;
  --mode-wash: #eef0f8;
  --coach-tint: #e5e9f5;
  --coach-tint2: #f3f4fa;
  --coach-orbit: #69779f20;
  --coach-shadow: #444d6a12;
  --shadow: 0 10px 26px #444d6a0d;
}
html[data-theme="eye-care"] body { background-image: linear-gradient(145deg, #f5f6fb, #edf0f7 58%, #f7f7fb); }
html[data-theme="eye-care"] .topbar { background: #fafaffed; border-bottom-color: var(--line); }
html[data-theme="eye-care"] .hero { background: linear-gradient(125deg, #7887ad, #666f98); color: #fbfbff; }
html[data-theme="eye-care"] .btn-primary { background: #69779f; border-color: #69779f; box-shadow: 0 4px 0 #505d83 !important; }
html[data-theme="eye-care"] .tab.active { background: #e8ebf6; }
html[data-theme="eye-care"] .theme-preview-eye-care { background: #edf0f8; }
html[data-theme="eye-care"] .theme-preview-eye-care i { background: #69779f; }
html[data-theme="eye-care"] .theme-preview-eye-care i:nth-child(2) { background: #858eaf; }
html[data-theme="eye-care"] .theme-preview-eye-care i:nth-child(3) { background: #b3bdd6; }

/* Additional presets: bright ocean blue and warm sunset orange. */
html[data-theme="ocean"] {
  --bg: #eef7ff;
  --surface: #ffffff;
  --ink: #26394e;
  --muted: #72859a;
  --line: #d9e7f3;
  --green: #3686c2;
  --green2: #e4f2ff;
  --leaf: #4b9bc2;
  --lime: #ffe17b;
  --gold: #d39b43;
  --red: #cc6671;
  --mode-library: #4c91c8;
  --mode-learn: #567bc6;
  --mode-dictation: #d18d56;
  --mode-wash: #f1f7ff;
  --coach-tint: #e3f2ff;
  --coach-tint2: #f6f8ff;
  --coach-orbit: #4c91c828;
  --coach-shadow: #2e5d8118;
  --shadow: 0 12px 30px #345d7b12;
}
html[data-theme="ocean"] body {
  background-image: radial-gradient(ellipse at 92% 8%, #ffe17b30 0 60px, transparent 63px),
    linear-gradient(145deg, #f4faff, #edf6ff 58%, #f7f9ff);
}
html[data-theme="ocean"] .topbar { background: #f8fcffed; border-bottom-color: var(--line); }
html[data-theme="ocean"] .hero { background: linear-gradient(125deg, #55b4e5, #477bc2); color: #fff; }
html[data-theme="ocean"] .btn-primary { background: #3686c2; border-color: #3686c2; box-shadow: 0 4px 0 #27669b !important; }
html[data-theme="ocean"] .tab.active { background: #e4f2ff; }
html[data-theme="ocean"] .theme-preview-ocean { background: #edf7ff; }
html[data-theme="ocean"] .theme-preview-ocean i { background: #3686c2; }
html[data-theme="ocean"] .theme-preview-ocean i:nth-child(2) { background: #7895d0; }
html[data-theme="ocean"] .theme-preview-ocean i:nth-child(3) { background: #ffe17b; }

html[data-theme="sunset"] {
  --bg: #fff5eb;
  --surface: #fffefd;
  --ink: #493b39;
  --muted: #8d7772;
  --line: #f0ded3;
  --green: #d47750;
  --green2: #ffede2;
  --leaf: #b96b4c;
  --lime: #ffd579;
  --gold: #bd843a;
  --red: #c7595e;
  --mode-library: #d28b64;
  --mode-learn: #c96750;
  --mode-dictation: #627f9a;
  --mode-wash: #fff2e8;
  --coach-tint: #ffede2;
  --coach-tint2: #fff8ef;
  --coach-orbit: #d4775028;
  --coach-shadow: #754d3516;
  --shadow: 0 12px 30px #754d3512;
}
html[data-theme="sunset"] body {
  background-image: radial-gradient(ellipse at 92% 8%, #ffd5793d 0 62px, transparent 65px),
    linear-gradient(145deg, #fff9f2, #fff1e7 58%, #fff7ef);
}
html[data-theme="sunset"] .topbar { background: #fffaf5ed; border-bottom-color: var(--line); }
html[data-theme="sunset"] .hero { background: linear-gradient(125deg, #e89a65, #c96250); color: #fffdf9; }
html[data-theme="sunset"] .btn-primary { background: #d47750; border-color: #d47750; box-shadow: 0 4px 0 #ad563c !important; }
html[data-theme="sunset"] .tab.active { background: #ffede2; }
html[data-theme="sunset"] .theme-preview-sunset { background: #fff1e7; }
html[data-theme="sunset"] .theme-preview-sunset i { background: #d47750; }
html[data-theme="sunset"] .theme-preview-sunset i:nth-child(2) { background: #c96750; }
html[data-theme="sunset"] .theme-preview-sunset i:nth-child(3) { background: #ffd579; }
