/* Shared appearance layer. Light keeps the approved cream/serif design. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;flex:none;min-height:44px;padding:.6rem .8rem;border:1px solid var(--rule,#d5ccbd);border-radius:999px;background:var(--surface,#fffdf8);color:var(--ink,#1a2238);font:600 .875rem/1.2 'Inter Variable',Inter,system-ui,sans-serif;white-space:nowrap;cursor:pointer}
.theme-toggle svg{width:20px;height:20px;flex:none}.theme-toggle .theme-sun{display:none}
html:root[data-theme=dark] .theme-toggle .theme-sun{display:block}html:root[data-theme=dark] .theme-toggle .theme-moon{display:none}
.theme-toggle:hover{background:var(--tint,#eee5d7)}.theme-toggle:active{box-shadow:inset 0 0 0 2px currentColor}.theme-toggle:focus-visible{outline:3px solid var(--crimson,#a42638);outline-offset:4px}
html:root[data-theme=dark]{color-scheme:dark;--paper:#101113;--surface:#1b1d21;--ink:#f5f5f7;--muted:#b6b8c0;--crimson:#ef9aa8;--rule:#454851;--tint:#25282e;--green:#a5d6b6;--theme-success:#1d352a;--theme-error:#3c222a;--theme-warning:#342c20;--theme-strong:#222a3a;color:var(--ink);background:var(--paper)}
html:root[data-theme=dark] body{color:var(--ink);background:var(--paper)}
html:root[data-theme=dark] :is(h1,h2,h3,h4,.brand,.chapter-number,.topic-order,.result-score,.featured-outline strong,.question-panel legend,.lesson-visual figcaption,.government-overview figcaption){font-family:'Inter Variable',Inter,system-ui,sans-serif}
html:root[data-theme=dark] :is(h1,h2,h3,h4){font-weight:650}html:root[data-theme=dark] h1{letter-spacing:-.045em;line-height:1.1}
html:root[data-theme=dark] .site-header{background:var(--paper);border-top:0;border-bottom:1px solid var(--rule)}
html:root[data-theme=dark] .header-inner{min-height:76px}
html:root[data-theme=dark] .brand{font-size:1.15rem;gap:.75rem;letter-spacing:-.025em}
html:root[data-theme=dark] .brand-subtitle{font-size:max(.875rem,.75rem);letter-spacing:0}
html:root[data-theme=dark] .brand-flag{width:30px;height:46px;filter:drop-shadow(0 0 1px #b8bdcc)}
html:root[data-theme=dark] .main-navigation{gap:1.2rem}
html:root[data-theme=dark] .site-menu-toggle{background:transparent;border-color:transparent;border-radius:8px}
html:root[data-theme=dark] .preview-strip{background:var(--tint);color:var(--ink)}
html:root[data-theme=dark][data-prelaunch] .preview-strip{background:#902c42;border-color:#902c42;color:#fff}
html:root[data-theme=dark] .preview-inner{justify-content:center;min-height:44px;padding-block:.45rem}
html:root[data-theme=dark][data-prelaunch] .preview-inner strong{font-size:1.5rem}
html:root[data-theme=dark] .button{border-radius:9px}
html:root[data-theme=dark] .button-primary{color:#151619;background:#f5f5f7}
html:root[data-theme=dark] .button-primary:hover:not(:disabled){background:#dddfe6}
html:root[data-theme=dark] .button-primary:disabled{background:#343740;color:#adb0bb}
html:root[data-theme=dark] :is(.button-secondary,.theme-toggle){background:var(--surface);color:var(--ink);border-color:#626671}
html:root[data-theme=dark] :is(.button-secondary,.theme-toggle):hover{background:var(--tint)}
html:root[data-theme=dark] :is(input:not([type=checkbox]):not([type=radio]),textarea,select){background:var(--surface);color:var(--ink);border-color:#757985}
html:root[data-theme=dark] input::placeholder,html:root[data-theme=dark] textarea::placeholder{color:#aeb1bc;opacity:1}
html:root[data-theme=dark] .skip-link{background:var(--ink);color:var(--paper)}
html:root[data-theme=dark] .site-menu{background:#1b1f28;color:#f5f5f7;border-color:#566078}
html:root[data-theme=dark] .site-menu :is(a,button):focus-visible{outline-color:#ef9aa8}
html:root[data-theme=dark] .site-menu a[aria-current=page]{border-left-color:#ef9aa8;background:#303744}
html:root[data-theme=dark] .site-menu :is(a,button):hover{background:#303744}
html:root[data-theme=dark] .site-menu::backdrop,html:root[data-theme=dark] .question-feedback-dialog::backdrop{background:rgb(0 0 0 / 65%)}
html:root[data-theme=dark] .handbook-banner{width:max-content;max-width:100%;background:transparent;color:var(--ink);border:1px solid var(--rule);border-radius:7px;margin-top:1.5rem;padding:.4rem .7rem}
html:root[data-theme=dark] .handbook-banner strong{font-size:max(.875rem,.8125rem)}
html:root[data-theme=dark] .home-intro{gap:3rem;padding:1rem 0 1.2rem}
html:root[data-theme=dark] .home-intro h1{font-size:clamp(2.3rem,4.3vw,3.5rem);max-width:18ch;margin:.55rem 0 1rem}
html:root[data-theme=dark] .home-intro .lead{font-size:1rem;line-height:1.6}
html:root[data-theme=dark] .home-intro .eyebrow{color:var(--muted);font-size:max(.875rem,.75rem)}
html:root[data-theme=dark] .home-actions{gap:.65rem;margin-top:1.2rem}
html:root[data-theme=dark] .home-signup{font-size:max(.875rem,.8125rem);padding:.5rem 0}
html:root[data-theme=dark] .home-demo{padding:0}
html:root[data-theme=dark] .sample-heading{margin-bottom:.75rem}
html:root[data-theme=dark] .sample-stack{margin-bottom:1.1rem}
html:root[data-theme=dark] .sample-stack::before{background:#171a1f;border-color:#41444e}
html:root[data-theme=dark] .sample-stack::after{background:#1d2026;border-color:#41444e}
html:root[data-theme=dark] .sample-card{background:#21242b;border-color:#565b68;border-radius:16px;padding:1.5rem;min-height:max(13.75rem,var(--sample-height,0px));box-shadow:0 8px 24px #0003}
html:root[data-theme=dark] .sample-question{font-family:'Inter Variable',Inter,system-ui,sans-serif;font-weight:600;letter-spacing:-.025em;font-size:1.55rem}
html:root[data-theme=dark] .sample-answer{margin-top:.85rem;padding-top:.7rem}
html:root[data-theme=dark] .home-features{padding:1rem 0 .5rem}
html:root[data-theme=dark] .home-feature-grid{gap:1.5rem}
html:root[data-theme=dark] .home-feature-grid>div{padding-top:1rem;border-top-width:1px}
html:root[data-theme=dark] .home-feature-grid h3{font-size:.9375rem;margin:.55rem 0 .4rem}
html:root[data-theme=dark] .home-feature-grid p{font-size:.875rem;line-height:1.6}
html:root[data-theme=dark] .home-feature-grid .icon{color:var(--crimson);width:21px;height:21px}
html:root[data-theme=dark] .curriculum{margin-top:1.35rem}
html:root[data-theme=dark] .curriculum .section-heading{margin-bottom:1rem}
html:root[data-theme=dark] .curriculum-entry{gap:1rem}
html:root[data-theme=dark] .sample-pointer svg{width:24px;height:36px}
html:root[data-theme=dark] .sample-pointer p{background:var(--theme-strong);color:#f5f5f7;border:1px solid #596780;padding:.6rem .8rem}
html:root[data-theme=dark] .sample-pointer strong{font-size:max(.875rem,.8125rem)}
html:root[data-theme=dark] .sample-pointer span{font-size:max(.875rem,.75rem)}
html:root[data-theme=dark] .intro-link{border-color:#6e727d;padding:.6rem .9rem}
html:root[data-theme=dark] .chapter{background:#181a1e;margin-bottom:.55rem}
html:root[data-theme=dark] .chapter>summary{padding:1rem 1.2rem;gap:1rem}
html:root[data-theme=dark] .chapter-number{font-size:1.5rem;color:#a5aab5;width:2rem}
html:root[data-theme=dark] .chapter-title{font-size:1rem}
html:root[data-theme=dark] .chapter-description,html:root[data-theme=dark] .chapter-count{font-size:max(.875rem,.8125rem)}
html:root[data-theme=dark] :is(.chapter>summary,.topic-detail summary,.lesson-background>summary):hover{background:var(--tint)}
html:root[data-theme=dark] :is(.chapter>summary,.practice-chapter>summary,.site-menu-toggle,.lesson-background>summary):active{background:#343842}
html:root[data-theme=dark] .unit-card{background:#202329;border-color:var(--rule)}
html:root[data-theme=dark]:not([data-signed-in]) .unit-card.free-sample{background:var(--theme-strong);border-color:#596780;color:#f5f5f7}
html:root[data-theme=dark] .topic-icon,html:root[data-theme=dark] .hub-emblem{background:#30272e;border-color:#66515c;color:var(--crimson)}
html:root[data-theme=dark] .topic-order{color:#a5aab5}
html:root[data-theme=dark] .starting-point{box-shadow:none;padding:1.3rem 1.5rem}
html:root[data-theme=dark] .welcome{padding-block:1.75rem 1.3rem}
html:root[data-theme=dark] .home-faq{padding:1.5rem 0}
html:root[data-theme=dark] .home-faq-grid{gap:1.75rem;margin-top:1rem}
html:root[data-theme=dark] .home-faq h3{font-size:1rem}
html:root[data-theme=dark] .home-faq p{font-size:.875rem}
html:root[data-theme=dark] main{padding-bottom:2rem}
html:root[data-theme=dark] .breadcrumbs{padding-top:1rem}
html:root[data-theme=dark] :is(.hub-heading,.lesson-heading){padding-block:1.2rem;margin-bottom:1rem}
html:root[data-theme=dark] .hub-meta{margin-top:1rem}
html:root[data-theme=dark] .hub-grid{gap:2rem}
html:root[data-theme=dark] .lesson-toolbar{margin-bottom:1rem}
html:root[data-theme=dark] .lesson-prose{line-height:1.75}
html:root[data-theme=dark] .lesson-prose>.lesson-section+.lesson-section{padding-top:1.25rem;margin-top:1.25rem}
html:root[data-theme=dark] .lesson-prose section{margin-bottom:1.4rem}
html:root[data-theme=dark] .lesson-section>h2{margin-bottom:.7rem}
html:root[data-theme=dark] .reading-blocks h3{margin-top:1.25em}
html:root[data-theme=dark] :is(.lesson-visual,.government-overview){margin-block:1.25rem}
html:root[data-theme=dark] .government-overview-head{background:var(--theme-strong);color:#f5f5f7}
html:root[data-theme=dark] .lesson-definition{background:var(--tint);border-color:#a99484}
html:root[data-theme=dark] .lesson-background{margin-block:1.4rem}
html:root[data-theme=dark] .recall-section{padding-top:1.4rem}
html:root[data-theme=dark] .recall-card{background:#21242b;border-color:#565b68;border-top-color:var(--crimson);border-radius:14px;box-shadow:none;padding:1.5rem}
html:root[data-theme=dark] .lesson-check-entry{margin-top:1.75rem;padding:1.3rem}
html:root[data-theme=dark] :is(.question-panel,.setup-panel,.results-panel){padding:1.5rem}
html:root[data-theme=dark] .practice-choice-layout{margin-bottom:1.75rem}
html:root[data-theme=dark] .status-pill{background:var(--tint);color:var(--muted)}
html:root[data-theme=dark] .empty-outline{border-color:#6e727d}
html:root[data-theme=dark] :is(.resume-box,.confirmation,.account-load-error){background:var(--theme-warning);color:#f0d6a7;border-color:#d1ad71}
html:root[data-theme=dark] .fact-reference li:target{background:var(--theme-warning);outline-color:#d1ad71}
html:root[data-theme=dark] :is(.save-warning,.inline-error,.feedback-wrong){background:var(--theme-error);color:#f6c7d0;border-color:var(--crimson)}
html:root[data-theme=dark] .example-warning{color:#f6c7d0}
html:root[data-theme=dark] .answer-option{border-color:#757985}
html:root[data-theme=dark] .answer-option:has(input:checked){background:#303644}
html:root[data-theme=dark] .answer-option.answer-correct,html:root[data-theme=dark] .answer-option.answer-correct:has(input:checked){background:var(--theme-success);border-color:var(--green);box-shadow:inset 3px 0 var(--green)}
html:root[data-theme=dark] .answer-option.answer-wrong,html:root[data-theme=dark] .answer-option.answer-wrong:has(input:checked){background:var(--theme-error);border-color:var(--crimson)}
html:root[data-theme=dark] :is(.answer-feedback:not(.feedback-wrong),.recall-answer,.question-grid .nav-correct,#question-feedback-status[data-state=success]){background:var(--theme-success)}
html:root[data-theme=dark] .question-grid .nav-wrong{background:var(--theme-error)}
html:root[data-theme=dark] .mock-layout-options label:has(input:checked){background:var(--theme-success)}
html:root[data-theme=dark] .mock-number-grid .is-answered,html:root[data-theme=dark] .mock-answer[data-correct=true] summary strong{background:var(--theme-success)}
html:root[data-theme=dark] .mock-colour-option:has(input:checked){border-color:#a9c7ff;box-shadow:0 0 0 1px #a9c7ff}
html:root[data-theme=dark] .mock-colour-option:has(input:focus-visible){outline-color:#a9c7ff}
html:root[data-theme=dark] :is(.account-message[data-state=saved],#test-date-status[data-saved=true],#billing-status[data-state=active]){background:var(--theme-success);color:var(--green);border-color:#699879}
html:root[data-theme=dark] :is(.account-message[data-state=conflict],.account-message[data-state=offline]){background:var(--theme-warning);color:#f0d6a7}
html:root[data-theme=dark] [data-score="3"] p{color:var(--green)}
html:root[data-theme=dark] [data-score="1"] span{background:var(--crimson)}html:root[data-theme=dark] [data-score="2"] span{background:#e3bc78}html:root[data-theme=dark] [data-score="3"] span{background:var(--green)}
html:root[data-theme=dark] #test-countdown a{background:var(--theme-success);color:var(--green);border-color:#699879}
html:root[data-theme=dark] .information-page{margin-bottom:1.5rem}
html:root[data-theme=dark] .information-prose section{margin-bottom:1.5rem}
html:root[data-theme=dark] .study-search{margin-bottom:1.5rem}
/* The exam canvas retains its independently selected colour scheme. */
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active]{background:#101113;color:#f5f5f7;--paper:#101113;--ink:#f5f5f7;--muted:#b6b8c0;--crimson:#ef9aa8}
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active]>.site-header{--ink:#f5f5f7;--muted:#b6b8c0;--crimson:#ef9aa8;color:var(--ink)}
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active] .mock-app{--paper:#f2f3f4;--surface:#fffdf8;--ink:#171717;--muted:#454545;--crimson:#175baa;--green:#326346;color:#171717;color-scheme:light}
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active] .mock-app select{color:#171717;background:#fff;border-color:#757e89}
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active] .mock-app[data-centre-colour=contrast] select{color:#fff45b;background:#101010;border-color:#aaa}
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active] .mock-centre-disclaimer{color:#b6b8c0}
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active] .mock-map>.reading-note{color:#b6b8c0}
/* Owner inbox is a separate, CSP-protected HTML entry point. */
.owner-theme-controls{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}.owner-theme-controls a{color:inherit}
html:root[data-theme=dark] body.owner-page{background:var(--paper);color:var(--ink)}
html:root[data-theme=dark] .owner-page article{background:var(--surface);border-color:var(--rule)}
html:root[data-theme=dark] .owner-page .muted{color:var(--muted)}
html:root[data-theme=dark] .owner-page button:not(.theme-toggle){background:#f5f5f7;color:#151619}
html:root[data-theme=dark] .owner-page .notice{background:var(--theme-success);border-color:#699879}
html:root[data-theme=dark] .owner-page .notice.attention{background:var(--theme-warning);border-color:#d1ad71}
@media(max-width:800px){html:root[data-theme=dark] .header-inner{flex-wrap:wrap;padding-block:.7rem;gap:.5rem}html:root[data-theme=dark] .brand-subtitle{display:none}html:root[data-theme=dark] .main-navigation{gap:1rem}html:root[data-theme=dark] .hub-grid{gap:1.25rem}}
@media(max-width:650px){html:root[data-theme=dark] .header-inner{justify-content:space-between}html:root[data-theme=dark] .brand{font-size:1.05rem}html:root[data-theme=dark] .main-navigation{width:100%;justify-content:space-between;gap:.4rem}html:root[data-theme=dark] .brand-flag{width:24px;height:38px}html:root[data-theme=dark] .home-intro{gap:1.25rem}html:root[data-theme=dark] .home-intro h1{font-size:2.5rem}html:root[data-theme=dark] .home-actions{flex-direction:row;align-items:center}html:root[data-theme=dark] .home-actions .button{width:auto;flex:1;gap:.5rem;padding-inline:.65rem;font-size:max(.875rem,.8125rem)}html:root[data-theme=dark] .sample-card{padding:1.2rem;min-height:max(12rem,var(--sample-height,0px))}html:root[data-theme=dark] .home-feature-grid{gap:1.25rem}html:root[data-theme=dark] .chapter>summary{padding:.9rem;gap:.75rem}html:root[data-theme=dark] :is(.question-panel,.setup-panel,.results-panel,.recall-card){padding:1.15rem}html:root[data-theme=dark] .hub-grid{grid-template-columns:minmax(0,1fr)}html:root[data-theme=dark] .home-faq-grid{gap:1rem}}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}}
@media(forced-colors:active){.theme-toggle{border:1px solid ButtonText}html:root[data-theme=dark] .button{border:1px solid ButtonText}}
html:root[data-theme=dark] body[data-mock-layout=test-centre][data-mock-phase=active] .mock-app :is(h1,h2,h3,h4){font-family:Arial,Helvetica,sans-serif}
/* Keep expanded free chapters readable and the new control within narrow headers. */
html:root[data-theme=dark]:not([data-signed-in]) .free-sample :is(h4 a,.outline-link,.member-label){color:#f5f5f7}
@media(max-width:650px){.header-inner{flex-wrap:wrap}.main-navigation{max-width:100%}}
