/* Semantic dark layers. Light remains the established FPT Schools palette. */
html[data-theme="dark"]{--fsc-blue:#a7c6ff;--fsc-blue-deep:#d1e2ff;--fsc-orange:#ffb97d;--fsc-orange-dark:#ffc28e;--fsc-green:#8ed8b1;--fsc-ink:#e6edf7;--fsc-copy:#ced9e8;--fsc-muted:#a7b8cd;--fsc-canvas:#101925;--fsc-surface:#172333;--fsc-border:#3b4d64;--fsc-shadow:0 12px 32px #0003;--polish-line:#3b4d64;--polish-text:#c2d1e3;--text:#ced9e8;--body:#ced9e8;--cream:#172333;--peach:#342a26;--navy-soft:#a8c8fb;--accent-soft:#3b2b20;--cms-ink:#d1e2ff;--cms-muted:#a7b8cd;--cms-line:#3b4d64;color-scheme:dark;background:#101925;color:#e6edf7}
html[data-theme="dark"] body{background:#101925!important;color:#e6edf7}
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6){color:#dce9ff!important}
html[data-theme="dark"] :is(p,label,legend,li,td){color:#c9d6e7}
html[data-theme="dark"] p{color:#c9d6e7!important}
html[data-theme="dark"] :is(.topic-foot span,.course-meta span,.course-foot small,.hero-stats span,.breadcrumbs,.lesson-head>span,.mini-progress span,.brand-copy small){color:#b4c7de!important}
html[data-theme="dark"] :is(small,time,.muted,.workspace-subtitle,.lesson-block-help){color:#a9bbd0!important}
html[data-theme="dark"] :is(.site-header,.nav-row,.mobile-nav,.course-dropdown,.mobile-course-menu,.panel,.course-card,.course-body,.topic-card,.announcement-card,.subject-surface,.student-workspace-card,.workspace-editor,.editorial-section,.lesson-block-card,.modal-card,.question-card,.exam-nav,.result-hero,.result-grid article,.lesson-content,.lesson-sidebar,.staff-card,.settings-card,.profile-card,.teacher-subject-cards article,.staff-portal-card,.note-link-row,.note-link-preview,.design-controls fieldset,.design-preview-head,.design-device-toolbar,.design-preview-caption,.calendar-event,.notification-tools,.assistant-chat,.assistant-chat-composer,.assistant-thread-row){background:#172333!important;border-color:#3b4d64!important;color:#d7e4f5;box-shadow:0 6px 24px #0002}
html[data-theme="dark"] :is(.dashboard-page,.dash-main,.hero-wrap,.student-workspace,.subject-home,.inner-page,.login-panel,.admin-workspace,.design-preview-stage,.design-preview-wrap){background:#101925!important}
html[data-theme="dark"] :is(.hero-stats,.hero-learning-card,.hero-art .floating-card,.book-card,.book-body,.learning-path-card,.course-learning-guide,.course-module-heading,.lesson-block-head,.lesson-block-toolbar,.cms-format-toolbar,.cms-writing-status,.cms-link-controls,.cms-table-tools,.cms-reading-outline,.teacher-subject-summary,.overview-welcome,.overview-shortcuts button,.staff-portal-hero,.staff-portal-search,.calendar-header,.calendar-detail,.calendar-day,.calendar-day-detail,.calendar-detail-head,.calendar-detail-list,.design-studio-head,.design-browser-bar,.design-custom-card,.cms-draft-state,.note-file-tile,.note-link-editor,.empty-state,.catalog-empty,.admin-empty,.lesson-practice,.lesson-practice-options label,.lesson-block-resource,.assistant-quick-forms,.assistant-context,.assistant-suggestions button,.assistant-message.assistant,.assistant-thread-empty,.proposal-card){background:#1d2c40!important;border-color:#3b4d64!important;color:#c9d9ed!important}
html[data-theme="dark"] :is(input,textarea,select,.cms-writing-surface,.cms-rich-host .tiptap){background:#111d2c!important;color:#e6edf7!important;border-color:#536b88!important}
html[data-theme="dark"] input[type="checkbox"],html[data-theme="dark"] input[type="radio"]{accent-color:#f5b57e}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#98acc4!important;opacity:1}
html[data-theme="dark"] :is(.pill.outline,.icon-btn,.menu-btn,.portal-menu-btn,.theme-toggle,.note-filter-row button,.note-link-remove,.design-device-toolbar button,.lesson-block-toolbar button,.lesson-block-actions button,.cms-focus-button,.cms-link-controls button,.cms-table-tools button,.admin-table button,.staff-card-actions button,.modal-cancel,.question-answer-editor button,.lesson-practice button){background:#21334b!important;color:#d6e6ff!important;border-color:#58718e!important;box-shadow:none}
html[data-theme="dark"] :is(.pill.primary,.subject-intro-action,.lesson-block-toolbar .cms-featured-tool){background:#f4b176!important;color:#23170e!important;border-color:#f4b176!important}
html[data-theme="dark"] .theme-toggle:hover{background:#304a6c!important}
html[data-theme="dark"] :is(.desktop-nav button,.mobile-nav button,.course-dropdown button,.text-link,.editor-back,.cms-reading-outline button,.cms-format-toolbar button,.lesson-tabs button,.course-foot button,.topic-foot button){color:#c7dcff!important}
html[data-theme="dark"] :is(.pill,.filter,.nav-subject,.theme-toggle):focus-visible,html[data-theme="dark"] :is(input,textarea,select,button,a):focus-visible{outline-color:#ffd0a1!important}
html[data-theme="dark"] :is(.filter.active,.note-filter-row button[aria-pressed="true"],.design-device-toolbar button[aria-pressed="true"],.cms-format-toolbar button[aria-pressed="true"]){background:#365a87!important;color:#fff!important;border-color:#9ec1ef!important}
html[data-theme="dark"] :is(.dash-side,.topbar,.assistant-chat-head,.site-footer){background:#0e1c31!important;color:#dfebff}
html[data-theme="dark"] .dash-side nav button{color:#c7d8ef!important}
html[data-theme="dark"] .dash-side nav button.active{background:#2a4363!important;color:#fff!important}
html[data-theme="dark"] :is(.admin-table th,.admin-table tbody tr:hover,.dash-stats article,.result-chips span){background:#1d2e45!important;color:#d3e2f7!important;border-color:#3b4d64!important}
html[data-theme="dark"] :is(.admin-table td,.admin-table th,.editorial-section,.modal-actions,.workspace-editor-head,.cms-reading-header,.lesson-block-head){border-color:#3b4d64!important}
html[data-theme="dark"] :is(.workspace-editor-head,.cms-studio-hero,.design-studio-head){background:linear-gradient(120deg,#192b43,#172333)!important}
html[data-theme="dark"] .cms-ambient-canvas{opacity:.18}
html[data-theme="dark"] :is(.cms-prose,.cms-prose p,.cms-prose li,.cms-prose strong,.lesson-rich-content p,.lesson-rich-content li,.lesson-block-text,.lesson-block-text p){color:#d2deed!important}
html[data-theme="dark"] :is(.cms-prose a,.subject-custom-block a,.lesson-resource a){color:#a8ceff!important}
html[data-theme="dark"] .cms-prose :is(td,th){border-color:#526a89!important;color:#d6e4f5!important}
html[data-theme="dark"] .cms-prose th{background:#2a405e!important}
html[data-theme="dark"] .cms-prose :is(code,blockquote){background:#23364e!important;color:#e4d2bf!important}
html[data-theme="dark"] .cms-prose blockquote p{color:#e4d2bf!important}
html[data-theme="dark"] :is(.cms-callout,.cms-callout p){background:#20364f!important;border-color:#496e96!important;color:#d6e9ff!important}
html[data-theme="dark"] .cms-callout.tone-tip{background:#1c352d!important;color:#bbebd2!important}
html[data-theme="dark"] .cms-callout.tone-warning{background:#3c3020!important;color:#ffe0b3!important}
html[data-theme="dark"] :is(.cms-reading-header p,.cms-writing-status,.cms-prose hr,.cms-divider){color:#a7bbd2!important;border-color:#3b4d64!important}
html[data-theme="dark"] .subject-surface{--subject-bg:#33271f;--subject-ink:#ffc99e;--subject-accent:#ffc99e;--subject-border:#75513b;background:#172333!important}
html[data-theme="dark"] .tone-peach{--subject-bg:#33271f;--subject-ink:#ffd0a8;--subject-border:#795b47;background:#33271f;color:#ffd0a8}
html[data-theme="dark"] .tone-lavender{--subject-bg:#2b2743;--subject-ink:#d4c4ff;--subject-border:#655c8e;background:#2b2743;color:#d4c4ff}
html[data-theme="dark"] .tone-mint{--subject-bg:#1b332b;--subject-ink:#a6e4c8;--subject-border:#477765;background:#1b332b;color:#a6e4c8}
html[data-theme="dark"] .tone-sky{--subject-bg:#1c3048;--subject-ink:#b5d5ff;--subject-border:#4f719c;background:#1c3048;color:#b5d5ff}
html[data-theme="dark"] .tone-lemon{--subject-bg:#34301b;--subject-ink:#eadd98;--subject-border:#7e7445;background:#34301b;color:#eadd98}
html[data-theme="dark"] .subject-surface[class*="design-layout-"]{--subject-bg:color-mix(in srgb,var(--design-accent) 15%,#182434);--subject-ink:#e5dcce;--subject-border:color-mix(in srgb,var(--design-accent) 45%,#52657c)}
html[data-theme="dark"] .subject-surface .subject-panel-intro{background:linear-gradient(115deg,var(--subject-bg),#172333)!important;border-color:var(--subject-border)!important}
html[data-theme="dark"] .subject-surface :is(.subject-panel-intro h3,.subject-panel-intro p,.subject-identity-caption,.subject-interest-tags,.subject-icon){color:var(--subject-ink)!important}
html[data-theme="dark"] :is(.subject-art-seal,.subject-identity-symbol,.subject-interest-tags>span,.topic-icon,.tag){background:var(--subject-bg)!important;color:var(--subject-ink)!important;border-color:var(--subject-border)!important}

html[data-theme="dark"] .course-cover{background:var(--subject-bg)!important;color:var(--subject-ink)!important}
html[data-theme="dark"] .subject-custom-block{background:#1d2c40!important;border-color:var(--subject-border)!important}
html[data-theme="dark"] .subject-custom-block p{color:#cbd9e9!important}
html[data-theme="dark"] .toast{background:#20334b!important;color:#dce9f9!important;border-color:#45678f!important}
html[data-theme="dark"] .toast.error{background:#3b242b!important;color:#ffd2d6!important;border-color:#b77a83!important}
html[data-theme="dark"] .toast :is(p,strong){color:inherit!important}
html[data-theme="dark"] .assistant-chat-composer>div{background:#111d2c!important;border-color:#88b2e6!important}
html[data-theme="dark"] .assistant-message.user{background:#29446c!important;color:#e8f0ff!important}
html[data-theme="dark"] .assistant-message p{color:inherit!important}
html[data-theme="dark"] .design-preview-stage iframe{background:#101925!important}
html[data-theme="dark"] #designDirtyState{background:#213d31!important;color:#b9edce!important}
html[data-theme="dark"] #designDirtyState[data-dirty="true"]{background:#453320!important;color:#ffd09f!important}
html[data-theme="dark"] :is(.note-file-copy b,.note-card p,.note-files-head,.staff-portal-card strong,.staff-portal-card small){color:#ccdcf0!important}
html[data-theme="dark"] .fschool-logo{background:#fff;border-radius:8px;padding:4px}
html[data-theme="dark"] :is(.hero-stats b,.hero-copy h1,.hero-learning-card strong,.brand-copy b){color:#e3eeff!important}
html[data-theme="dark"] :is(.hero-bg,.orange-orbit){opacity:.18}
html[data-theme="dark"] .subject-panel .announcement-card:only-child::after{background:var(--subject-bg)!important;box-shadow:12px 12px 0 var(--subject-border)}
html[data-theme="dark"] :is(.calendar-day.selected,.calendar-day.today){background:#2b4363!important}
html[data-theme="dark"] .calendar-day:not(.muted){color:#e3edfa!important}
html[data-theme="dark"] :is(.status-badge,.note-kind,.kind,.eyebrow.orange,.orange){color:#ffd0a4!important}
html[data-theme="dark"] :is(.question-answer-editor,.question-author-preview,.exam-top,.exam-list-card,.analysis-card,.review-panel,.review-item,.editor-pane,.editor-settings,.editor-publish,.editor-bank,.editor-intro,.course-studio-hero,.course-studio-module){background:#172333!important;color:#d6e3f5!important;border-color:#3b4d64!important}
html[data-theme="dark"] :is(.passage,.answers label,.q-grid button,.review-explanation,.calendar-chip,.calendar-event-card){background:#213249!important;color:#dbe8fa!important;border-color:#526b8a!important}
html[data-theme="dark"] :is(.answers label.selected,.answers label:has(input:checked),.q-grid button.done){background:#2d4666!important;color:#e8f1ff!important;border-color:#9fc4f6!important}
html[data-theme="dark"] :is(.answers label.selected>span,.q-grid button.current){background:#f4b176!important;color:#21170f!important;border-color:#f4b176!important}
html[data-theme="dark"] .timer b{color:#ffb7b2!important}
html[data-theme="dark"] :is(.legend,.result-grid span,.course-module-heading strong,.question-answer-head strong,.teacher-subject-summary strong,.cms-format-toolbar button){color:#c6d9f1!important}
html[data-theme="dark"] .cms-studio-meta span{background:#25384f!important;color:#d4e4fb!important;border-color:#49617e!important}
html[data-theme="dark"] :is(#staffPortalCount,.note-count,.staff-portal-arrow,.lesson-list button,.lesson-tabs button){color:#bfd1e9!important}
html[data-theme="dark"] .staff-portal-icon{background:#293e5a!important;color:#bfd9ff!important}
html[data-theme="dark"] :is(.staff-portal-index,.editorial-section-head>span){background:#493326!important;color:#ffd2af!important}
html[data-theme="dark"] .lesson-list button.current{background:#2b4465!important;color:#f0f6ff!important}
html[data-theme="dark"] .connection-notice{background:#392e20!important;color:#ffe0b8!important;border-color:#b48a5e!important}
html[data-theme="dark"] .connection-notice :is(strong,span){color:#ffe0b8!important}
html[data-theme="dark"] .dashboard-page[data-section="portal"] .admin-workspace,
html[data-theme="dark"] .dashboard-page :is(.staff-portal,.staff-portal-tools,.staff-portal-group){background:transparent!important;border:0!important;box-shadow:none!important}
html[data-theme="dark"] .dashboard-page .staff-portal-search input{background:transparent!important;box-shadow:none!important}
/* Navigation states own both foreground and surface; light hover fills must
   never combine with dark-mode text colors. */
html[data-theme="dark"] :is(.desktop-nav>button,.nav-course-group>[data-course-menu-toggle],.mobile-nav>button,.mobile-course-group>[data-course-menu-toggle]){background:transparent!important;color:#c7dcff!important}
html[data-theme="dark"] :is(.desktop-nav>button,.nav-course-group>[data-course-menu-toggle],.mobile-nav>button,.mobile-course-group>[data-course-menu-toggle]):is(.active,:hover,:focus-visible,[aria-expanded="true"]){background:#2a405c!important;color:#f2f6ff!important}
html[data-theme="dark"] :is(.course-dropdown,.mobile-course-menu) button[data-course-all]{background:#21334b!important;color:#dceaff!important}

html[data-theme="dark"] .book-top{background:#2b4f7b!important;color:#f4f8ff!important}
html[data-theme="dark"] .hero-art .floating-card>span{background:#334860!important;color:#ffd0a3!important}
@media(max-width:620px){.nav-actions .icon-btn[data-go="courses"]{display:none}.dash-top{gap:10px}.dash-top h1{overflow-wrap:anywhere}}

/* Import review uses the same semantic surfaces as the staff workspace. */
html[data-theme=dark] .exam-import{background:transparent!important}
html[data-theme=dark] .exam-import :is(.import-upload,.import-question,.import-audit,.import-source-preview,.import-empty,.import-exam-meta,.import-commit){background:#172333!important;border-color:#3b4d64!important;color:#d7e4f5!important;box-shadow:none}
html[data-theme=dark] .exam-import .import-review{background:transparent!important;border:0!important}
html[data-theme=dark] .exam-import .import-question header span{background:#253b55!important;color:#dce9ff!important}
html[data-theme=dark] .exam-import :is(input,textarea,select){background:#101b2b!important;color:#e6edf7!important;border-color:#536b88!important}
html[data-theme=dark] .exam-import :is(summary,strong,label){color:#d7e4f5}
html[data-theme=dark] .exam-import .import-issues{background:#3b2528!important;color:#ffd9d9!important}
