.theme-toggle{display:grid;place-items:center;flex:none;width:42px;height:42px;padding:9px;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--ink)}
.theme-toggle[hidden]{display:none!important}.theme-toggle:hover{background:var(--line)}.theme-toggle svg{width:21px;height:21px;grid-area:1/1}
.theme-toggle .theme-sun,html[data-theme=dark] .theme-toggle .theme-moon{display:none}html[data-theme=dark] .theme-toggle .theme-sun{display:block}
:root[data-theme=dark]{--paper:#111c1b;--white:#1b2926;--ink:#e4efeb;--muted:#afc2b9;--teal:#7bdac5;--teal-dark:#a0e8d8;--orange:#f09b64;--line:#3c5149;--surface:#1b2926;--surface-soft:#243830;--field:#15231f;--action:#0b7867;--action-hover:#0d8070;--error:#ffb9a7}
:root[data-theme=dark] body{background:var(--paper);color:var(--ink);accent-color:var(--teal)}
:root[data-theme=dark] body :where(.steps article,.project-card,.filter-bar,.list-row,.info-card,.form-card,.account-rail,.cookie-inventory article,.tool-availability,.ai-panel,.ai-nav,.ai-composer,.ai-notification-bell,.ai-shell dialog,.ai-history-link[aria-current=page],.studio-node,.studio-inspector,.formula-editor,.homework-task-card,.inline-rich-editor,.variable-menu[open]){background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] body :where(.button,.ai-nav>a[aria-current=page],.pill.selected,.studio-port){background:var(--action);border-color:var(--action);color:#fff}
:root[data-theme=dark] body :where(.button:hover,.ai-nav>a[aria-current=page]:hover,.studio-port:hover){background:var(--action-hover);color:#fff}
:root[data-theme=dark] body :where(.button-light,.button-white,.studio-toolbar button,.import-label,.photo-controls button){background:var(--surface);border-color:var(--line);color:var(--ink)}
:root[data-theme=dark] body :where(.button-light:hover,.button-white:hover,.studio-toolbar button:hover,.photo-controls button:hover){background:var(--surface-soft);color:var(--teal)}
:root[data-theme=dark] .button.button-danger{background:#a9322b;border-color:#a9322b;color:#fff}
:root[data-theme=dark] .button.button-danger:hover{background:#ba3c33}
:root[data-theme=dark] body :where(input,select,textarea,math-field){background:var(--field);color:var(--ink);border-color:var(--line);caret-color:var(--teal)}
:root[data-theme=dark] body :where(input,textarea)::placeholder{color:#9bb0a5;opacity:1}
:root[data-theme=dark] input[type=checkbox],:root[data-theme=dark] input[type=radio]{accent-color:var(--action)}
:root[data-theme=dark] body :where(.principles,.empty-state,.account-balance,.cookie-notice,.ai-history,.ai-empty-symbol,.chat-avatar,.account-initial,.avatar-placeholder,.registration-role:has(input:checked),.rich-preview,.draft-bar,.review-condition,.task-total,.parameter-panel,.inline-formula,.template-formula,.homework-journal thead th,.journal-graded,.studio-node header){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] .ai-context{background:linear-gradient(110deg,#20382e,var(--surface));border-color:var(--line)}
:root[data-theme=dark] body :where(.ai-context-symbol,.ai-empty-symbol,.chat-avatar){background:var(--surface-soft);color:var(--teal);border-color:var(--line);box-shadow:none}
:root[data-theme=dark] body :where(.account-links a:hover,.account-links [aria-current=page],.language-switch button[aria-current=true],.ai-history-link:hover,.chat-action:hover,.ai-notification-bell:hover){background:var(--surface-soft);color:var(--teal);border-color:var(--line)}
:root[data-theme=dark] .ai-chat-workspace .chat-user .ai-prompt,:root[data-theme=dark] .ai-chat-workspace .ai-prompt{background:#29473b;color:var(--ink)}
:root[data-theme=dark] body :where(.ai-shell th,.ai-shell td,.ai-nav-secondary,.ai-history-link,.ai-student-table tbody tr,.appeal-message,.homework-journal th,.homework-journal td,.journal-scroll,.homework-page [data-marking-solution]){border-color:var(--line)}
:root[data-theme=dark] body :where(.ai-empty,.ai-generation-top span,.ai-shell [role=status]:not(:empty),.editor-hint,.journal-missing,.art-label,.art-index){color:var(--muted)}
:root[data-theme=dark] body :where(.notice,.notice.success){background:#203c2d;border-color:#4a7158;color:var(--ink)}
:root[data-theme=dark] body :where(.notice.error,.language-status:not(:empty),.mark-item,.mark-toolbar,.journal-waiting,.journal-appeal,.editing-formula){background:#3b2c24;border-color:#85604a;color:#ffcfaa}
:root[data-theme=dark] body :where(.errorlist,.homework-page .errorlist,.author-save-status[data-error=true]){color:var(--error)}
:root[data-theme=dark] body :where(code,.ai-rich-answer pre,.photo-viewport){background:var(--field);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] body :where(.hljs,.hljs-subst){background:var(--field);color:var(--ink)}
:root[data-theme=dark] body :where(.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-section,.hljs-link){color:#c3a7ff}
:root[data-theme=dark] body :where(.hljs-string,.hljs-regexp,.hljs-symbol,.hljs-bullet,.hljs-addition){color:#a5d89b}
:root[data-theme=dark] body :where(.hljs-title,.hljs-built_in,.hljs-type,.hljs-attr,.hljs-number){color:#87d8ee}
:root[data-theme=dark] body :where(.hljs-comment,.hljs-quote,.hljs-meta){color:#a6b6a8}
:root[data-theme=dark] .ai-rich-answer blockquote{border-color:#6e9d84}
:root[data-theme=dark] .hero-art{background:#25352c}
:root[data-theme=dark] .art-grid{background-image:linear-gradient(#415347 1px,transparent 1px),linear-gradient(90deg,#415347 1px,transparent 1px)}
:root[data-theme=dark] .art-label-bottom{background:var(--surface);border-color:var(--line)}
:root[data-theme=dark] .project-art{background:linear-gradient(135deg,#284b3e,#4b3c29)}
:root[data-theme=dark] .project-monogram{color:#8fcdb7}
:root[data-theme=dark] .viewer{background:var(--surface-soft)}
:root[data-theme=dark] .studio-viewport{background-color:var(--field);background-image:radial-gradient(#385448 1px,transparent 1px);border-color:var(--line)}
:root[data-theme=dark] .variable-token{background:#2d5043;color:#adedd7}
:root[data-theme=dark] .skip-link{background:var(--surface);color:var(--ink)}
:root[data-theme=dark] .notification-item.is-read{background:transparent;border-color:var(--line)}
:root[data-theme=dark] body :where(.account-count,.ai-notification-count){background:#087b6d;color:#fff}
:root[data-theme=dark] .pilot-callout{background:#185947;color:#fff}
:root[data-theme=dark] body :where(.tool-availability,.ai-shell dialog)::backdrop{background:#050c09b3}
:root[data-theme=dark] ::selection{background:#386f59;color:#fff}
:root[data-theme=dark] math-field{--caret-color:#7bdac5;--selection-background-color:#386f59;--contains-highlight-background-color:#29473b;--smart-fence-color:#afc2b9}
@media(max-width:650px){.theme-toggle{width:38px;height:38px;padding:8px;border-radius:10px}.site-header .header-inner{column-gap:.55rem}}

:root[data-theme=dark] .pill:not(.selected){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
:root[data-theme=dark] .ai-student-table td[data-label]::before{color:var(--muted)}
.theme-preference-info{margin-top:24px}
