:root{color-scheme:light}
.theme-form{position:relative;margin:0}
.theme-toggle{display:inline-flex;align-items:center;gap:8px;padding:8px 11px;border:1px solid #cbd5e1;border-radius:9px;background:#f8fafc;color:#334155;font:600 12px/1.4 "DM Sans",Arial,sans-serif;white-space:nowrap;cursor:pointer;min-height:36px}
.theme-toggle [data-theme-icon]{font-size:18px;line-height:1}
.theme-toggle:hover{background:#edf3ff;border-color:#83a7eb}
.theme-toggle:focus-visible{outline:3px solid #83a7eb;outline-offset:3px}
.theme-toggle:disabled{opacity:.65;cursor:wait}
.theme-status:not(.sr-only){position:absolute;right:0;top:calc(100% + 10px);width:260px;padding:12px;border:1px solid #e7b4bc;border-radius:9px;background:#fff0f1;color:#8c2234;box-shadow:0 8px 24px #0002;font-size:13px;z-index:30}
:root[data-theme="dark"]{color-scheme:dark;--ink:#e4ebf5;--muted:#a3b2c8;--line:#344258;--paper:#0c1422;--white:#172235;--blue:#3d70d6;--blue-dark:#3164ca;--mint:#143a30;--green:#7ee3b1;--amber:#f4ce83;--red:#ffabb5;--shadow:0 14px 40px rgba(0,0,0,.18);--theme-link:#9bc3ff;--theme-soft:#202e43;--theme-input:#111d2e;--theme-focus:#94baff}
:root[data-theme="dark"] .topbar,:root[data-theme="dark"] .sidebar,:root[data-theme="dark"] .member-nav,:root[data-theme="dark"] .login-card,:root[data-theme="dark"] .payment-option{background:var(--white);border-color:var(--line)}
:root[data-theme="dark"] a{color:var(--theme-link)}
:root[data-theme="dark"] .brand,:root[data-theme="dark"] .shortcut,:root[data-theme="dark"] .template-card,:root[data-theme="dark"] .form-list-item{color:var(--ink)}
:root[data-theme="dark"] .brand b,:root[data-theme="dark"] .nav-item,:root[data-theme="dark"] .member-nav a,:root[data-theme="dark"] .link-button{color:#bac8dc}
:root[data-theme="dark"] .admin-chip{background:var(--theme-soft);color:#bfcee2}
:root[data-theme="dark"] .side-label,:root[data-theme="dark"] .planned,:root[data-theme="dark"] .sidebar-foot,:root[data-theme="dark"] .eyebrow,:root[data-theme="dark"] .empty,:root[data-theme="dark"] .spam-empty{color:var(--muted)}
:root[data-theme="dark"] .nav-dot{background:#6f839e}
:root[data-theme="dark"] .nav-item:hover,:root[data-theme="dark"] .nav-item.active,:root[data-theme="dark"] .ops-tabs a:hover,:root[data-theme="dark"] .ops-tabs a.active{background:#213959;color:#b7d5ff}
:root[data-theme="dark"] th{background:#1c293d;color:#a9bad1}
:root[data-theme="dark"] td{border-color:var(--line)}
:root[data-theme="dark"] td small,:root[data-theme="dark"] label small,:root[data-theme="dark"] .pager,:root[data-theme="dark"] .newsletter-page .pager,:root[data-theme="dark"] .template-card span,:root[data-theme="dark"] .template-card small,:root[data-theme="dark"] .form-list-item small,:root[data-theme="dark"] .survey-progress,:root[data-theme="dark"] .required-label,:root[data-theme="dark"] .survey-page .small-note{color:var(--muted)}
:root[data-theme="dark"] label,:root[data-theme="dark"] .form-grid label,:root[data-theme="dark"] .stack label,:root[data-theme="dark"] .period-control label,:root[data-theme="dark"] .log-filters label,:root[data-theme="dark"] .purge-form label,:root[data-theme="dark"] .survey-page label,:root[data-theme="dark"] .forms-page .check-inline{color:#c4d1e3}
:root[data-theme="dark"] input:not([type=checkbox]):not([type=radio]),:root[data-theme="dark"] select,:root[data-theme="dark"] textarea,:root[data-theme="dark"] .survey-page select,:root[data-theme="dark"] .survey-page textarea{background:var(--theme-input);color:var(--ink);border-color:#53657e}
:root[data-theme="dark"] input::placeholder,:root[data-theme="dark"] textarea::placeholder{color:#95a7c1;opacity:1}
:root[data-theme="dark"] input[type=checkbox],:root[data-theme="dark"] input[type=radio]{accent-color:#82b1ff}
:root[data-theme="dark"] input:focus-visible,:root[data-theme="dark"] select:focus-visible,:root[data-theme="dark"] textarea:focus-visible,:root[data-theme="dark"] button:focus-visible,:root[data-theme="dark"] a:focus-visible,:root[data-theme="dark"] summary:focus-visible{outline:2px solid var(--theme-focus);outline-offset:3px}
:root[data-theme="dark"] .button.secondary,:root[data-theme="dark"] .small-button,:root[data-theme="dark"] [data-spam-view] .small-button,:root[data-theme="dark"] .theme-toggle{background:var(--theme-soft);color:#d6e4f8;border-color:#53657e}
:root[data-theme="dark"] .button.secondary:hover,:root[data-theme="dark"] .small-button:hover,:root[data-theme="dark"] [data-spam-view] .small-button:hover,:root[data-theme="dark"] .theme-toggle:hover{background:#2b4162;border-color:#86afe8;color:#eff6ff}
:root[data-theme="dark"] .button.primary,:root[data-theme="dark"] .danger-button{color:white}
:root[data-theme="dark"] .text-link,:root[data-theme="dark"] details summary{color:var(--theme-link)}
:root[data-theme="dark"] .log-filters,:root[data-theme="dark"] .template-editor,:root[data-theme="dark"] .credential-group,:root[data-theme="dark"] .smtp-fields,:root[data-theme="dark"] .field-card,:root[data-theme="dark"] .template-card,:root[data-theme="dark"] .newsletter-page .stat-card{background:#1b293e;border-color:var(--line)}
:root[data-theme="dark"] .field-card legend{color:var(--ink)}
:root[data-theme="dark"] fieldset,:root[data-theme="dark"] .rule-grid>div,:root[data-theme="dark"] .form-list-item,:root[data-theme="dark"] .survey-page .builder-option{border-color:var(--line)}
:root[data-theme="dark"] .form-list-item:hover{background:var(--theme-soft);border-color:#86afe8}
:root[data-theme="dark"] .forms-page .tabs{background:#101c2e;border-color:var(--line)}
:root[data-theme="dark"] .forms-page .tabs a,:root[data-theme="dark"] .ops-tabs a{color:#b5c5dc}
:root[data-theme="dark"] .newsletter-page .tabs a,:root[data-theme="dark"] [data-spam-view] .tabs a{background:var(--theme-soft);color:#cad8ed;border-color:#425572}
:root[data-theme="dark"] .forms-page .tabs a.active,:root[data-theme="dark"] .newsletter-page .tabs a.active,:root[data-theme="dark"] [data-spam-view] .tabs a.active{background:#263f63;color:#c8dfff;border-color:#709bd6}
:root[data-theme="dark"] .notice,:root[data-theme="dark"] .provider-mark{background:#1c3453;border-color:#3b5a81;color:#c5d8f3}
:root[data-theme="dark"] .notice b{color:#dbeaff}
:root[data-theme="dark"] .badge{background:#293950;color:#cad5e6}
:root[data-theme="dark"] .badge.success,:root[data-theme="dark"] .badge.active,:root[data-theme="dark"] .badge.sent,:root[data-theme="dark"] .badge.received,:root[data-theme="dark"] .badge.trialing,:root[data-theme="dark"] .badge.comped,:root[data-theme="dark"] .flash.success,:root[data-theme="dark"] .ajax-status.success,:root[data-theme="dark"] .key-reveal{background:#173c32;color:#91edc1;border-color:#387b63}
:root[data-theme="dark"] .badge.failure,:root[data-theme="dark"] .badge.failed,:root[data-theme="dark"] .badge.paused,:root[data-theme="dark"] .badge.timed_out,:root[data-theme="dark"] .badge.open,:root[data-theme="dark"] .badge.past_due,:root[data-theme="dark"] .flash.error,:root[data-theme="dark"] .ajax-status.error,:root[data-theme="dark"] .theme-status:not(.sr-only){background:#432631;color:#ffb8c0;border-color:#98515e}
:root[data-theme="dark"] .badge.blocked,:root[data-theme="dark"] .badge.spam,:root[data-theme="dark"] .badge.submitted,:root[data-theme="dark"] .badge.scheduled,:root[data-theme="dark"] .badge.pending{background:#423622;color:#f9d58c}
:root[data-theme="dark"] .badge.neutral,:root[data-theme="dark"] .badge.setup_incomplete{background:#293b58;color:#b6d2fd}
:root[data-theme="dark"] .spam-level-0{background:#173c32;color:#91edc1;border-color:#387b63}
:root[data-theme="dark"] .spam-level-1{background:#423622;color:#f9d58c;border-color:#9e8145}
:root[data-theme="dark"] .spam-level-2{background:#452e22;color:#ffc596;border-color:#a66c45}
:root[data-theme="dark"] .spam-level-3{background:#432631;color:#ffb8c0;border-color:#98515e}
:root[data-theme="dark"] .danger{color:#ffb8b0!important}
:root[data-theme="dark"] .danger-panel{border-color:#98515e}
:root[data-theme="dark"] .key-reveal p{color:#9ed3bb}
:root[data-theme="dark"] .key-reveal code{background:#102b25;color:#c9f7e2;border-color:#387b63}
:root[data-theme="dark"] .ajax-status{background:var(--theme-soft);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .spam-summary,:root[data-theme="dark"] .spam-body,:root[data-theme="dark"] .spam-response-preview,:root[data-theme="dark"] [data-spam-test-result]:not(:empty),:root[data-theme="dark"] details pre,:root[data-theme="dark"] .secret-code,:root[data-theme="dark"] .recovery-codes{background:#101d30;color:#d6e1f1;border-color:var(--line)}
:root[data-theme="dark"] .spam-response-preview code,:root[data-theme="dark"] .message-details{color:#b2c5dd}
:root[data-theme="dark"] .forms-save{background:#243f61;color:#e9f2ff}
:root[data-theme="dark"] .forms-save .button{background:#d7e8ff;color:#163251}
:root[data-theme="dark"] .security-page .readiness-table td{background:var(--white)}
:root[data-theme="dark"] .newsletter-preview{color-scheme:light;background:white;border-color:#53657e}
@media(max-width:600px){.topbar{height:auto;min-height:72px;gap:12px;padding:12px 16px;flex-wrap:wrap}.topbar .brand{font-size:13px;gap:9px}.topbar-right{gap:12px;margin-left:auto}.theme-toggle{min-height:40px}.member-nav{flex-wrap:wrap}.theme-status:not(.sr-only){width:min(260px,calc(100vw - 36px))}}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}}
