:root{color-scheme:light}
.appearance-settings{margin:18px 0 24px;padding:16px 18px;border:1px solid #dce5ed;border-radius:14px;background:#f4f8fc}
.appearance-settings h3{margin:0 0 10px;font-size:16px}
.appearance-settings label{margin:0}
.appearance-settings p{margin:10px 0 0}
#themeSaveStatus{min-height:1.5em}
:root[data-theme="dark"]{color-scheme:dark;--theme-bg:#101820;--theme-panel:#18232f;--theme-raised:#213241;--theme-input:#121e29;--theme-border:#34495b;--theme-text:#e6eef7;--theme-muted:#a5b7c9;--theme-blue:#8ad0ff;--theme-tint:#193b55;--theme-primary:#196bb0;--theme-danger:#ffb0b6;--theme-danger-bg:#46272e;--theme-success:#9edbb1;--theme-success-bg:#203d32;color:var(--theme-text);background:var(--theme-bg)}
:root[data-theme="dark"] body{background:var(--theme-bg);color:var(--theme-text)}
:root[data-theme="dark"] button{background:var(--theme-primary);color:#fff}
:root[data-theme="dark"] button:hover{filter:brightness(1.12)}
:root[data-theme="dark"] .secondary,
:root[data-theme="dark"] .reaction-picker summary,
:root[data-theme="dark"] .message-menu summary,
:root[data-theme="dark"] .reaction-picker>div button,
:root[data-theme="dark"] .spreadsheet-table th{background:var(--theme-raised);color:var(--theme-blue)}
:root[data-theme="dark"] .login,
:root[data-theme="dark"] aside,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .message,
:root[data-theme="dark"] .composer,
:root[data-theme="dark"] dialog,
:root[data-theme="dark"] .photo-card,
:root[data-theme="dark"] .chat-pins,
:root[data-theme="dark"] .filter-panel,
:root[data-theme="dark"] .reaction-picker>div,
:root[data-theme="dark"] .message-menu>div,
:root[data-theme="dark"] #sheetTable{background:var(--theme-panel);color:var(--theme-text);border-color:var(--theme-border)}
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select{background:var(--theme-input);color:var(--theme-text);border-color:var(--theme-border);accent-color:var(--theme-blue)}
:root[data-theme="dark"] ::placeholder{color:#8fa3b7;opacity:1}
:root[data-theme="dark"] small,
:root[data-theme="dark"] .fine,
:root[data-theme="dark"] .meta,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .calendar .dow,
:root[data-theme="dark"] .admin-role,
:root[data-theme="dark"] .file-version-label,
:root[data-theme="dark"] .draft-fallback,
:root[data-theme="dark"] #sheetStatus,
:root[data-theme="dark"] #pdfStatus,
:root[data-theme="dark"] .employee-chat-picker summary span{color:var(--theme-muted)}
:root[data-theme="dark"] h1.brand,
:root[data-theme="dark"] .login h1{color:var(--theme-text)}
.brand .brand-logo-dark{display:none}
:root[data-theme="dark"] .brand .brand-logo-light{display:none}
:root[data-theme="dark"] .brand .brand-logo-dark{display:block}
:root[data-theme="dark"] .group-heading,
:root[data-theme="dark"] .direct-heading{color:var(--theme-text)}
:root[data-theme="dark"] nav button{background:transparent;color:var(--theme-text)}
:root[data-theme="dark"] nav button.active,
:root[data-theme="dark"] .favorite-chats button,
:root[data-theme="dark"] .initials,
:root[data-theme="dark"] .quote,
:root[data-theme="dark"] .reply-draft,
:root[data-theme="dark"] .mention-link,
:root[data-theme="dark"] .file,
:root[data-theme="dark"] .badge,
:root[data-theme="dark"] .reaction.selected,
:root[data-theme="dark"] #content.file-drag{background:var(--theme-tint);color:var(--theme-blue)}
:root[data-theme="dark"] .group-sections,
:root[data-theme="dark"] .admin-chat-tree .admin-chat-tree,
:root[data-theme="dark"] .member-list,
:root[data-theme="dark"] .admin-chat-row,
:root[data-theme="dark"] .admin-employee-row,
:root[data-theme="dark"] .employee-chat-picker,
:root[data-theme="dark"] .employee-chat-children,
:root[data-theme="dark"] .favorite-chats,
:root[data-theme="dark"] .direct-chats,
:root[data-theme="dark"] .backup-row,
:root[data-theme="dark"] .version-row,
:root[data-theme="dark"] nav .new-group,
:root[data-theme="dark"] .pdf-toolbar,
:root[data-theme="dark"] .pdf-navigation,
:root[data-theme="dark"] .sheet-controls,
:root[data-theme="dark"] .spreadsheet-table th,
:root[data-theme="dark"] .spreadsheet-table td{border-color:var(--theme-border)}
:root[data-theme="dark"] nav .new-group,
:root[data-theme="dark"] .chat-pins summary,
:root[data-theme="dark"] .filter-panel summary{color:var(--theme-blue)}
:root[data-theme="dark"] #tabs button,
:root[data-theme="dark"] .calendar button{background:var(--theme-panel);color:var(--theme-muted)}
:root[data-theme="dark"] #tabs .active,
:root[data-theme="dark"] .calendar .selected,
:root[data-theme="dark"] .unread,
:root[data-theme="dark"] #personal .personal-count,
:root[data-theme="dark"] .admin-tabs button[aria-pressed=true]{background:var(--theme-primary);color:#fff}
:root[data-theme="dark"] #personal.has-items{box-shadow:inset 0 0 0 1px var(--theme-border)}
:root[data-theme="dark"] .message.mine{background:#17364c;border-color:#2e536b}
:root[data-theme="dark"] .profile-link,
:root[data-theme="dark"] .later-link,
:root[data-theme="dark"] .chat-nav-item>.chat-favorite,
:root[data-theme="dark"] .message-resize-handle,
:root[data-theme="dark"] .admin-delete{background:transparent}
:root[data-theme="dark"] .profile-link{color:inherit}
:root[data-theme="dark"] .later-link,
:root[data-theme="dark"] .chat-nav-item>.chat-favorite,
:root[data-theme="dark"] .message-resize-handle{color:var(--theme-muted)}
:root[data-theme="dark"] .message-menu>summary,
:root[data-theme="dark"] .message-menu>div button{background:transparent;color:var(--theme-muted)}
:root[data-theme="dark"] .message-menu>div button:hover,
:root[data-theme="dark"] .message-menu>summary:hover,
:root[data-theme="dark"] .message-menu[open]>summary,
:root[data-theme="dark"] .message-resize-handle:hover,
:root[data-theme="dark"] .message-resize-handle:focus-visible{background:var(--theme-raised);color:var(--theme-blue)}
:root[data-theme="dark"] .reaction{background:var(--theme-raised);color:var(--theme-text)}
:root[data-theme="dark"] .reaction.selected{border-color:var(--theme-blue)}
:root[data-theme="dark"] .edited-label,
:root[data-theme="dark"] .photo-loading{color:var(--theme-muted)}
:root[data-theme="dark"] .high,
:root[data-theme="dark"] .deleted-label,
:root[data-theme="dark"] .delete-warning,
:root[data-theme="dark"] .task-hold.blocked,
:root[data-theme="dark"] .admin-delete:hover{background:var(--theme-danger-bg);color:var(--theme-danger)}
:root[data-theme="dark"] .confirm-error,
:root[data-theme="dark"] .admin-delete{color:var(--theme-danger)}
:root[data-theme="dark"] .danger{background:#a93242;color:#fff}
:root[data-theme="dark"] .done{background:var(--theme-success-bg);color:var(--theme-success)}
:root[data-theme="dark"] .completed-label,
:root[data-theme="dark"] #connection{color:var(--theme-success)}
:root[data-theme="dark"] .appearance-settings,
:root[data-theme="dark"] #photoCrop,
:root[data-theme="dark"] .draft-attachment,
:root[data-theme="dark"] .chat-photo,
:root[data-theme="dark"] .notification-item.seen,
:root[data-theme="dark"] .spreadsheet-table tbody tr:nth-child(even) td{background:var(--theme-input);border-color:var(--theme-border)}
:root[data-theme="dark"] .notification-item{background:var(--theme-tint);color:var(--theme-text)}
:root[data-theme="dark"] .outbox-item,
:root[data-theme="dark"] .task-hold{background:#3a3220;color:#f2d795}
:root[data-theme="dark"] .unread-divider,
:root[data-theme="dark"] .file-version-label{color:var(--theme-blue)}
:root[data-theme="dark"] .unread-divider:before,
:root[data-theme="dark"] .unread-divider:after{background:var(--theme-border)}
:root[data-theme="dark"] .history,
:root[data-theme="dark"] .quote,
:root[data-theme="dark"] .reply-draft{border-left-color:#478cbe}
:root[data-theme="dark"] #notice{background:#d9e9f5;color:#12283a;box-shadow:0 8px 30px #0005}
:root[data-theme="dark"] dialog::backdrop{background:#050b12b3}
:root[data-theme="dark"] #pdfPages,
:root[data-theme="dark"] #pdfFrame{background:#0c121a}
/* Keep document pixels and photographs unchanged. Only their surrounding UI changes. */
:root[data-theme="dark"] #pdfCanvas{background:white}
:root[data-theme="dark"] .photo-viewer{background:#0c121a;color:var(--theme-text)}
:root[data-theme="dark"] .photo-viewer .secondary{background:var(--theme-raised);color:var(--theme-text)}
:root[data-theme="dark"] :focus-visible{outline:2px solid var(--theme-blue);outline-offset:2px}

:root[data-theme="dark"] .admin-chat-row button.admin-tree-toggle{background:transparent;color:var(--theme-muted)}
:root[data-theme="dark"] .admin-protected{color:var(--theme-muted)}
:root[data-theme="dark"] .reaction.selected{background:var(--theme-tint);color:var(--theme-blue)}
