html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e4e4ea;
  --muted: #a4a4b3;
  --brand: #8c8ed7;
  --line: #313140;
  --paper: #111116;
  --white: #1a1a23;
  --orange: #dfad7c;
  --shadow: 0 12px 45px #00000018;
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar { background: #15161c; }
html[data-theme="dark"] .wordmark span { color: #d4a576; }
html[data-theme="dark"] .workspace-label { color: #9c9cae; }
html[data-theme="dark"] .nav-link { color: #adadbb; }
html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .icon-button:hover { background: #252632; }
html[data-theme="dark"] .nav-link.active { background: #2a2a37; color: #a5a6df; }
html[data-theme="dark"] .nav-link .count { border-color: #46465d; }
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .search svg,
html[data-theme="dark"] .search kbd { color: #a1a1b1; }
html[data-theme="dark"] .breadcrumb strong { color: #c9cad7; }
html[data-theme="dark"] .breadcrumb span { color: #616176; }
html[data-theme="dark"] .search input { color: var(--ink); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #9090a3; opacity: 1; }
html[data-theme="dark"] select { background: #1a1a23; color: #cbcbd7; }
html[data-theme="dark"] .user-circle,
html[data-theme="dark"] .avatar,
html[data-theme="dark"] .mini-avatar { color: #d7c7a1; background: #3a3828; }
html[data-theme="dark"] .primary { background: #8283cf; color: #101027; }
html[data-theme="dark"] .primary:hover { background: #a3a4df; }
html[data-theme="dark"] .secondary { background: #1f1f28; border-color: #404054; color: #d3d3de; }
html[data-theme="dark"] .secondary:hover { background: #2d2d3b; }
html[data-theme="dark"] .icon-button { color: #afafc1; }
html[data-theme="dark"] .stat,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .calendar-grid,
html[data-theme="dark"] .proposed-task { background: #1a1a23; }
html[data-theme="dark"] .stat-title,
html[data-theme="dark"] .stat-title svg,
html[data-theme="dark"] .stat-foot { color: #a6a6b7; }
html[data-theme="dark"] .stat-foot.emphasis,
html[data-theme="dark"] .overdue { color: #e4ae84; }
html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .task-row,
html[data-theme="dark"] .event-row,
html[data-theme="dark"] td,
html[data-theme="dark"] .card-foot,
html[data-theme="dark"] .calendar-day { border-color: #2c2c3a; }
html[data-theme="dark"] .date-badge { color: #afafc1; background: #2a2a37; }
html[data-theme="dark"] .task-row:hover,
html[data-theme="dark"] tbody tr:hover { background: #24242f; }
html[data-theme="dark"] .check { border-color: #5a5a72; background: #16161e; }
html[data-theme="dark"] .check.done { background: #28294e; border-color: #6a6b8d; }
html[data-theme="dark"] .task-sub,
html[data-theme="dark"] .due,
html[data-theme="dark"] .event-time,
html[data-theme="dark"] .event-info p,
html[data-theme="dark"] .activity-row small,
html[data-theme="dark"] .progress-label,
html[data-theme="dark"] th,
html[data-theme="dark"] .mail-row p,
html[data-theme="dark"] footer { color: #a7a7b7; }
html[data-theme="dark"] .brand-pill { background: #2d2d3c; color: #a6a7d4; }
html[data-theme="dark"] .brand-pill.spectra { background: #3b3047; color: #cfb8df; }
html[data-theme="dark"] .pill { background: #2c2d3b; color: #b7b7c8; }
html[data-theme="dark"] .pill.high { background: #493729; color: #e6bc91; }
html[data-theme="dark"] .empty { color: #a4a4b7; }
html[data-theme="dark"] .empty .empty-icon { background: #2b2c3a; color: #b7b7c8; }
html[data-theme="dark"] .empty h3 { color: #d0d0dc; }
html[data-theme="dark"] .welcome-note { background: #21212b; border-color: #313141; }
html[data-theme="dark"] .welcome-note svg,
html[data-theme="dark"] .welcome-note p { color: #abacc0; }
html[data-theme="dark"] .assistant-card { background: #1e1e3c; color: #efeff3; border: 1px solid #414257; }
html[data-theme="dark"] .assistant-card .eyebrow { color: #b0b1dd; }
html[data-theme="dark"] .assistant-card p,
html[data-theme="dark"] .assistant-card small { color: #bdbece; }
html[data-theme="dark"] .assistant-card a { border-color: #595a77; color: #e6e6f4; }
html[data-theme="dark"] .event-info { border-left-color: #8d8da9; }
html[data-theme="dark"] .activity-dot { background: #8a8ba7; }
html[data-theme="dark"] .activity-row p,
html[data-theme="dark"] .project-card p { color: #b0b1c4; }
html[data-theme="dark"] .project-card:hover,
html[data-theme="dark"] .service-card:hover { border-color: #696a8b; }
html[data-theme="dark"] .progress { background: #313242; }
html[data-theme="dark"] .progress-fill { background: #9c9cb4; }
html[data-theme="dark"] .segmented { background: #1c1c24; border: 1px solid var(--line); }
html[data-theme="dark"] .segmented button { color: #aeaec2; }
html[data-theme="dark"] .segmented button.active { background: #3b3b4e; color: #e9e9f5; }
html[data-theme="dark"] .board-column { background: #16161e; border-color: #2a2a38; }
html[data-theme="dark"] .board-column.drag-over { background: #2e2e3d; border-color: #9394ae; }
html[data-theme="dark"] .column-heading .num { color: #a7a8bd; }
html[data-theme="dark"] .task-card { background: #23232e; border-color: #3d3d51; box-shadow: 0 2px 8px #00000015; }
html[data-theme="dark"] .add-card { color: #aeaec2; }
html[data-theme="dark"] .add-card:hover { background: #2f2f3e; }
html[data-theme="dark"] td select { background: #2c2d3b; }
html[data-theme="dark"] .service-icon { background: #30303f; color: #b1b1c4; }
html[data-theme="dark"] .notice { background: #24242f; border-color: #38384a; color: #b5b6c8; }
html[data-theme="dark"] .day-head,
html[data-theme="dark"] .day-number { color: #b4b5c7; }
html[data-theme="dark"] .calendar-day.today .day-number { background: #8c8ed7; color: #101027; }
html[data-theme="dark"] .calendar-entry { background: #303040; border-color: #8b8cc8; }
html[data-theme="dark"] .calendar-entry.spectra { background: #40334c; border-color: #b59bc9; }
html[data-theme="dark"] .calendar-entry.task { background: #453c26; border-color: #d4bc77; }
html[data-theme="dark"] .calendar-entry small { color: #bfbfcf; }
html[data-theme="dark"] .integration p { color: #aaaabe; }
html[data-theme="dark"] .connected { color: #b2b3df; background: #323242; }
html[data-theme="dark"] .not-connected { color: #dfc98d; background: #413d27; }
html[data-theme="dark"] label { color: #bfbfcf; }
html[data-theme="dark"] label>input,
html[data-theme="dark"] label>textarea,
html[data-theme="dark"] label>select,
html[data-theme="dark"] .chat-compose textarea { background: #121218; border-color: #414156; color: #e4e4ea; }
html[data-theme="dark"] dialog { background: #1a1a23; box-shadow: 0 25px 100px #00000070; }
html[data-theme="dark"] dialog::backdrop { background: #00000099; }
html[data-theme="dark"] .dialog-actions { background: #15161c; }
html[data-theme="dark"] .danger,
html[data-theme="dark"] .error { color: #f0b29d; }
html[data-theme="dark"] #toast { background: #cfcfe9; color: #18193c; }
html[data-theme="dark"] .chat-message { background: #282936; }
html[data-theme="dark"] .chat-message.user { background: #333343; }
html[data-theme="dark"] .chat-author { color: #b2b3d8; }
html[data-theme="dark"] .suggestion { color: #bcbdcd; }
html[data-theme="dark"] .mailbox.active { background: #2f2f3e; }
html[data-theme="dark"] .login-shell { background: #131319; }
html[data-theme="dark"] .login-brand { background: #191933; color: #efeff3; }
html[data-theme="dark"] .login-brand .eyebrow { color: #aeafd9; }
html[data-theme="dark"] .login-brand p { color: #c2c2d1; }
html[data-theme="dark"] .login-brand small { color: #a7a8bd; }
html[data-theme="dark"] .login-form>p,
html[data-theme="dark"] .login-form small { color: #a6a6bb; }
html[data-theme="dark"] .loading { color: #b7b7c9; }

/* Keep the same accessible switch in both appearances. */
.theme-control { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.theme-control h3 { margin: 0 0 9px; }
.theme-control p { margin: 0; max-width: 460px; }
.theme-choice { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-choice-label { color: var(--muted); font-size: 12px; }
.theme-choice-label.selected { color: var(--ink); font-weight: 650; }
.theme-switch { background: #d2d2dd; border: 1px solid #b3b4c6; width: 49px; height: 28px; padding: 3px; border-radius: 20px; display: inline-flex; align-items: center; }
.theme-switch-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #00000030; transform: translateX(0); transition: transform .15s; }
.theme-switch[aria-checked="true"] { background: #696ab7; border-color: #9293ca; }
.theme-switch[aria-checked="true"] .theme-switch-thumb { transform: translateX(20px); background: #101027; }
.theme-panel { grid-column: 1/-1; }
.profile .icon-button { display: block; }
@media(max-width:520px) { .theme-control { align-items: flex-start; flex-direction: column; } }
@media(prefers-reduced-motion:reduce) { .theme-switch-thumb { transition: none; } }
