/* The original styles remain authoritative in Light mode. Only this new control
   has geometry; dark overrides below change paint, not component layout. */
.appearance-control{position:relative;flex:none;color:var(--ink,#18243a);font:14px/1.55 "Segoe UI",Arial,sans-serif}
.appearance-control>summary{display:grid;place-items:center;width:44px;height:44px;padding:0;list-style:none;cursor:pointer;border:1px solid var(--line,#d9e0e9);border-radius:9px;background:transparent;font-size:24px}
.appearance-control>summary::-webkit-details-marker{display:none}
.appearance-control>summary:hover{background:var(--light,#eef2fc)}
.appearance-control fieldset{position:fixed;z-index:20;min-width:160px;margin:0;padding:10px;border:1px solid var(--line,#d9e0e9);border-radius:9px;background:var(--white,#fff);box-shadow:0 6px 24px #10151e30}
.appearance-control legend{float:left;width:100%;padding:0 8px 6px;font-weight:650;font-size:14px}
.appearance-control label{display:flex;align-items:center;gap:10px;min-height:44px;padding:4px 8px;cursor:pointer;border-radius:6px;clear:both}
.appearance-control label:has(:checked){background:var(--light,#eef2fc)}
.appearance-control input{accent-color:var(--blue,#324fbd);margin:0;width:16px;height:16px}
.appearance-control :focus-visible{outline:3px solid #6287ed;outline-offset:3px}
@media screen{
 html[data-theme=dark]{color-scheme:dark;--ink:#f0eee8;--muted:#c6d1df;--blue:#a7c9f1;--line:#536b85;--light:#284566;--white:#1b293b;--theme-page:#10151e;--theme-surface:#1b293b;--theme-raised:#284566;--theme-button:#6189b7;--theme-gold:#e0bd78;--theme-success:#97d8b3;--theme-success-bg:#183b30;--theme-error:#ffb4aa;background:#10151e;color:#f0eee8}
 html[data-theme=dark] a{color:var(--blue)}
 html[data-theme=dark] body{background:var(--theme-page);color:var(--ink)}
 html[data-theme=dark] :is(header,footer,.notebook,.journey article,.card,.pilot-form,.profile-row,.table-wrap table,.reading-grid article,.plan-intro details,.plan-reader details,.home-programme-modes>div){background:var(--theme-surface);border-color:var(--line);color:var(--ink)}
 html[data-theme=dark] :is(.hero,.deep-promo,.family-note,.plan-intro,.policy-links){background:var(--theme-surface);border-color:var(--line)}
 html[data-theme=dark] :is(.demo-label,.eyebrow,.tag,nav .active,.reading-grid small,.session-meta){color:var(--muted)}
 html[data-theme=dark] :is(.sample-select select,select,input:not([type=checkbox]):not([type=radio]),textarea){background:var(--theme-page);color:var(--ink);border-color:#7990aa}
 html[data-theme=dark] ::placeholder{color:var(--muted);opacity:1}
 html[data-theme=dark] input{accent-color:var(--blue)}
 html[data-theme=dark] :is(.primary,.intro-copy .assessment-start,.deep-promo .primary){background:var(--theme-button);color:#10151e;border-color:var(--theme-button)}
 html[data-theme=dark] :is(.primary,.intro-copy .assessment-start,.deep-promo .primary):hover{background:#91b6df;color:#10151e;border-color:#91b6df}
 html[data-theme=dark] :is(.demo-options button,.choices button){background:var(--theme-page);border-color:#7990aa;color:var(--ink)}
 html[data-theme=dark] :is(.demo-options button:hover,.demo-options button[aria-pressed=true],.choices button:hover,.programme-modes button[aria-pressed=true]){background:var(--theme-raised);border-color:var(--blue);color:var(--ink)}
 html[data-theme=dark] :is(.demo-reply,.hint,.working-pad,.desk-stats div){background:var(--theme-raised);color:var(--ink);border-color:var(--line)}
 html[data-theme=dark] :is(.table-wrap thead,.session-status){background:var(--theme-raised);color:var(--ink)}
 html[data-theme=dark] :is(.support-page details,.learning-activity,.session-editor fieldset){border-color:var(--line)}
 html[data-theme=dark] :is(#notice:not(:empty),#pilot-error:not(:empty)){color:var(--theme-error)}
 html[data-theme=dark] .learning-track{background:#365548}
 html[data-theme=dark] .learning-track span{background:var(--theme-success)}
 html[data-theme=dark] :is(.learning-award,.learning-dashboard .overall-progress){background:var(--theme-success-bg);color:var(--ink);border-color:#6d9e86}
 html[data-theme=dark] :is(.learning-progress>b,.finished-session .session-status){color:var(--theme-success)}
 html[data-theme=dark] .finished-session{border-color:#6d9e86}
 html[data-theme=dark] .finished-session .session-status{background:var(--theme-success-bg)}
 html[data-theme=dark] .achievement-star{background:var(--theme-raised);color:var(--theme-gold)}
 html[data-theme=dark] .learning-dashboard .session-action.secondary{background:var(--theme-surface);color:var(--ink);border-color:#7990aa}
 html[data-theme=dark] .learning-dashboard .session-action.secondary:hover{background:var(--theme-raised)}
 html[data-theme=dark] :focus-visible{outline-color:var(--theme-gold)}
 html[data-theme=dark] .reading-grid article:focus-within{outline-color:var(--theme-gold)}
 html[data-theme=dark] .working-pad svg{background-color:var(--theme-page);background-image:radial-gradient(#536b85 1px,transparent 1px);box-shadow:inset 0 0 0 1px #7990aa}
 html[data-theme=dark] .working-pad polyline{stroke:#f0eee8}
 html[data-theme=dark] .counter-grid button{background:var(--theme-page);border-color:#7990aa}
 html[data-theme=dark] .counter-grid button[aria-pressed=true]{background:radial-gradient(circle,#a7c9f1 0 13px,#10151e 14px)}
 html[data-theme=dark] :is(.fraction-picture,.bar,.fraction-picture i,.bar i){border-color:#7990aa}
 html[data-theme=dark] :is(.fraction-picture i,.bar i){background:var(--theme-page)}
 html[data-theme=dark] :is(.fraction-picture i:nth-child(-n+3),.bar .a){background:#a99be8}
 html[data-theme=dark] :is(.fraction-picture i:nth-child(n+4):nth-child(-n+6),.bar .b){background:repeating-linear-gradient(55deg,#f6c38b 0 5px,#e9ae76 5px 7px)}
 html[data-theme=dark] .sample-dots i{background:#a7c9f1}
 html[data-theme=dark] .marker-word i{color:color-mix(in srgb,var(--ink-colour) 45%,#f0eee8)}
 html[data-theme=dark] .founder-note{border-color:var(--theme-gold)}
 html[data-theme=dark] .founder-signature{color:var(--theme-gold)}
 html[data-theme=dark] .sample-studio{background-color:#1b293b;background-image:linear-gradient(#a7c9f117 1px,transparent 1px),linear-gradient(90deg,#a7c9f117 1px,transparent 1px),radial-gradient(ellipse at top right,#284566,transparent 73%)}
 /* Preserve the wordmark artwork. Screen blending removes its white backing
    after inversion, keeping pale lettering on the dark header only.
    The original blue accents are isolated by blue-minus-red; #dcb04f screens
    over header #1b293b to match signature gold #e0bd78 (rounded to 8-bit). */
 html[data-theme=dark] .logo img{background:transparent;filter:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cfilter%20id%3D%22brand%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeColorMatrix%20in%3D%22SourceGraphic%22%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3CfeComponentTransfer%20result%3D%22silver%22%3E%3CfeFuncR%20type%3D%22linear%22%20slope%3D%22-1%22%20intercept%3D%221%22%2F%3E%3CfeFuncG%20type%3D%22linear%22%20slope%3D%22-1%22%20intercept%3D%221%22%2F%3E%3CfeFuncB%20type%3D%22linear%22%20slope%3D%22-1%22%20intercept%3D%221%22%2F%3E%3C%2FfeComponentTransfer%3E%3CfeColorMatrix%20in%3D%22SourceGraphic%22%20type%3D%22matrix%22%20values%3D%220%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20-2%200%202%200%20-0.5%22%20result%3D%22blueMask%22%2F%3E%3CfeFlood%20flood-color%3D%22%23dcb04f%22%2F%3E%3CfeComposite%20in2%3D%22blueMask%22%20operator%3D%22in%22%2F%3E%3CfeComposite%20in2%3D%22silver%22%20operator%3D%22over%22%2F%3E%3C%2Ffilter%3E%3C%2Fsvg%3E#brand");mix-blend-mode:screen}
 html[data-theme=dark] #mr-fractions{--ink:#f0eee8;--paper:#1b293b;--blueink:#a7c9f1;--soft:#284566;--edge:#7990aa}
 html[data-theme=dark] #mr-fractions button[aria-pressed=true]{background:#6189b7;color:#10151e}
 html[data-theme=dark] #mr-fractions .appearance-control label:has(:checked){background:#284566}
 html[data-theme=dark] #mr-fractions .appearance-control fieldset{background:#1b293b}
}
@media print{
 .appearance-control{display:none!important}
 html[data-theme]{color-scheme:light;background:white;color:#18243a;--ink:#18243a;--muted:#536078;--blue:#324fbd;--line:#d9e0e9;--light:#eef2fc;--white:#fff}
 html[data-theme] body{background:white;color:#18243a}
 #programme-printout,#programme-printout p,#programme-printout li{color:#182337;background:white}
}
