/* Profile appearance choices and the always-available session dark-mode control. */
.profile-themes{margin:22px 0;padding:18px 0;border-top:1px solid #d9e4ed;border-bottom:1px solid #d9e4ed}.profile-themes h3{font-size:17px;margin:0 0 12px}.profile-theme-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.profile-theme-options button{display:flex;align-items:center;gap:10px;min-height:48px;padding:10px;border:2px solid #dbe3eb;border-radius:10px;background:#fff;color:#344b61;text-align:left;font-weight:700;cursor:pointer}.profile-theme-options button[aria-pressed=true]{border-color:#42a672;box-shadow:0 0 0 2px #42a67220}.theme-swatch{display:block;flex-shrink:0;width:34px;height:28px;border-radius:7px;border:1px solid #0002}.swatch-default{background:linear-gradient(135deg,#edf5fd 50%,#7aadd5 50%)}.swatch-lavender{background:linear-gradient(135deg,#f1eafa 50%,#b799d1 50%)}.swatch-mint{background:linear-gradient(135deg,#e8f5ef 50%,#88bea5 50%)}.swatch-rose{background:linear-gradient(135deg,#fcecf1 50%,#d895ad 50%)}.swatch-peach{background:linear-gradient(135deg,#fff0e4 50%,#dba27c 50%)}.swatch-sand{background:linear-gradient(135deg,#fcf5df 50%,#ccb66b 50%)}.swatch-language{background:linear-gradient(90deg,#315b91 33%,#fff 33% 66%,#c55764 66%)}.swatch-language[data-course=it]{background:linear-gradient(90deg,#428b65 33%,#fff 33% 66%,#c55764 66%)}.swatch-language[data-course=de]{background:linear-gradient(#35383e 33%,#ba5059 33% 66%,#dfba52 66%)}.swatch-language[data-course=en]{background:linear-gradient(135deg,#315b91 36%,transparent 36%),repeating-linear-gradient(#c55764 0 4px,#fff 4px 8px)}.theme-description{font-size:13px;line-height:1.5;color:#677b8c}.appearance-dark-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;border:1px solid #bccada;border-radius:9px;background:#eef3f8;color:#344b61;padding:9px 14px;font-weight:700}.appearance-dark-toggle[aria-pressed=true]{background:#283c50;border-color:#6f8eab;color:#eef5fc}.session-appearance-controls{display:flex;justify-content:flex-end;margin:16px 0 4px}
body{--theme-page:#f1f6fc;--theme-soft:#edf4fc;--theme-strong:#dceafa;--theme-border:#8eb2d6;--theme-ink:#315b82;--theme-accent:#75a3ce;--theme-light:#b3d6f4;--theme-flag:linear-gradient(90deg,#315b91 33%,#fff 33% 66%,#c55764 66%)}
body[data-lesson-theme=lavender]{--theme-page:#f7f3fb;--theme-soft:#f0e8f8;--theme-strong:#e2d2f0;--theme-border:#b79ad1;--theme-ink:#66507c;--theme-accent:#a383c0;--theme-light:#dac2ef}
body[data-lesson-theme=mint]{--theme-page:#f2f9f5;--theme-soft:#e6f3ed;--theme-strong:#d0e8dc;--theme-border:#88bba1;--theme-ink:#3e6b57;--theme-accent:#72a98e;--theme-light:#b0dfc7}
body[data-lesson-theme=rose]{--theme-page:#fdf4f7;--theme-soft:#fae8ef;--theme-strong:#f0d0de;--theme-border:#d49ab1;--theme-ink:#814d65;--theme-accent:#c683a0;--theme-light:#f0bcd3}
body[data-lesson-theme=peach]{--theme-page:#fff7f0;--theme-soft:#ffeddf;--theme-strong:#f5dac4;--theme-border:#d9ac89;--theme-ink:#805f47;--theme-accent:#d09a73;--theme-light:#f2ceaa}
body[data-lesson-theme=sand]{--theme-page:#fcf9ed;--theme-soft:#f8f0d6;--theme-strong:#eee0ae;--theme-border:#ccba78;--theme-ink:#74653a;--theme-accent:#b9a358;--theme-light:#e8dba4}
body[data-lesson-theme=language][data-theme-language=en]{--theme-page:#f3f5fa;--theme-soft:#edf1fa;--theme-strong:#e1e7f5;--theme-border:#a2b4d0;--theme-ink:#344f76;--theme-accent:#bd6877;--theme-light:#b6cbed;--theme-flag:linear-gradient(90deg,#315b91 33%,#fff 33% 66%,#c55764 66%)}
body[data-lesson-theme=language][data-theme-language=fr]{--theme-page:#f3f6fb;--theme-soft:#e9f0fa;--theme-strong:#dce7f7;--theme-border:#8faed5;--theme-ink:#345e92;--theme-accent:#6f96c6;--theme-light:#b2d0f4;--theme-flag:linear-gradient(90deg,#315b91 33%,#fff 33% 66%,#c55764 66%)}
body[data-lesson-theme=language][data-theme-language=it]{--theme-page:#f3f8f3;--theme-soft:#e7f2e9;--theme-strong:#d5e7d9;--theme-border:#91b49c;--theme-ink:#37654b;--theme-accent:#77a78a;--theme-light:#b6dec2;--theme-flag:linear-gradient(90deg,#428b65 33%,#fff 33% 66%,#c55764 66%)}
body[data-lesson-theme=language][data-theme-language=de]{--theme-page:#faf7ed;--theme-soft:#f6edcf;--theme-strong:#ebdaa4;--theme-border:#c6ab66;--theme-ink:#60543a;--theme-accent:#bd9c49;--theme-light:#eed894;--theme-flag:linear-gradient(90deg,#35383e 33%,#ba5059 33% 66%,#dfba52 66%)}

body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark){background:var(--theme-page)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study,body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #lessonPreview,body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #finish{border-color:var(--theme-border)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) .primary{background:var(--theme-strong);border:1px solid var(--theme-border);color:var(--theme-ink);box-shadow:0 3px 10px #0000000a}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) .primary:hover{background:var(--theme-soft)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study .clue strong,body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study .lesson-score strong{background:var(--theme-soft);border:1px solid var(--theme-border);color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study .progress{background:var(--theme-soft)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study #bar{background:var(--theme-accent)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study:not(.learning-card) .blank:not(.answered),body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study.learning-card:not(.answer-confirmed) .blank.answered{background:var(--theme-soft);border-color:var(--theme-border);color:var(--theme-ink);-webkit-text-fill-color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study .blank:not(.answered):focus{background:var(--theme-soft);border-color:var(--theme-accent);box-shadow:0 0 0 3px var(--theme-strong)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study #options .option:not(.right):not(.wrong):not(.hint-eliminated){background:var(--theme-soft);border-color:var(--theme-border);color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study #options .option.type-match:not(.right):not(.wrong):not(.hint-eliminated),body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study #options .option:not(.right):not(.wrong):not(.hint-eliminated):hover{background:var(--theme-strong);border-color:var(--theme-accent);box-shadow:none}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study #options .option:not(.right):not(.wrong) small{background:var(--theme-strong);border-color:var(--theme-border);color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study .learning-answer:not(.right),body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #lessonPreview .preview-word:not(.heard){background:var(--theme-soft);border-color:var(--theme-border);color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) .modes,body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) .browse-controls button,body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) .session-setup button,body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study #replayAudio,body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #study #slowAudio{background:var(--theme-soft);border-color:var(--theme-border);color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) .modes button.active{background:var(--theme-strong);color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #finishRewardBubble{background:var(--theme-soft);border-color:var(--theme-border)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #finishRewardBubble strong{color:var(--theme-ink)}
body.session-themed:not(.favorite-session):not(.memory-session):not(.theme-dark) #finishRewardBubble>.finish-total-score{border-color:var(--theme-border)}
body.session-themed[data-lesson-theme=language]:not(.favorite-session):not(.memory-session) #study #bar{background:var(--theme-flag)}
/* Dark mode is available in normal lessons, Favorites, Memories, and the profile. */
body.theme-dark{color-scheme:dark;--dark-bg:#111923;--dark-surface:#1b2633;--dark-input:#26394c;--dark-ink:#e5edf5;--dark-border:#4a6177;background:var(--dark-bg)!important;color:var(--dark-ink)}
body.theme-dark.favorite-session{--dark-input:#3b3421;--theme-light:#f4dfa1;--dark-border:#7b7049}
body.theme-dark.memory-session{--dark-input:#213944;--theme-light:#aeddeb;--dark-border:#4e7481}
body.theme-dark :is(#study,#lessonPreview,#finish,.account-panel){background:var(--dark-surface);color:var(--dark-ink);border-color:var(--dark-border);box-shadow:0 8px 28px #0002}
body.theme-dark :is(.sentence,.lesson-preview h2,.finish-title,.account-panel h1,.account-panel h2,.account-panel h3,.account-panel label){color:var(--dark-ink)}
body.theme-dark :is(.quiet,.text-button,.modes,.modes button,.all-in,.literal-toggle,.side-toggle,.session-setup button,.browse-controls button,.profile-theme-options button){background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark .modes button.active{background:#38516a;color:#f3f7fc}
body.theme-dark :is(#study,#lessonPreview,#finish) .primary{background:#36526d;border-color:#698ca9;color:#f0f6fc}
body.theme-dark #finish #again{background:#294861;border-color:#668daa;color:#e1f0fb}
body.theme-dark #study :is(#replayAudio,#slowAudio,#autoAudio,.clue strong,.lesson-score strong){background:var(--dark-input);border-color:var(--dark-border);color:var(--theme-light)}
body.theme-dark #study:not(.learning-card) .blank:not(.answered),body.theme-dark #study.learning-card:not(.answer-confirmed) .blank.answered{background:var(--dark-input);border-color:var(--dark-border);color:var(--theme-light);-webkit-text-fill-color:var(--theme-light)}
body.theme-dark #study .blank:not(.answered):focus{background:var(--dark-input);border-color:var(--theme-light);box-shadow:0 0 0 3px #9ebcda22}
body.theme-dark #study #options .option:not(.right):not(.wrong):not(.hint-eliminated),body.theme-dark #study .learning-answer:not(.right),body.theme-dark #lessonPreview .preview-word:not(.heard){background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark #study #options .option.type-match:not(.right):not(.wrong):not(.hint-eliminated),body.theme-dark #study #options .option:not(.right):not(.wrong):not(.hint-eliminated):hover{background:#36516b;border-color:var(--theme-light)}
body.theme-dark #study #options .option small{background:var(--dark-surface);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark #study .translation{background:#203a2d;border-color:#47745a}body.theme-dark #study .translation p,body.theme-dark #study .translation span{color:#a6e1b9}
body.theme-dark #study.learning-card:not(.answer-confirmed) .translation{background:var(--dark-input);border-color:var(--dark-border)}body.theme-dark #study.learning-card:not(.answer-confirmed) .translation p{color:var(--theme-light)}
body.theme-dark.favorite-session #study .translation{background:#39321f;border-color:#786b41}body.theme-dark.favorite-session #study .translation p,body.theme-dark.favorite-session #study .translation span{color:#f1dfa6}
body.theme-dark #study .option.right,body.theme-dark #study .learning-answer.right,body.theme-dark #lessonPreview .preview-word.heard,body.theme-dark #study.answer-confirmed .blank.answered{background:#203e2d;border-color:#66b888;color:#90dfac;-webkit-text-fill-color:#90dfac}
body.theme-dark #options .option.wrong,body.theme-dark #options .option.wrong:hover,body.theme-dark #options .option.wrong small{background:#4a2935!important;border-color:#b16e83!important;color:#ffbdcd!important}
body.theme-dark #study .option.hint-eliminated{background:#26323d;border-color:#4a5968;color:#a4adb5}
body.theme-dark #study.answer-revealed .blank.answered{background:#29392e;border-color:#607b68}body.theme-dark .spelling-correction{color:#ff9daf!important}
body.theme-dark #study .progress{background:#2b3d4c}
body.theme-dark #study #blindToggle{background:var(--dark-input)!important;border-color:var(--dark-border)!important}
body.theme-dark #finishRewardBubble{background:var(--dark-input);border-color:var(--dark-border)}body.theme-dark #finishRewardBubble strong{color:var(--theme-light)}body.theme-dark #finishRewardBubble>.finish-total-score{border-color:var(--dark-border)}
body.theme-dark .finish-breakdown .finish-gains{background:#1d3528;border-color:#47745a!important}body.theme-dark .finish-breakdown .finish-faults{background:#3d2832;border-color:#82566a!important}body.theme-dark .finish-gains h3,body.theme-dark .finish-breakdown .reward-gain{color:#a2dfb8}body.theme-dark .finish-faults h3,body.theme-dark .finish-breakdown .reward-fault{color:#f1b1c5}
body.theme-dark :is(.audio-credit-banner,.repeat-practice-note,.feedback.review-notice:not(:empty),.password-warning){background:#3d2832;border-color:#82566a;color:#f1bfd0}
body.theme-dark :is(.preview-words button,.word-result,.account-panel input,.account-panel select,.flag-picker,.flag-picker-options,.interface-options,.language-options){background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark :is(.theme-description,.lesson-preview p,.review-help,.set-label,.key-hint,.account-panel small,.preference-status,.account-panel p){color:#bac9d6}
body.theme-dark .appearance-dark-toggle{background:#2b4054;border-color:#7892aa;color:#e4eff8}
body.theme-dark :is(.account-panel .profile-word-totals>*,#profilePointsBox){background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
@media(max-width:420px){.profile-theme-options{grid-template-columns:1fr 1fr}.profile-theme-options button{font-size:13px;padding:8px;gap:7px}.theme-swatch{width:26px}.session-appearance-controls{justify-content:center}}

body.theme-dark #study .quiet:not(.blind-toggle),body.theme-dark :is(#study,#lessonPreview) .browse-controls button{background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark #study #bar{background:var(--theme-accent)}body.theme-dark[data-lesson-theme=language] #study #bar{background:var(--theme-flag)}
body.theme-dark :is(.card-time,.card-navigation,.key-hint,footer,.compact-header){color:#bac9d6}body.theme-dark .learning-answer .meaning-link{color:#c7d4df}
body.theme-dark :is(.ui-language summary,.ui-language-options,.ui-language-options button,.flag-picker summary,.flag-picker-options button){background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark :is(#feedback:not(:empty),#audioCreditNote,#repeatPracticeNote){background:#3d2832;border-color:#82566a;color:#f1bfd0}
body.theme-dark :is(button,a,input,select):focus-visible{outline:2px solid var(--theme-light);outline-offset:3px}
.profile-theme-options button:focus-visible{outline:2px solid #42a672;outline-offset:3px}

/* Translation colors can follow the lesson palette or stay green. Auto preserves each session's existing colors. */
.translation-color-preference{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:14px 0;font-size:14px}
.translation-color-preference select{border:1px solid #bdcddd;border-radius:8px;background:#f5f8fc;color:#344b61;padding:9px 12px;font:inherit;max-width:100%}
body.favorite-session[data-translation-color=theme] #study{--theme-soft:#fff4c5;--theme-strong:#fff1b6;--theme-border:#edd47b;--theme-ink:#514c37;--theme-light:#f1dfa6}
body.memory-session[data-translation-color=theme] #study{--theme-soft:#e6f5ff;--theme-strong:#d8edf8;--theme-border:#91caeb;--theme-ink:#356b8c;--theme-light:#b4dfed}
body[data-translation-color=theme] #study.study .translation{background:var(--theme-soft);border-color:var(--theme-border)}
body[data-translation-color=theme] #study.study .translation p,body[data-translation-color=theme] #study.study .translation span{color:var(--theme-ink)}
body[data-translation-color=theme] #study #blindToggle,body[data-translation-color=theme] #study #blindToggle:hover{background:var(--theme-strong)!important;border-color:var(--theme-border)!important;color:var(--theme-ink)}
body[data-translation-color=green] #study.study .translation{background:#e7f4e9;border-color:#cce5d1}
body[data-translation-color=green] #study.study .translation p,body[data-translation-color=green] #study.study .translation span{color:#368352}
body[data-translation-color=green] #study #blindToggle,body[data-translation-color=green] #study #blindToggle:hover{background:#d9f1df!important;border-color:#91cba3!important;color:#225f38}
body.theme-dark[data-translation-color=theme] #study.study .translation{background:var(--dark-input);border-color:var(--dark-border)}
body.theme-dark[data-translation-color=theme] #study.study .translation p,body.theme-dark[data-translation-color=theme] #study.study .translation span{color:var(--theme-light)}
body.theme-dark[data-translation-color=theme] #study #blindToggle,body.theme-dark[data-translation-color=theme] #study #blindToggle:hover{background:var(--dark-input)!important;border-color:var(--dark-border)!important;color:var(--theme-light)}
body.theme-dark[data-translation-color=green] #study.study .translation{background:#203a2d;border-color:#47745a}
body.theme-dark[data-translation-color=green] #study.study .translation p,body.theme-dark[data-translation-color=green] #study.study .translation span{color:#a6e1b9}
body.theme-dark[data-translation-color=green] #study #blindToggle,body.theme-dark[data-translation-color=green] #study #blindToggle:hover{background:#274732!important;border-color:#5d9b72!important;color:#c0e8ce}
/* Keep navigation calm and readable against the dark lesson surface. */
body.theme-dark #previewHome,body.theme-dark a.pitru-home-button{background:#233c30!important;border-color:#58896b!important;color:#c1e5ce!important}
body.theme-dark #previewHome:hover,body.theme-dark a.pitru-home-button:hover{background:#2c4a3a!important;border-color:#76ab8b!important}
body.theme-dark a.pitru-home-button .home-icon{filter:brightness(0) saturate(100%) invert(88%) sepia(15%) saturate(400%) hue-rotate(87deg)}
body.theme-dark #practiceLinks .practice-favorites-link{background:#3c3623;border-color:#897a46;color:#eee0aa}
body.theme-dark #practiceLinks .practice-favorites-link:hover{background:#4b422a;border-color:#ad995b;color:#fff0bb}

/* Additional palettes and the two saved theme intensity choices. */
body[data-lesson-theme=teal]{--theme-page:#f0f9f8;--theme-soft:#e0f2ef;--theme-strong:#c1e2dd;--theme-border:#7ab4ac;--theme-ink:#2e6560;--theme-accent:#579c93;--theme-light:#ace0d7;}
.swatch-teal{background:linear-gradient(135deg,#e0f2ef 50%,#579c93 50%)}
body[data-lesson-theme=coral]{--theme-page:#fff5f2;--theme-soft:#fce6df;--theme-strong:#f4cec2;--theme-border:#d49b89;--theme-ink:#824f42;--theme-accent:#c7836e;--theme-light:#f4c5b5;}
.swatch-coral{background:linear-gradient(135deg,#fce6df 50%,#c7836e 50%)}
body[data-lesson-theme=sky]{--theme-page:#f3faff;--theme-soft:#e4f4fc;--theme-strong:#cce9f7;--theme-border:#8cbdd6;--theme-ink:#386980;--theme-accent:#6aaccb;--theme-light:#b4e1f6;}
.swatch-sky{background:linear-gradient(135deg,#e4f4fc 50%,#6aaccb 50%)}
body[data-lesson-theme=lilac]{--theme-page:#f8f3fc;--theme-soft:#f1e5f8;--theme-strong:#e3cdef;--theme-border:#b994ce;--theme-ink:#704f85;--theme-accent:#a57aba;--theme-light:#dfc1f0;}
.swatch-lilac{background:linear-gradient(135deg,#f1e5f8 50%,#a57aba 50%)}
body[data-lesson-theme=olive]{--theme-page:#f8f9f0;--theme-soft:#eff1dc;--theme-strong:#e0e5bc;--theme-border:#b1b77d;--theme-ink:#5b6338;--theme-accent:#98a15f;--theme-light:#d6dfa4;}
.swatch-olive{background:linear-gradient(135deg,#eff1dc 50%,#98a15f 50%)}
body[data-lesson-theme=paper]{--theme-page:#f5f5f3;--theme-soft:#fafafa;--theme-strong:#e4e4e1;--theme-border:#93938f;--theme-ink:#292929;--theme-accent:#686865;--theme-light:#e0e0dd;}
.swatch-paper{background:linear-gradient(135deg,#fafafa 50%,#686865 50%)}
.theme-style-switch{display:flex;gap:8px;margin:14px 0;flex-wrap:wrap}.theme-style-switch button{flex:1;min-height:42px;padding:9px 12px;border:2px solid #c2ced8;border-radius:9px;background:#f5f8fb;color:#435969;font:inherit;font-weight:700;cursor:pointer}.theme-style-switch button[aria-pressed=true]{background:var(--theme-strong);border-color:var(--theme-accent);color:var(--theme-ink)}
body[data-theme-style]{--translation-soft:color-mix(in srgb,#e7f4e9 85%,var(--theme-soft));--translation-border:color-mix(in srgb,#9ccbac 75%,var(--theme-border));--translation-ink:color-mix(in srgb,#326c48 85%,var(--theme-ink));--nav-soft:var(--theme-soft);--nav-strong:var(--theme-strong);--nav-border:var(--theme-border);--nav-ink:var(--theme-ink)}
body[data-theme-style=full]{--translation-soft:var(--theme-soft);--translation-border:var(--theme-border);--translation-ink:var(--theme-ink)}
body[data-theme-style] #study.study .translation{background:var(--translation-soft)!important;border-color:var(--translation-border)!important}
body[data-theme-style] #study.study .translation :is(p,span){color:var(--translation-ink)!important}
body[data-theme-style] #study #blindToggle{background:var(--translation-soft)!important;border-color:var(--translation-border)!important;color:var(--translation-ink)!important}
body.theme-dark[data-theme-style]{--translation-soft:color-mix(in srgb,#203a2d 85%,var(--theme-ink));--translation-border:color-mix(in srgb,#58856a 75%,var(--theme-accent));--translation-ink:#b9dfc6;--nav-soft:color-mix(in srgb,#1b2633 80%,var(--theme-ink));--nav-strong:color-mix(in srgb,#1b2633 65%,var(--theme-ink));--nav-border:var(--theme-accent);--nav-ink:var(--theme-light)}
body.theme-dark[data-theme-style=full]{--translation-soft:var(--nav-soft);--translation-border:var(--nav-border);--translation-ink:var(--theme-light)}
body[data-theme-style=full] #previewHome,body[data-theme-style=full] a.pitru-home-button,body[data-theme-style=full] #practiceLinks #practiceFavorites,body[data-theme-style=full] #study #favoriteWord{background:var(--nav-soft)!important;border-color:var(--nav-border)!important;color:var(--nav-ink)!important}
body[data-theme-style=full] #previewHome:hover,body[data-theme-style=full] a.pitru-home-button:hover,body[data-theme-style=full] #practiceLinks #practiceFavorites:hover,body[data-theme-style=full] #study #favoriteWord[aria-pressed=true]{background:var(--nav-strong)!important}
body[data-theme-style=full] #practiceLinks :is(.teacher-dashboard-button,.split-account,.practice-logout),body[data-theme-style=full] .browse-controls button,body[data-theme-style=full] #study :is(#replayAudio,#slowAudio,#autoAudio,#letterHint){background:var(--nav-strong)!important;border-color:var(--nav-border)!important;color:var(--nav-ink)!important}
body[data-theme-style=full] #study #favoriteWord .favorite-label{color:inherit}
body[data-theme-style=full] a.pitru-home-button .home-icon{filter:grayscale(1)}
body.theme-dark .theme-style-switch button{background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}body.theme-dark .theme-style-switch button[aria-pressed=true]{border-color:var(--theme-light);background:var(--nav-strong);color:var(--theme-light)}
body[data-theme-style=full] #study{--theme-soft:inherit;--theme-strong:inherit;--theme-border:inherit;--theme-ink:inherit;--theme-light:inherit;}
body[data-theme-style=full] #study :is(.option.right,.learning-answer.right),body[data-theme-style=full] #study.answer-confirmed .blank.answered,body[data-theme-style=full] #lessonPreview .preview-word.heard{background:var(--nav-strong)!important;border-color:var(--nav-border)!important;color:var(--nav-ink)!important;-webkit-text-fill-color:var(--nav-ink)}
body[data-theme-style=full] #study #bar{background:var(--theme-accent)}
/* Complete mobile account capsule and dark practice settings. */
@media(max-width:600px){
 body:has(#study) #practiceLinks .split-account{min-height:40px;min-width:112px;max-width:100%;box-sizing:border-box;align-items:center;justify-content:center;background:#edf3fb;color:#365d84;border:1px solid #b5c9df!important;border-radius:10px;overflow:visible;flex:0 0 auto}
 body:has(#study) #practiceLinks .split-account>small{display:block;padding:10px 16px;border:0;background:transparent;font-size:13px;line-height:1.4;white-space:normal}
}
body.theme-dark #practiceLinks :is(.split-account,.teacher-dashboard-button){background:var(--dark-input)!important;border-color:var(--dark-border)!important;color:var(--dark-ink)!important}
body.theme-dark #practiceLinks .split-account>small{background:transparent;color:inherit;border-color:var(--dark-border)}
body.theme-dark #practiceLinks :is(.split-account,.teacher-dashboard-button):hover{background:#31485c!important}
body.theme-dark .header-actions #allIn[aria-pressed=false]{background:#28323e;color:#c0cad4;border-color:#596777}
body.theme-dark .header-actions #allIn[aria-pressed=true]{background:#244332;color:#b5e5c7;border-color:#5fa77c}
body.theme-dark .study-nav label{color:var(--dark-ink)}
body.theme-dark .study-nav .sections button,body.theme-dark .study-nav #set,body.theme-dark #groupLevels,body.theme-dark #groupLevels .level-choice{background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark .study-nav #set option{background:var(--dark-surface);color:var(--dark-ink)}
body.theme-dark .study-nav .sections button.active,body.theme-dark .study-nav .sections button[aria-pressed=true],body.theme-dark #groupLevels .level-choice[aria-pressed=true]{background:#294936;border-color:#6ca782;color:#bde5ca}
body.theme-dark #groupLevels summary{color:var(--dark-ink)}
body.theme-dark #groupLevels :is(p,.group-actions span){color:#bac9d6}
body.theme-dark #groupLevels #applyLevels{background:#304b62;border-color:#698ca9;color:#e5edf5}
/* Shared appearance bar stays in document flow on every page. */
body #globalThemeBar{display:flex!important;align-items:center;justify-content:center;flex-wrap:wrap;gap:9px;max-width:1120px;margin:24px auto 16px;padding:14px 20px;border-top:1px solid var(--theme-border);font:600 13px Nunito,system-ui,sans-serif;color:var(--theme-ink)}
#globalThemeBar label{display:flex;align-items:center;gap:8px}#globalThemeBar :is(select,button){width:auto;min-height:38px;margin:0;padding:8px 12px;border:1px solid var(--theme-border);border-radius:9px;background:var(--theme-soft);color:var(--theme-ink);font:inherit;cursor:pointer}#globalThemeBar button[aria-pressed=true]{background:var(--theme-strong);border-color:var(--theme-accent);box-shadow:inset 0 0 0 1px var(--theme-accent)}
body .session-appearance-controls{display:none!important}
body[data-theme-style] :is(.study-nav .sections button,.study-nav #set,#groupLevels,#groupLevels .level-choice,.header-actions #allIn,.ui-language summary,.ui-language-options,.ui-language-options button){background:var(--nav-soft)!important;border-color:var(--nav-border)!important;color:var(--nav-ink)!important}
body[data-theme-style] :is(.study-nav .sections button.active,#groupLevels .level-choice[aria-pressed=true],.header-actions #allIn[aria-pressed=true],.ui-language-options button:hover){background:var(--nav-strong)!important;border-color:var(--theme-accent)!important}
body[data-theme-style] #practiceLinks .split-account{background:var(--nav-soft)!important;color:var(--nav-ink)!important;border-color:var(--nav-border)!important}body[data-theme-style] #practiceLinks .split-account small{background:transparent;color:inherit;border-color:var(--nav-border)}
body[data-theme-style] #groupLevels :is(summary,p,.group-actions span),body[data-theme-style] .study-nav label{color:var(--nav-ink)}
body.theme-dark #globalThemeBar{color:var(--dark-ink);border-color:var(--dark-border)}body.theme-dark #globalThemeBar :is(select,button){background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}body.theme-dark #globalThemeBar button[aria-pressed=true]{background:var(--nav-strong);border-color:var(--theme-light)}
/* Dark home and auxiliary pages share readable surfaces. */
body.theme-dark :is(.level,.home-level-preview,.home-stat,.points,.section-intro,.category-info,.login-panel,.admin-panel,.favorite-item,.memory-word,.memory-tile){background:var(--dark-surface)!important;border-color:var(--dark-border)!important;color:var(--dark-ink)!important}
body.theme-dark :is(.brand,.eyebrow,.home-motto,.course-description,.home-stat strong,.home-stat span,.level h3,.level strong,.section-toggle,.section-heading,.home-preview-heading,h1,h2,h3){color:var(--dark-ink)}
body.theme-dark :is(.range-button,.home-preview-word,.home-page #courseSwitch summary,.home-page .course-options,.home-page .course-options button){background:var(--dark-input)!important;border-color:var(--dark-border)!important;color:var(--dark-ink)!important}
body.theme-dark :is(.home-preview-word.selected,.range-button.selected-range,.practice-level-now,.home-preview-start){background:#294936!important;border-color:#6ca782!important;color:#bde5ca!important}
body.theme-dark.home-page :is(#nextHomeLesson,#continuePractice,#quickGame,#teacher,#accountLink,#refreshHomeLink,#favoritesHome){background:var(--dark-input)!important;border-color:var(--dark-border)!important;color:var(--dark-ink)!important}
body.theme-dark.home-page :is(#logout,#status,.welcome p,.level p,.level small,.course-kicker,.section-intro p){color:#bac9d6}
body.theme-dark .home-stat :is(strong,span),body.theme-dark #pointsBox :is(strong,span){color:var(--dark-ink)!important}
@media(max-width:600px){#globalThemeBar{gap:7px;padding:12px}#globalThemeBar label{flex-basis:100%;justify-content:center}}
/* Preserve each Home shortcut's identity without bright light-mode fills. */
body.theme-dark.home-page #nextHomeLesson{background:#233c30!important;border-color:#65ad82!important;color:#c4ead2!important}
body.theme-dark.home-page #favoritesHome{background:#3b3521!important;border-color:#b5a45e!important;color:#f3e5ac!important}
body.theme-dark.home-page #refreshHomeLink{background:#203b49!important;border-color:#6eacc5!important;color:#c2e5f2!important}
body.theme-dark.home-page #quickGame{background:#362c48!important;border-color:#a38abb!important;color:#e1d3f1!important}
body.theme-dark.home-page #continuePractice{background:#432c37!important;border-color:#bd8498!important;color:#f2cfdd!important}
body.theme-dark.home-page #teacher{background:#2a354b!important;border-color:#839fc9!important;color:#d4e3fa!important}
body.theme-dark.home-page #accountLink{background:#26394b!important;border-color:#819db7!important;color:#e5edf5!important}
body.theme-dark.home-page #accountLink>small{background:#30465a;color:#e5edf5;border-color:#819db7}
body.theme-dark.home-page :is(#nextHomeLesson,#favoritesHome,#refreshHomeLink,#quickGame,#continuePractice,#teacher,#accountLink):hover{filter:brightness(1.12)}
body.theme-dark.home-page #accountLink[hidden]{display:none!important}
/* Keep both parts of the account link visible and readable on narrow screens. */
@media(max-width:600px){
 body:has(#study) #practiceLinks .split-account{display:inline-flex!important;flex-wrap:wrap;align-items:stretch;justify-content:center;min-height:42px;max-width:100%;overflow:hidden}
 body:has(#study) #practiceLinks .split-account>[data-username]{display:flex!important;align-items:center;justify-content:center;min-width:0;max-width:100%;padding:10px 12px;overflow-wrap:anywhere;white-space:normal;font-size:13px;line-height:1.4}
 body:has(#study) #practiceLinks .split-account>small{display:flex;align-items:center;justify-content:center;padding:10px 12px;border-left:1px solid var(--nav-border);font-size:13px;line-height:1.4}
 body.theme-dark.home-page #accountLink{display:inline-flex;align-items:stretch;min-width:0;max-width:100%;overflow:hidden}
 body.theme-dark.home-page #accountLink>span{display:flex;align-items:center;justify-content:center;min-width:0;padding:10px 12px;overflow-wrap:anywhere;white-space:normal;color:inherit}
 body.theme-dark.home-page #accountLink>small{display:flex!important;align-items:center;justify-content:center;padding:10px 12px;white-space:normal;font-size:13px;line-height:1.4}
}
/* The expanded level wrapper must not expose its white light-mode surface. */
body.theme-dark.home-page .level-entry.expanded{background:var(--dark-surface);border-color:#527c66;box-shadow:none}
body.theme-dark.home-page .level-entry.expanded:hover,body.theme-dark.home-page .level-entry.expanded:focus-within{border-color:#6ca782}
body.theme-dark.home-page .level-entry.expanded>.level,body.theme-dark.home-page .level-entry.expanded>.home-level-preview{background:transparent!important;border:0;box-shadow:none}

/* Distinct greens for Soft; full palettes remain unchanged. */
body[data-lesson-theme=amber]{--theme-page:#fff9ed;--theme-soft:#fff0d1;--theme-strong:#f4dba0;--theme-border:#cfad64;--theme-ink:#775c2d;--theme-accent:#bc964b;--theme-light:#efda9e;}
.swatch-amber{background:linear-gradient(135deg,#fff0d1 50%,#bc964b 50%)}
body[data-lesson-theme=indigo]{--theme-page:#f3f4fc;--theme-soft:#e8ebfa;--theme-strong:#d1d8f2;--theme-border:#979fc9;--theme-ink:#4b568b;--theme-accent:#7d89bc;--theme-light:#c4cdf3;}
.swatch-indigo{background:linear-gradient(135deg,#e8ebfa 50%,#7d89bc 50%)}
body[data-lesson-theme=forest]{--theme-page:#f1f7f1;--theme-soft:#e0eee3;--theme-strong:#c3ddc9;--theme-border:#88ac91;--theme-ink:#365e41;--theme-accent:#669873;--theme-light:#b9dcc2;}
.swatch-forest{background:linear-gradient(135deg,#e0eee3 50%,#669873 50%)}
body[data-lesson-theme=plum]{--theme-page:#faf3f8;--theme-soft:#f3e5ef;--theme-strong:#e5cbe0;--theme-border:#bd97b5;--theme-ink:#754d6d;--theme-accent:#ab7b9e;--theme-light:#e6bddd;}
.swatch-plum{background:linear-gradient(135deg,#f3e5ef 50%,#ab7b9e 50%)}
body[data-lesson-theme=slate]{--theme-page:#f3f6f7;--theme-soft:#e7eef0;--theme-strong:#d0dee3;--theme-border:#98afb9;--theme-ink:#465f6b;--theme-accent:#7b99a6;--theme-light:#c1d7e0;}
.swatch-slate{background:linear-gradient(135deg,#e7eef0 50%,#7b99a6 50%)}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=default]{--translation-soft:#e7f4e9;--translation-border:#cce5d1;--translation-ink:#46D180;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=default]{--translation-soft:#203a2d;--translation-border:#47745a;--translation-ink:#a6e1b9;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=lavender]{--translation-soft:#e7f1ea;--translation-border:#a8c6b4;--translation-ink:#397b5c;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=lavender]{--translation-soft:#263b32;--translation-border:#608c77;--translation-ink:#b6dcc8;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=mint]{--translation-soft:#def4eb;--translation-border:#97ccb7;--translation-ink:#29775c;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=mint]{--translation-soft:#193d32;--translation-border:#4a8c74;--translation-ink:#9de0c6;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=rose]{--translation-soft:#eef3e6;--translation-border:#bccba3;--translation-ink:#58753d;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=rose]{--translation-soft:#323c28;--translation-border:#83956b;--translation-ink:#d0dfa9;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=peach]{--translation-soft:#edf3da;--translation-border:#bfcc96;--translation-ink:#657c34;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=peach]{--translation-soft:#343e23;--translation-border:#8c9e5c;--translation-ink:#d5e4a1;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=sand]{--translation-soft:#f0f2dc;--translation-border:#c6ca98;--translation-ink:#727b3c;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=sand]{--translation-soft:#3a3e27;--translation-border:#939963;--translation-ink:#dce1ad;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=teal]{--translation-soft:#ddf3ee;--translation-border:#8dc8ba;--translation-ink:#28796d;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=teal]{--translation-soft:#193c37;--translation-border:#4d8e82;--translation-ink:#9bddcf;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=coral]{--translation-soft:#e9f2df;--translation-border:#b2c99e;--translation-ink:#507838;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=coral]{--translation-soft:#2d3d26;--translation-border:#7b9866;--translation-ink:#c3dfa7;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=sky]{--translation-soft:#e1f4ec;--translation-border:#a1d1ba;--translation-ink:#33846a;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=sky]{--translation-soft:#1d3d33;--translation-border:#528e75;--translation-ink:#a5e1c7;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=lilac]{--translation-soft:#e9f0e8;--translation-border:#b0c5b0;--translation-ink:#4f7957;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=lilac]{--translation-soft:#2b3b2e;--translation-border:#758f77;--translation-ink:#c1d9be;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=olive]{--translation-soft:#eef2d8;--translation-border:#c3cc92;--translation-ink:#697e33;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=olive]{--translation-soft:#373f23;--translation-border:#929e5e;--translation-ink:#dce7a7;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=paper]{--translation-soft:#edf1ed;--translation-border:#b9c7bc;--translation-ink:#596f5d;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=paper]{--translation-soft:#303b33;--translation-border:#788b7d;--translation-ink:#c9d7cc;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=amber]{--translation-soft:#f1f4d7;--translation-border:#cdd59a;--translation-ink:#758438;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=amber]{--translation-soft:#3b4127;--translation-border:#a2ac68;--translation-ink:#e2ecae;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=indigo]{--translation-soft:#e2f1ec;--translation-border:#9dc6b8;--translation-ink:#367565;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=indigo]{--translation-soft:#213a35;--translation-border:#598b7b;--translation-ink:#b0dbcd;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=forest]{--translation-soft:#dfeddd;--translation-border:#9cbb98;--translation-ink:#426f3b;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=forest]{--translation-soft:#263c24;--translation-border:#648c5d;--translation-ink:#b4d8aa;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=plum]{--translation-soft:#edf2e8;--translation-border:#bbcda9;--translation-ink:#597b45;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=plum]{--translation-soft:#303e29;--translation-border:#849e70;--translation-ink:#cfe3bb;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=slate]{--translation-soft:#e4efea;--translation-border:#a6c2b4;--translation-ink:#486f60;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=slate]{--translation-soft:#293c34;--translation-border:#6f8e7e;--translation-ink:#bdd9c9;}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=language]{--translation-soft:#e5f2e7;--translation-border:#abcbb4;--translation-ink:#3f7c53;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=language]{--translation-soft:#253d2d;--translation-border:#5e8969;--translation-ink:#b5dfbf;}

/* The six Memories tier palettes are also selectable lesson themes. */
body[data-lesson-theme=memory-wood]{--theme-page:#faf5ef;--theme-soft:#f2e2d2;--theme-strong:#e6cbb1;--theme-border:#bc936c;--theme-ink:#6b482d;--theme-accent:#a67d55;--theme-light:#e6cbb1;}
.swatch-memory-wood{background:linear-gradient(135deg,#f2e2d2 50%,#e6cbb1 50%);border-color:#bc936c}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=memory-wood]{--translation-soft:#eef1df;--translation-border:#c3c9a1;--translation-ink:#65753e;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=memory-wood]{--translation-soft:#353d28;--translation-border:#929d6c;--translation-ink:#d7e2b0;}
body[data-lesson-theme=memory-stone]{--theme-page:#f3f5f3;--theme-soft:#e7e8e7;--theme-strong:#d0d8d3;--theme-border:#9baba4;--theme-ink:#465650;--theme-accent:#82988c;--theme-light:#c8d9ce;}
.swatch-memory-stone{background:linear-gradient(135deg,#e7e8e7 50%,#d0d8d3 50%);border-color:#9baba4}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=memory-stone]{--translation-soft:#e5ede5;--translation-border:#acbfae;--translation-ink:#4b6c50;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=memory-stone]{--translation-soft:#2c392e;--translation-border:#768d79;--translation-ink:#c1d6c4;}
body[data-lesson-theme=memory-silver]{--theme-page:#f5f7fa;--theme-soft:#edf1f5;--theme-strong:#dbe2e9;--theme-border:#a3afbe;--theme-ink:#48566c;--theme-accent:#8c9db2;--theme-light:#d5e0ef;}
.swatch-memory-silver{background:linear-gradient(135deg,#edf1f5 50%,#dbe2e9 50%);border-color:#a3afbe}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=memory-silver]{--translation-soft:#e6f0ec;--translation-border:#aec8bd;--translation-ink:#4b7763;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=memory-silver]{--translation-soft:#293b34;--translation-border:#789b89;--translation-ink:#bedccc;}
body[data-lesson-theme=memory-gold]{--theme-page:#fffcf0;--theme-soft:#fff8dd;--theme-strong:#fae6a0;--theme-border:#e4bf59;--theme-ink:#725c20;--theme-accent:#c6a13d;--theme-light:#f3e0a2;}
.swatch-memory-gold{background:linear-gradient(135deg,#fff8dd 50%,#fae6a0 50%);border-color:#e4bf59}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=memory-gold]{--translation-soft:#f0f4d8;--translation-border:#cad696;--translation-ink:#748439;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=memory-gold]{--translation-soft:#3a4126;--translation-border:#a0ac67;--translation-ink:#e0ebaa;}
body[data-lesson-theme=memory-diamond]{--theme-page:#f5fbff;--theme-soft:#e9f6fc;--theme-strong:#d5f0f8;--theme-border:#94c8e3;--theme-ink:#446c92;--theme-accent:#7eafd0;--theme-light:#c3e6f6;}
.swatch-memory-diamond{background:linear-gradient(135deg,#e9f6fc 50%,#d5f0f8 50%);border-color:#94c8e3}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=memory-diamond]{--translation-soft:#e1f4ef;--translation-border:#9dcebf;--translation-ink:#357c68;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=memory-diamond]{--translation-soft:#213c35;--translation-border:#5c9681;--translation-ink:#afe4d2;}
body[data-lesson-theme=memory-cloud]{--theme-page:#f5fbff;--theme-soft:#f0faff;--theme-strong:#dceff8;--theme-border:#a6d8ef;--theme-ink:#326a87;--theme-accent:#83bfdc;--theme-light:#caeafa;}
.swatch-memory-cloud{background:linear-gradient(135deg,#f0faff 50%,#dceff8 50%);border-color:#a6d8ef}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=memory-cloud]{--translation-soft:#e5f5ed;--translation-border:#aed7bd;--translation-ink:#408460;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=memory-cloud]{--translation-soft:#233d30;--translation-border:#639c79;--translation-ink:#bee8cc;}
.swatch-memory-silver{background:linear-gradient(135deg,#f8fafc,#dbe2e9,#f5f7fa)}
.swatch-memory-gold{background:linear-gradient(135deg,#fff8dd,#fae6a0,#fff6d4)}
.swatch-memory-diamond{background:linear-gradient(135deg,#f6fdff,#d5f0f8,#e9e5ff,#f4fcff)}

/* Six additional pastel themes. */
body[data-lesson-theme=buttercream]{--theme-page:#fffdf3;--theme-soft:#fff6d9;--theme-strong:#f5e9b7;--theme-border:#d9c889;--theme-ink:#726536;--theme-accent:#c4ae6b;--theme-light:#f2e5b0;}
.swatch-buttercream{background:linear-gradient(135deg,#fff6d9 50%,#f5e9b7 50%);border-color:#d9c889}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=buttercream]{--translation-soft:#f1f5df;--translation-border:#cbd6a2;--translation-ink:#70833e;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=buttercream]{--translation-soft:#394128;--translation-border:#9cae6a;--translation-ink:#dcebb6;}
body[data-lesson-theme=pistachio]{--theme-page:#f8fbf1;--theme-soft:#edf4dc;--theme-strong:#dce9c1;--theme-border:#b1c58e;--theme-ink:#566d3c;--theme-accent:#95b170;--theme-light:#d6e8b8;}
.swatch-pistachio{background:linear-gradient(135deg,#edf4dc 50%,#dce9c1 50%);border-color:#b1c58e}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=pistachio]{--translation-soft:#e9f3d9;--translation-border:#bbd29c;--translation-ink:#5d7d3d;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=pistachio]{--translation-soft:#303f26;--translation-border:#829e62;--translation-ink:#cce4af;}
body[data-lesson-theme=powder-pink]{--theme-page:#fff7fa;--theme-soft:#fce9f1;--theme-strong:#f5d4e4;--theme-border:#d9abc1;--theme-ink:#855b70;--theme-accent:#c591ad;--theme-light:#f2cadf;}
.swatch-powder-pink{background:linear-gradient(135deg,#fce9f1 50%,#f5d4e4 50%);border-color:#d9abc1}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=powder-pink]{--translation-soft:#edf4e7;--translation-border:#bfd3af;--translation-ink:#587c46;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=powder-pink]{--translation-soft:#303e2b;--translation-border:#85a273;--translation-ink:#cee5bd;}
body[data-lesson-theme=periwinkle]{--theme-page:#f7f7ff;--theme-soft:#ececfc;--theme-strong:#dcdcf5;--theme-border:#b4b3d9;--theme-ink:#60618b;--theme-accent:#9594c0;--theme-light:#d7d7f5;}
.swatch-periwinkle{background:linear-gradient(135deg,#ececfc 50%,#dcdcf5 50%);border-color:#b4b3d9}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=periwinkle]{--translation-soft:#e7f3ed;--translation-border:#afcfc0;--translation-ink:#427a63;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=periwinkle]{--translation-soft:#263d33;--translation-border:#6b9b83;--translation-ink:#bce1cc;}
body[data-lesson-theme=apricot]{--theme-page:#fff9f4;--theme-soft:#fff0e3;--theme-strong:#f8ddc8;--theme-border:#dfb99c;--theme-ink:#86634a;--theme-accent:#cda17d;--theme-light:#f5d9be;}
.swatch-apricot{background:linear-gradient(135deg,#fff0e3 50%,#f8ddc8 50%);border-color:#dfb99c}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=apricot]{--translation-soft:#eef4dd;--translation-border:#c4d2a0;--translation-ink:#687e3c;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=apricot]{--translation-soft:#374027;--translation-border:#96a86a;--translation-ink:#dce9b3;}
body[data-lesson-theme=seafoam]{--theme-page:#f3fcf9;--theme-soft:#e2f5ee;--theme-strong:#ccebe0;--theme-border:#9bcabc;--theme-ink:#3e7165;--theme-accent:#7bb5a4;--theme-light:#bde7d8;}
.swatch-seafoam{background:linear-gradient(135deg,#e2f5ee 50%,#ccebe0 50%);border-color:#9bcabc}
body:not(.theme-dark)[data-theme-style=soft][data-lesson-theme=seafoam]{--translation-soft:#def4e9;--translation-border:#9dcfb6;--translation-ink:#357c5b;}
body.theme-dark[data-theme-style=soft][data-lesson-theme=seafoam]{--translation-soft:#203e2e;--translation-border:#5b9774;--translation-ink:#afe4c7;}
/* Favorites need their own readable text and a clear selected outline in dark mode. */
body.theme-dark.favorites-page #favoriteList .favorite-item{background:#302e25!important;border:2px solid #766e50!important;color:#f1e8c9!important;box-shadow:none;transition:background .15s,border-color .15s,box-shadow .15s}
body.theme-dark.favorites-page #favoriteList .favorite-item .favorite-select{color:#f1e8c9;font-size:16px;font-weight:700;line-height:1.5;-webkit-font-smoothing:antialiased}
body.theme-dark.favorites-page #favoriteList .favorite-item.selected{background:#484029!important;border-color:#f0d981!important;box-shadow:0 0 0 1px #f0d98155}
body.theme-dark.favorites-page #favoriteList .favorite-item.selected .favorite-select{color:#fff3c2;font-weight:800}
body.theme-dark.favorites-page #favoriteList .favorite-item:hover{border-color:#c6b56f!important}
body.theme-dark.favorites-page #favoriteList .favorite-item.selected:hover{border-color:#ffe8a0!important}
body.theme-dark.favorites-page #favoriteList .favorite-item>button:not(.favorite-select){color:#d5cba8}
body.theme-dark.favorites-page #favoriteList .seen-today{color:#bcb9aa!important}
body.theme-dark.favorites-page #favoriteList .favorite-select:focus-visible{outline:2px solid #f0d981;outline-offset:-4px}
body.theme-dark.favorites-page #favoriteSuggestions button{background:#263d50;border-color:#739ab8;color:#deedfa;font-size:16px;line-height:1.5}
body.theme-dark.favorites-page #favoriteSuggestions button small{color:#b6ccdf}
body.theme-dark.favorites-page #favoriteSuggestions button:hover{background:#304b62;border-color:#9cc3e1}
body.theme-dark.favorites-page #favoriteSearch{background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
/* Favorites actions keep their yellow/green identity on dark surfaces. */
body.theme-dark.favorites-page #practiceFavorites{background:#494022;border-color:#bba252;color:#fff0b2}
body.theme-dark.favorites-page #practiceFavorites:hover:not(:disabled){background:#5a4e28;border-color:#dfc56d}
body.theme-dark.favorites-page #practiceFavorites:disabled{background:#2a3037;border-color:#525b65;color:#9ca6b1;opacity:1;cursor:default}
body.theme-dark.favorites-page #saveFavorites{background:#244332;border-color:#639d78;color:#c7ecd3}
body.theme-dark.favorites-page #saveFavorites:hover{background:#2e533e;border-color:#82bb96}
body.theme-dark.favorites-page #saveFavorites:disabled{opacity:.55;cursor:default}
body.theme-dark.favorites-page #favoriteList .favorite-item.selected{background:#65551f!important;border-color:#f0d981!important}
body.theme-dark.favorites-page #favoriteList .favorite-item.selected .favorite-select{color:#fff5cd}
/* Fill the viewport and prevent the light document canvas showing below short pages. */
html:has(body.theme-dark){background:#111923;color-scheme:dark}
body.theme-dark{min-height:100svh;display:flow-root}
body.favorites-page #favoriteSuggestions:empty{margin:0}
body.favorites-page main{padding-bottom:24px}
/* Memories panels and tier text stay readable on dark surfaces. */
body.theme-dark .refresh-main :is(.refresh-panel,.memory-category-info){background:var(--dark-surface);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark .refresh-main :is(.memory-category-info p,.memory-category-info h2,#refreshIntro,#refreshStatus,.refresh-help,.refresh-score,#memoryLearnMore){color:#c5dce9}
body.theme-dark .refresh-main #refreshSearch{background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}
body.theme-dark .refresh-main .tier-0{--tier-bg:#413326;--tier-border:#ad8864;--tier-text:#eed2b5}
body.theme-dark .refresh-main .tier-1{--tier-bg:#303b35;--tier-border:#859c8f;--tier-text:#d6e4da}
body.theme-dark .refresh-main .tier-2{--tier-bg:linear-gradient(135deg,#2c3542,#3d4959);--tier-border:#94a5bb;--tier-text:#e0e9f5}
body.theme-dark .refresh-main .tier-3{--tier-bg:linear-gradient(135deg,#393322,#514526);--tier-border:#bfa458;--tier-text:#f4e3ab}
body.theme-dark .refresh-main .tier-4{--tier-bg:linear-gradient(135deg,#243b49,#393650);--tier-border:#80b3d1;--tier-text:#d1ecfb}
body.theme-dark .refresh-main .tier-5{--tier-bg:#243d4a;--tier-border:#78abc4;--tier-text:#d3edf9}
body.theme-dark .refresh-main .memory-word.memory-tier{background:var(--tier-bg)!important;border-color:var(--tier-border)!important;color:var(--tier-text)!important}
body.theme-dark .refresh-main .memory-word.memory-tier :is(strong,span,small){color:var(--tier-text)}
body.theme-dark .refresh-main .memory-groups .memory-tier[aria-pressed=true]{outline-color:#718ca1;box-shadow:0 0 0 2px #91bdd055}
body.theme-dark .refresh-main .refresh-score strong{background:var(--dark-input);color:var(--dark-ink)}
body.home-page #accountLink.home-account-link,body.theme-dark.home-page #accountLink.home-account-link{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px 10px;background:transparent!important;border:0!important;border-radius:0;box-shadow:none;padding:8px 0!important;min-height:36px;text-decoration:none;color:#365d84!important;filter:none}
body.home-page #accountLink.home-account-link>span,body.home-page #accountLink.home-account-link>small{display:inline!important;padding:0!important;border:0;background:transparent;line-height:1.4;font-size:14px;white-space:normal;overflow-wrap:anywhere}
body.home-page #accountLink.home-account-link>span{font-weight:700}body.home-page #accountLink.home-account-link>small{font-weight:600;color:inherit}
body.theme-dark.home-page #accountLink.home-account-link{color:#c4d9eb!important}
body.home-page #accountLink.home-account-link:hover{text-decoration:underline;filter:none}
body.home-page #accountLink.home-account-link[hidden]{display:none!important}
/* The two Home language selectors always share the selected palette. */
body.home-page header .home-language-controls :is(.ui-language,#courseSwitch)>summary{background:var(--nav-soft,var(--theme-soft))!important;border-color:var(--nav-border,var(--theme-border))!important;color:var(--nav-ink,var(--theme-ink))!important;box-shadow:none}
body.home-page header .home-language-controls :is(.ui-language,#courseSwitch)>summary:hover,body.home-page header .home-language-controls :is(.ui-language,#courseSwitch)[open]>summary{background:var(--nav-strong,var(--theme-strong))!important;border-color:var(--theme-accent)!important;color:var(--nav-ink,var(--theme-ink))!important}
body.home-page header .home-language-controls :is(.ui-language,#courseSwitch)>summary:focus-visible{outline:2px solid var(--theme-accent);outline-offset:3px}
body.theme-dark #groupLevels :is(#applyLevelsTop,#applyLevelsInline){background:#304b62;border-color:#698ca9;color:#e5edf5}
body[data-theme-style=full] #groupLevels :is(#applyLevels,#applyLevelsTop,#applyLevelsInline){background:var(--nav-strong)!important;border-color:var(--nav-border)!important;color:var(--nav-ink)!important}
body.theme-dark .game-level-mix,body.theme-dark .game-level-groups fieldset{background:var(--dark-surface);border-color:var(--dark-border);color:var(--dark-ink)}body.theme-dark .game-level-groups label{background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}body.theme-dark .game-level-groups label:has(input:checked){background:#294936;border-color:#6ca782;color:#bde5ca}body.theme-dark .game-level-bar :is(#gameShuffleLevels,.game-shuffle-shortcut){background:var(--dark-input);border-color:var(--dark-border);color:var(--dark-ink)}

/* Memories progression: cloud, crystal, wood, silver, gold, diamond. */
body:not(.theme-dark) .refresh-main .memory-tier.tier-0{--tier-bg:#f0faff;--tier-border:#9ccfe8;--tier-text:#326a87;}
body.theme-dark .refresh-main .memory-tier.tier-0{--tier-bg:#243d4a;--tier-border:#78abc4;--tier-text:#d3edf9;}
body:not(.theme-dark) .refresh-main .memory-tier.tier-1{--tier-bg:linear-gradient(135deg,#fbffff,#dff4f8,#eefaff);--tier-border:#85bac9;--tier-text:#355f72;}
body.theme-dark .refresh-main .memory-tier.tier-1{--tier-bg:linear-gradient(135deg,#203a44,#304b55,#263e4a);--tier-border:#8bc4d4;--tier-text:#d9f4fb;}
body:not(.theme-dark) .refresh-main .memory-tier.tier-2{--tier-bg:#f2e2d2;--tier-border:#bc936c;--tier-text:#6b482d;}
body.theme-dark .refresh-main .memory-tier.tier-2{--tier-bg:#413326;--tier-border:#ad8864;--tier-text:#eed2b5;}
body:not(.theme-dark) .refresh-main .memory-tier.tier-3{--tier-bg:linear-gradient(135deg,#f8fafc,#dbe2e9,#f5f7fa);--tier-border:#a3afbe;--tier-text:#48566c;}
body.theme-dark .refresh-main .memory-tier.tier-3{--tier-bg:linear-gradient(135deg,#2c3542,#3d4959);--tier-border:#94a5bb;--tier-text:#e0e9f5;}
body:not(.theme-dark) .refresh-main .memory-tier.tier-4{--tier-bg:linear-gradient(135deg,#fff8dd,#fae6a0,#fff6d4);--tier-border:#e4bf59;--tier-text:#725c20;}
body.theme-dark .refresh-main .memory-tier.tier-4{--tier-bg:linear-gradient(135deg,#393322,#514526);--tier-border:#bfa458;--tier-text:#f4e3ab;}
body:not(.theme-dark) .refresh-main .memory-tier.tier-5{--tier-bg:linear-gradient(135deg,#f6fdff,#d5f0f8,#e9e5ff,#f4fcff);--tier-border:#94c8e3;--tier-text:#446c92;}
body.theme-dark .refresh-main .memory-tier.tier-5{--tier-bg:linear-gradient(135deg,#243b49,#393650);--tier-border:#80b3d1;--tier-text:#d1ecfb;}
body .refresh-main .memory-word.memory-tier{background:var(--tier-bg)!important;border:2px solid var(--tier-border)!important;color:var(--tier-text)!important}
body .refresh-main .memory-groups .memory-tier{background:var(--tier-bg);border-color:var(--tier-border);color:var(--tier-text)}
/* Memories theme choices follow the same renamed tiers as the page. */
body[data-lesson-theme=memory-wood]{--theme-page:#f5fbff;--theme-soft:#f0faff;--theme-strong:#dceff8;--theme-border:#a6d8ef;--theme-ink:#326a87;--theme-accent:#83bfdc;--theme-light:#caeafa}
body[data-lesson-theme=memory-stone]{--theme-page:#f5fcff;--theme-soft:#e6f6fa;--theme-strong:#d3edf3;--theme-border:#85bac9;--theme-ink:#355f72;--theme-accent:#76aebe;--theme-light:#d9f4fb}
body[data-lesson-theme=memory-silver]{--theme-page:#faf5ef;--theme-soft:#f2e2d2;--theme-strong:#e6cbb1;--theme-border:#bc936c;--theme-ink:#6b482d;--theme-accent:#a67d55;--theme-light:#e6cbb1}
body[data-lesson-theme=memory-gold]{--theme-page:#f5f7fa;--theme-soft:#edf1f5;--theme-strong:#dbe2e9;--theme-border:#a3afbe;--theme-ink:#48566c;--theme-accent:#8c9db2;--theme-light:#d5e0ef}
body[data-lesson-theme=memory-diamond]{--theme-page:#fffcf0;--theme-soft:#fff8dd;--theme-strong:#fae6a0;--theme-border:#e4bf59;--theme-ink:#725c20;--theme-accent:#c6a13d;--theme-light:#f3e0a2}
body[data-lesson-theme=memory-cloud]{--theme-page:#f5fbff;--theme-soft:#e9f6fc;--theme-strong:#d5f0f8;--theme-border:#94c8e3;--theme-ink:#446c92;--theme-accent:#7eafd0;--theme-light:#c3e6f6}
.swatch-memory-wood{background:#f0faff;border-color:#a6d8ef}.swatch-memory-stone{background:linear-gradient(135deg,#fbffff,#dff4f8,#eefaff);border-color:#85bac9}.swatch-memory-silver{background:#f2e2d2;border-color:#bc936c}.swatch-memory-gold{background:linear-gradient(135deg,#f8fafc,#dbe2e9);border-color:#a3afbe}.swatch-memory-diamond{background:linear-gradient(135deg,#fff8dd,#fae6a0);border-color:#e4bf59}.swatch-memory-cloud{background:linear-gradient(135deg,#f6fdff,#d5f0f8,#e9e5ff);border-color:#94c8e3}
/* Final three stages: Stone, Silver, Gold. */
body:not(.theme-dark) .refresh-main .memory-tier.tier-3{--tier-bg:#e7e8e7;--tier-border:#9baba4;--tier-text:#465650}
body:not(.theme-dark) .refresh-main .memory-tier.tier-4{--tier-bg:linear-gradient(135deg,#f8fafc,#dbe2e9,#f5f7fa);--tier-border:#a3afbe;--tier-text:#48566c}
body:not(.theme-dark) .refresh-main .memory-tier.tier-5{--tier-bg:linear-gradient(135deg,#fff8dd,#fae6a0,#fff6d4);--tier-border:#e4bf59;--tier-text:#725c20}
body.theme-dark .refresh-main .memory-tier.tier-3{--tier-bg:#303b35;--tier-border:#859c8f;--tier-text:#d6e4da}
body.theme-dark .refresh-main .memory-tier.tier-4{--tier-bg:linear-gradient(135deg,#2c3542,#3d4959);--tier-border:#94a5bb;--tier-text:#e0e9f5}
body.theme-dark .refresh-main .memory-tier.tier-5{--tier-bg:linear-gradient(135deg,#393322,#514526);--tier-border:#bfa458;--tier-text:#f4e3ab}
body[data-lesson-theme=memory-gold]{--theme-page:#f3f5f3;--theme-soft:#e7e8e7;--theme-strong:#d0d8d3;--theme-border:#9baba4;--theme-ink:#465650;--theme-accent:#82988c;--theme-light:#c8d9ce}
body[data-lesson-theme=memory-diamond]{--theme-page:#f5f7fa;--theme-soft:#edf1f5;--theme-strong:#dbe2e9;--theme-border:#a3afbe;--theme-ink:#48566c;--theme-accent:#8c9db2;--theme-light:#d5e0ef}
body[data-lesson-theme=memory-cloud]{--theme-page:#fffcf0;--theme-soft:#fff8dd;--theme-strong:#fae6a0;--theme-border:#e4bf59;--theme-ink:#725c20;--theme-accent:#c6a13d;--theme-light:#f3e0a2}
.swatch-memory-gold{background:#e7e8e7;border-color:#9baba4}.swatch-memory-diamond{background:linear-gradient(135deg,#f8fafc,#dbe2e9);border-color:#a3afbe}.swatch-memory-cloud{background:linear-gradient(135deg,#fff8dd,#fae6a0);border-color:#e4bf59}
