/* Shared controls and dark palettes for pages without a native theme. */
html[data-theme=night][data-kb-page]{color-scheme:dark}

/* Trivia landing, play, answer and score screens. */
html[data-theme=night][data-kb-page=quiz]{--ink:#f6e9ee;--muted:#d0bdc5;--cream:#211b24;--cream-deep:#302631;--line:#5c4855;--line-strong:#745b69;--hair:#5b4754;--berry:#f3a7c1;--berry-deep:#ffd2e0;--berry-bright:#df6d97;--pink-wash:#442d3a;--amber-deep:#ffcd8c}
html[data-theme=night][data-kb-page=quiz] body{background:#211b24;color:var(--ink)}
html[data-theme=night][data-kb-page=quiz] :is(.topbar,.card,.panel,.timer,.idpill,.score-row,.hero .eyebrow,.level-opt .box,.cat-opt .cat-box,.session-block,.side-card){background:#352a35;color:var(--ink);border-color:#654d5b}
html[data-theme=night][data-kb-page=quiz] :is(input[type=text],input[type=number],select,textarea){background-color:#211c25;color:#f8edf1;border-color:#806473}
html[data-theme=night][data-kb-page=quiz] :is(.brand-name,.timer-text,.score-row .nm,.panel-title){color:#ffd2e0}
html[data-theme=night][data-kb-page=quiz] :is(.btn--ghost,.chip--ink,.modal-close){background:#493541;color:#ffe8f1;border-color:#765768}
html[data-theme=night][data-kb-page=quiz] :is(.team-banner,.summary-box,.qcard,.modal){background:#352a35;color:#f8edf1;border-color:#745b69}
html[data-theme=night][data-kb-page=quiz] .score-row.is-lead{background:#47382d}
html[data-theme=night][data-kb-page=quiz] .opt{background:#302831;color:#fff1f5;border-color:#735a67}
html[data-theme=night][data-kb-page=quiz] .opt.is-correct{background:#24503d;border-color:#76d19c}
html[data-theme=night][data-kb-page=quiz] .opt.is-wrong{background:#63343f;border-color:#f19ba5}
html[data-theme=night][data-kb-page=quiz] :is(.level-opt input:checked + .box,.cat-opt input:checked + .cat-box){background:#604052;border-color:#f3a7c1}

/* Ambient mixer. */
html[data-theme=night][data-kb-page=ambient]{--ink:#eef6ee;--muted:#c2d3c4;--cream:#19251f;--green:#87c7a1;--line:#4b6152}
html[data-theme=night][data-kb-page=ambient] :is(.topbar,.sound-card){background:#293b31;border-color:#506c5a}
html[data-theme=night][data-kb-page=ambient] .sound-card.selected{background:#345340;border-color:#8dcbaa}
html[data-theme=night][data-kb-page=ambient] :is(.intro-text,.sound-description,.library-heading p:not(.eyebrow),.top-inner nav a){color:#c8d8ca}
html[data-theme=night][data-kb-page=ambient] :is(.eyebrow,.intro h1 em,.library-heading h2 span){color:#f3b88d}
html[data-theme=night][data-kb-page=ambient] .art-disc{background:#3e5a48;box-shadow:0 0 0 13px #2b4033}

/* Contact form and confirmation. */
html[data-theme=night][data-kb-page=contact]{--ink:#f8eaf0;--muted:#d0bec5;--rose:#f0a2be;--cream:#211b24;--line:#634b58}
html[data-theme=night][data-kb-page=contact] .contact-main{background:#211b24;border-color:#634b58}
html[data-theme=night][data-kb-page=contact] :is(.form-card,.mascot-note){background:#352a35;border-color:#674f5d}
html[data-theme=night][data-kb-page=contact] :is(.field input,.field textarea){background:#211c25;color:#f9edf1;border-color:#816575}
html[data-theme=night][data-kb-page=contact] :is(.field small,.privacy-note,.mascot-note p,.contact-header nav a){color:#d6c3ca}
html[data-theme=night][data-kb-page=contact] .send-button{background:#e996b5;color:#281b23}
html[data-theme=night][data-kb-page=contact] .error-summary{background:#572c38;color:#ffe4e7;border-color:#d48d9c}

/* Citizenship landing, forms, questions and results. */
html[data-theme=night][data-kb-page=practice]{--ink:#faedf2;--ink-soft:#e2d1d8;--muted:#d0bbc4;--muted-soft:#c5aeb8;--berry:#f2a4bf;--berry-dark:#ffd1e0;--berry-tint:#573344;--green:#99d3a6;--green-dark:#b7e5bd;--green-tint:#294936;--line:#5e4b54;--bg:#211b24;--bg-cream:#302631}
html[data-theme=night][data-kb-page=practice] :is(.site-header,.card,.question-card,.option,.option-letter,.btn-ghost,.mock-card,.disclaimer-card,.length-card,.check){background:#352a35;color:var(--ink);border-color:#6e5662}
html[data-theme=night][data-kb-page=practice] :is(input[type=text],input[type=email],select,textarea){background:#211c25;color:#f8edf1;border-color:#806473}
html[data-theme=night][data-kb-page=practice] .option:has(input:checked){background:#4b3946;color:var(--ink)}
html[data-theme=night][data-kb-page=practice] .option.is-correct,html[data-theme=night][data-kb-page=practice] :is(.length-card,.check):has(input:checked){background:#294936}
html[data-theme=night][data-kb-page=practice] .option.is-wrong{background:#573344}
html[data-theme=night][data-kb-page=practice] :is(.btn-green,.btn-red){color:#fff;background:#9b375e}

/* Admin sign-in and workspace. */
html[data-theme=night][data-kb-page=admin]{--ink:#f8eef3;--muted:#cdbcc6;--line:#564650;--rose:#efa3c0;--pink:#4a3341;--bg:#201b23;--white:#332a33}
html[data-theme=night][data-kb-page=admin] :is(.login-shell,.topbar,.stat-card,.panel,.message,.confirm-card){background:#332a33;color:var(--ink);border-color:#66515e}
html[data-theme=night][data-kb-page=admin] :is(.login-card input,.date-form select){background:#241d26;color:#f8eef3;border-color:#806473}
html[data-theme=night][data-kb-page=admin] :is(.message pre,.selection-toolbar small){color:#e1d1d9}
html[data-theme=night][data-kb-page=admin] :is(.eyebrow,.panel-heading>a){color:#f3b4ca}

/* Keep text legible on the light, hard-coded surfaces in these tools. */
html[data-theme=night][data-kb-page=quiz] .summary-box[style]{background:#3d3231 !important}
html[data-theme=night][data-kb-page=quiz] :is(.chip--amber,.chip--danger,.kbd,.mini,.cat-n,.cat-opt input:checked + .cat-box .cat-n){background:#4b3540;color:#ffe4ed;border-color:#765768}
html[data-theme=night][data-kb-page=quiz] .mini.is-on{background:#ad426c;color:#fff}
html[data-theme=night][data-kb-page=quiz] .btn:not(.btn--ghost){color:#2c1822}
html[data-theme=night][data-kb-page=quiz] .qhint{background:#4b3b2c;color:#ffdfac}
html[data-theme=night][data-kb-page=quiz] .answer-panel{background:#203a2d;color:#e4f9eb}
html[data-theme=night][data-kb-page=quiz] :is(.answer-head,.answer-main,.answer-list li){color:#a8e6bc}
html[data-theme=night][data-kb-page=quiz] .answer-expl{color:#d6ebdc}
html[data-theme=night][data-kb-page=quiz] .alert{background:#502d37;color:#ffe5ea}
html[data-theme=night][data-kb-page=quiz] :is(.alert strong,.alert ul){color:#ffc5cf}
html[data-theme=night][data-kb-page=practice] :is(.steps .step,.footer-disclaimer,.chip,.dot-btn,.quiz-exit-actions,.review-item){background:#352a35;color:var(--ink);border-color:#6e5662}
html[data-theme=night][data-kb-page=practice] :is(.feedback-incorrect,.flash-error,.dot-btn.state-incorrect,.rstat-incorrect){color:#ffd3dd}
html[data-theme=night][data-kb-page=practice] :is(.feedback-correct,.flash-success,.dot-btn.state-correct,.rstat-correct){color:#c4eccb}
html[data-theme=night][data-kb-page=practice] :is(.review-your,.rstat-incorrect .rstat-num,.option-mark.bad){color:#ffc5d1}
@media(max-width:600px){
  html[data-kb-page=ambient] .top-inner{height:auto;min-height:68px;gap:.5rem;flex-wrap:wrap;padding:.65rem 0}
  html[data-kb-page=ambient] .top-inner .kb-theme-switch{margin-left:auto}
  html[data-kb-page=ambient] .top-inner .home-link{margin-left:0}
}
html[data-theme=night][data-kb-page=practice] .page-head{background:#211b24}
html[data-theme=night][data-kb-page=admin] :is(th,.empty){background:#40323d;color:#e1cfd8}
html[data-theme=night][data-kb-page=admin] td{color:#d7c5ce;border-color:#634e5b}
html[data-theme=night][data-kb-page=admin] td strong{color:#faedf2}
html[data-theme=night][data-kb-page=admin] :is(.top-actions a,.stat-label,.stat-card small,.pagination){color:#cfbdc6}
html[data-theme=night][data-kb-page=admin] :is(.info-box,.alert,.warning){background:#50313d;color:#ffdee8;border-color:#865264}
html[data-theme=night][data-kb-page=admin] .notice{background:#294936;color:#daf5e0;border-color:#5b8868}
html[data-theme=night][data-kb-page=admin] :is(.delete-link,.pagination a){color:#f4acc5}
html[data-theme=night][data-kb-page=quiz] :is(.btn.btn--good,.btn.btn--bad){color:#fff;background:#873650}
html[data-theme=night][data-kb-page=quiz] .btn.btn--good{background:#276c4c}
html[data-theme=night][data-kb-page=quiz] #endBtn{color:#fff;background:#873650 !important}
