/* Approved portal palette, 18 September 2026. Magic entrance keeps its existing theme. */
:root[data-portal-theme] {
 --brand-heading-paper-ink:#174A7E; --brand-heading-surface-ink:#174A7E;
 --brand-paper-ink:#17324D; --brand-surface-ink:#17324D;
 --brand-surface:#D2F9F6; --brand-paper:#FFFFFF;
}
:root[data-portal-theme] body {background:#FFFFFF;}
:root[data-portal-theme] body :is(.button,.primary,.secondary,.adventure-link,.header-button,.portal-parent-link,.parents-nav,.parent-entry,.yellow-button,.world-home-parent,.atlas-play,.parent-button,.farm-button,.realm-game-actions a[data-world-play]) {
 background:#174A7E !important; --brand-ink:#FFFFFF;
}
:root[data-portal-theme] body :is(.ap-home,.ap-parent,.ap-today,.ap-future,.ap-step,.farm-titleband,.farm-gate,.farm-jumps,.farm-shelf,.farm-pages,.farm-memo,.farm-keepsakes,.farm-arrival,.realm-stories,.home-meeting,.oak-arrival,.oak-arrival-scene,.oak-arrival-note,.oak-paths,.oak-entry,.oak-game,.oak-draw-intro,.welcome-parent,.answers-picker,.path-pace,.path-notice,.path-extra) {
 background:#D2F9F6; --brand-ink:#17324D; --brand-heading-ink:#174A7E;
}
:root[data-portal-theme] body :is(.family-value,.portal-header,.feature-set) {background:#FFFFFF !important;}
:root[data-portal-theme] body :is(.platform-access,.platform-featured,.world-home-visual) {background:#EDFCFA;}
:root[data-portal-theme] body .wrap {width:calc(100% - 64px);max-width:1200px;box-sizing:border-box;}
:root[data-portal-theme] body :is(.platform-access,.platform-featured) {padding-inline:clamp(24px,4vw,48px);border-radius:16px;}
:root[data-portal-theme] .world-home-visual {padding:16px;border-radius:16px;box-sizing:border-box;}
:root[data-portal-theme] .world-home-visual figcaption {padding:16px 12px;}
:root[data-portal-theme] .world-home-places {padding:0 4px 12px;}
:root[data-portal-theme] body :is(a,button,input,select,textarea,summary):focus-visible {outline-color:#174A7E !important;}
@media(max-width:700px){
 :root[data-portal-theme] body .wrap {width:calc(100% - 40px);}
 :root[data-portal-theme] body :is(.platform-access,.platform-featured) {padding-inline:24px;}
 :root[data-portal-theme] .world-home-visual {padding:12px;}
}
/* Shared entries are injected after page load; include them in the action palette. */
:root[data-portal-theme] body :is(.reader-entry,.tablet-entry,.coloring-entry,.answers-entry,.oak-play) {
 background:#174A7E !important; color:#FFFFFF !important; --brand-ink:#FFFFFF !important;
}
/* Uniform library presentation; original pages are never cropped or stretched. */
:root[data-portal-theme] body .answer-callout {
 background:#D2F9F6; color:#17324D; --brand-ink:#17324D; --brand-heading-ink:#174A7E;
}
:root[data-portal-theme] body .resource-preview {
 height:320px; padding:24px; box-sizing:border-box; flex:none;
}
:root[data-portal-theme] body .resource-preview img {
 width:240px; max-width:100%; height:272px; object-fit:contain;
 background:#FFFFFF; padding:12px; box-sizing:border-box;
 border-radius:8px !important; filter:none;
}
:root[data-portal-theme] body .resource-copy {padding:24px;gap:12px;}
:root[data-portal-theme] body .resource-copy h3 {font-size:26px;line-height:1.25;margin:0;min-height:3.75em;}
:root[data-portal-theme] body .resource-kind {margin:0;min-height:2.8em;}
:root[data-portal-theme] body .resource-copy>.text-link {margin-top:auto;}
:root[data-portal-theme] body .resource-copy :is(.reader-entry,.tablet-entry,.coloring-entry,.answers-entry) {width:100%;box-sizing:border-box;margin:0;min-height:48px;}
:root[data-portal-theme] body .resource-card {border-radius:16px;}
/* Tablet/coloring controls share the portal palette; ink swatches keep their colors. */
:root[data-portal-theme] body :is(.tablet-sidebar,.tablet-tools){background:#D2F9F6!important;--brand-ink:#174A7E!important;}
:root[data-portal-theme] body .tablet-desk{background:#EDFCFA!important;}
:root[data-portal-theme] body.tablet-page :is(#check-work,#save-copy,#close-check,#picture-download,#show-tools){background:#174A7E!important;color:#FFFFFF!important;--brand-ink:#FFFFFF!important;border-color:#174A7E!important;}
:root[data-portal-theme] body.tablet-page :is(.tablet-top,dialog,dialog button){border-color:#174A7E!important;}
:root[data-portal-theme] body.tablet-page dialog button:last-child{background:#174A7E!important;color:#FFFFFF!important;--brand-ink:#FFFFFF!important;}
:root[data-portal-theme] body.tablet-page .memory-cover{background:#174A7E;}
:root[data-portal-theme] body.tablet-page .answer-region:is(:hover,:focus-visible),
:root[data-portal-theme] body.tablet-page #answer-layer .answer-region:is(:hover,:focus-visible){background:#D2F9F630!important;border-color:#174A7E!important;}
:root[data-portal-theme] body.tablet-page .answer-region[data-kind=number][data-filled=false]{border-color:#174A7E!important;}
