.theme-toggle{flex:0 0 38px;font-size:22px;display:grid;place-items:center}
.theme-toggle:focus-visible{outline:2px solid var(--green);outline-offset:3px}
html[data-theme="dark"]{
 --ink:#e2e8e3;--muted:#c2cbc5;--line:#4b5a51;--bg:#202724;
 --purple:#a9dfbb;--purple-light:#365642;--green:#a9dfbb;--orange:#f1bd8e;
 --brand-cream:#202724;--brand-terracotta:#f1bd8e;--brand-stone:#c2cbc5;
 --shadow:0 12px 35px #0002;--dark-surface:#2b3430;--dark-raised:#35433b;--dark-hover:#405347;
}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] :is(.sidebar,.topbar,.stat,.card,.notice-card,.auth-card,.modal,.modal-actions,.search,.global-search-results,.conv-item,.conversation-chat,.composer,.chat-head,.field input,.field textarea,.field select,.composer input,.chat-rich-input,.icon-btn,.secondary,.filter-pill,.message-action-trigger,.message-action-menu,.message-action-menu button,.emoji-picker,.gif-library,.gif-picker-toggle,.gif-library-upload-button,.gif-library-search,.attach-file-button,.kitchen-day,.kitchen-dialog,.kitchen-form input,.kitchen-form select,.kitchen-form textarea,.presence-dialog,.attachment-preview-dialog,.attachment-preview-head button,.global-announcement-card,.reminder-alerts){background:var(--dark-surface);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.workspace,.chat-messages,.attachment-preview-body,.kitchen-day.is-weekend){background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .auth-screen{background:radial-gradient(circle at 15% 10%,#274331 0,transparent 36%),var(--bg)}
html[data-theme="dark"] :is(.welcome h1,.view-toolbar h2,.card-title,.auth-card h1,.global-announcement-card h2,.gif-library-head,.profile-details dd){color:var(--ink)}
html[data-theme="dark"] :is(.post p,.notice-card p,.welcome p,.rem-time,.message-author,.post-meta,.chat-snippet,.chat-time,.stat small,.field label,.profile-photo-controls small,.notification-setting small,.kitchen-help,.kitchen-weekday,.kitchen-empty,.gif-library-message,.gif-library-attribution,.global-announcement-card p,.presence-badge,.nav-label,.breadcrumbs,.reminder-alert-item small){color:var(--muted)}
html[data-theme="dark"] :is(.nav button,.channel){color:var(--muted)}
html[data-theme="dark"] :is(.nav button.active,.channel.active,.filter-pill.active){background:var(--purple-light);color:var(--purple);border-color:var(--line)}
html[data-theme="dark"] :is(.nav button:hover,.channel:hover,.conv-item:hover,.conv-item.active,.dashboard-conversation:hover,.search-result-item:hover,.search-result-item:focus,.message-action-menu button:hover,.emoji-toggle:hover,.emoji-choice:hover,.gif-picker-toggle:hover,.gif-library-upload-button:hover,.presence-person:hover){background:var(--dark-hover)}
html[data-theme="dark"] :is(.primary,.auth-submit,.gif-library-search-button){background:#487957;color:#f3f5ef;box-shadow:none}
html[data-theme="dark"] :is(.primary:hover,.auth-submit:hover,.gif-library-search-button:hover){background:#426e50}
html[data-theme="dark"] :is(.text-btn,.record-action,.auth-link,.eyebrow,.back-dashboard,.chat-file-preview button,.gif-library-close,.reminder-alert-link){color:#efae7f}
html[data-theme="dark"] :is(.stat-icon,.post-icon,.tag,.count,.role-badge,.person,.person.green,.person.orange,.avatar,.workspace-mark,.profile-photo-preview){background:var(--dark-raised);color:var(--purple)}
html[data-theme="dark"] .chat-messages .bubble:not(.mine){background:#35453b;border-color:#52665a;color:var(--ink)}
html[data-theme="dark"] .chat-messages .bubble.mine{background:#41654b;border-color:#64866b;color:#e9f1e8}
html[data-theme="dark"] :is(.reply-quote,.reply-compose-preview){background:var(--dark-raised);color:var(--ink);border-left-color:#efae7f}
html[data-theme="dark"] :is(.reply-compose-preview button,.emoji-toggle,.chat-gif-preview button,.reminder-alert-close){color:var(--ink)}
html[data-theme="dark"] :is(.post,.reminder,.chat-entry,.check,.attachment-preview-head,.user-table th,.user-table td){border-color:var(--line)}
html[data-theme="dark"] :is(.field input:focus,.field textarea:focus,.field select:focus,.composer input:focus,.composer .chat-rich-input:focus,.gif-library-search:focus){border-color:var(--green);box-shadow:0 0 0 2px #87cba025}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--muted)}
html[data-theme="dark"] .presence-badge.is-online{color:#8ce3ad}
html[data-theme="dark"] .kitchen-note{color:#eab07d}
html[data-theme="dark"] :is(.kitchen-error,.record-action.danger,.message-action-menu .danger){color:#ffaca4}
html[data-theme="dark"] :is(.auth-error,.profile-feedback.error){background:#4b2928;color:#ffbbb4}
html[data-theme="dark"] .profile-feedback.success{background:#284333;color:#b5ebc3}
html[data-theme="dark"] .toast{background:#d8e9de;color:#17251b}
html[data-theme="dark"] input[type="checkbox"]{accent-color:#87cba0}
html[data-theme="dark"] .message-read-receipt{color:#c0cec4}
html[data-theme="dark"] .message-read-receipt.is-read{color:#74caff}
@media(max-width:760px){.top-actions{gap:7px}.theme-toggle{width:32px;height:34px;flex-basis:32px}}
html[data-theme="dark"] .brand-logo{background:#f5f5ef;border-radius:8px;padding:5px}
html[data-theme="dark"] :is(.card-sub,.search-result-heading){color:var(--muted)}

/* Distinct accents keep the dashboard readable without bright white text. */
html[data-theme="dark"] :is(.welcome h1,.view-toolbar h2,.card-title,.auth-card h1,.global-announcement-card h2){color:#f0dfc2}
html[data-theme="dark"] .stat strong{color:#e2e8e3}
html[data-theme="dark"] .stat{border-top:3px solid #92cda6}
html[data-theme="dark"] .stat:nth-child(2){border-top-color:#f1bd8e}
html[data-theme="dark"] .stat:nth-child(3){border-top-color:#e5cf8a}
html[data-theme="dark"] .stat:nth-child(4){border-top-color:#9ac6ef}
html[data-theme="dark"] :is(.stat-icon,.post-icon,.tag.green,.role-badge,.person.green){background:#365342;color:#b6ebc7}
html[data-theme="dark"] :is(.stat:nth-child(2) .stat-icon,.post:first-child .post-icon,.tag:not(.green):not(.purple),.person.orange){background:#584637;color:#ffd1a8}
html[data-theme="dark"] .stat:nth-child(3) .stat-icon{background:#504d34;color:#f2dda0}
html[data-theme="dark"] :is(.stat:nth-child(4) .stat-icon,.post:nth-child(3) .post-icon,.tag.purple){background:#374b5b;color:#b4d9fb}
html[data-theme="dark"] .bubble small{opacity:1;color:#c8d6cc}
html[data-theme="dark"] :is(.conversation-list .unread-badge,.dashboard-conversation .unread-badge,.nav .count.has-items){background:#487957;color:#f3f5ef;box-shadow:none}
