html[data-theme=dark]{--ink:#e6edf7;--muted:#a9b8cb;--cream:#111827;--line:#344459;--purple:#79ccfa;--lavender:#203548;--brand-action:#79ccfa;--brand-soft:#203548;--brand-warm:#3a3020;--brand-line:#344459;color-scheme:dark;background:#111827}
html[data-theme=dark] body{background:#111827;color:#e6edf7}
html[data-theme=dark] :is(.app-shell,.shell,.dashboard,.parent-shell,.parent-dashboard,.admin-workspace,main,.content,.page-body){background-color:#111827;color:#e6edf7}
html[data-theme=dark] :is(.topbar,.header,.footer,.sidebar,.workspace-topbar,.page-hero,.display-preferences,.dashboard-header,.parent-header){background:#182334;color:#e6edf7;border-color:#344459}
html[data-theme=dark] :is(section,.card,.stat-card,.metric-card,.insight-card,.insights-card,.dt-shell,.dt-summary-card,.admin-modal,.focus-dialog,.learner-tools-panel,.article-card,.article-rich-body,.editor-article-preview,.blog-preview,.auth-card,.child-sign-in-card,.family-card,.child-card,.plan-card,.gateway-card,.media-edit,.theme-editor,.search-preview,.rich-editor,.pricing-plan-cell,.ad-slot,.feedback-dialog){background-color:#1b283a;background-image:none;color:#e6edf7;border-color:#344459}
html[data-theme=dark] :is(h1,h2,h3,h4,h5,h6,p,label,legend,dt,dd,th,td,strong,.breadcrumb,.brand,.logo-name,.curriculum-field,.dt-cell-main,.stat-value,.metric-value){color:inherit}
html[data-theme=dark] :is(small,.muted,.lead,.eyebrow,.section-description,.dt-summary-card>span,.dt-summary-card>small,.dt-footer,.workspace-heading>p){color:#a9b8cb}
html[data-theme=dark] :is(input,select,textarea,.rich-editor-document){background:#132033;color:#e6edf7;border-color:#45566d}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#a0afc1}
html[data-theme=dark] :is(table,thead,tbody,tr,th,td,.dt-toolbar,.dt-filters,.dt-footer,.dt-filter,.dt-search,.admin-modal-header,.admin-modal-footer){background-color:transparent;color:#e6edf7;border-color:#344459}
html[data-theme=dark] :is(thead,.dt-summary-card,.rich-editor-tools,.media-dropzone,.editor-cover,.blog-section-editor,.mail-thread article,.attachment-chip,.sidebar-note,.parent-tip,.hero-card,.hero,.lesson-card,.topic-card,.kid-card){background:#203146;color:#e6edf7;border-color:#45566d}
html[data-theme=dark] :is(.audio-toggle,.detail-secondary,.display-mode-toggle,.mailbox-folders button,.rich-editor-tools button,.rich-link button,.dt-tools button,.dt-footer button,.sidebar-toggle){background:#22344a;color:#dceaf8;border-color:#45566d}
html[data-theme=dark] :is(.curriculum-action,.workspace-primary,.auth-submit,.primary-button,.btn,.primary,.action-button,button[type=submit]){background:#08699e;color:#fff;border-color:#258ebd}
html[data-theme=dark] :is(.curriculum-link,.detail-back,a:not(.btn):not(.brand):not(.side-link):not(.side-active)){color:#8ed4fc}
html[data-theme=dark] :is(.danger,.error,[role=alert]){color:#ffadb5}
html[data-theme=dark] :is(.admin-modal-backdrop,.focus-dialog::backdrop){background:#020617bb}
html[data-theme=dark] :is(.dt-summary-card>strong,.metric-card strong,.stat-card strong){color:#e6edf7}
html[data-theme=dark] :is(.active,.selected,[aria-current=page],.mailbox-folders button[aria-pressed=true]){border-color:#79ccfa}
html[data-theme=dark] :is(.rich-editor-document blockquote,.editor-article-preview blockquote){background:#243c46;color:#e6edf7}
html[data-theme=dark] :is(.rich-editor-document pre,code){background:#132033;color:#e6edf7}
html[data-theme=dark] svg text{fill:#b8c9db}
html[data-theme=dark] :is(.trace-canvas,canvas){background:#fff}

html[data-theme=dark] :is(.panel,.progress-panel,.share-panel,.learning-settings,.billing-panel,.child-modal,.insights-panel,.insights-metric,.insights-scope,.data-table,.login,.login-card,.auth-panel,.auth-form,.auth-layout,.activity-panel,.activity-card,.lesson-panel,.searchable-select-menu,.feedback-toast,.feedback-center,.chart-tooltip){background:#1b283a;color:#e6edf7;border-color:#344459}
html[data-theme=dark] :is(.insights-panel p,.insights-metric p,.insights-metric small,.insights-heading p,.child-modal p,.panel p,.page-hero p,.hero .lead){color:#afc0d4}
html[data-theme=dark] :is(.insights-metric-value,.insights-donut-center strong,.insights-legend strong,.insights-panel h3,.insights-metric strong){color:#e6edf7}
html[data-theme=dark] :is(.child-modal-close,.child-modal-modes,.child-modal-note,.child-card.selected,.insights-scope button,.billing-status,.searchable-select-trigger){background:#22344a;color:#e6edf7;border-color:#45566d}
html[data-theme=dark] :is(.preview,.preview-head,.preview-body,.parent-preview,.float,.faq details){background:#203146;color:#e6edf7;border-color:#45566d}

/* Semantic surfaces and states shared by eagerly and lazily loaded screens.
   Root specificity deliberately wins over workspace/component selectors. */
:root{--theme-page:#f6f8fb;--theme-surface:#fff;--theme-raised:#f0f6fb;--theme-text:#24364b;--theme-muted:#53677d;--theme-border:#ccd9e5;--theme-link:#08699e;--theme-action:#08699e;--theme-on-action:#fff}
html[data-theme=dark]{--theme-page:#111827;--theme-surface:#1b283a;--theme-raised:#22344a;--theme-text:#e6edf7;--theme-muted:#b4c4d8;--theme-border:#45566d;--theme-link:#8ed4fc;--theme-action:#08699e;--theme-on-action:#fff;--brand-action:#08699e;--brand-action-hover:#07547e}
html:root[data-theme=dark] body :is(.interest-panel,.course-option,.subject-card,.daily,.progress-card,.exercise,.empty-lessons,.topic-filters,.recommend-card,.animal-group-card,.letter-card,.plan-purchase,.billing-current,.empty,.historical-detail,.parent-play-guides,.signin-card,.activity-center,.activity-center-card,.notification-template-form,.skill-admin-card,.detail-related a,.topic-plan-item,.price-card,.info-panel,.level,.dash-child,.dash-box,.trust,.learning-history,.history-panel){background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.sidebar-app,.overview,.overview-stat,.grade-history,.first-lesson,.code-row,.setting-chip,.child-modal-footer,.child-link-help,.child-login-code,.parent-guide-detail,.parent-guide-list button,.stats div,.definition-card,.side-panel,.sentence-line,.learn-badge,.module-visual,.quantity-builder,.object-counter,.animal-picker-hero,.auth-art,.child-sign-in-art,.payment-pending,.catalog-template-notice,.diagnostic-counts span,.skill-admin-list button,.answers span,.tags span,.pill,.legal-links a,.note){background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(h1,h2,h3,h4,h5,h6,.workspace-heading,.card-name,.course-select,.course-option strong,.plan-total strong,.notification-template-form p,.activity-center-card strong){color:var(--theme-text)}
html:root[data-theme=dark] body :is(.card-desc,.card-foot,.course-select small,.course-empty,.billing-muted,.plan-payment-note,.activity-center-card p,.activity-center-card small,.activity-center-heading p,.hero-note,.nav-label,.sidebar-label,.side-label,.workspace-breadcrumb,.workspace-date,.insights-empty,.insights-footnote,.insights-footer,.insights-chart-note,.animal-picker-hero p,.animal-group-description){color:var(--theme-muted)}
html:root[data-theme=dark] body :is(input,select,textarea,.rich-editor-document){background:#132033;color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.secondary,.back,.speak,.interest-chip,.clear-filters,.arrow,.skill-tabs button,.code-row button,.social-auth-button,.activity-center-card button,.activity-center-pages button,.notification-template-send button,.admin-modal-close,.device-dialog-close,.curriculum-pages button,.curriculum-chips button,.rich-editor-tools button,.choice,.word-tile,.countable-object){background:var(--theme-raised);color:var(--theme-link);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.primary,.primary-button,.workspace-primary,.curriculum-action,.auth-submit,.btn,button[type=submit]){background:var(--theme-action);color:var(--theme-on-action);border-color:#258ebd}
html:root[data-theme=dark] body :is(.primary,.primary-button,.workspace-primary,.curriculum-action,.auth-submit,.btn,button[type=submit]):hover:not(:disabled){background:#07547e;color:#fff}
html:root[data-theme=dark] body :is(.nav-item,.side-link){color:#c1cee0}
html:root[data-theme=dark] body :is(.nav-item:hover,.side-link:hover,.nav-item.active,.side-link.active,.side-active,.course-option.active,.interest-chip.chosen,.interest-chip[aria-pressed=true],.skill-tabs button.active,.parent-guide-list button.active){background:#203d53;color:#a4dfff;border-color:#629bbf}
html:root[data-theme=dark] body :is(.count-badge,.plan-purchase-heading span,.detail-badge,.catalog-tags>span,.topic-count){background:#294259;color:#bfE6ff;border-color:#52718e}
html:root[data-theme=dark] body :is(.billing-status span,.status-pill,.offline-status,.success,.curriculum-notice,.detail-badge.good,.choice.correct,.completion,.adult-guide,.activity-center-card.unread){background:#173d35;color:#a9efd0;border-color:#397f67}
html:root[data-theme=dark] body :is(.error,.error-banner,.child-modal-error,.choice.wrong,.form-error){background:#48252f;color:#ffc0c7;border-color:#a45c6b}
html:root[data-theme=dark] body :is(.offline-status p,.adult-guide p){color:#bce3d4}
html:root[data-theme=dark] body :is(.app-shell .topbar .audio-toggle,.app-shell .learner-tools>summary){background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body .app-shell .topbar .audio-toggle:hover:not(:disabled){background:#2b4862;color:#fff}
html:root[data-theme=dark] body .app-shell .topbar .sync-toggle{background:#173d35;color:#a9efd0;border-color:#397f67}
html:root[data-theme=dark] body .app-shell .streak{background:#3a3020;color:#ffdc8f;border-color:#a7894d}
html:root[data-theme=dark] body :is(.learner-tools-panel,.auth-shell,.child-sign-in){background:var(--theme-page);color:var(--theme-text)}
html:root[data-theme=dark] body :is(.history-toggle,.learning-history>summary,details>summary){color:var(--theme-link);background:var(--theme-surface);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.section.alt,.section.white,.section.warm){background:var(--theme-surface);color:var(--theme-text)}
html:root[data-theme=dark] body .answers span:first-child{background:#173d35;color:#a9efd0}
html:root[data-theme=dark] body .detail-hero{background:var(--theme-surface)!important;color:var(--theme-text)}
html:root[data-theme=dark] body :is(.dt-empty,.dt-caption,.dt-search-icon,.dt-filter label,.rich-editor-tools,.rich-editor-status,.editor-field-note){color:var(--theme-muted)}
html:root[data-theme=dark] body :is(.dt-table tbody tr:hover,.dt-table tbody tr[data-selected=true]){background:var(--theme-raised)}
html:root[data-theme=dark] body :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid #79ccfa;outline-offset:3px}
html:root[data-theme=dark] body ::selection{background:#315d80;color:#fff}
html:root[data-theme=dark]{scrollbar-color:#526781 #182334}
html:root[data-theme=dark] body .admin-workspace{--workspace-ink:var(--theme-text);--workspace-line:var(--theme-border)}
html:root[data-theme=dark] body :is(.insights,.data-table,.admin-workspace .insights,.admin-workspace .data-table){--dash-ink:var(--theme-text);--dash-muted:var(--theme-muted);--dash-purple:var(--theme-link);--dash-line:var(--theme-border);--dash-soft:var(--theme-raised)}
html:root[data-theme=dark] body .shell.admin-workspace>main>header h1{color:var(--theme-text)}
html:root[data-theme=dark] body .shell.admin-workspace>main>header p{color:var(--theme-muted)}
html:root[data-theme=dark] body :is(.insights-history,.email-theme-grid article,.mail-thread,.rich-link,.searchable-select-menu,.searchable-select-option){background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.searchable-select-option:hover,.searchable-select-option[aria-selected=true]){background:var(--theme-raised);color:var(--theme-link)}
html:root[data-theme=dark] body :is(.plan-total,.admin-record,.child-modal-footer,.insights-chart-data){border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.secondary:hover,.interest-chip:hover,.rich-editor-tools button:hover){background:#2b4862;color:#fff}
/* Illustrations and writing canvases intentionally keep their original colours. */
html:root[data-theme=dark] body :is(.canvas-wrap,.trace-canvas){color:#24364b;background-color:#fff}
html:root[data-theme=dark] body :is(.searchable-select-control,.date-time-picker-control,.date-time-picker-popover){background:#132033;color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.date-time-picker-toggle,.date-time-picker-heading>button,.date-time-picker-days button,.date-time-picker-actions button){background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.searchable-select-option.is-active,.date-time-picker-days button[aria-selected=true]){background:#203d53;color:#a4dfff;border-color:#79ccfa}
html:root[data-theme=dark] body :is(.insights-metric>strong,.workspace-breadcrumb strong){color:var(--theme-text)}
html:root[data-theme=dark] body :is(.insights-metric>div>span,.insights-metric>small,.insights-secondary-metrics span,.searchable-select-group,.searchable-select-chevron){color:var(--theme-muted)}
html:root[data-theme=dark] body .date-time-picker-grid>button{color:var(--theme-text)}
html:root[data-theme=dark] body .date-time-picker-grid>button:hover:not(:disabled){background:var(--theme-raised);color:var(--theme-link)}
html:root[data-theme=dark] body .date-time-picker-grid>button[aria-pressed=true]{background:#08699e;color:#fff}
html:root[data-theme=dark] body .date-time-picker-grid>button:disabled{color:#75859a}
html:root[data-theme=dark] body :is(.date-time-picker-clock>span,.date-time-picker-weekdays){color:var(--theme-muted)}

/* Always-reachable, high-contrast quick controls with touch-sized targets. */
.page-quick-controls{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:65;display:flex;flex-direction:column;align-items:flex-end;gap:10px;pointer-events:none}
.page-quick-controls button{pointer-events:auto;min-height:48px;padding:12px 18px;border:2px solid #08699e;border-radius:999px;background:#08699e;color:#fff;font:800 14px/1.3 "DM Sans",sans-serif;box-shadow:0 5px 20px #10233c30;cursor:pointer}
.page-quick-controls button[hidden]{display:none}
.page-quick-controls button:hover{background:#07547e;border-color:#07547e}
.page-quick-controls button:focus-visible{outline:3px solid #e0a526;outline-offset:4px}
html:root[data-theme=dark] body .page-quick-controls button{background:#ffd276;color:#24364b;border-color:#ffd276}
html:root[data-theme=dark] body .page-quick-controls button:hover{background:#ffe3a8}
/* Reserve room for floating controls in content, never beneath a sticky sidebar. */
body:has(.page-quick-controls) :is(.shell.admin-workspace>main,.dashboard>.main,.app-shell>.main){padding-bottom:82px}
body:has([aria-modal=true]) .page-quick-controls{visibility:hidden}
@media(max-width:600px){.page-quick-controls{right:12px;bottom:max(12px,env(safe-area-inset-bottom))}.page-quick-controls button{min-height:46px;padding:10px 14px;font-size:13px}}

/* Table cells and sticky regions must own their surface, including row hover. */
html:root[data-theme=dark] body :is(.data-table,.table-wrap) :is(.dt-heading,.dt-toolbar,.dt-footer,tbody tr,tbody td){background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.data-table,.table-wrap) :is(thead th,.dt-scroll){background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border);box-shadow:none}
html:root[data-theme=dark] body :is(.data-table,.table-wrap) tbody tr:hover :is(td,th){background:#263c53;color:var(--theme-text);border-color:#629bbf}
html:root[data-theme=dark] body :is(.data-table button,.dt-columns>summary,.insights-refresh){background:var(--theme-raised);color:var(--theme-link);border-color:var(--theme-border)}
html:root[data-theme=dark] body .data-table .dt-footer button:disabled{opacity:1;background:#203146;color:#a9b8cb;border-color:#45566d}
html:root[data-theme=dark] body :is(.dt-columns>div,.skill-filterbar,.skill-metric,.skill-editor-identity,.skill-prerequisite-options label,.skill-state-list>div,.admin-record,.gateway-card details,.pricing-inherited,.insights-secondary-metrics,.insights-explainer,.insights-loading,.learning-confirm,.learning-toast){background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.skill-metric strong,.admin-record strong,.skill-page-intro h2,.learning-confirm h2){color:var(--theme-text)}
html:root[data-theme=dark] body :is(.skill-filterbar label,.skill-filterbar span,.skill-page-intro p,.learning-confirm p,.learning-confirm-detail){color:var(--theme-muted)}
html:root[data-theme=dark] body :is(.learning-confirm-close,.learning-confirm-cancel,.learning-confirm .learning-confirm-detail,.insights-legend button:hover,.insights-legend button[aria-pressed=true],.insights-scope button[aria-pressed=true]){background:var(--theme-raised);color:var(--theme-link);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.dt-badge-completed,.dt-badge-active,.dt-badge-published){background:#173d35;color:#a9efd0}
html:root[data-theme=dark] body :is(.dt-badge-in_progress,.dt-badge-pending,.publication-results,.skill-status.paused){background:#3a3020;color:#ffdc8f;border-color:#a7894d}
html:root[data-theme=dark] body :is(.dt-badge-past_due,.dt-badge-unpaid,.dt-badge-incomplete,.dt-error,.learning-toast.error){background:#48252f;color:#ffc0c7;border-color:#a45c6b}
html:root[data-theme=dark] body :is(.pricing-summary,.sponsor-provider,.hero-pills span,.panel-icon,.panel-icon.purple){background:var(--theme-raised);color:var(--theme-text);border-color:var(--theme-border)}
html:root[data-theme=dark] body :is(.price,.pricing-summary strong,.grade-history b,.overview-stat span){color:var(--theme-text)}
html:root[data-theme=dark] body :is(.pricing-summary p,.regional-pricing p){color:var(--theme-muted)}
html:root[data-theme=dark] body .top-cta{background:#08699e;color:#fff;border-color:#258ebd}
html:root[data-theme=dark] body .top-cta:hover{background:#07547e;color:#fff}
html:root[data-theme=dark] body :is(.subject-card .top small,.dash-top small,.dash-child span,.hero-note span,.card .icon,.step .number,.checks li:before){background:var(--theme-raised);color:var(--theme-link)}
html:root[data-theme=dark] body .checks li{color:var(--theme-text)}
html:root[data-theme=dark] body .child-sign-in-art .login-shapes{color:var(--brand-secondary)}
html:root[data-theme=dark] body :is(.child-sign-in-card a.brand,.brand strong,.logo-name>span){color:#8ed4fc}
html:root[data-theme=dark] body .child-sign-in-card{background:#1b283a;color:#e6edf7;border-color:#45566d;box-shadow:0 22px 65px #0206174d}
html:root[data-theme=dark] body .child-sign-in-card label span{color:#b4c4d8}
html:root[data-theme=dark] body .child-sign-in-card .primary:disabled{background:#294259;color:#dceaf8;border-color:#52718e;opacity:1;box-shadow:none}

/* Text on action surfaces must stay readable even when generic link rules apply. */
html:root[data-theme=dark] body a.top-cta{color:#fff!important}
html:root[data-theme=dark] body a.top-cta,
html:root[data-theme=dark] body a.top-cta :is(span,svg){color:#fff}
html:root[data-theme=dark] body :is(.primary,.primary-button,.workspace-primary,.curriculum-action,.auth-submit,.btn,button[type=submit]) :is(span,strong,small,svg){color:inherit}
html:root[data-theme=dark] body :is(.skip-link,.admin-skip){background:#08699e;color:#fff}
html:root[data-theme=dark] body .user-avatar{color:#24364b}
html:root[data-theme=dark] body .child-modal-modes button{color:#dceaf8}
html:root[data-theme=dark] body .child-modal-modes button[aria-pressed=true]{background:#203d53;color:#a4dfff}
html:root[data-theme=dark] body .child-required{color:var(--theme-muted)}
html:root[data-theme=dark] body :is(.insights-legend button,.insights-legend button>span,.insights-legend button>b,.insights-legend button>small,.insights-chart-caption){color:var(--theme-text)}
html:root[data-theme=dark] body .insights-chart-caption{color:var(--theme-muted)}
html:root[data-theme=dark] body :is(.date-time-picker-weekday,.date-time-picker-grid>button:disabled){color:#a9b8cb}
/* Modals retain their dimensions while overlays open and background scrolling locks. */
html{scrollbar-gutter:stable}
.child-modal-body,.admin-modal-body{scrollbar-gutter:stable;overscroll-behavior:contain;min-height:0}
.child-modal-close,.admin-modal-close{min-width:44px;min-height:44px}
html:root[data-theme=dark] body .child-modal-modes button{color:var(--theme-muted);background:transparent}
html:root[data-theme=dark] body .child-modal-modes button[aria-pressed=true]{background:#08699e;color:#fff;box-shadow:0 2px 6px #0003}
.date-time-picker-popover .date-time-picker-heading{grid-template-columns:32px minmax(0,1fr) 86px 32px}
.date-time-picker-popover .date-time-picker-control{margin:0}
@media(max-width:600px){.date-time-picker-popover .date-time-picker-grid>button{min-height:40px}}
