/* Final dark palette. Loaded after base and administration styles. */
html[data-theme=dark]{color-scheme:dark;--surface:#1c2822;--surface-raised:#24372d;--field:#142019;--muted:#b4c5ba;--text:#e2ece5;--brand:#98d9bd;--light:#2b4437;--border:#40564a;--bg:#121b18}
html[data-theme=dark] :is(.sidebar,.card,dialog,.account-options,.notes-toolbar,.question-stats article){background:var(--surface);color:var(--text);border-color:var(--border)}
html[data-theme=dark] .sidebar nav button,html[data-theme=dark] .sidebar #admin-sidebar-navigation button{color:var(--text);background:transparent}
html[data-theme=dark] .sidebar nav button:hover,html[data-theme=dark] .sidebar #admin-sidebar-navigation button:hover{background:var(--surface-raised);color:#f0fff6}
html[data-theme=dark] .sidebar nav button[aria-current],html[data-theme=dark] .sidebar #admin-sidebar-navigation button[aria-current]{background:var(--light);color:#d1f5de}
html[data-theme=dark] .sidebar #admin-sidebar-navigation .manager-menu>button{background:#22372b;color:var(--text)}
html[data-theme=dark] .sidebar #admin-sidebar-navigation .manager-menu>button[aria-current]{background:#355441;color:#e1ffe9}
html[data-theme=dark] .manager-menu>summary{background:var(--surface-raised);color:var(--text)}
html[data-theme=dark] .sidebar svg{color:inherit}
html[data-theme=dark] :is(.text-button,.next-lesson,.plan-row,.account-trigger,.account-options button){color:var(--text)}
html[data-theme=dark] button.secondary{background:var(--light);color:#d1f5de}
html[data-theme=dark] :is(.chip,.avatar,.student>b,.lesson-tag-chip){background:var(--light);color:#d1f5de;border-color:var(--border)}
html[data-theme=dark] :is(.class-tabs,.support-tabs,.lesson-page-tabs,.lesson-editor-tabs) button{background:transparent;color:var(--muted)}
html[data-theme=dark] :is(.class-tabs,.support-tabs,.lesson-page-tabs,.lesson-editor-tabs) button:is(.active,[aria-selected=true]){background:var(--light);color:#e0ffeb;border-bottom-color:var(--brand)}
html[data-theme=dark] :is(.comment-tabs button,.comment-tabs button.active){color:#d1f5de}
html[data-theme=dark] :is(.lesson-row,.material-tile,.theme-toggle){color:var(--text)}
html[data-theme=dark] .lesson-rating .rating-button{color:var(--muted);background:transparent}
html[data-theme=dark] .lesson-rating .rating-button.selected{background:var(--light);color:var(--accent)}
html[data-theme=dark] :is(.muted,.page-title p,.foot,.question-stats span,.question-notebook small,.support-reply small,.member-enrollments small,.member-identity small,.class-student small,.class-check small,.access-table small,#access-count,.student-lesson-tags>span,.note-save-status,.auto-duration small,.duration-extraction small,.material-attachment-row small){color:var(--muted)}
html[data-theme=dark] :is(.notice,.result,.tip,.support-reply,.member-detail-header,.material-attachment-row){background:#293d2f;color:#deeddf;border-color:var(--border)}
html[data-theme=dark] :is(.class-error,.admin-form-error,.question-error,#auto-error,#member-detail-error){color:#ffb7ac}
html[data-theme=dark] :is(.admin-area #app,.admin-dialog,.lesson-student-preview) label{color:var(--text)}
html[data-theme=dark] :is(.admin-area #app,.admin-dialog,.lesson-student-preview) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){background:var(--field);color:var(--text);border-color:#789483}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#adbdaf;opacity:1}
html[data-theme=dark] .admin-area #app .lesson-page label>:is(input:not([type=checkbox]),select,textarea){background:var(--field);color:var(--text);border-color:#789483}
html[data-theme=dark] :is(.admin-area #app .lesson-page textarea[name=contentHtml],.admin-area #app .lesson-page #video-embed-label textarea,.admin-area .automation-form textarea[name=html]){background:#101a15;color:#d5efdd;border-color:#617c69}
html[data-theme=dark] .admin-area :is(.lesson-page-header,.lesson-page-top>div,.lesson-page-top>aside,.lesson-page>section[role=tabpanel],.lesson-more){background:var(--surface);color:var(--text);border-color:var(--border)}
html[data-theme=dark] .admin-area #app .lesson-page .lesson-check{background:var(--light);color:var(--text)}
html[data-theme=dark] .admin-area #app .lesson-page-tabs button{color:var(--muted);background:transparent}
html[data-theme=dark] .admin-area #app .lesson-page-tabs button[aria-selected=true]{background:var(--light);color:#e0ffeb;border-bottom-color:var(--brand)}
html[data-theme=dark] .admin-area .duration-extraction{background:#16271e;border-color:var(--border)}
html[data-theme=dark] :is(.lesson-cover-preview,.admin-area .lesson-cover-preview){background:var(--light);color:var(--text);border-color:#789483}
html[data-theme=dark] .admin-area #app .lesson-page input[type=file]::file-selector-button{background:#35513f;color:#e0ffeb}
html[data-theme=dark] :is(.admin-area #app .lesson-tag-chip button,.lesson-tag-chip button){background:transparent;color:#e0ffeb}
html[data-theme=dark] :is(.student-lesson-tags>button,#lesson-material-links>.material-download){background:var(--light);color:#d1f5de;border-color:var(--border)}
html[data-theme=dark] .module-detail .lesson-row{background:transparent;color:var(--text);border-color:var(--border)}
html[data-theme=dark] .module-detail .lesson-row:hover{background:var(--light)}
html[data-theme=dark] .module-detail .lesson-row .lesson-status{background:var(--light);color:#d1f5de}
html[data-theme=dark] .bank-question .option{background:#17251d;color:var(--text);border-color:var(--border)}
html[data-theme=dark] .bank-question .question-right,html[data-theme=dark] .question-feedback{background:#294633;color:#d8efdf;border-color:#5f8a69}
html[data-theme=dark] .question-feedback.incorrect{background:#433526;color:#f5e6cf;border-color:#99815e}
html[data-theme=dark] .support-waiting{background:#443b25;color:#ead7a0}
html[data-theme=dark] .support-answered{background:#294633;color:#c4ebcd}
html[data-theme=dark] .broadcast-action{background:var(--brand);color:#102d28}
html[data-theme=dark] dialog::backdrop{background:#040b07bb}
html[data-theme=dark] :is(button,a,input,select,textarea,summary):focus-visible{outline-color:#dff05b}
html[data-theme=dark] :is(.notes-empty p,.note-entry label,.material-attachment-row small,.broadcast-modal small){color:var(--muted)}
html[data-theme=dark] .course-cover.sage small{color:#233f2b}
html[data-theme=dark] .course-cover.sand small{color:#57482d}
html[data-theme=dark] .question-entry{background:linear-gradient(120deg,#1c2822,#253b2e);border-color:#4c6a55}html[data-theme=dark] .question-entry-icon{background:var(--light);color:var(--brand)}html[data-theme=dark] .question-time-options button{background:var(--light);color:var(--text)}html[data-theme=dark] .question-time-options button[aria-pressed=true]{background:var(--brand);color:#102d28}html[data-theme=dark] .question-entry-controls>button:disabled{background:#35433a;color:#c3cec6}
html[data-theme=dark] .question-home-link{background:var(--surface);color:var(--text)}html[data-theme=dark] .question-home-link strong{color:var(--brand)}html[data-theme=dark] .question-home-link:hover{background:var(--light)}html[data-theme=dark] .performance-empty{color:var(--muted)}

html[data-theme=dark] .sidebar #admin-sidebar-navigation #questions-admin-menu:has([aria-current])>summary{background:var(--light);color:#d1f5de}
