:root{--surface:#fff;--surface-muted:#f1f3f7;--action:#123f83}
:root[data-theme=dark]{color-scheme:dark;--bg:#111b2a;--surface:#182538;--surface-muted:#203149;--white:#182538;--ink:#e7eef8;--muted:#afbdd1;--line:#3c4d65;--navy:#bed5f6;--blue:#a9caff;--green:#92e1bc;--amber:#f7d18b;--gray:#afbdd1;--action:#285ba0;--editorial-focus:#a9caff;--editorial-danger:#ffb8b8;background:var(--bg);color:var(--ink)}
[data-theme-toggle]{border:1px solid var(--line);border-radius:8px;padding:10px 14px;min-height:44px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}
.panel-session [data-theme-toggle]{width:100%;background:transparent;border-color:#b9c8df;color:#fff}
.login-shell [data-theme-toggle]{margin-bottom:22px}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] :is(.environment,.summary article,.card,.activity,.compose-section,.editor-pane,.calendar-day,.calendar-weekday,.task-card,.login-shell,dialog,.mention-suggestions,.toast){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.column,.description-preview,.calendar-day.other-month,.permissions span,.notification-item.unread,.attachment-item){background:var(--surface-muted);color:var(--ink)}
html[data-theme=dark] :is(main,dialog) :is(input,textarea,select,button){background:var(--surface);color:var(--ink);border-color:var(--line);caret-color:var(--blue)}
html[data-theme=dark] :is(main,dialog) :is(input,textarea,select):disabled{background:var(--surface-muted);color:var(--muted)}
html[data-theme=dark] :is(main,dialog) :is(button.primary,button[type=submit],.test-button),html[data-theme=dark] .variant-tabs button[aria-pressed=true]{background:var(--action);color:#fff;border-color:#6292cf}
html[data-theme=dark] :is(main,dialog) button:hover{background:var(--surface-muted);color:var(--ink)}
html[data-theme=dark] :is(main,dialog) :is(button.primary,button[type=submit],.test-button):hover{background:#326bb4;color:#fff}
html[data-theme=dark] :is(.post-list .post-row[aria-pressed=true],.view-tabs button[aria-pressed=true],.mention-suggestions [aria-selected=true],.user-mention){background:#284367;color:#e7eef8}
html[data-theme=dark] :is(.muted,.post-row small,.text-meta,.state-label,.empty-state,.report-note,.data-table th,.service small,.next strong,.card-meta,.markdown,.description-preview,#description-hint,.verification-note,.connection-details dd,.connection-message,.history-content,.last-success span){color:var(--muted)}
html[data-theme=dark] :is(main,dialog) :is(a,.eyebrow){color:var(--blue)}
html[data-theme=dark] :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
html[data-theme=dark] .verification-note{background:#203553;border-color:var(--blue)}
html[data-theme=dark] #notice{color:#b8d8ff}
html[data-theme=dark] :is(#notice.error,#post-error,.toast-error,#login-error,#card-save-error,.note-feedback.error){color:#ffb8b8}
html[data-theme=dark] .connection-badge.verified,html[data-theme=dark] .summary-icon.connected{color:#a5efce;background:#183f34}
html[data-theme=dark] :is(.connection-badge.not_configured,.connection-badge.stale,.summary-icon.pending){color:#d1dbeb;background:#28374d}
html[data-theme=dark] :is(.connection-badge.limited,.summary-icon.partial,.priority-medium){color:#ffe0a3;background:#493b24}
html[data-theme=dark] :is(.connection-badge.error,.priority-high){color:#ffd1d1;background:#4b2830}
html[data-theme=dark] .connection-badge.manual{color:#ded2ff;background:#39304f}
html[data-theme=dark] :is(.summary-icon.mode,.task-number,.count,.avatar){color:#d2e3ff;background:#29415f}
html[data-theme=dark] .health-card[open]>.integration-toggle,html[data-theme=dark] .integration-toggle:hover{background:var(--surface-muted)}
html[data-theme=dark] dialog::backdrop{background:rgba(3,8,17,.72)}
html[data-theme=dark] :focus-visible{outline:3px solid var(--blue);outline-offset:3px}
html[data-theme=dark] ::selection{background:#42679c;color:#fff}

html[data-theme=dark] :is(#monitor-info,#last-refresh){color:var(--muted)}
