/* Additional theme only: the established light palette remains the default. */
.appearance-panel{max-width:620px}.appearance-panel select{width:100%;margin:10px 0 16px}.appearance-panel p:last-child:empty{display:none}
html[data-theme="dark"]{
 color-scheme:dark;color:#ebe9f0;background:#15171e;
 --canvas:#15171e;--surface:#1d2029;--raised:#272b36;--foreground:#ebe9f0;
 --accent:#ff9c79;--soft:#3a2924;--muted:#b9b3c5;--border:#434753;
 --green:#263c30;--blue:#27364c;--action:#bd421f;--warning:#f1d084;--danger:#ffb0a2;
 scrollbar-color:#626575 var(--canvas);
}
html[data-theme="dark"] body{background:var(--canvas);color:var(--foreground)}
html[data-theme="dark"] :is(.sidebar,.topbar,.card,.panel,.stat,.graph-wrap,.link-row,.empty,.calendar-day,.auth-panel,.workspace-service,.workspace-zone,.login,.quick-count,dialog),html[data-theme="dark"] .completed-cabinet>summary,html[data-theme="dark"] #message-form{background:var(--surface);border-color:var(--border);color:var(--foreground)}
html[data-theme="dark"] :is(input,textarea,select,.secondary,.zone-button,.sidebar-search,.check-cabinet,.project-composer-name,.source-text){background:var(--raised);border-color:var(--border);color:var(--foreground)}
html[data-theme="dark"] :is(input,textarea,select,.secondary,.zone-button){border-color:#777c8d}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:var(--muted);opacity:1}
html[data-theme="dark"] input:focus,html[data-theme="dark"] textarea:focus,html[data-theme="dark"] select:focus{outline-color:#ff9c7959;border-color:var(--accent)}
html[data-theme="dark"] :is(button,a,input,select,textarea):focus-visible{outline:2px solid var(--accent);outline-offset:3px}
html[data-theme="dark"] :is(.secondary,.icon-button,.nav button,.nav-settings>summary):hover{background:var(--raised);color:var(--foreground)}
html[data-theme="dark"] :is(.nav button.active,.nav-settings.active>summary,.workspace-service .room-tabs button.active,.quick-count.active){background:var(--soft);color:var(--accent);border-color:#97563e}
html[data-theme="dark"] .primary{background:var(--action);color:#fff;box-shadow:none}
html[data-theme="dark"] .primary:hover{background:#a93718}
html[data-theme="dark"] :is(.nav button,.nav-settings>summary,.nav-label,.brand small,.hint,.muted,.eyebrow,.card-description,.tag,.card-footer,.legend,.time-label,.device-facts,.details-meta,.coverage,.health-chip,.date-divider,.chat-source,.metric-note,.login-story>p,.login-footer,.detail-section h3,.column>h3,.stat .label,.stat-icon,.search>.icon,.icon-button,.zone-label,.cab-counts,.calendar-day>span,.memory-status,.workspace-zone-title,.workspace-description summary,.workspace-manage summary,.workspace-storage summary,.assistant-context summary,.composer-extra summary,.message .message-delivery,[data-computer-connection]){color:var(--muted)}
html[data-theme="dark"] :is(.topbar strong,.empty h2,.cab-summary b,.cab-counts b,.device-facts b,.zone-button .zone-label,.check-title,th){color:var(--foreground)}
html[data-theme="dark"] :is(.nav button.active,.nav-settings.active>summary,.workspace-service .room-tabs button.active,.quick-count.active){color:var(--accent)}
html[data-theme="dark"] :is(.tag,.card-footer,.sidebar-bottom,.topbar,.tabs,.completed-subnav,.modal-head,.detail-section,fieldset,th,td,.timeline-row,.membership-toolbar,.design-file,.design-event,.design-job,.ai-opinion,.user-access-row){border-color:var(--border)}
html[data-theme="dark"] :is(.avatar,.project-icon,.column,.task-column,.track,.memory-status,.rich-message code,.code-block,.rich-table th,.chat-search-toolbar,.conversation-queue,.calendar-day>span,.sidebar-search){background:var(--raised);border-color:var(--border);color:var(--muted)}
html[data-theme="dark"] .card[data-category="Инфраструктура"] .project-icon{background:#26364b;color:#a8cbff}
html[data-theme="dark"] .card[data-category="Работа"] .project-icon{background:var(--soft);color:var(--accent)}
html[data-theme="dark"] .card[data-category="Личное"] .project-icon{background:#2c3929;color:#c8dfab}
html[data-theme="dark"] .cabinet-card{background:color-mix(in srgb,var(--zone) 13%,var(--surface));border-top-color:var(--zone)}
html[data-theme="dark"] :is(.zone-button:hover,.zone-button:focus-visible,.zone-choice:has(input:checked)){background:color-mix(in srgb,var(--zone) 18%,var(--surface));border-color:var(--zone)}
html[data-theme="dark"] :is(.zone-label,.cab-counts) i{background:var(--zone)}
html[data-theme="dark"] :is(.note,#message-form .composer-mode-help,.composer-editing,#session-connection-notice:not([hidden])){background:#3a3122;border-color:#8e7748;color:var(--warning)}
html[data-theme="dark"] :is(.message,.ai-history>.message){background:#29231f;border-color:#645044;color:var(--foreground)}
html[data-theme="dark"] :is(.assistant-message,.ai-history>.assistant-message,.work-result,.file-receipt){background:#1f2d27;border-color:#466453;color:var(--foreground)}
html[data-theme="dark"] :is(.assistant-message>b,.assistant-message .row>b){color:#b7d8c3}
html[data-theme="dark"] :is(.error,.composer-stop button){color:var(--danger)}
html[data-theme="dark"] .composer-stop button{border-color:#a76d62}
html[data-theme="dark"] :is(.badge,.memory-status){background:var(--raised);color:var(--muted)}
html[data-theme="dark"] :is(.badge.live,.badge.done,.badge.verified,.memory-status.status-working){background:#284331;color:#c6e8ba}
html[data-theme="dark"] :is(.badge.testing,.badge.port_open,.memory-status.status-testing,.memory-status.status-planned){background:#463923;color:#f5d898}
html[data-theme="dark"] .badge.development{background:#293e5b;color:#b9d9ff}
html[data-theme="dark"] .badge.idea{background:#493025;color:#ffc6aa}
html[data-theme="dark"] :is(.badge.paused,.badge.unavailable,.badge.closed,.memory-status.status-retired,.memory-status.status-rejected){background:var(--raised);color:var(--muted)}
html[data-theme="dark"] .memory-status.status-failed{background:#482c2b;color:var(--danger)}
html[data-theme="dark"] :is(.calendar-day.selected,.check-list .check-cabinet.current){background:var(--soft);border-color:var(--accent);color:var(--accent)}
html[data-theme="dark"] .pending-image img{background:var(--raised)}
html[data-theme="dark"] .login-story{background:var(--canvas);border-color:var(--border)}
html[data-theme="dark"] #session-shield:not([hidden]){background:var(--canvas);color:var(--foreground)}
html[data-theme="dark"] #toast{background:#ebe9f0;color:#20232c}
html[data-theme="dark"] dialog::backdrop{background:#0009}
html[data-theme="dark"] .relation{color:var(--accent)}
html[data-theme="dark"] :is(.bar,.bar.live,.bar.testing){background:#94715f}
html[data-theme="dark"] .bar.live{background:#729764}
html[data-theme="dark"] .bar.testing{background:#b49b5a}
html[data-theme="dark"] .workspace-splitter>span{background:#74798b}
html[data-theme="dark"] .graph rect{fill:var(--raised);stroke:var(--border)}
html[data-theme="dark"] .graph text{fill:var(--foreground)}
html[data-theme="dark"] .graph line{stroke:#a58673}
html[data-theme="dark"] ::selection{background:#754833;color:#fff}
html[data-theme="dark"] .chat-search-hit{background:#816424;color:#fff}
html[data-theme="dark"] .chat-search-current{background:#96552e;color:#fff;outline-color:var(--accent)}
