/* Shared theme palette. Colour-only legacy overrides are generated by tools/site_theme.py. */
@media screen {

html[data-site-theme="dark"]{color-scheme:dark;--ink:#f2f0e9;--muted:#bdc8d8;--teal:#b4dfe5;--line:#3c4c64;--bg:#141c2c;background:#141c2c;color:#f2f0e9}
html[data-site-theme="dark"] body{background:#141c2c;color:#f2f0e9}
html[data-site-theme="dark"] .topbar{background:#141c2c}
html[data-site-theme="dark"] :is(.brand,.nav a){color:#f2f0e9}
html[data-site-theme="dark"] .intro{background:#25334c}
html[data-site-theme="dark"] :is(h1,h2,h3,.course-label,.home-stats):not(:where([data-theme-surface="light"],[data-theme-surface="light"] *)){color:#f2f0e9}
html[data-site-theme="dark"] .intro h1 span{color:#f4976c}
html[data-site-theme="dark"] .intro p:last-child{color:#c8d3e1}
html[data-site-theme="dark"] .home-stats dl>div{border-color:#526a7d}
html[data-site-theme="dark"] .home-stats dd{color:#b4dfe5}
html[data-site-theme="dark"] .home-stats dt{color:#c8d3e1}
html[data-site-theme="dark"] .results-header{border-color:#3c4c64}
html[data-site-theme="dark"] .unit-card{--tint:#2d4854;--accent:#b4dfe5;background:#202e40;color:#f2f0e9;border-color:#425a6b}
html[data-site-theme="dark"] .unit-card:before{background:#729da9}
html[data-site-theme="dark"] .unit-card:hover{background:#2d4052;border-color:#b4dfe5}
html[data-site-theme="dark"] .unit-card p{color:#c3cedd}
html[data-site-theme="dark"] :is(.card-bottom,.card-link){color:#b4dfe5;border-color:#425a6b}
html[data-site-theme="dark"] .unit-code,html[data-site-theme="dark"] .unit-card:hover .unit-code{background:#34475d;color:#d2fdff}
html[data-site-theme="dark"] .home-search-field #home-search{background:#1c293b;color:#f2f0e9;border-color:#71869c}
html[data-site-theme="dark"] #home-search::placeholder{color:#afbdcf}
html[data-site-theme="dark"] .li-search-row input::placeholder{color:#afbdcf;opacity:1}
html[data-site-theme="dark"] #li-activity-list button:is(:hover,[aria-selected="true"]){background:#293e50;border-left-color:#b4dfe5}
html[data-site-theme="dark"] :is(.site-view-toggle,.site-feedback-open,.site-share-open,.home-search-field button){background:#293e50;color:#d2fdff;border-color:#71869c}
html[data-site-theme="dark"] :is(.site-view-toggle,.site-feedback-open,.site-share-open):hover{background:#f4976c;color:#141c2c}
html[data-site-theme="dark"] footer{background:#202e40;color:#c3cedd;border-color:#425a6b}
html[data-site-theme="dark"] footer a{color:#b4dfe5}
html[data-site-theme="dark"] #home-search-panel{background:#25334c;color:#f2f0e9;border-color:#526a7d}
html[data-site-theme="dark"] #home-search-results a{background:#202e40;color:#f2f0e9;border-color:#526a7d}
html[data-site-theme="dark"] #home-search-results a:hover{background:#2d4052}
html[data-site-theme="dark"] :focus-visible{outline-color:#f4976c}

html[data-site-theme="dark"] :is(#site-view-dialog,#site-share-dialog,#site-feedback-dialog){background:#25334c;color:#f2f0e9;border-color:#71869c}
html[data-site-theme="dark"] :is(#site-view-heading,#site-share-dialog .site-share-heading h2,#site-share-dialog .site-share-hint){color:#f2f0e9}
html[data-site-theme="dark"] :is(.site-share-heading,.site-feedback-heading){background:#293e50;border-color:#71869c}
html[data-site-theme="dark"] :is(#site-view-dialog button,#site-share-dialog button,#site-share-dialog a,#site-feedback-dialog button){background:#293e50;color:#d2fdff;border-color:#71869c}
html[data-site-theme="dark"] :is(#site-share-dialog input,#site-feedback-dialog input){background:#1c293b;color:#f2f0e9;border-color:#71869c}
}
.site-theme-select{box-sizing:border-box;height:44px;min-height:44px;padding:7px 9px;border:2px solid #303c6c;background:#d2fdff;color:#303c6c;border-radius:0;font:inherit;font-size:.9rem;font-weight:750;cursor:pointer}
.topbar .nav{align-items:center;flex-wrap:wrap;gap:10px}
@media screen{html[data-site-theme="dark"] .site-theme-select{background:#293e50;color:#d2fdff;border-color:#71869c}}
@media print{.site-theme-select{display:none}}

/* Keep the working paper and its inherited drawing colours independent of the UI. */
@media screen{
 html[data-site-theme="dark"] body.classroom-site{background:#141c2c!important;color:#f2f0e9!important}
 html[data-site-theme="dark"] .integrated-site-nav{background:#141c2c!important;color:#f2f0e9!important;border-color:#425a6b!important}
 html[data-site-theme="dark"] .site-theme-select{background:#293e50!important;color:#d2fdff!important;border:2px solid #71869c!important;width:auto;min-width:88px;height:44px;min-height:44px;padding:7px 9px!important;align-self:center;flex:none;margin:0;font-size:.9rem!important}
 html[data-site-theme="dark"] [data-theme-surface="light"]{color-scheme:light;background:#fff!important;color:#303c6c!important;--ink:#303c6c;--text:#303c6c;--dark:#303c6c;--muted:#535c7b;--blue:#303c6c;--blue-dark:#303c6c;--yellow:#fbe8a6;--pink:#f4976c;--page:#fffdf5;--bg:#fffdf5;--white:#fff;--card:#fff;--line:#b4dfe5;--teal:#303c6c;--accent:#303c6c;--tint:#b4dfe5}
 html[data-site-theme="dark"] [data-theme-surface="light"] :is(h1,h2,h3,h4,h5,h6){color:#303c6c!important}
 html[data-site-theme="dark"] [data-theme-surface="light"] a{color:#303c6c!important}
 html[data-site-theme="dark"] .revision-content figure:has(svg),html[data-site-theme="dark"] .ir-notes figure:has(svg){background:white;color:#303c6c}
 html[data-site-theme="dark"] :is(.ok,.status.ok,.answer-feedback.correct){background:#223e35!important;color:#bce5cb!important;border-color:#7fcca1!important}
 html[data-site-theme="dark"] :is(.bad,.status.error,.answer-feedback.incorrect){background:#4b2d30!important;color:#ffd1c8!important;border-color:#ef9e90!important}
}
.site-theme-select{align-self:center;flex:none;width:auto;min-width:88px;margin:0;line-height:1.3}
.integrated-site-nav>.site-theme-select{margin-left:auto}
.integrated-site-nav>.site-theme-select~.site-feedback-open{margin-left:0}
html[data-site-view="student"] .integrated-site-nav>.site-theme-select~.site-view-toggle{margin-left:0}
@media print{html[data-site-theme] body{color-scheme:light}}
/* Important classroom defaults live in a cascade layer; theme exceptions must
   participate in the earliest layer too, including the light drawing paper. */
@layer site-theme{
 html[data-site-theme] .site-theme-select{box-sizing:border-box;width:auto;min-width:88px;height:44px;min-height:44px;padding:7px 9px!important;border:2px solid #303c6c!important;border-radius:0!important;background:#d2fdff!important;color:#303c6c!important;font-size:.9rem!important;font-weight:750;line-height:1.3}
 @media screen{
  html[data-site-theme="dark"] select:not(.site-theme-select):not(:where([data-theme-surface="light"],[data-theme-surface="light"] *)){background:#202e40!important;color:#f2f0e9!important;border-color:#71869c!important}
  html[data-site-theme="dark"] select:not(.site-theme-select):disabled{opacity:.55}
  html[data-site-theme="dark"] body.classroom-site{background:#141c2c!important;color:#f2f0e9!important}
  html[data-site-theme="dark"] .integrated-site-nav{background:#141c2c!important;color:#f2f0e9!important;border-color:#425a6b!important}
  html[data-site-theme="dark"] .site-theme-select{background:#293e50!important;color:#d2fdff!important;border:2px solid #71869c!important}
  html[data-site-theme="dark"] .app .part .glyph{background:#d2fdff!important;color:#303c6c!important}
  html[data-site-theme="dark"] :is(.unit-actions,.subject-resource-actions) img{background:#d2fdff}
  html[data-site-theme="dark"] [data-theme-surface="light"]{background:#fff!important;color:#303c6c!important;--ink:#303c6c!important;--text:#303c6c!important;--dark:#303c6c!important;--muted:#535c7b!important;--blue:#303c6c!important;--blue-dark:#303c6c!important;--yellow:#fbe8a6!important;--pink:#f4976c!important;--page:#fffdf5!important;--bg:#fffdf5!important;--white:#fff!important;--card:#fff!important;--line:#b4dfe5!important}
  html[data-site-theme="dark"] [data-theme-surface="light"] :is(h1,h2,h3,h4,h5,h6,a){color:#303c6c!important}
 }
}
