html[data-theme=dark]{--theme-bg:#202d40;--theme-surface:#293a50;--theme-subtle:#30435b;--theme-control:#344a65;--theme-hover:#405b7b;--theme-border:#526983;--theme-border-subtle:#5c7490;--theme-border-table:#586f8b;--theme-border-control:#7189a5;--theme-muted:#c6d3e5;--theme-table-heading:#3b5270;--theme-table-cell:#2d4059;--theme-footer:#26364d;--theme-icon:#3b5474;--theme-focus-border:#7891ae;--theme-text:#ecf2fb;--theme-fa:#d8e4f7;--theme-subtle-text:#e7eefb;--theme-control-text:#edf4ff;--theme-note:#bfcde2;--theme-festival:#2d4850;--theme-festival-border:#678b8c;--theme-known-bg:#254d40;--theme-review-bg:#563640;--theme-image-bg:#263246}
html[data-theme=dark][data-color-mode=black]{--theme-bg:#08090b;--theme-surface:#15171c;--theme-subtle:#1d2027;--theme-control:#242831;--theme-hover:#333a46;--theme-border:#3d424e;--theme-border-subtle:#464d5c;--theme-border-table:#414856;--theme-border-control:#596273;--theme-muted:#c7cbd5;--theme-table-heading:#2a2f3a;--theme-table-cell:#20252d;--theme-footer:#111318;--theme-icon:#282d37;--theme-focus-border:#5b6577;--theme-text:#f0f1f5;--theme-fa:#d8dbe5;--theme-subtle-text:#e7e9f0;--theme-control-text:#f0f2f6;--theme-note:#c4c9d3;--theme-festival:#17251f;--theme-festival-border:#455e53;--theme-known-bg:#18382d;--theme-review-bg:#3e2530;--theme-image-bg:#1e222b}
.theme-mode-button{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;white-space:nowrap;min-height:38px;padding:6px 11px;border:1px solid #b8c6de;border-radius:10px;background:var(--m6-surface-ffffff, #ffffff);color:#263c65;cursor:pointer;font-size:.88rem;font-weight:600;line-height:1.4;font-family:inherit;}
.theme-mode-button:focus-visible{outline:3px solid #80a6ff;outline-offset:2px}
/* Keep appearance first and the account at the outer end of the book header. */
.top #themeModeButton{margin-left:auto}
.top #accountButton31{margin-left:0!important}
html[data-theme=dark]{color-scheme:dark;--bg:var(--theme-bg);--card:var(--theme-surface);--ink:var(--theme-text);--muted:var(--theme-muted);--blue:#83a8ff;--green:#7dd4a8;--red:#ff9a9a;--gold:#e9c766;--line:var(--theme-border);--accent:#e795b4}
html[data-theme=dark] body{background:var(--theme-bg)!important;color:var(--theme-text)!important}
html[data-theme=dark] :is(.top,#sectionNav21,nav,.hero,.panel,details,.card,.audio-card,.book-task,.book-task23,.read-card25,.b12-reading-card,.b12-exercise,.b12-track,.a11-track,.a12-track,.a21-track,.b11-track,.grammar-example26,.grammar-ex,.grammar-detail,.gp-item,.official-item,.bild-book-shell,.book,.account-dialog31,dialog,.a11-reading-popup,.top-settings-panel,.source25,.quiz,.reading-practice,.grammar-item,.picture-card,.word-card,.listen-card,.lesson-card){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-theme=dark] :is(summary,.ex,.source-note,.grammar-rule,.reading-text25,.reading-segment26,.reading-translation26,.original-instruction37,.original-open37,.listening-choice31,.listening-body31,.b12-reading-instructions,.book-fidelity-part-intro,.taskpic23,.book-footer,.book-info,.cover-wrap,.book-fidelity-alphabet,.book-fidelity-letters,.status-new,.stat,.badge,.progress){background:var(--theme-subtle)!important;color:var(--theme-subtle-text)!important;border-color:var(--theme-border-subtle)!important}
html[data-theme=dark] :is(button,input,select,textarea,.search,.free-answer textarea,.grammar-answer input,.grammar-answer select){background:var(--theme-control)!important;color:var(--theme-control-text)!important;border-color:var(--theme-border-control)!important}
html[data-theme=dark] :is(button:hover,.theme-mode-button:hover){background:var(--theme-hover)!important}
html[data-theme=dark] :is(button.active,nav .active,#sectionNav21 button.active,.active-tab){background:#456ae0!important;color:#fff!important;border-color:#6487f2!important}
html[data-theme=dark] :is(.muted,.tr,.en,.small,.source-label,.listening-meta31,.book-footer,.type,.brand-caption,.hover-help){color:var(--theme-muted)!important}
html[data-theme=dark] :is(.fa,.translation-fa,.grammar-fa26,.example-fa26,.gloss-fa){color:var(--theme-fa)!important}
html[data-theme=dark] :is(.known,.active-known,.status-known){color:#9be4bd!important}
html[data-theme=dark] :is(.review,.active-review,.status-review){color:#ffaaaa!important}
html[data-theme=dark] :is(.active-known,.state-known,.listen-correct31,.gp-ok){background:var(--theme-known-bg)!important;border-color:#4a9c73!important}
html[data-theme=dark] :is(.active-review,.state-review,.listen-wrong31,.gp-bad){background:var(--theme-review-bg)!important;border-color:#b56e7d!important}
html[data-theme=dark] :is(.warning,.book-tip,.book-hint){background:#40371e!important;color:#f6e4a8!important;border-color:#9e8447!important}
html[data-theme=dark] :is(.a11-main,.b11-main,.b12-main,.main,.shell,.layout,#readingPane,#readingPane25,#audioExercises){color:var(--theme-text)}
html[data-theme=dark] :is(h1,h2,h3,h4,h5,h6,[lang=de]){color:inherit}
html[data-theme=dark] a{color:#9fbeff}
html[data-theme=dark] a:visited{color:#c8b0f9}
html[data-theme=dark] :is(table,td,th){border-color:var(--theme-border-table)!important}
html[data-theme=dark] th{background:var(--theme-table-heading)!important;color:var(--theme-control-text)!important}
html[data-theme=dark] td{background:var(--theme-table-cell)!important;color:var(--theme-control-text)!important}
html[data-theme=dark] :is(audio,video){color-scheme:dark}
html[data-theme=dark] :is(.book-page,.overview-book-page,.a11-source img,.b11-source img){filter:brightness(.86)}
html[data-theme=dark] .book{box-shadow:0 4px 18px #0005!important}
html[data-theme=dark] .contact{background:var(--theme-footer)!important}
html[data-theme=dark] .telegram{background:var(--m6-surface-e5edff, #e5edff)!important;color:#17243b!important;}
html[data-theme=dark] .theme-mode-button{background:var(--theme-table-heading)!important;color:var(--theme-text)!important;border-color:var(--theme-focus-border)!important}
html[data-theme=dark] :is(.book-access-bar,.book-access-gate,.book-access-dialog,.book-access-plan,.book-access-price-note,.book-access-festival){background:var(--theme-festival)!important;color:#e9f8ee!important;border-color:var(--theme-festival-border)!important}
html[data-theme=dark] :is(.book-access-bar small,.book-access-plan-body small,.book-access-pay-note,.book-access-prices-caption){color:#c3d7c9!important}
html[data-theme=dark] .book-access-badge{background:#35634e!important;color:#c8f6d6!important}
html[data-theme=dark] :is(.book-return,.library-back){background:var(--theme-control)!important;color:#bfd2ff!important;border-color:var(--theme-border-control)!important}
.piper-voice-status{display:block;color:var(--muted,#667085);font-size:.8rem;max-width:290px}
.piper-voice-status[hidden]{display:none}
.a11-exercise-picture{position:relative;overflow:hidden;max-width:100%;margin:12px 0;border:1px solid var(--m6-border-dce4f0, #dce4f0);border-radius:10px;background:var(--m6-surface-ffffff, #ffffff);}
.a11-exercise-picture img{position:absolute;display:block;max-width:none;height:auto}
html[data-theme=dark] .a11-exercise-picture{background:var(--theme-image-bg);border-color:var(--theme-border-table)}

/* Dark contrast repair: paired foreground/background colours for every course. */
html[data-theme=dark]{--gender-masc:#9fbeff;--gender-fem:#ff9fbe;--gender-neut:#87ddb0}
html[data-theme=dark] :is(.face,.front,.back,.a11-flash-front,.a11-flash-back,.a12-flash-front,.a12-flash-back,.a21-flash-front,.a21-flash-back,.a22-flash-front,.a22-flash-back,.b11-flash-front,.b11-flash-back,.b12-flash-card,.b12-flash-front,.b12-flash-back,.reading-section25,.reading-section26,.reading-shell26,.original-exercise37,.original-question37,.b12-script,.b12-grammar-rules article){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border-table)!important}
html[data-theme=dark] :is(.vex21,.b12-example,.b12-line-fa,.de-line,.de-line-fa,.grammar-fa-translation,.gtr21,.gex21 .de,.gex21 .fa,.a11-question-fa,.a12-question-fa,.a21-question-fa,.a22-question-fa,.b11-question-fa,.a11-transcript,.a12-transcript,.a21-transcript,.a22-transcript,.b11-transcript,.a11-transcript-de,.a12-transcript-de,.a21-transcript-de,.a22-transcript-de,.b11-transcript-de,.a11-translation,.a12-translation,.a21-translation,.a22-translation,.b11-translation,.m-overview-context,.b12-source-note){background:var(--theme-subtle)!important;color:var(--theme-subtle-text)!important;border-color:var(--theme-border-table)!important}
html[data-theme=dark] :is(#wordGloss26,#b12WordPopup,.a11-reading-popup,.a11-trans-tooltip,.a12-trans-tooltip,.a21-trans-tooltip,.a22-trans-tooltip,.b11-trans-tooltip){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-focus-border)!important;box-shadow:0 12px 40px #0007}
html[data-theme=dark] :is(#wordGloss26,#b12WordPopup,.a11-reading-popup,.a11-trans-tooltip,.a12-trans-tooltip,.a21-trans-tooltip,.a22-trans-tooltip,.b11-trans-tooltip) :is(strong,[lang=de],[lang=fa],.gloss-fa,.gloss-fa26,.b12-meaning.fa){color:var(--theme-text)!important}
html[data-theme=dark] :is(#wordGloss26,#b12WordPopup,.a11-reading-popup,.a11-trans-tooltip,.a12-trans-tooltip,.a21-trans-tooltip,.a22-trans-tooltip,.b11-trans-tooltip) :is([lang=en],[role=status],.gloss-en26,.b12-meaning.en){color:var(--theme-note)!important}
html[data-theme=dark] :is(.a11-trans-word,.a12-trans-word,.a21-trans-word,.a22-trans-word,.b11-trans-word,.reading-word26,#b12Main .b12-trans-word){background:transparent!important;color:var(--theme-text)!important;border-bottom-color:#8093b8!important}
html[data-theme=dark] :is(.a11-trans-word.a11-added,.a12-trans-word.a12-added,.a21-trans-word.a21-added,.a22-trans-word.a22-added,.b11-trans-word.b11-added,.reading-word26[aria-pressed=true],#b12Main .b12-trans-word.b12-selected){background:var(--theme-known-bg)!important;color:#9be4bd!important;border-bottom-color:#61a17f!important}
html[data-theme=dark] :is(.a11-trans-word,.a12-trans-word,.a21-trans-word,.a22-trans-word,.b11-trans-word,.reading-word26,#b12Main .b12-trans-word):is(:hover,:focus-visible){background:var(--theme-hover)!important;color:#dbe8ff!important}
html[data-theme=dark] :is(.article.der,.article24.article-der,.a11-der,.a12-der,.a21-der,.a22-der,.b11-der,.gender-masc){color:#9fbeff!important}
html[data-theme=dark] :is(.article.die,.article24.article-die,.a11-die,.a12-die,.a21-die,.a22-die,.b11-die,.gender-fem){color:#ff9fbe!important}
html[data-theme=dark] :is(.article.das,.article24.article-das,.a11-das,.a12-das,.a21-das,.a22-das,.b11-das,.gender-neut){color:#87ddb0!important}
html[data-theme=dark] :is(.a11-flash-description,.a12-flash-description,.a21-flash-description,.a22-flash-description,.b11-flash-description,.a11-card-count,.a12-card-count,.a21-card-count,.a22-card-count,.b11-card-count,.muted25,.free-answer,.b12-free-note,.b12-track-file,.b12-question-fa,.b12-options small,.b12-example-fa,.b12-word-meta summary,#b12WordForm label,.fa23,.b12-flash-status){color:var(--theme-note)!important}
html[data-theme=dark] :is(.a11-reading-legend,.a12-reading-legend,.a21-reading-legend,.a22-reading-legend,.b11-reading-legend){color:#9be4bd!important}
html[data-theme=dark] :is(.listening-instruction31,.book-fidelity-part,.book-sub-letter37){color:#b7ceff!important}
html[data-theme=dark] :is(.book-main-number37,.a22-book-task-mark38){background:#e3c93e!important;color:#192132!important}
html[data-theme=dark] :is(.small-icon,.a11-icon,.a12-icon,.a21-icon,.a22-icon,.b11-icon){background:var(--theme-icon)!important;color:var(--theme-text)!important}
html[data-theme=dark] :is(.flash.known-card .face,#b12Main .b12-flash-card.known-card,.status-known){background:var(--theme-known-bg)!important;color:#9be4bd!important}
html[data-theme=dark] :is(.flash.review-card .face,#b12Main .b12-flash-card.review-card,.status-review){background:var(--theme-review-bg)!important;color:#ffaaaa!important}
html[data-theme=dark] #b12Main .b12-flash-controls [data-card-status=known][aria-pressed=true]{background:var(--theme-known-bg)!important;color:#9be4bd!important}
html[data-theme=dark] #b12Main .b12-flash-controls [data-card-status=review][aria-pressed=true]{background:var(--theme-review-bg)!important;color:#ffaaaa!important}

html[data-theme=dark] :is(#readingPane25,.m-overview-guide,.m-bild-card,.b12-bild-card,.b12-bild-strip,.b12-overview-guide,.a11-word-row,.a12-word-row,.a21-word-row,.a22-word-row,.b11-word-row,.a22-track,.a11-anki-list label,.a12-anki-list label,.a21-anki-list label,.a22-anki-list label,.b11-anki-list label){background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border-table)!important}
html[data-theme=dark] :is(.grammar-intro26,.grammar-rule26,.quiz25,.b12-grammar-line,.b12-fields){background:var(--theme-subtle)!important;color:var(--theme-subtle-text)!important;border-color:var(--theme-border-table)!important}
html[data-theme=dark] body :is(.grammar-table26,.gtable23,.gsum21) th{background:var(--theme-table-heading)!important;color:var(--theme-control-text)!important}
html[data-theme=dark] :is(.book-fidelity-part,.listening-body31 strong){color:#b7ceff!important}
html[data-theme=dark] :is(.a11-source-note,.a12-source-note,.a21-source-note,.a22-source-note,.b11-source-note,.b12-official-filter){color:var(--theme-note)!important}

html[data-theme=dark] :is(.m-overview-guide strong,.b12-overview-guide dt){color:#b7ceff!important}
html[data-theme=dark] .m-overview-guide span{color:var(--theme-text)!important}
html[data-theme=dark] :is(.m-overview-guide small,.m-bild-en,.intro25,.b12-draft-note,.b12-bild-strip figcaption,.a12-track>p,.a11-anki-list label span,.a12-anki-list label span,.a21-anki-list label span,.a22-anki-list label span,.b11-anki-list label span){color:var(--theme-note)!important}
html[data-theme=dark] :is(.a11-anki-list,.a12-anki-list,.a21-anki-list,.a22-anki-list,.b11-anki-list,.a12-track) label{background:var(--theme-control)!important;color:var(--theme-control-text)!important;border-color:var(--theme-border-control)!important}
html[data-theme=dark] :is(#grammar,#grammarPane,#grammarPane26,#grammarSection,#grammarPane25) th{background:var(--theme-table-heading)!important;color:var(--theme-control-text)!important}
html[data-theme=dark] .a22-book-track-mark38{color:#9cdbf2!important}
html[data-theme=dark] .a12-track p{color:var(--theme-fa)!important}

.piper-voice-progress{display:block;width:100%;height:9px;margin-top:6px;accent-color:#4065d8}
.piper-voice-progress[hidden]{display:none}
html[data-theme=dark] .piper-voice-progress{accent-color:#9fbeff}

/* Stable vector artwork in Wortliste, Wortschatz and only the back of flashcards. */
[data-word-icon]{overflow:hidden;box-sizing:border-box}
[data-word-icon]>.word-icon-art{display:block;width:78%;height:78%;object-fit:contain;margin:auto}
.vhead21>[data-word-icon]{grid-column:1;grid-row:1 / span 3;flex:0 0 52px;width:52px;height:52px}
html[data-theme=dark] .b12-semantic-icon{background:var(--theme-icon)!important}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#c0cfe2!important;opacity:1}
html[data-theme=dark] .fa24{background:var(--theme-subtle)!important;color:var(--theme-fa)!important}
html[data-theme=dark] .book-access-total strong{color:#adf1ce!important}
html[data-theme=dark] .book-access-total{border-color:var(--theme-festival-border)!important;color:#e9f8ee!important}

/* Compact native selector; the same saved choice applies to all six books. */
.theme-mode-button{direction:rtl;min-width:132px;max-width:180px;padding-inline:10px 27px;display:inline-block}
html[data-theme=light]{--bg:#eef2f6;--card:#fafbfd;--line:#d3dce7}
html[data-theme=light] body{background:var(--m6-surface-eef2f6, #eef2f6)!important;}
html[data-theme=light] :is(.top,nav,.hero,.panel,.card,details,dialog,.book,.a11-word-row,.a12-word-row,.a21-word-row,.a22-word-row,.b11-word-row,.b12-official-row){background:var(--m6-surface-fafbfd, #fafbfd)!important;border-color:var(--m6-border-d3dce7, #d3dce7)!important;}
html[data-theme=light] :is(.ex,.vex21,.b12-example,.reading-segment26,.b12-reading-card){background:var(--m6-surface-f0f4f8, #f0f4f8)!important;}
html[data-theme=light] .b12-word-meta summary{color:#53647b!important}
html[data-theme=light] :is(.book-fidelity-task,.book-main-number37,.a22-book-task-mark38){background:#e7c72d!important;color:#20314f!important}
html[data-theme=light] .book-fidelity-track{color:#17627c!important}
html[data-theme=dark] #b12Main .b12-official-row{background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-border)!important}
html[data-theme=dark] #b12Main .b12-official-word{background:transparent!important;color:inherit!important;border:0!important;box-shadow:none!important;border-radius:0!important}
html[data-theme=dark] #b12Main .b12-official-word:hover{background:transparent!important;text-decoration:underline;text-underline-offset:4px}
@media(max-width:850px){#b12Main .b12-official-grid{grid-template-columns:minmax(0,1fr)!important}}

/* Blue-grey preview based on the owner's cPanel reference (#293a4a). */
html[data-theme=dark][data-color-mode=dark]{--theme-bg:#243442;--theme-surface:#293a4a;--theme-subtle:#304353;--theme-control:#35495a;--theme-hover:#405768;--theme-border:#485d6e;--theme-border-subtle:#506576;--theme-border-table:#4c6172;--theme-border-control:#637b8d;--theme-muted:#bac7d2;--theme-table-heading:#354c5f;--theme-table-cell:#2e4253;--theme-footer:#253746;--theme-icon:#354c5f;--theme-focus-border:#6e879a;--theme-text:#dce3e8;--theme-fa:#cddae4;--theme-subtle-text:#d7e1e9;--theme-control-text:#dfe7ee;--theme-note:#b9c8d4;--theme-image-bg:#293a4a;--blue:#a4bfd8}
html[data-theme=dark][data-color-mode=dark] :is(button.active,nav .active,#sectionNav21 button.active,#sectionNav21 button[aria-selected=true],.active-tab){background:#405f73!important;color:#e3ebf1!important;border-color:#7791a4!important}




/* Preserve the source book's exercise accents independently of the chosen appearance. */
html{--book-exercise-bg:#efd433;--book-exercise-ink:#263746}
html[data-book-group="2"]{--book-exercise-bg:#397a52;--book-exercise-ink:#fff}
html[data-book-group="3"]{--book-exercise-bg:#365b92;--book-exercise-ink:#fff}
html[data-book-group="4"]{--book-exercise-bg:#963448;--book-exercise-ink:#fff}
html[data-theme] :is(.book-fidelity-task,.book-main-number37,.a22-book-task-mark38){background:var(--book-exercise-bg)!important;color:var(--book-exercise-ink)!important;border-color:var(--m6-border-ffffff, #ffffff)!important;outline-color:var(--book-exercise-bg)!important;}
html[data-theme] .book-fidelity-track{background:transparent!important;color:#177b9e!important;border:0!important}
html[data-theme=dark] .book-fidelity-track{color:#9cdbf2!important}
.a21-track-part .a21-track-image{width:auto;max-width:min(100%,900px);height:auto;max-height:480px;margin:12px auto;background:transparent}
@media(max-width:700px){.a21-track-part .a21-track-image{max-height:360px}}

/* Keep exercise illustrations readable without occupying the whole screen. */
#b12Main .b12-exercise-image img{width:auto;min-width:min(180px,100%);max-width:min(100%,860px);max-height:420px;object-fit:contain}
@media(max-width:700px){#b12Main .b12-exercise-image img{max-height:320px}}

/* Exercise feedback must take priority over the shared dark control surfaces. */
html[data-theme=dark]{--answer-correct-bg:#214d3b;--answer-correct-text:#d4f7e1;--answer-correct-border:#71d39b;--answer-wrong-bg:#57303c;--answer-wrong-text:#ffe0e5;--answer-wrong-border:#ee96a5;--answer-selected-bg:#2b4b65;--answer-selected-text:#e3f2ff;--answer-selected-border:#90bce4}
html[data-theme=dark][data-color-mode=black]{--answer-correct-bg:#163d2c;--answer-wrong-bg:#472631;--answer-selected-bg:#233c54}
html[data-theme=dark] body :is(.a11-options,.a12-options,.a21-options,.a22-options,.b11-options,.question25,.aq,.grammar-answer,#b12Main .b12-options) label:has(input:checked){background:var(--answer-selected-bg)!important;color:var(--answer-selected-text)!important;border-color:var(--answer-selected-border)!important}
html[data-theme=dark] body :is(.a11-correct,.a12-correct,.a21-correct,.a22-correct,.b11-correct,.listen-correct31,.correct25,.gp-ok,.aq label.correct,.reading-inline-correct38,#b12Main [data-result=correct],#b12Main [data-result=correct] .b12-options label:has(input:checked)){background:var(--answer-correct-bg)!important;color:var(--answer-correct-text)!important;border-color:var(--answer-correct-border)!important}
html[data-theme=dark] body :is(.a11-wrong,.a12-wrong,.a21-wrong,.a22-wrong,.b11-wrong,.listen-wrong31,.wrong25,.gp-bad,.aq label.wrong,.reading-inline-wrong38,#b12Main [data-result=retry],#b12Main [data-result=retry] .b12-options label:has(input:checked)){background:var(--answer-wrong-bg)!important;color:var(--answer-wrong-text)!important;border-color:var(--answer-wrong-border)!important}
html[data-theme=dark] body :is(.listen-correct31,.gp-ok,#b12Main [data-result=correct]) :is(.feedback,.b12-feedback){color:var(--answer-correct-text)!important}
html[data-theme=dark] body :is(.listen-wrong31,.gp-bad,#b12Main [data-result=retry]) :is(.feedback,.b12-feedback){color:var(--answer-wrong-text)!important}
html[data-theme=dark] body :is(tr.listen-correct31,tr.listen-wrong31,#b12Main tr[data-result])>:is(td,th){background:inherit!important;color:inherit!important;border-color:inherit!important}
