/* Explicit light default; dark is a separate palette, never an inversion. */
:root { color-scheme: light; }
.header-account-tools { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.theme-toggle { display:grid; place-items:center; width:42px; height:42px; padding:0; border:1px solid var(--color-border); border-radius:50%; background:var(--color-card); color:var(--color-ink); cursor:pointer; flex-shrink:0; }
.theme-toggle[hidden] { display:none; }
.theme-toggle:hover { border-color:var(--color-accent); }
.theme-toggle .theme-sun { display:none; }
.theme-standalone { position:absolute; right:34px; top:34px; z-index:5; }
html[data-theme="dark"] { color-scheme:dark; --color-bg:#101412; --color-card:#1b221f; --color-ink:#eef2eb; --color-ink-muted:#adb8ae; --color-border:#354038; --color-accent:#ff875e; --color-accent-ink:#21170f; --color-danger:#ffac99; --color-success:#94d7aa; --dark-soft:#242d27; --dark-hover:#2a362e; }
html[data-theme="dark"] .theme-moon { display:none; }
html[data-theme="dark"] .theme-sun { display:block; }
html[data-theme="dark"] .app-shell { background:#151c18; border-color:#303a32; }
html[data-theme="dark"] .card { border-color:#303a32; box-shadow:0 8px 30px #00000018; }
html[data-theme="dark"] :is(.rail-groups,.pills,.profile-pill,.profile-menu-panel,.dossier-tabs) { background:var(--color-card); }
html[data-theme="dark"] :is(.rail-link,.pill) { color:var(--color-ink-muted); }
html[data-theme="dark"] :is(.rail-link,.pill,.profile-pill,.profile-menu-panel a,.profile-menu-panel button,.dossier-tabs a):hover { background:var(--dark-hover); color:var(--color-ink); }
html[data-theme="dark"] :is(.rail-link.active,.pill.active,.dossier-tabs a.active) { background:#e8eddf; color:#1c281e; }
html[data-theme="dark"] :is(.btn-secondary,.input,.panel-tabs,.tag-chip,.document-status) { background:var(--dark-soft); border-color:var(--color-border); color:var(--color-ink); }
html[data-theme="dark"] .btn:hover { background:#ffa17c; }
html[data-theme="dark"] .btn-secondary:hover { background:var(--dark-hover); }
html[data-theme="dark"] .btn-danger { background:#9b352b; color:#fff0ed; }
html[data-theme="dark"] .btn-danger:hover { background:#b34639; }
html[data-theme="dark"] .input:focus { border-color:var(--color-accent); }
html[data-theme="dark"] .input::placeholder { color:#a2b0a3; }
html[data-theme="dark"] table.data-table th { background:var(--dark-soft); }
html[data-theme="dark"] table.data-table td { border-color:var(--color-border); }
html[data-theme="dark"] table.data-table tbody tr:hover { background:#222c25; }
html[data-theme="dark"] :is(table.data-table td a,.activity-item a) { text-decoration-color:#788b79; }
html[data-theme="dark"] .customer-avatar { background:#4b3024; color:#ffb798; }
html[data-theme="dark"] .customer-facts { border-color:var(--color-border); }
html[data-theme="dark"] :is(.customer-facts dt,.eyebrow span,.tag-editor summary,.activity-item .activity-meta,.context-panel-section h3) { color:var(--color-ink-muted); }
html[data-theme="dark"] .panel-tabs a.active { background:#3b3028; color:#ffb493; box-shadow:0 2px 8px #0003; }
html[data-theme="dark"] .dossier-tabs .badge { background:#303d32; color:#dae5d7; }
html[data-theme="dark"] .dossier-tabs a.active .badge { background:#cbd7c4; color:#263b27; }
html[data-theme="dark"] .activity-timeline .activity-item { border-left-color:#435246; }
html[data-theme="dark"] .activity-timeline .activity-item::before { background:#657b66; border-color:var(--color-card); box-shadow:0 0 0 1px #617562; }
html[data-theme="dark"] .activity-timeline .activity-item:first-of-type::before { background:var(--color-accent); box-shadow:0 0 0 1px var(--color-accent); }
html[data-theme="dark"] :is(.badge-active,.badge-mail-captured,.badge-mail-submitted,.badge-run-healthy,.messages .success,.document-status-geprueft) { background:#233e2d; color:#a7e3b8; }
html[data-theme="dark"] :is(.badge-pending,.badge-mail-queued,.badge-mail-processing,.badge-run-running) { background:#453523; color:#f4ce92; }
html[data-theme="dark"] :is(.badge-suspended,.badge-mail-failed,.badge-run-error,.messages .error,.document-status-abgelehnt) { background:#482c27; color:#ffb7a7; }
html[data-theme="dark"] :is(.badge-mail-uncertain,.badge-run-stale) { background:#443f23; color:#e8db91; }
html[data-theme="dark"] :is(.badge-terminated,.badge-mail-cancelled,.badge-run-never-started,.messages .info) { background:#2c382f; color:#c3cec1; }
html[data-theme="dark"] :focus-visible { outline-color:#ffab83; }
html[data-theme="dark"] .app-rail .rail-summary { background:var(--color-card); color:var(--color-ink); }
@media(max-width:760px) { .header-account-tools { gap:6px; } .theme-toggle { width:38px; height:38px; } .theme-standalone { top:16px; right:16px; } }
