/* Readable night palette; light appearance stays in style.css. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-shrink:0;min-width:44px;min-height:44px}.theme-toggle svg{width:20px;height:20px}.theme-login{position:absolute;top:20px;right:24px;z-index:2}.login-form-wrap{position:relative}.login-form-wrap form{margin-top:40px}
@media(max-width:760px){.topbar .theme-toggle{padding:8px}.topbar .theme-toggle span{display:none}.session-heading .theme-toggle{padding:8px}.topbar>.row{gap:6px}}
:root[data-theme=dark]{color-scheme:dark;--paper:#141d19;--surface:#1c2822;--ink:#e8eee9;--muted:#b4c4bb;--green:#9bd6bb;--green-hover:#b6e6cf;--soft:#2b3e33;--line:#41564a;--ochre:#efd19a}
[data-theme=dark] button{background:var(--surface);color:var(--ink);border-color:#71897a}
[data-theme=dark] button:hover{background:var(--soft)}
[data-theme=dark] button.quiet{background:transparent;border-color:transparent}
[data-theme=dark] button.quiet:hover{background:var(--soft)}
[data-theme=dark] :is(button.primary,.primary,.library-filters button.active,.new-messages){background:var(--green);color:#14271d;border-color:var(--green)}
[data-theme=dark] button.primary:hover{background:var(--green-hover)}
[data-theme=dark] button.danger{color:#ffb7ac}
[data-theme=dark] :is(input,textarea,select){background:#142019;color:var(--ink);border-color:#71897a;caret-color:#b6e6cf}
[data-theme=dark] :is(input,textarea)::placeholder{color:#a6b8ac;opacity:1}
[data-theme=dark] :is(input,textarea,select):focus{border-color:#b6e6cf;box-shadow:none}
[data-theme=dark] :focus-visible{outline-color:#f0cf85}
[data-theme=dark] ::selection{background:#a8d9bd;color:#12261a}
[data-theme=dark] *{scrollbar-color:#71897a transparent}
[data-theme=dark] :is(.sidebar,.topbar,.bottom-nav,.login-story){background:#19271f}
[data-theme=dark] :is(.sidebar nav button.active,.bottom-nav button.active,.record-sections .active,.deep-review button[aria-pressed=true]){background:#324f40;color:#d9f4e5}
[data-theme=dark] :is(.tabs,.mode-select,.level-panel,.avatar){background:var(--soft)}
[data-theme=dark] .tabs button.active{background:#3a5546;color:#f2f7f3;box-shadow:none}
[data-theme=dark] .continue{background:#244e3c;color:#f2f7f3}
[data-theme=dark] .continue p{color:#d6e9dc}
[data-theme=dark] .continue button{background:#d3ecdd;color:#173a28}
[data-theme=dark] .continue button:hover{background:#e6f5eb}
[data-theme=dark] .continue :is(.pill,.avatar){background:#395f4b;color:#f2f7f3}
[data-theme=dark] .notice{background:#283e30;color:#dbeade}
[data-theme=dark] :is(.notice.error,.offline){background:#4b2c28;color:#ffd0c6}
[data-theme=dark] .pill.warn{background:#483b24;color:#f5d9a4}
[data-theme=dark] :is(.table-list,.chat-panel,.composer,.in-session .composer,.quick-actions button,.notes-panel .row,.doc,.skip,.tour-panel){background:var(--surface)}
[data-theme=dark] .bubble{background:#2a3930;color:#edf3ee}
[data-theme=dark] .user .bubble{background:#31513f;color:#f0f7f1}
[data-theme=dark] .message.mentor .bubble{background:#3b382b;color:#f3eddb}
[data-theme=dark] .composer textarea{background:#142019}
[data-theme=dark] :is(.source .task,.source-practice,.quick-notes,.record-comparison .record-text){background:#223329}
[data-theme=dark] .maria-access{background:#38362a;color:#eee9d9}
[data-theme=dark] :is(.login-story p,.library-source .source-kind,.deep-review span,.record-transcript time){color:var(--muted)}
[data-theme=dark] #error{color:#ffb7ac}
[data-theme=dark] .progress-track{background:#34493b}
[data-theme=dark] progress::-webkit-progress-bar{background:#34493b}
[data-theme=dark] #toast{background:#d9eadf;color:#15291e;box-shadow:0 8px 30px #0005}
[data-theme=dark] .tour-panel{border-color:#71897a;box-shadow:0 12px 40px #0006}
[data-theme=dark] .thinking span{background:var(--green)}
[data-theme=dark] .tour-target{outline-color:#f0cf85}
@media(max-width:380px){.topbar{height:auto;min-height:76px;flex-wrap:wrap;padding-top:10px;padding-bottom:10px;gap:8px}.topbar>.row{width:100%;justify-content:space-between}.topbar .mode-select{max-width:120px}.topbar .mobile-brand{font-size:22px}}
[data-theme=dark] button:disabled{opacity:1;background:#2a3930;color:#b4c4bb;border-color:#41564a;cursor:not-allowed}
@media print{[data-theme=dark]{color-scheme:light}[data-theme=dark] body{background:#fff!important}[data-theme=dark] *{color:#18231c!important;background-color:transparent!important;border-color:#69776c!important;box-shadow:none!important;text-shadow:none!important}.theme-toggle{display:none!important}}

.login-form-wrap .theme-login{width:auto;justify-content:center}
