/* Semantic surface palettes. Brand blue stays #0078CF; links adapt for contrast. */
:root{
 --whml-accent:#0078cf;
 --whml-surface:#ffffff;
 --whml-surface-soft:#eaf3f8;
 --whml-surface-sage:#eaf2ee;
 --whml-surface-hover:#dcecf6;
 --whml-overlay:rgba(240,247,251,.93);
 --whml-focus:#a95100;
 --whml-shadow:0 12px 36px #0a35400c;
}
html[data-whml-theme="light"]{
 color-scheme:light;
 --paper:#f5f8f8;--ink:#123449;--muted:#4d6575;--line:#cedee5;
 --ice:#eaf3f8;--blue:#0078cf;--blue-deep:#005b9e;
}
html[data-whml-theme="dark"]{
 color-scheme:dark;
 --paper:#0b1d29;--ink:#e5eff5;--muted:#b6cbd8;--line:#345061;
 --ice:#162e3e;--blue:#72c7ff;--blue-deep:#8dd2ff;
 --whml-surface:#112937;
 --whml-surface-soft:#162e3e;
 --whml-surface-sage:#152f32;
 --whml-surface-hover:#203e50;
 --whml-overlay:rgba(14,35,49,.94);
 --whml-focus:#ffcc82;
 --whml-shadow:0 14px 38px #00000024;
}
html[data-whml-theme] body{background:var(--paper);color:var(--ink)}
html[data-whml-theme] :is(body,.course-card,.source-plan,.home-letter,.audience-account,.whml-a11y-dialog,.search-dialog){
 transition:background-color .22s ease,color .22s ease,border-color .22s ease;
}
html[data-whml-theme] :is(.audience-journeys,.knowledge-feature){background:var(--whml-surface-sage);color:var(--ink)}
html[data-whml-theme] :is(.impact-band,.related-section,.trust-routes,.source-note,.course-facts,.contact-routes,.inline-notice,.newsletter-form,.callout){
 background:var(--whml-surface-soft);border-color:var(--line);color:var(--ink);
}
html[data-whml-theme] :is(.course-card,.source-plan,.home-service-grid>article,.home-letter,.fee-overview,.published-fees,.social-directory a,.filter-empty,.audience-account){
 background:var(--whml-surface);border-color:var(--line);box-shadow:var(--whml-shadow);color:var(--ink);
}
html[data-whml-theme="light"] .home-service-grid>article:nth-child(3n+2){background:var(--whml-surface-soft)}
html[data-whml-theme="light"] .home-service-grid>article:nth-child(3n){background:var(--whml-surface-sage)}
html[data-whml-theme] .knowledge-inner figcaption{background:var(--whml-surface);color:var(--ink)}
html[data-whml-theme] .discipline-strip{background:var(--whml-surface-sage);border-color:var(--line)}
html[data-whml-theme] .discipline-strip a{color:var(--ink);border-color:var(--line)}
html[data-whml-theme] .discipline-strip strong{color:var(--ink)}
html[data-whml-theme] .discipline-strip>.container>span{color:var(--muted)}
html[data-whml-theme] :is(.audience-intro>p:not(.audience-eyebrow),.audience-option-heading>span,.audience-option-body>p,.audience-account-copy>p,.audience-account-action>span,.trust-routes-list>a>span>span){color:var(--muted)}
html[data-whml-theme] :is(.audience-eyebrow,.audience-number){color:var(--muted)}
html[data-whml-theme] :is(.audience-help,.audience-links a,.audience-account-guides a,.audience-account-mark,.trust-routes-list>a>span:last-child){color:var(--blue-deep)}
html[data-whml-theme] :is(.audience-options,.audience-option,.audience-toggle,.trust-routes-list>a,.figures>div,.figure-note){border-color:var(--line)}
html[data-whml-theme] .audience-toggle{color:var(--blue-deep)}
html[data-whml-theme] .audience-option[open] .audience-toggle{color:#fff;background:var(--whml-accent);border-color:var(--whml-accent)}
html[data-whml-theme="dark"] :is(.audience-help:hover,.audience-links a:hover,.audience-option>summary:hover .audience-option-heading strong,.trust-routes-list>a:hover strong){color:#b4e1ff}
html[data-whml-theme] :is(.source-table-scroll,.published-fees){scrollbar-color:var(--line) transparent}
html[data-whml-theme] .source-table-scroll tbody tr:nth-child(even){background:var(--whml-surface-soft)}
html[data-whml-theme] .source-table-scroll thead th{background:#005b9e;color:#fff}
html[data-whml-theme] :is(.source-detail,.source-timeline li:before){border-color:var(--line)}
html[data-whml-theme] .source-timeline li:before{background:var(--line)}
html[data-whml-theme] :is(input:not([type=checkbox],[type=radio],[type=range],[type=submit]),select,textarea,.search-field){
 background:var(--whml-surface);color:var(--ink);border-color:var(--line);
}
html[data-whml-theme] input::placeholder,html[data-whml-theme] textarea::placeholder{color:var(--muted);opacity:1}
html[data-whml-theme] .search-field input{background:transparent}
html[data-whml-theme] :is(.search-dialog,.offline-services-dialog,.donation-review-dialog){
 background:var(--whml-overlay);color:var(--ink);backdrop-filter:blur(14px);
}
html[data-whml-theme] :is(.search-result,.search-results>a){border-color:var(--line)}
html[data-whml-theme] .search-result small{color:var(--muted)}
html[data-whml-theme] :is(.search-result:hover,.search-results>a:hover){background:var(--whml-surface-hover)}
html[data-whml-theme] .status-tag{background:var(--whml-surface-soft);color:var(--blue-deep)}
/* Blue buttons remain readable, including when links use the lighter dark palette. */
html[data-whml-theme="dark"] .button:not(.button-white,.register-button,.account-button,.hero-primary,.audience-account-button){background:#006bb7;border-color:#258bd0;color:#fff}
html[data-whml-theme="dark"] .button:not(.button-white,.register-button,.account-button,.hero-primary,.audience-account-button):hover{background:#005b9e}
html[data-whml-theme="dark"] .button-white{background:#eaf5fc;color:#104168;border-color:#eaf5fc}
html[data-whml-theme="dark"] .button-white:hover{background:#d4eaf8}
html[data-whml-theme="dark"] .skip-link{background:#eaf5fc;color:#0b1d29}
html[data-whml-theme="dark"] .support-band{background:#075989;color:#fff}
html[data-whml-theme="dark"] .support-band :is(h2,.button){color:inherit}
html[data-whml-theme="dark"] .support-band .button-white{color:#104168}
html[data-whml-theme="dark"] .support-band p{color:#e0f0fb}
html[data-whml-theme="dark"] .site-footer{background:#071722}
html[data-whml-theme="dark"] .large-index{color:#8baabc}
html[data-whml-theme="dark"] .figure-index{background:var(--whml-overlay);color:var(--ink)}
html[data-whml-theme="dark"] .masthead .language-picker-flags .language-options{background:#12466b;border-color:#58758a;scrollbar-color:#8cbbd9 #12466b}
html[data-whml-theme="dark"] ::selection{background:#2e627f;color:#fff}
html[data-whml-theme] :where(a,button,input,select,textarea,summary):focus-visible{outline-color:var(--whml-focus)}
/* Keep the controls outside page color filters, while applying the actual theme. */
html[data-whml-theme] [data-whml-accessibility]{color:var(--ink)}
html[data-whml-theme] [data-whml-accessibility] .whml-a11y-dialog{background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-whml-theme] [data-whml-accessibility] :is(.whml-a11y-card,.whml-a11y-filters,.whml-a11y-footer){background:var(--whml-surface);color:var(--ink);border-color:var(--line)}
html[data-whml-theme] [data-whml-accessibility] :is(.whml-a11y-section h3,.whml-a11y-filters legend){color:var(--ink)}
html[data-whml-theme] [data-whml-accessibility] :is(.whml-a11y-body>p:first-child,.whml-a11y-card small,.whml-a11y-filters p,.whml-a11y-note,.whml-a11y-limits,.whml-a11y-status){color:var(--muted)}
html[data-whml-theme] [data-whml-accessibility] :is(.whml-a11y-filters button,.whml-a11y-theme button){background:var(--whml-surface-soft);color:var(--ink);border-color:var(--line)}
html[data-whml-theme] [data-whml-accessibility] :is(.whml-a11y-card:hover,.whml-a11y-card[aria-pressed="true"],.whml-a11y-filters button[aria-pressed="true"],.whml-a11y-theme button[aria-pressed="true"]){background:var(--whml-surface-hover);border-color:var(--blue)}
html[data-whml-theme] [data-whml-accessibility] :is(.whml-a11y-card svg,.whml-a11y-theme svg,.whml-a11y-card[aria-pressed="true"]:before,.whml-a11y-dialog a){color:var(--blue-deep)}
html[data-whml-theme] [data-whml-accessibility] .whml-a11y-steps i{background:var(--line)}
html[data-whml-theme] [data-whml-accessibility] .whml-a11y-steps i.active{background:var(--blue)}
html[data-whml-theme] [data-whml-accessibility] .whml-a11y-limits{border-color:var(--line)}
html[data-whml-theme="dark"] [data-whml-accessibility] .whml-a11y-launcher{border-color:#9ac3df}
/* High-contrast and reduced-motion preferences take precedence over theme transitions. */
html[data-whml-contrast="high"]{--blue:#ffed78;--blue-deep:#ffed78;--ink:#fff;--muted:#fff;--line:#b9bdc4;--paper:#000;--ice:#000}
html[data-whml-contrast="high"] [data-whml-accessibility]{--paper:#0b1d29;--ink:#e5eff5;--muted:#b6cbd8;--line:#688391;--blue:#a8dfff;--blue-deep:#a8dfff;--whml-surface:#112937;--whml-surface-soft:#162e3e;--whml-surface-hover:#203e50}
@media(prefers-reduced-motion:reduce){
 html[data-whml-theme] :is(body,.course-card,.source-plan,.home-letter,.audience-account,.whml-a11y-dialog,.search-dialog){transition:none}
}
@media(forced-colors:active){
 html[data-whml-theme] [data-whml-accessibility] [aria-pressed="true"]{outline:2px solid Highlight}
}
@media print{
 html[data-whml-theme]{color-scheme:light;--paper:#fff;--ink:#000;--muted:#222;--line:#999;--blue:#005b9e;--blue-deep:#005b9e;--ice:#fff;--whml-surface:#fff;--whml-surface-soft:#fff;--whml-surface-sage:#fff;--whml-shadow:none}
}
