/* Appearance controls only. Existing day-mode content geometry/type is unchanged. */
.ui-theme-settings{margin:14px 0;padding:14px;border:1px solid #dce4df;border-radius:14px;background:#fff;color:#102c29}
.ui-theme-settings>strong{display:block;font-size:13px}
.ui-theme-settings>small{display:block;margin-top:8px;font-size:11px;color:#62776c}
.ui-theme-options{display:flex;gap:6px;margin-top:10px}
.ui-theme-options>button{flex:1;min-height:44px;padding:9px 12px;border:1px solid #cbd9d0;border-radius:10px;background:#f4f7f2;color:#365e49;font-family:inherit;font-size:13px;font-weight:600;line-height:1.5;cursor:pointer}
.ui-theme-options>button[aria-pressed=true]{background:#173e32;color:#fff;border-color:#173e32}
.ui-theme-options>button:focus-visible,#ui-theme-dialog button:focus-visible{outline:3px solid #47856e;outline-offset:3px}
#ui-theme-dialog{width:min(400px,calc(100% - 32px));max-height:80dvh;overflow:auto;padding:20px;border:1px solid #cbd9d0;border-radius:18px;background:#fff;color:#102c29}
#ui-theme-dialog::backdrop{background:#102c2977}
#ui-theme-dialog h2{margin:0 0 14px;font-size:18px}
#ui-theme-dialog p{font-size:12px;line-height:1.7;color:#62776c}
#ui-theme-dialog .ui-theme-close{width:100%;min-height:44px;margin-top:10px;border:0;border-radius:10px;background:#173e32;color:#fff;font-family:inherit;font-size:13px;font-weight:600;line-height:1.5}

:root[data-ui-theme=dark]{color-scheme:dark;--ui-bg:#111918;--ui-surface:#1b2825;--ui-raised:#243730;--ui-text:#edf4ef;--ui-muted:#a1b5ac;--ui-line:#344a41;--ui-accent:#a6e8ce;--ink:var(--ui-text);--muted:var(--ui-muted);--line:var(--ui-line);--canvas:var(--ui-bg);--paper:var(--ui-surface);--bg:var(--ui-bg);--mint:var(--ui-raised);--accent:var(--ui-accent);--green:var(--ui-accent);--dark:var(--ui-accent);--warn:#3d3325;--danger:#ffb3a5;--discover-paper:var(--ui-bg);--discover-ink:var(--ui-text);--discover-muted:var(--ui-muted);--discover-line:var(--ui-line);--detail-line:var(--ui-line)}
:root[data-ui-theme=dark] body,:root[data-ui-theme=dark] :is(.app,.app-shell,#reply-form){background:var(--ui-bg);color:var(--ui-text)}
:root[data-ui-theme=dark] :is(.desktop-sidebar,.project-head,.thread,.search-box,.session-filter,.icon-button,.fusion-tools,.fusion-tools button,.account-card,.account-link,.companion-item,.brief-card,.idea-form,.idea-item,.review-result,.enhancement-preview,.message>div,.bottom-dock,.bottom-nav,.bottom,.atlas,.panel,.kpi,.summary-grid article,.bridge,.skill-card,.source,.related,.search,.route-cards a,.insight-reference-list a,.insight-template,dialog,.ui-theme-settings){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(.sidebar-section-head,.project-icon,.section-count,.top-tabs,.tabs,.periods,.switch,.more-link,.new-task,.message.user>div,.message-body pre,.discovery-categories button,.insight-figure,.insight-section .discovery-source,.tree summary,.routes article,.filters button,.mini-flow span,.flow span,.bridge-pair,.bridge-pair a,.connection-strip span,.asset-summary,.metrics>div,.scenario-route,.scenario-route article>div,.tag,.method-badge,.chart-toggle button.active,.track,.dual-rings>section,.viz-control,.viz-grains button,.analysis-summary,.analysis-project>div,.analysis-time,.analysis-next,.reply-attachment,#reply-quote){background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(.thread-content small,.thread-state,.sidebar-section-head,.sidebar-legend,.message header,.message-time,.eyebrow,.subcopy,.sync-state,.private,.meta,.card p,.source summary>span,.location,.bridge p,.bridge-number,.bridge-number span,.skill-card p,.file-card>small,.scenario-route article p,.atlas-bridges small,.tree a small,.route-cards a small,.related a small,.scenario-route a small,.file-cards a small,.metrics span,.source-label,.load-status,.value-scope,.value-number,.outcome-row p,.outcome-row small,.consumption-facts,.consumption-facts b,.viz-control button,.viz-grains button,.viz-legend,.model-key small,.dual-rings h3,.dual-rings p,.heat-scale,.analysis-summary b,.analysis-summary span,.analysis-summary p,.analysis-project small,.analysis-project b,.analysis-more summary,.analysis-more h3,.analysis-time small,.analysis-time b,.analysis-next p,.axis-label,.chart-value,.insight-eyebrow,.insight-deck,.insight-meta,.insight-section>p,.insight-steps small,.insight-limit,.insight-limit strong,.insight-template,.insight-reference-list span,.insight-reference-list small,.insight-section .discovery-source blockquote,.insight-section .discovery-source small,.discovery-source button,.ui-theme-settings>small,#ui-theme-dialog p,#message-action-preview,#reply-feedback,#reply-model-value,#reply-model-defaults,.reply-menu-columns h3,.reply-attachment small){color:var(--ui-muted)}
:root[data-ui-theme=dark] :is(input,textarea,select,#reply-composer-card,#reply-model-menu,#fusion-new-task){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:1}
:root[data-ui-theme=dark] :is(.top-tabs>.active,.tabs button.active,.tabs [aria-selected=true],.periods button.active,.switch [aria-pressed=true],.filters [aria-pressed=true],.bottom-dock button.active,.bottom-nav .active,.bottom>a[aria-current],.bottom-dock button,.bottom-dock>a,.bottom-nav a,.bottom>a,.discovery-categories [aria-pressed=true],.ui-theme-options>button){background:var(--ui-raised);color:var(--ui-accent);border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(.bottom-dock button,.bottom-dock>a,.bottom-nav a,.bottom>a){background:transparent;color:var(--ui-muted)}
:root[data-ui-theme=dark] :is(.bottom-dock button.active,.bottom-nav .active,.bottom>a[aria-current]){background:var(--ui-raised);color:var(--ui-accent)}
:root[data-ui-theme=dark] :is(.message-body a,.insight-back,.insight-section .discovery-source button,.back-button,.dashed,.routes h3,.tree summary,.metrics b,.reply-form #reply-model-button,.reply-form #reply-attach,#reply-quote strong,#reply-form #cancel-reply-quote,#reply-form .reply-attachment button,#reply-form #reply-menu-close,#reply-model-menu [role=option]){color:var(--ui-accent)}
:root[data-ui-theme=dark] :is(.reply-form #enhance-reply,#reply-model-menu [aria-selected=true],.insight-meta button,.insight-copy,.insight-footer button,.insight-reference-list a,.source button,.source-jump,.reference,.file-card,.coverage,.insight,.warning,.warning-panel,.try,.demo-label,.outcome-kind){background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(.reply-form #send-reply,#message-actions button,#ui-theme-dialog .ui-theme-close,.ui-theme-options>button[aria-pressed=true],.save-outcome,.primary,dialog .close,.analysis-next button){background:var(--ui-accent);color:#111918;border-color:var(--ui-accent)}
:root[data-ui-theme=dark] #message-actions #cancel-message-action{background:var(--ui-raised);color:var(--ui-text)}
:root[data-ui-theme=dark] :is(.hero,.consumption-hero,.connection-lead,.tree-root,.insight-next){background:#243f35;color:var(--ui-text)}
:root[data-ui-theme=dark] .discovery-card{--card-bg:#1b2825;--card-ink:#edf4ef;--card-muted:#a1b5ac;--card-line:#344a41;--card-accent:#a6e8ce}
:root[data-ui-theme=dark] .card,:root[data-ui-theme=dark] .card:nth-child(n){background:var(--ui-surface);border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(.atlas-bridges,.metric-row,.outcome-row,.model-key>div,.analysis-more,.reply-menu-columns>section+section){border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(.stat-viz,.ring-viz) text{fill:var(--ui-muted)}
:root[data-ui-theme=dark] :is(.stat-viz,.ring-viz) [stroke="#eef1e8"]{stroke:var(--ui-line)}
:root[data-ui-theme=dark] :is(.stat-viz,.ring-viz) [fill="#edf1ed"]{fill:var(--ui-line)}
/* Knowledge atlas keeps its category colors and dark-on-light node labels. */
:root[data-ui-theme=dark] #fusion-new-task{--new-paper:#1b2825;--new-muted:#a1b5ac;--new-selected:#243730;--new-dark:#a6e8ce}
:root[data-ui-theme=dark] #fusion-new-task :is(.fusion-new-footer,.fusion-new-menu-header,#fusion-new-model-defaults){border-color:var(--ui-line);background:var(--ui-bg)}
:root[data-ui-theme=dark] #fusion-new-task :is(#fusion-new-model-value,#fusion-new-help,#fusion-new-status){color:var(--ui-muted)}
:root[data-ui-theme=dark] #fusion-new-task :is(#fusion-new-menu-close,#fusion-new-attachments button){background:var(--ui-raised);color:var(--ui-text)}
:root[data-ui-theme=dark] #fusion-new-task #fusion-new-submit{background:var(--ui-accent);color:#111918!important}
:root[data-ui-theme=dark] #fusion-new-task #fusion-new-status.error{color:#ffb3a5}
/* Classic file/settings tools inherit the same choice on navigation. */
:root[data-ui-theme=dark] :is(.shell,.sidebar,.workspace,.side-panel,.info-card,.file-card,.thread-card,.mobile-nav,.toolbar,.composer,.thread-actions-sheet){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
:root[data-ui-theme=dark] #new-task{background:var(--ui-accent);color:#111918;border-color:var(--ui-accent)}
:root[data-ui-theme=dark] #new-task :is(strong,small,i){color:#111918}
:root[data-ui-theme=dark] #new-task>span{background:#111918;color:var(--ui-accent)}
:root[data-ui-theme=dark] .message.user>div{background:#243f35;color:var(--ui-text)}
:root[data-ui-theme=dark] .message-body blockquote{color:var(--ui-muted);border-color:var(--ui-accent)}
:root[data-ui-theme=dark] :is(.deck,.detail-section p,.steps small,.card-foot,.card-foot a,.card-foot small,.card-foot button,.concept p,.concept figcaption){color:var(--ui-muted);border-color:var(--ui-line)}
:root[data-ui-theme=dark] :is(.concept,.callout,.detail-section pre,.source blockquote){background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-line)}
:root[data-ui-theme=dark] #reply-form #send-reply{background:var(--ui-accent);color:#111918}
:root[data-ui-theme=dark] #reply-form #enhance-reply{background:var(--ui-raised);color:var(--ui-accent)}
