/* Light mode retains the panel's existing palette and layout. */
#adminThemeToggle{margin-left:auto;flex-shrink:0;white-space:nowrap;background:#283b55;color:#fff5dc;border:1px solid #b8862f;padding:8px 12px;font-size:13px}
#adminThemeToggle:hover{background:#36506f}
#adminThemeToggle:focus-visible{outline:3px solid #e7bc70;outline-offset:3px}
html[data-admin-theme="dark"]{
 color-scheme:dark;
 --ink:#edf2fa;--ink-light:#d7e2f1;--parchment:#101722;--paper:#1b2635;
 --rule:#405066;--slate:#c4cede;--slate-bg:#28374a;--brass:#e7bc70;--brass-light:#f2d59d;
 --sage:#9ee1b2;--sage-bg:#203e32;--clay:#f0bd95;--clay-bg:#423124;
 --danger:#ffb4ae;--danger-bg:#492a30;--error:#ffb4ae;--success:#9ee1b2;
}
html[data-admin-theme="dark"] body{background:var(--parchment);color:var(--ink)}
html[data-admin-theme="dark"] .site-header{background:#132034}
html[data-admin-theme="dark"] button{background:#35577e;color:#fff;border:1px solid #567697}
html[data-admin-theme="dark"] button:hover{background:#436992}
html[data-admin-theme="dark"] button.secondary{background:transparent;color:var(--ink);border-color:var(--rule)}
html[data-admin-theme="dark"] button.secondary:hover{background:var(--slate-bg)}
html[data-admin-theme="dark"] :is(.sidebar-toggle,.editor-toolbar button,.action-menu button){background:transparent;color:var(--ink);border-color:var(--rule)}
html[data-admin-theme="dark"] :is(.sidebar-toggle,.editor-toolbar button,.action-menu button):hover{background:var(--slate-bg)}
html[data-admin-theme="dark"] .action-menu button.danger{color:var(--danger)}
html[data-admin-theme="dark"] .nav-item{color:var(--ink)}
html[data-admin-theme="dark"] .nav-item.active{background:#35577e;color:#fff0cc}
html[data-admin-theme="dark"] .nav-item.active .nav-badge{background:var(--brass-light);color:#172336}
html[data-admin-theme="dark"] :is(.nav-badge,.sms-unread-dot){background:#a87625;color:#fff}
html[data-admin-theme="dark"] .badge{background:#283b55;color:var(--brass-light)}
html[data-admin-theme="dark"] .notice{background:var(--clay-bg);border-color:#70513d;color:var(--clay)}
html[data-admin-theme="dark"] :is(.pill-flag,.n-tag){background:#483923;color:#ffe0a1}
html[data-admin-theme="dark"] .sms-bubble.out{background:#35577e;color:#fff}
html[data-admin-theme="dark"] .sms-bubble.in{background:var(--slate-bg);color:var(--ink)}
html[data-admin-theme="dark"] .sms-bubble.failed{background:var(--danger-bg);color:var(--danger)}
html[data-admin-theme="dark"] :is(input,textarea,select,.editor-body){background:var(--paper);color:var(--ink);border-color:var(--rule)}
html[data-admin-theme="dark"] :is(input,textarea)::placeholder{color:#b4c1d4;opacity:1}
html[data-admin-theme="dark"] .editor-body:empty:before{color:#b4c1d4}
html[data-admin-theme="dark"] input[type="checkbox"]{accent-color:#e7bc70}
html[data-admin-theme="dark"] a{color:#b9d8ff}
html[data-admin-theme="dark"] :is(.n-success,.n-yes strong){color:#9ee1b2}
html[data-admin-theme="dark"] .n-seen strong{color:#a9ceff}
html[data-admin-theme="dark"] .n-preview button:not(.secondary){background:#286542!important;color:#fff!important}
html[data-admin-theme="dark"] #scrollTopBtn{background:#35577e;color:var(--brass-light)}
/* Original modals and dynamic rows use some fixed light colors. Only theme UI,
   preserving incoming email HTML and user-authored rich text. */
html[data-admin-theme="dark"] :is([style*="background:#fff"],[style*="background: #fff"],[style*="background:#f9f9fb"]):not(#modalBody *):not(.editor-body *){background:var(--paper)!important;color:var(--ink)}
html[data-admin-theme="dark"] :is([style*="color:#555"],[style*="color:#666"],[style*="color:#999"],[style*="color: #555"],[style*="color: #666"],[style*="color: #999"]):not(#modalBody *):not(.editor-body *){color:var(--slate)!important}
html[data-admin-theme="dark"] [style*="color:#5c7a5c"]:not(#modalBody *):not(.editor-body *){color:var(--sage)!important}
html[data-admin-theme="dark"] [style*="color:#b8862f"]:not(#modalBody *):not(.editor-body *){color:var(--brass)!important}
/* Incoming messages keep their sender's formatting on a readable light canvas. */
html[data-admin-theme="dark"] #modalBody{background:#fffdf8;color:#1f2a3d;padding:12px;border-radius:4px;color-scheme:light}
html[data-admin-theme="dark"] #modalBody a{color:#245a99}
@media(max-width:600px){.site-header{flex-wrap:wrap}.site-header .wordmark{white-space:normal;flex:1;min-width:180px}#adminThemeToggle{padding:7px 10px;font-size:12px}}
html[data-admin-theme="dark"] button[style*="background:var(--danger)"]{background:#8c3540!important;color:#fff!important}
html[data-admin-theme="dark"] #noticePreviewButtons button:not(.secondary){background:#286542!important;color:#fff!important}
