/* Appearance preferences; the original light palette stays intact. */
:root{--surface:#fff;--surface-soft:#f7f5fb;--surface-hover:#eee8fc;--text-soft:#655a76;--focus:#9b8bed}
:root[data-theme="dark"]{color-scheme:dark;--ink:#eeedf5;--muted:#b2afc4;--line:#393747;--violet:#b6a5ff;--bg:#14141e;--surface:#20202e;--surface-soft:#292837;--surface-hover:#373046;--text-soft:#cbc2dc;--red:#ef9bb1;--green:#86d8b6;--shadow:0 6px 26px #0003;--focus:#c0b2ff}
:root[data-theme="light"]{color-scheme:light}
.theme-control{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;font-size:12px;color:var(--muted)}
.theme-control select{max-width:116px;min-height:36px;padding:6px 9px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer}
.theme-control.is-floating{position:fixed;right:20px;top:18px;z-index:30;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:7px 10px;box-shadow:var(--shadow)}
.theme-control select:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
:root[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
:root[data-theme="dark"] :is(.sidebar,.card,.module-card,.stat-card,.guild-card,.record,.group,.feature-guide,.console-tabs a,.mention-options,.hero-features article,dialog){background:var(--surface);border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] :is(.topbar,.save-bar){background:#20202ef2;border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] :is(.server-switch,.module-search,.settings-search,.settings-note,.collection-row,.group .group,.toggle-field,.command-chip,.tabs button,.module-icon,.stat-icon){background:var(--surface-soft);border-color:var(--line);color:var(--text-soft)}
:root[data-theme="dark"] :is(.nav-item,.brand-small,.nav-label,.sidebar-bottom,.breadcrumb,.header-actions,.feature-guide-body,.field>span,.field>label,.field small,.record-reason,.module-card p,.page-heading .muted,.result dt,.mention-options p,.filter-count,.save-bar small){color:var(--muted)}
:root[data-theme="dark"] :is(.feature-guide summary,.group>legend,.console-tabs a){color:var(--text-soft)}
:root[data-theme="dark"] .group>legend{background:var(--surface)}
:root[data-theme="dark"] :is(.nav-item.active,.nav-item:hover,.tabs button.selected,.mention-options button:hover,.mention-options button[aria-selected="true"]){background:var(--surface-hover);color:var(--violet);border-color:var(--line)}
:root[data-theme="dark"] :is(.secondary,.icon-button){background:var(--surface);border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] .primary{background:var(--violet);color:#20172f}
:root[data-theme="dark"] .danger{background:#a43c5a;color:#fff}
:root[data-theme="dark"] .stat-card strong{color:var(--ink)}
:root[data-theme="dark"] .module-bottom{border-color:var(--line);color:var(--violet)}
:root[data-theme="dark"] :is(.field input:not([type="checkbox"]),.field select,.field textarea,.action-controls>label select,.connection-field input,.log-settings-tools input){background:var(--surface-soft);border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] :is(.field input,.field select,.field textarea)::placeholder{color:#a39bb4}
:root[data-theme="dark"] :is(.module-search input,.settings-search input){background:transparent;color:var(--ink)}
:root[data-theme="dark"] .mention-options button{color:var(--ink)}
:root[data-theme="dark"] .mention-chip{color:#dfc9ff;background:#40314f}
:root[data-theme="dark"] .notice{background:#2f293e;color:#dacfee;border-color:#4c405f}
:root[data-theme="dark"] :is(.notice.success,.badge.on){background:#1c372e;color:#a0e0c3;border-color:#345344}
:root[data-theme="dark"] :is(.notice.error,.badge.danger){background:#3e2631;color:#ffbfd1;border-color:#684154}
:root[data-theme="dark"] .badge{background:#353242;color:#d0c8df}
:root[data-theme="dark"] .badge.warn{background:#3f3421;color:#f1ce92}
:root[data-theme="dark"] .guild-avatar{background:#3b3054;color:#dccfff}
:root[data-theme="dark"] :is(.result th,.result td,.result,.record-head,.action-section>.section-heading){border-color:var(--line)}
:root[data-theme="dark"] .toast{background:#e9e2f6;color:#251d32}
:root[data-theme="dark"] dialog::backdrop{background:#05050db8}
:root[data-theme="dark"] :is(a,button,input,select,textarea,summary):focus-visible{outline-color:var(--focus)}
:root[data-theme="dark"] :is(.login-card,.hero-card,.hero-panel,.hero-visual,.empty,.loading-card){background:var(--surface);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] :is(.hero h1,.hero h2,.hero p,.hero-copy p,.login-card p,.guild-main>p){color:var(--ink)}
:root[data-theme="dark"] .command-chip:hover{background:var(--surface-hover)}
:root[data-theme="dark"] .hero .pill{background:var(--surface-hover);color:var(--violet)}
:root[data-theme="dark"] .settings-note{border-left-color:#a68cdb}
:root[data-theme="dark"] .module-search kbd{border-color:var(--line);color:var(--muted)}
/* Dedicated log settings. These use the same save/version and channel picker. */
.logs-settings .card>h2{margin-bottom:8px}
.logs-settings .toggle-field>span small{display:block;max-width:480px;margin-top:5px;line-height:1.5;font-size:11px;color:var(--muted);font-weight:400}
.logs-settings .toggle-field{gap:18px;align-items:flex-start}
.logs-settings input[type="checkbox"]{accent-color:var(--violet);width:19px;height:19px;flex-shrink:0}
.log-settings-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:20px 0 10px}
.log-settings-tools>input{flex:1 1 240px;min-width:0;min-height:42px;padding:10px 13px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);color:var(--ink)}
.log-settings-tools .button{padding:10px 12px;font-size:12px}
.log-settings-summary{font-size:12px;color:var(--muted);margin:10px 0 18px}
.log-event-group{margin:0 0 12px;border:1px solid var(--line);border-radius:13px;background:var(--surface);min-width:0}
.log-event-group>summary{cursor:pointer;display:flex;align-items:center;gap:12px;justify-content:space-between;padding:16px 18px;font-weight:650;color:var(--ink);list-style:none}
.log-event-group>summary::-webkit-details-marker{display:none}
.log-event-group>summary::before{content:'›';font-size:20px;color:var(--violet);line-height:1}
.log-event-group[open]>summary::before{transform:rotate(90deg)}
.log-event-group>summary>span:first-child{flex:1}
.log-event-row{display:grid;grid-template-columns:minmax(160px,.85fr) minmax(220px,1.3fr);gap:18px;padding:16px 18px;border-top:1px solid var(--line);align-items:start;min-width:0}
.log-event-row .toggle-field{border:0;padding:9px 0;background:transparent;min-height:0;align-items:center}
.log-event-row .toggle-field>span{font-size:13px;font-weight:600}
.log-event-row.is-disabled .toggle-field>span{color:var(--muted)}
.log-event-channel{min-width:0}
.log-channel-label{display:block;margin-bottom:6px;font-size:11px;color:var(--muted)}
.log-event-channel .connection-field>small{display:none}
.log-event-channel .connection-field input{width:100%;border:1px solid var(--line);border-radius:9px;padding:10px 12px;background:var(--surface-soft);color:var(--ink);font:inherit;min-height:42px}
.log-event-row[hidden],.log-event-group[hidden],.logs-settings .empty[hidden]{display:none!important}
@media(max-width:760px){.theme-control>span{display:none}.theme-control select{max-width:94px}.topbar{gap:10px;padding-left:16px;padding-right:16px}.topbar .breadcrumb{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.header-actions{gap:10px;flex-shrink:0}.log-event-row{grid-template-columns:1fr;gap:4px}.log-settings-tools{align-items:stretch}.log-settings-tools>input{flex-basis:100%}.log-settings-tools .filter-count{flex-basis:100%}.log-settings-tools .button{flex:1}.theme-control.is-floating{top:10px;right:10px}}
