/* Complete semantic palette. All themes share this contract. */
:root {
  color-scheme: light;
  --theme-accent: #425536; --theme-on-accent: #ffffff; --theme-soft: #edf1e5; --theme-hover: #e3e9d8;
  --theme-input: #fffefb; --theme-input-border: #839176; --theme-chrome: #1e281c; --theme-sidebar: #263322;
  --theme-nav: #f0f3e9; --theme-nav-muted: #c3cdb7; --theme-nav-current: #405235; --theme-nav-icon: #d4dfac;
  --theme-bg: url('/assets/theme-olive.png') center top / cover no-repeat var(--orero-ground);
  --theme-bg: image-set(url('/assets/theme-olive.webp') type('image/webp'),url('/assets/theme-olive.png') type('image/png')) center top / cover no-repeat var(--orero-ground);
  --theme-stream: linear-gradient(145deg, #e9eedd, #dfe7d5); --theme-own: #e9f0da; --theme-system: #f4f6ef;
  --theme-danger: #983b30; --theme-danger-bg: #fff0eb; --theme-success: #326040; --theme-success-bg: #e8f3e8;
  --theme-warning: #755016; --theme-warning-bg: #faf0d7; --theme-backdrop: #101b13b8;
  --theme-heading-font: Georgia, 'Times New Roman', serif;
  --theme-icon-radius: 10px; --theme-icon-border: 1px solid currentColor; --theme-icon-shadow: none; --theme-icon-weight: 1.7;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-card: 16px; --radius-modal: 18px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px;
  --shadow-card: 0 3px 16px #14231508; --shadow-dropdown: 0 12px 32px #14231526;
  --shadow-modal: 0 28px 80px #0c16184d; --shadow-floating: 0 8px 24px #14231524;
  --theme-chrome-border: #ffffff26; --theme-glass: #292725e8;
  --theme-info: #245b88; --theme-info-bg: #eaf3fc;
  --planner-busy: #e78585; --planner-conflict: #d84444; --planner-conflict-border: #a11e1e; --planner-selection: #e9c774; --planner-selection-border: #94701d;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --orero-ink: #e6edf3; --orero-olive: #8dd4be; --orero-olive-hover: #afe9d7; --orero-lime: #31584e;
  --orero-paper: #202933; --orero-ground: #141b23; --orero-line: #394652; --orero-muted: #abb9c6;
  --theme-accent: #8dd4be; --theme-on-accent: #132c24; --theme-soft: #293943; --theme-hover: #303f4b;
  --theme-input: #19222c; --theme-input-border: #657788; --theme-chrome: #10171e; --theme-sidebar: #17212b;
  --theme-nav: #e6edf3; --theme-nav-muted: #aab9c7; --theme-nav-current: #2d4944; --theme-nav-icon: #8dd4be;
  --theme-bg: url('/assets/theme-dark.png') center top / cover no-repeat var(--orero-ground);
  --theme-bg: image-set(url('/assets/theme-dark.webp') type('image/webp'),url('/assets/theme-dark.png') type('image/png')) center top / cover no-repeat var(--orero-ground);
  --theme-icon-radius: 12px; --theme-icon-border: 1px solid #8dd4be40; --theme-icon-shadow: inset 0 1px #c9fff018; --theme-icon-weight: 1.7;
  --shadow-card: 0 4px 20px #0000001a; --shadow-dropdown: 0 14px 36px #00000055; --shadow-modal: 0 30px 90px #00000080; --shadow-floating: 0 8px 24px #00000050;
  --theme-info: #a1cff4; --theme-info-bg: #243949; --planner-conflict: #f18080; --planner-conflict-border: #ffc0b9; --planner-selection-border: #efcd91;
  --theme-stream: linear-gradient(145deg, #1c3034, #202b3b); --theme-own: #29493f; --theme-system: #263340;
  --theme-danger: #ffb4a5; --theme-danger-bg: #482c2c; --theme-success: #b1e0c1; --theme-success-bg: #253e34;
  --theme-warning: #efcd91; --theme-warning-bg: #443a29; --theme-backdrop: #070c13c9;
  --theme-heading-font: Arial, Helvetica, sans-serif;
}
:root[data-theme="classic"] {
  color-scheme: light;
  --orero-ink: #252c35; --orero-olive: #344e68; --orero-olive-hover: #243c53; --orero-lime: #e2e8ed;
  --orero-paper: #ffffff; --orero-ground: #f1f3f5; --orero-line: #dce1e6; --orero-muted: #5c6773;
  --theme-accent: #344e68; --theme-on-accent: #ffffff; --theme-soft: #edf1f4; --theme-hover: #e5ebef;
  --theme-input: #ffffff; --theme-input-border: #87929d; --theme-chrome: #20272f; --theme-sidebar: #252d36;
  --theme-nav: #f4f6f8; --theme-nav-muted: #b9c2cc; --theme-nav-current: #3a4652; --theme-nav-icon: #c4d0da;
  --theme-bg: #f1f3f5;
  --theme-icon-radius: 6px; --theme-icon-border: 1px solid transparent; --theme-icon-shadow: none; --theme-icon-weight: 1.7;
  --theme-stream: linear-gradient(#f4f6f8,#f4f6f8); --theme-own: #e7edf2; --theme-system: #f0f3f5;
  --theme-danger: #a23942; --theme-danger-bg: #fbeff0; --theme-success: #2f624e; --theme-success-bg: #edf5f0;
  --theme-warning: #76551f; --theme-warning-bg: #faf4e8; --theme-info: #345a7b; --theme-info-bg: #edf3f8;
  --theme-backdrop: #18212b80; --theme-heading-font: system-ui,-apple-system,'Segoe UI',sans-serif;
}

:root[data-theme="vibe"] {
  color-scheme: light;
  --orero-ink: #2d3049; --orero-olive: #6150b8; --orero-olive-hover: #4c3b98; --orero-lime: #e4dcff;
  --orero-paper: #ffffff; --orero-ground: #58408e; --orero-line: #e2deee; --orero-muted: #5a5f74;
  --theme-accent: #6150b8; --theme-on-accent: #ffffff; --theme-soft: #f2effb; --theme-hover: #eae4f9;
  --theme-input: #ffffff; --theme-input-border: #878298; --theme-chrome: #4a346f; --theme-sidebar: #413064;
  --theme-nav: #fcfaff; --theme-nav-muted: #e0d8f3; --theme-nav-current: #65518d; --theme-nav-icon: #d4e9ff;
  --theme-bg: url('/assets/theme-vibe.webp') center / cover no-repeat var(--orero-ground);
  --theme-stream: linear-gradient(140deg,#eeebf8,#e7eefa); --theme-own: #e9e1fb; --theme-system: #f3f0fa;
  --theme-danger: #a63848; --theme-danger-bg: #fff0f2; --theme-success: #32664f; --theme-success-bg: #ebf6ee;
  --theme-warning: #7b551e; --theme-warning-bg: #fff4df; --theme-info: #3a609e; --theme-info-bg: #edf3fc;
  --theme-backdrop: #241a4a73; --theme-heading-font: system-ui,-apple-system,'Segoe UI',sans-serif;
  --theme-icon-radius: 11px; --theme-icon-border: 1px solid #ffffff30; --theme-icon-shadow: none; --theme-icon-weight: 1.7;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-card: 18px; --radius-modal: 20px;
  --shadow-card: 0 6px 24px #23173f0e; --shadow-dropdown: 0 14px 40px #24163f24;
  --shadow-modal: inset 0 1px #ffffffbb,0 30px 90px #20183c40; --shadow-floating: 0 12px 32px #23173f24;
  --theme-chrome-border: #ffffff38; --theme-glass: #faf8ffec;
}
:root[data-theme="courtyard"] {
  color-scheme: light;
  --orero-ink: #302936; --orero-olive: #a94331; --orero-olive-hover: #8b3427; --orero-lime: #f6dbc7;
  --orero-paper: #fffaf6; --orero-ground: #211a29; --orero-line: #e5d9d6; --orero-muted: #72606b;
  --theme-accent: #a94331; --theme-on-accent: #ffffff; --theme-soft: #f6ece6; --theme-hover: #f0dfd5;
  --theme-input: #fffdfb; --theme-input-border: #9c8288; --theme-chrome: #261c30; --theme-sidebar: #28202f;
  --theme-nav: #fff9f1; --theme-nav-muted: #d4c4d1; --theme-nav-current: #514052; --theme-nav-icon: #e8eaae;
  --theme-bg: url('/assets/alimpiyev/backstage.webp') center / cover no-repeat var(--orero-ground);
  --theme-icon-radius: 9px; --theme-icon-border: 1px solid #f7c9a82e; --theme-icon-shadow: none; --theme-icon-weight: 1.7;
  --theme-stream: linear-gradient(140deg,#f7efe8,#efeaf3); --theme-own: #f8e4d7; --theme-system: #f4edf5;
  --theme-danger: #a33243; --theme-danger-bg: #fff0f1; --theme-success: #366246; --theme-success-bg: #edf4e9;
  --theme-warning: #79521f; --theme-warning-bg: #fbefd9; --theme-info: #365988; --theme-info-bg: #edf2fa;
  --theme-backdrop: #1e122bb0; --theme-heading-font: system-ui,-apple-system,'Segoe UI',sans-serif;
}

:root[data-theme="macos"] {
  color-scheme: light;
  --orero-ink: #24252a; --orero-olive: #075bbd; --orero-olive-hover: #0055b5; --orero-lime: #dceaff;
  --orero-paper: #ffffff; --orero-ground: #395641; --orero-line: #d7e1db; --orero-muted: #58645e;
  --theme-accent: #075bbd; --theme-on-accent: #ffffff; --theme-soft: #edf2fa; --theme-hover: #e2eaf6;
  --theme-input: #ffffff; --theme-input-border: #868992; --theme-chrome: #203b32; --theme-sidebar: #203b32;
  --theme-nav: #ffffff; --theme-nav-muted: #e4efe8; --theme-nav-current: #405c4d; --theme-nav-icon: #d4edff;
  --theme-bg: linear-gradient(#19382b20,#19382b20),url('/assets/theme-macos-meadow.webp') center / cover no-repeat var(--orero-ground);
  --theme-stream: linear-gradient(140deg, #f0f2fa, #e8edf9); --theme-own: #ddeaff; --theme-system: #f2f3f7;
  --theme-danger: #b52e35; --theme-danger-bg: #fff0f0; --theme-success: #24653d; --theme-success-bg: #e8f5ec;
  --theme-warning: #795315; --theme-warning-bg: #fff3db; --theme-info: #205d9f; --theme-info-bg: #eaf3ff;
  --theme-backdrop: #1f254f50; --theme-heading-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --theme-icon-radius: 9px; --theme-icon-border: 1px solid transparent; --theme-icon-shadow: inset 0 1px #ffffff80; --theme-icon-weight: 1.7;
  --radius-sm: 5px; --radius-md: 8px; --radius-lg: 12px; --radius-card: 16px; --radius-modal: 18px;
  --shadow-card: 0 2px 4px #22264b04, 0 12px 28px #22264b09; --shadow-dropdown: 0 12px 40px #22264b2b;
  --shadow-modal: 0 1px 0 #ffffffcc inset, 0 35px 100px #17204345, 0 8px 24px #17204324; --shadow-floating: 0 10px 40px #22264b25;
  --theme-chrome-border: #ffffff99; --theme-glass: #f8f9ffea;
}
.preview-macos { --preview-bg: url('/assets/theme-macos-meadow.webp') center / cover; --preview-chrome: #18392da8; --preview-card: #ffffffdd; --preview-accent: #97d4ff; --preview-line: #a4b8aa; }
.preview-macos .preview-bar::before { content: ''; display: block; margin: 10px 0 0 12px; width: 7px; height: 7px; border-radius: 50%; background: #ff6058; box-shadow: 12px 0 #ffbd2f,24px 0 #28c840; }
.preview-macos .preview-nav i { background: #ffffff66; }

/* Official ORERO vessel, kept beside the wordmark at narrow widths too. */
.brand { align-items: center; }
.brand-icon { display: block; width: 34px; height: 46px; object-fit: contain; flex: 0 0 auto; }
@media (max-width: 560px) { .brand-icon { width: 25px; height: 34px; } }

/* Settings cards use native radio inputs for keyboard and touch access. */
.settings-panel { margin-top: 24px; padding: clamp(20px, 3vw, 36px); }
.settings-section-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.settings-section-heading h2 { margin: 0 0 8px; font-size: 1.35rem; }
.settings-section-heading p { margin: 0; line-height: 1.6; }
.settings-symbol { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 14px; background: var(--theme-soft); color: var(--theme-accent); font-size: 1.7rem; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; border: 0; padding: 0; margin: 0; min-width: 0; }
.theme-option { display: block; position: relative; margin: 0; padding: 9px; min-width: 0; border: 1px solid var(--orero-line); border-radius: 14px; background: var(--orero-paper); cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.theme-option:hover { border-color: var(--theme-accent); }
.theme-option:has(input:checked) { border-color: var(--theme-accent); background: var(--theme-soft); }
.theme-option input { position: absolute; left: 20px; top: 21px; z-index: 1; margin: 0; width: 20px; height: 20px; min-height: 20px; accent-color: var(--theme-accent); cursor: pointer; }
.theme-option:focus-within { outline: 1px solid var(--theme-accent); outline-offset: 3px; }
.theme-options:disabled .theme-option { cursor: wait; }
.theme-option-copy { display: grid; gap: 8px; padding: 18px 10px 6px; }
.theme-option-copy strong { color: var(--orero-ink); font-size: 1.05rem; }
.theme-option-copy > span { font-size: .82rem; line-height: 1.5; font-weight: 400; color: var(--orero-muted); }
.theme-option-copy .theme-selected-label { visibility: hidden; color: var(--theme-accent); font-weight: 600; }
.theme-option input:checked ~ .theme-option-copy .theme-selected-label { visibility: visible; }
.theme-selected-label > span { float: right; }
.theme-preview { display: grid; grid-template-columns: 26% 1fr; grid-template-rows: 27px 1fr; height: 170px; border-radius: 8px; overflow: hidden; background: var(--preview-bg); }
.preview-dark { --preview-bg: image-set(url('/assets/theme-dark.webp') type('image/webp'),url('/assets/theme-dark.png') type('image/png')) center / cover; --preview-chrome: #101820; --preview-card: #2c3b47; --preview-accent: #8dd4be; --preview-line: #576877; }
.preview-classic { --preview-bg: #f1f3f5; --preview-chrome: #252d36; --preview-card: #ffffff; --preview-accent: #748b9e; --preview-line: #dce1e6; }
.preview-olive { --preview-bg: image-set(url('/assets/theme-olive.webp') type('image/webp'),url('/assets/theme-olive.png') type('image/png')) center / cover; --preview-chrome: #263121; --preview-card: #fffef9; --preview-accent: #9da978; --preview-line: #d8ddc7; }
.preview-vibe { --preview-bg: url('/assets/theme-vibe.webp') center / cover; --preview-chrome: #46326c99; --preview-card: #ffffffee; --preview-accent: #c4b5fc; --preview-line: #b0a8c7; }
.preview-courtyard { --preview-bg: url('/assets/alimpiyev/backstage.webp') center / cover; --preview-chrome: #28202fe6; --preview-card: #fffaf6; --preview-accent: #e8b192; --preview-line: #dfd0ca; }

html:root[data-background-pending="true"] { --theme-bg: var(--orero-ground) !important; }
.preview-courtyard .preview-bar { background: #261c30; }
.preview-bar { grid-column: 1 / -1; background: var(--preview-chrome); }
.preview-nav { padding: 18px 9px; background: var(--preview-chrome); display: grid; align-content: start; gap: 13px; }
.preview-nav i { display: block; height: 4px; border-radius: 3px; background: #ffffff42; }
.preview-nav i:first-child { background: var(--preview-accent); }
.preview-content { padding: 17px 12px; display: grid; gap: 10px; align-content: start; }
.preview-content i { width: 50%; height: 8px; border-radius: 3px; background: var(--preview-accent); }
.preview-content b { height: 38px; border-radius: 5px; background: var(--preview-card); position: relative; }
.preview-content b::after { content: ''; position: absolute; left: 10px; right: 20%; top: 11px; height: 3px; background: var(--preview-line); box-shadow: 0 9px var(--preview-line); }
.theme-save-status { margin: 24px 0 0; line-height: 1.6; font-size: .86rem; }
#theme-retry { margin-top: 12px; }
@media (max-width: 1100px) { .theme-options { gap: 12px; } .theme-preview { height: 145px; } }
@media (max-width: 900px) { .theme-options { grid-template-columns: 1fr; } .theme-option { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; align-items: center; gap: 8px; } .theme-option-copy { padding: 8px; } .theme-preview { height: 135px; } }
@media (max-width: 400px) { .settings-panel { padding: 16px; } .theme-option { grid-template-columns: 1fr; } .theme-preview { height: 155px; } }
@media (prefers-reduced-motion: reduce) { .theme-option { transition: none; } }

/* Theme surfaces: scoped overrides preserve all existing olive layouts and sizing. */
html[data-theme] body { background: var(--theme-bg); background-attachment: fixed; color: var(--orero-ink); }
html[data-theme] .topbar { background: var(--theme-chrome); border-color: var(--orero-line); }
html[data-theme] .sidebar { background: var(--theme-sidebar); border-color: #ffffff18; }
html[data-theme] :is(.brand, .account, .nav-item, .nav-subitem, .nav-group-title) { color: var(--theme-nav); }
html[data-theme] :is(.sidebar-profile span, .sidebar-footer, .sidebar .unavailable) { color: var(--theme-nav-muted); }
html[data-theme] :is(.nav-icon, .soon, .brand-family) { color: var(--theme-nav-icon); }
html[data-theme] :is(.nav-icon, .nav-item.current, button.nav-item:hover, .sidebar .unavailable:hover) { background: var(--theme-nav-current); }
html[data-theme] .nav-item.current { box-shadow: inset 3px 0 var(--theme-nav-icon); }
html[data-theme] :is(h1, .profile-dialog-head h2, .profile-hero h3, .employee-dialog-head h2, .calendar-empty-title) { font-family: var(--theme-heading-font); letter-spacing: -.02em; }
html[data-theme] :is(label, legend, .task-detail-description, .task-table td, .calendar-event-row, .news-comment-text) { color: var(--orero-ink); }
html[data-theme] :is(.eyebrow, .expand-mark, .task-sort span, .task-activity-event strong, .calendar-event-symbol) { color: var(--theme-accent); }
html[data-theme] :is(.calendar-event-time, .calendar-event-summary > span, .calendar-weekdays, .calendar-empty-caption, .task-activity-event.system strong, .task-check-item input:checked + span) { color: var(--orero-muted); }
html[data-theme] :is(.task-table-wrap, .task-table, .calendar-event-list, .task-stream-heading, .task-comment-form, .news-comment-form, .news-poll-vote label, .news-file, #news-expand, #news-body, #calendar-event-form > .calendar-form-footer) { background: var(--orero-paper); color: var(--orero-ink); border-color: var(--orero-line); }
html[data-theme] :is(.department-card, .role-card, .role-create-form, .news-extra-fields, .message-extra, .task-form-side, .task-detail-main, .calendar-form-side, .task-table th, .news-quote, .news-event-detail, .news-comment-confirm) { background: var(--theme-soft); color: var(--orero-ink); border-color: var(--orero-line); }
html[data-theme] :is(.task-table th:nth-child(2), .task-activity-cell, .composer-audience select) { background: var(--theme-soft); }
html[data-theme] :is(.task-table tbody tr:hover, .employee:hover, .task-person-choice:hover, .task-person-choice:focus-within, .calendar-people label:hover, #news-expand:hover, #notification-list .notification-item:hover) { background: var(--theme-hover); }
html[data-theme] :is(input, select, textarea, #news-body, #profile-form textarea, #employee-profile-form textarea) { color: var(--orero-ink); background-color: var(--theme-input); border-color: var(--theme-input-border); accent-color: var(--theme-accent); }
html[data-theme] :is(input, textarea)::placeholder { color: var(--orero-muted); opacity: 1; }
html[data-theme] :is(input, select, textarea):disabled { color: var(--orero-muted); }
html[data-theme] :is(.profile-avatar-small, .profile-initial, .news-avatar, .person-avatar, .profile-photo, .compose-avatar, .calendar-mark) { background: var(--theme-soft); color: var(--theme-accent); }

/* Buttons and links retain their semantic treatments in both new themes. */
html[data-theme] :where(button).secondary { color: var(--theme-accent); background: var(--orero-paper); border-color: var(--theme-input-border); }
html[data-theme] :where(button).secondary:hover { background: var(--theme-hover); }
html[data-theme] :is(#profile-toggle, #logout, #company-search-toggle,#notifications-toggle) { color: var(--theme-nav); background: var(--theme-nav-current); border-color: #ffffff30; }
html[data-theme] :is(#profile-toggle, #logout, #company-search-toggle,#notifications-toggle):hover { background: #ffffff20; }
html[data-theme] :is(#profile-close, #news-collapse, #notification-close, .department-card button.department-edit, .task-drawer button.quiet, .task-activity-event button.task-message-action) { color: var(--theme-accent); background: var(--theme-soft); border-color: var(--orero-line); }
html[data-theme] :is(#profile-close, #news-collapse, #notification-close, .department-card button.department-edit, .task-drawer button.quiet, .task-activity-event button.task-message-action):hover { color: var(--theme-accent); background: var(--theme-hover); }
html[data-theme] :is(#news-form .composer-tool-button, #news-form .composer-cancel, #task-detail .task-edit-link, button.profile-person-link, .message-toolbar .composer-tool-button, .message-reply-action, .news-icon-action, .task-sort, .reply-source-link, .news-comments-toggle, .news-emoji-panel button, .text-mention-link) { color: var(--theme-accent); background: transparent; }
html[data-theme] :is(button.profile-person-link, .news-icon-action, .task-sort, .news-emoji-panel button):hover { background: var(--theme-hover); }
html[data-theme] :is(button.news-tag, button.message-reply-reference, .message-reply-reference, .reply-draft, .calendar-participant-tags button.profile-person-link) { background: var(--theme-soft); color: var(--theme-accent); border-color: var(--orero-line); }
html[data-theme] button.news-search-toggle { color: var(--orero-ink); background: var(--theme-input); border-color: var(--theme-input-border); }
html[data-theme] .composer-tabs button.composer-tab { color: var(--orero-muted); background: transparent; }
html[data-theme] .composer-tabs button.composer-tab.selected { color: var(--theme-accent); box-shadow: inset 0 -2px var(--theme-accent); }
html[data-theme] .task-row-title { color: var(--theme-accent); }
html[data-theme] :is(a, .mention-link) { color: var(--theme-accent); }
html[data-theme] a.brand { color: var(--theme-nav); }
html[data-theme] :is(.mention-option, #mention-menu .mention-option, .text-mention-menu button) { background: var(--orero-paper); color: var(--orero-ink); }
html[data-theme] :is(.mention-option:hover, #mention-menu .mention-option:hover, .text-mention-menu button:hover) { background: var(--theme-hover); }

/* Messages, status colors, notifications and modal surfaces. */
html[data-theme] .task-detail-stream { background: var(--theme-stream); }
html[data-theme] .task-activity-event.own { background: var(--theme-own); }
html[data-theme] .task-activity-event.system { background: var(--theme-system); }
html[data-theme] :is(.task-row-status, .task-detail-status, .department-meta span, .calendar-event-badge, .audience-chip) { background: var(--theme-soft); color: var(--theme-accent); }
html[data-theme] :is(.tag, .news-event-badge) { background: var(--theme-warning-bg); color: var(--theme-warning); }
html[data-theme] :is(.toast, .profile-status, .employee-feedback, #notice, .task-detail-feedback) { color: var(--theme-success); background: var(--theme-success-bg); border-color: var(--orero-line); }
html[data-theme] :is(.toast.error, .profile-status.error, .employee-feedback.error, #notice.error, .task-detail-feedback.error, .task-overdue) { color: var(--theme-danger); background: var(--theme-danger-bg); border-color: var(--theme-danger); }
html[data-theme] :is(.toast-close, .toast-region button.toast-close) { color: inherit; background: transparent; }
html[data-theme] :is(.news-feedback, .task-feedback) { color: var(--theme-success); }
html[data-theme] :is(.news-feedback.error, .task-feedback.error, .news-status.error, .tasks-status.error, .notification-status.error, .calendar-occupied) { color: var(--theme-danger); }
html[data-theme] .calendar-free { color: var(--theme-success); }
html[data-theme] #notification-list .notification-item.unread { background: var(--theme-soft); }
html[data-theme] :is(.profile-backdrop, .employee-backdrop, .task-backdrop) { background: var(--theme-backdrop); }
html[data-theme] .window-tray-item { background: var(--theme-sidebar); color: var(--theme-nav); border-color: var(--theme-accent); }
html[data-theme] .news-post-actions button.news-icon-delete:hover { color: var(--theme-danger); background: var(--theme-danger-bg); border-color: var(--theme-danger); }
html[data-theme] :is(button.person-mention, .news-kind-badge, .news-files a) { color: var(--theme-accent); background: var(--theme-soft); }
html[data-theme] :is(button.person-mention:hover, .news-files a:hover) { color: var(--theme-accent); background: var(--theme-hover); }
html[data-theme] .news-kind-badge.event { color: var(--theme-warning); background: var(--theme-warning-bg); }
html[data-theme] .news-event-detail span { color: var(--orero-muted); }
html[data-theme] .universal-mention-menu button.mention-option { background: var(--orero-paper); color: var(--orero-ink); }
html[data-theme] .universal-mention-menu button.mention-option:hover { background: var(--theme-hover); }
html[data-theme] .task-inline-feedback { color: var(--theme-success); }
html[data-theme] .task-inline-feedback.error { color: var(--theme-danger); }
html[data-theme] .news-edit-feedback { color: var(--theme-danger); }
html[data-theme] :is(.news-file a, .news-quote, .news-quote cite, .news-event-detail, .news-poll-result) { color: var(--orero-ink); }
html[data-theme] .news-poll-bar { background: var(--theme-soft); accent-color: var(--theme-accent); }
html[data-theme] .news-poll-bar::-webkit-progress-bar { background: var(--theme-soft); }
html[data-theme] .news-poll-bar::-webkit-progress-value { background: var(--theme-accent); }
html[data-theme] .news-poll-bar::-moz-progress-bar { background: var(--theme-accent); }

/* Calendar, including the empty-day mascot. */
html[data-theme] #calendar-view .calendar-event-row { color: var(--orero-ink); border-color: var(--orero-line); }
html[data-theme] #calendar-view .calendar-event-row:hover { background: var(--theme-hover); }
html[data-theme] #calendar-view .calendar-day { color: var(--orero-ink); background: transparent; }
html[data-theme] #calendar-view .calendar-day:hover { background: var(--theme-hover); }
html[data-theme] #calendar-view .calendar-day.outside { color: var(--orero-muted); opacity: .65; }
html[data-theme] #calendar-view .calendar-day.today { box-shadow: inset 0 0 0 1px var(--theme-accent); }
html[data-theme] #calendar-view .calendar-day[aria-pressed="true"] { background: var(--theme-accent); color: var(--theme-on-accent); opacity: 1; }
html[data-theme] :is(.calendar-date-label h3, .calendar-form-side label.calendar-room-choice) { background: var(--orero-paper); color: var(--orero-ink); border-color: var(--orero-line); }
html[data-theme] .calendar-room-choice:has(input:checked) { background: var(--theme-soft); border-color: var(--theme-accent); }
html[data-theme] .calendar-room-choice.occupied { background: var(--theme-danger-bg); }
html[data-theme] :is(.calendar-room-row, .calendar-form-footer, .calendar-people, .news-comments, .news-comment-form, .news-comment, .task-check-item, .task-comment-form, .task-stream-heading) { border-color: var(--orero-line); }
html[data-theme] :is(.calendar-date-label::before, .calendar-date-label::after, .events-line) { background: var(--orero-line); }
html[data-theme] .events-line::before { background: var(--theme-accent); }
html:root[data-theme] .events-list .upcoming-event { background: var(--theme-soft); color: var(--orero-ink); border-left-color: var(--theme-accent); }
html:root[data-theme] .events-list .upcoming-event:hover { background: var(--theme-hover); }
html[data-theme] .calendar-empty { background: radial-gradient(ellipse at 50% 40%, var(--theme-soft), transparent 72%); }
html[data-theme] .calendar-empty-title { color: var(--orero-ink); }
html[data-theme="dark"] .calendar-empty::before { opacity: .28; }
html[data-theme] :is(:focus-visible, input:focus, select:focus, textarea:focus, [contenteditable="true"]:focus) { outline-color: var(--theme-accent); }
html[data-theme] :is(input:focus, select:focus, textarea:focus) { border-color: var(--theme-accent); box-shadow: none; }
@media (forced-colors: active) { html[data-theme] :is(:focus-visible, input:focus, select:focus, textarea:focus) { outline-color: Highlight; } }
@media (max-width: 700px) {
  html[data-theme] .task-table tr { background: var(--orero-paper); border-color: var(--orero-line); }
}
