:root { color-scheme: light; --surface: #fff; --surface-raised: #fff; --surface-soft: #f4f7f2; --theme-border: #dbe4d7; --theme-muted: #67746b; --theme-active: #eaf1e7; --theme-focus: #2563c5; }
:root[data-theme="dark"] { color-scheme: dark; --ink: #e4eae7; --text: #e4eae7; --muted: #a4b1aa; --line: #34423b; --green: #8ed3b7; --green-light: #273d33; --paper: #141c18; --white: #1d2822; --accent: #728d60; --surface: #1d2822; --surface-raised: #25322b; --surface-soft: #202e26; --theme-border: #405148; --theme-muted: #afbbb4; --theme-active: #30493c; --theme-focus: #8bb9ff; }
#breadcrumbs { display: none; }
.appearance-switch { display: flex; align-items: center; flex-shrink: 0; }
.appearance-trigger { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--theme-border); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; }
.appearance-trigger svg { width: 20px; height: 20px; }
.appearance-trigger:hover { background: var(--surface-soft); }
.appearance-trigger:focus-visible, #appearance-menu button:focus-visible { outline: 2px solid var(--theme-focus); outline-offset: 2px; }
#appearance-menu { position: fixed; inset: auto; margin: 0; width: 190px; padding: 6px; border: 1px solid var(--theme-border); border-radius: 12px; color: var(--ink); background: var(--surface-raised); box-shadow: 0 10px 32px #0003; }
#appearance-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 7px; background: transparent; color: inherit; font-size: 14px; text-align: left; cursor: pointer; }
#appearance-menu button svg { width: 21px; height: 21px; flex-shrink: 0; }
#appearance-menu button:hover { background: var(--surface-soft); }
#appearance-menu button[aria-checked="true"] { background: var(--theme-active); color: var(--green); font-weight: 600; }
.login-appearance { position: fixed; top: 17px; right: 28px; z-index: 15; }
.login-languages { right: 78px; height: 38px; box-sizing: border-box; align-items: center; }
@media(max-width:760px) { .login-appearance { right: 12px; } .login-languages { right: 60px; } }

/* Dark surfaces and controls; source documents and profile photos retain their colors. */
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] :is(.sidebar,.topbar,.directory,.brief-document,.info-card,.gantt-card,.login-card,.settings-card,.selection-progress,.allocation-summary section,.allocation-phases section,dialog,#workspace-menu,#decision-menu) { background: var(--surface); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .login-logo { filter: invert(1) grayscale(1); }
html[data-theme="dark"] :is(.brand,.breadcrumbs strong,.selection-label strong,.selection-numbers>strong,.selection-numbers b,.info-card dd,.info-card h3,.document-body h3,.workspace-option,.allocation-notes summary) { color: var(--ink); }
html[data-theme="dark"] :is(.brand-sub,.nav-label,.nav-item,.sidebar-version,.text-button,.workspace-switch small,.eyebrow,.subtitle,.tab,.directory-note,.creator-handle,.platform,.brief-mini,.updated,.table-footer,.page-footer,.empty p,.detail-identity,.document-label,.document-meta,.document-body,.info-card dt,.document-end,label,label small,.dialog-footer>span,.help-body li,.help-body p,.theme-source>span,.theme-source p,.download-note,.gantt-legend>span,.gantt-corner,.gantt-day strong,.gantt-day span,.gantt-task-label a,.schedule-notes,.followers-col small,.not-set,.decision-chevron,.metrics-note,.decision-summary-label,.brief-library-name>span,.brief-kind,.selection-label,.selection-numbers small,.selection-numbers>span,.selection-progress p,.pdf-heading span,.language-label,.workspace-menu-label,.allocation-period,.allocation-summary span,.allocation-summary p,.allocation-table th small,.allocation-phases p,.allocation-source,.powerpoint-info small,.batch-description,.powerpoint-preview p,.login-card p,.login-card small,.member-row small,.account-mode,.fx-notice) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.workspace-switch,.secondary,.profile-link,.profile-button,.decision-trigger,.decision-summary button,.language-switch,#mode-switch) { background: var(--surface); color: var(--ink); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.workspace-switch:hover,.secondary:hover,.nav-item:hover,.icon-button:hover,.workspace-option:hover,.brief-library-row:hover,.delivery-date:hover,tbody tr:hover) { background: var(--surface-soft); }
html[data-theme="dark"] :is(.nav-item.active,.workspace-option.selected,.decision-summary button[aria-pressed="true"],.allocation-summary section:first-child) { background: var(--theme-active); color: #a9e1c7; }
html[data-theme="dark"] :is(.workspace-icon,.nav-count,.title-count,.tab-count,.tab[aria-selected="true"] .tab-count,.campaign-file-icon) { background: #314437; color: #c1d3b8; border-color: var(--theme-border); }
html[data-theme="dark"] :is(.tab[aria-selected="true"],.sort-heading:hover) { color: #b4e4cc; }
html[data-theme="dark"] .tab[aria-selected="true"]:after { background: #8ed3b7; }
html[data-theme="dark"] :is(.search-box input,.filters select,.sort-select,label input,label select,label textarea,.login-card input,#issued-password,.delete-password-label input) { background: #15221b; color: var(--ink); border-color: var(--theme-border); }
html[data-theme="dark"] :is(input,textarea)::placeholder { color: #8e9e94; }
html[data-theme="dark"] :is(thead,thead th,thead .decision-col,.metrics-note,.dialog-footer,.document-end,.theme-source,.gantt-header,.gantt-corner,.allocation-table .allocation-group>*) { background: var(--surface-soft); color: var(--theme-muted); }
html[data-theme="dark"] :is(td,th,.member-row,.brief-library-row,.gantt-track,.gantt-task-label,.gantt-day,.gantt-corner,.track-cell,.pdf-section iframe,.powerpoint-preview iframe) { border-color: var(--line); }
html[data-theme="dark"] :is(.decision-col,.gantt-task-label,#decision-menu button) { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] :is(#decision-menu button:hover,#decision-menu button:focus-visible,#decision-menu button[aria-checked="true"],.gantt-row:hover .gantt-task-label) { background: var(--theme-active); }
html[data-theme="dark"] :is(.tag,.aside-note,.notice,.allocation-table tfoot>*) { background: #29382c; color: #bbcdb0; border-color: var(--theme-border); }
html[data-theme="dark"] :is(.followers-col,.fee-col,.metric,.gantt-task-label button) { color: #d8e5dc; }
html[data-theme="dark"] .metric.unit-cost { background: #22382e; color: #ace0c5; }
html[data-theme="dark"] :is(.creator-name,.brief-cell a,.profile-link,.profile-button,.back-link,.brief-library-name strong,.library-open,.delivery-date,.pdf-open-link,.target-edit,#rename-workspace,.translation-pending a) { color: #8bb9ff; }
html[data-theme="dark"] :is(.creator-link:hover .creator-name,.brief-cell a:hover,.profile-link:hover,.profile-button:hover,.back-link:hover) { color: #bad5ff; }
html[data-theme="dark"] :is(.profile-link:hover,.profile-button:hover,.batch-badge) { background: #263c58; color: #a6c9ff; }
html[data-theme="dark"] .view-toggle { background: #23354e; border-color: #3d5f89; }
html[data-theme="dark"] .view-toggle button { color: #afcfff; }
html[data-theme="dark"] .view-toggle button:hover { background: #304a70; }
html[data-theme="dark"] .view-toggle button[aria-pressed="true"] { background: #326cc3; color: #fff; }
html[data-theme="dark"] :is(.primary,.language-switch button[aria-pressed="true"],.allocation-mode [aria-pressed="true"]) { background: #35674f; color: #fff; }
html[data-theme="dark"] .primary:hover { background: #407e60; }
html[data-theme="dark"] .language-switch button { color: #b2c3b7; }
html[data-theme="dark"] :is(.icon-button,.rename-list) { color: #adbea8; }
html[data-theme="dark"] :is(.status,.translation-pending) { background: #443b23; color: #ead18f; border-color: #625337; }
html[data-theme="dark"] .status.progress { background: #33432b; color: #c3da9f; }
html[data-theme="dark"] .status.done { background: #2f3e34; color: #b6cdbd; }
html[data-theme="dark"] .decision-symbol.yes { color: #6bcf9f; }
html[data-theme="dark"] .decision-symbol.no { color: #ff9090; }
html[data-theme="dark"] .decision-symbol.pending { color: #edbd64; }
html[data-theme="dark"] :is(.decision-symbol.unset,.sort-heading span,.delivery-date svg) { color: #8fa296; }
html[data-theme="dark"] .selection-meter { background: #35443a; }
html[data-theme="dark"] .selection-meter>span { background: #72ba94; }
html[data-theme="dark"] :is(.gantt-day.weekend,.track-cell.weekend) { background: #202820; }
html[data-theme="dark"] .gantt-day.today { background: #324835; }
html[data-theme="dark"] .gantt-bar { border-color: #33443b; }
html[data-theme="dark"] .planned { background: #35485e; color: #d3e1f3; }
html[data-theme="dark"] .in-progress { background: #3e5734; color: #e1efd1; }
html[data-theme="dark"] .complete { background: #3b4538; color: #c2ceba; }
html[data-theme="dark"] .powerpoint-section { background: #2c2723; }
html[data-theme="dark"] :is(.delete-list-button,#delete-list,.danger) { background: #3a2826; color: #ffb1a3; border-color: #72433a; }
html[data-theme="dark"] .button.danger { background: #a13d37; color: #fff; }
html[data-theme="dark"] :is(#delete-list-error,#form-error,.form-error,#powerpoint-error,.login-card [role="alert"]) { color: #ffafa0; }
html[data-theme="dark"] dialog::backdrop { background: #0009; }
