/* The light palette remains the default. These colors apply only to a signed-in user who selects dark mode. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --green: #a7d873;
  --green-dark: #c4ee94;
  --green-soft: #294332;
  --pink: #ff86b8;
  --ink: #edf5ef;
  --muted: #a8b9ae;
  --line: #34483d;
  --surface: #1b2922;
  --canvas: #111a16;
  --danger: #ffa0ac;
  --shadow: 0 18px 60px rgba(0, 0, 0, .36);
  background: var(--canvas);
}
html[data-theme="dark"] body { color: var(--ink); background: var(--canvas); }
html[data-theme="dark"] :is(label, .department-filter, .department-info-editor label, .service-hours-times label) { color: #d7e5db; }
html[data-theme="dark"] :is(input, textarea, select) { border-color: #3d5345; color: var(--ink); background: #202f26; }
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #9aac9f; opacity: 1; }
html[data-theme="dark"] :is(input, textarea, select):focus { border-color: #a7d873; box-shadow: 0 0 0 3px rgba(167, 216, 115, .17); }
html[data-theme="dark"] :is(.button.primary, .button.primary:hover) { color: #102016; }
html[data-theme="dark"] .button.primary:hover { background: #bee994; }
html[data-theme="dark"] .button.ghost { color: #dceadf; background: #2a3b30; }
html[data-theme="dark"] .button.ghost:hover { background: #354b3a; }
html[data-theme="dark"] .button.secondary { color: #c4ee94; background: #294332; }
html[data-theme="dark"] .button.danger { color: #ffadba; background: #432932; }
html[data-theme="dark"] .icon-button:hover { background: rgba(213, 238, 217, .11); }
html[data-theme="dark"] :is(.sidebar, .mobile-topbar) { color: #e4f0e7; background: #121f18; }
html[data-theme="dark"] .sidebar { border-right: 1px solid #31453a; box-shadow: 4px 0 28px rgba(0, 0, 0, .2); }
html[data-theme="dark"] :is(.nav-item, .user-meta span) { color: #afc0b4; }
html[data-theme="dark"] .nav-item.active { color: #eaf6e9; background: linear-gradient(90deg, rgba(167, 216, 115, .23), rgba(167, 216, 115, .07)); }

/* Main pages, data lists and editor surfaces. */
html[data-theme="dark"] :is(.login-shell, .login-panel, .card, .stat-card, .inbox, .chat-header, .composer, .mobile-topbar, .provider-card div, .team-summary article, .flow-node, .flow-workspace, .flow-block, .flow-inspector, .typebot-choice) { color: var(--ink); background: var(--surface); }
html[data-theme="dark"] :is(.webhook-box, .integration-state, .sync-rule, .service-hours-toggle, .service-hours-fields, .department-options label, .active-check, .broadcast-contact-filter-panel, .backup-schedule-status span, .backup-safety-note) { border-color: var(--line); color: var(--ink); background: #223329; }
html[data-theme="dark"] :is(.integration-state.success, .evolution-connection) { border-color: #44634a; color: #c4ee94; background: #263e2e; }
html[data-theme="dark"] .evolution-pairing-code { border-color: #648c58; color: #e4f6d4; background: #1b2922; }
html[data-theme="dark"] .integration-state.warning { border-color: #776246; color: #ffd894; background: #3a3123; }
html[data-theme="dark"] .integration-state.error { border-color: #79434b; color: #ffc0c7; background: #3d272b; }
html[data-theme="dark"] :is(.flow-canvas, .flow-viewport) { border-color: var(--line); background-color: #17241d; background-image: radial-gradient(#344c3a 1px, transparent 1px); }
html[data-theme="dark"] .flow-toolbar { border-color: var(--line); background: #223229; }
html[data-theme="dark"] .flow-block-head { border-color: var(--line); }
html[data-theme="dark"] .flow-edge-label { fill: #c1d2c5; stroke: #17241d; }
html[data-theme="dark"] .flow-block-id { color: #a1b4a4; }
html[data-theme="dark"] .flow-port { border-color: #17241d; }
html[data-theme="dark"] .step b { color: #c2d3c6; background: #304338; }
html[data-theme="dark"] .step.done b { color: #142018; background: var(--green); }
html[data-theme="dark"] .step:not(:last-child)::after { background: #3b5141; }
html[data-theme="dark"] :is(.team-item.inactive, .department-item.inactive) { background: #1d2922; }
html[data-theme="dark"] :is(.service-hours-weekdays span, .role-pill, .department-tag, .department-tag.neutral, .department-tag.service-hours-summary) { border-color: #3c5542; color: #d6e7d9 !important; background: #2a3d2d; }
html[data-theme="dark"] .service-hours-weekdays input:checked + span { border-color: #9bd46a; color: #d9f6b7; background: #305038; }
html[data-theme="dark"] .service-hours-fields legend { color: #c5d6c9; }
html[data-theme="dark"] .contact-department-field select:disabled { color: #9cac9e; background: #27372c; }

/* Inbox and internal chat. */
html[data-theme="dark"] :is(.operator-inbox-mode, .operator-inbox, .operator-chat-pane, .chat-pane, .operator-messages, .messages, .department-chat-messages, .operator-inbox-mode .broadcast-page, .operator-inbox-mode .backup-page) { color: var(--ink); background-color: #15231b; }
html[data-theme="dark"] .operator-messages { background-image: radial-gradient(rgba(167, 216, 115, .075) .7px, transparent .7px); }
html[data-theme="dark"] :is(.operator-list-pane, .operator-brand, .operator-list-tools, .operator-chat-header, .operator-composer, .department-chat-drawer) { border-color: var(--line); color: var(--ink); background: #1b2a22; }
html[data-theme="dark"] :is(.conversation-item, .operator-conversation-item, .broadcast-contact-choice) { border-color: #34473b; color: var(--ink); background: #1c2b23; }
html[data-theme="dark"] :is(.conversation-item:hover, .operator-conversation-item:hover, .broadcast-contact-choice:hover) { background: #283e2d; }
html[data-theme="dark"] :is(.conversation-item.active, .operator-conversation-item.active, .broadcast-contact-choice:has(input:checked)) { color: #f0f8ed; background: #2b4832; }
html[data-theme="dark"] :is(.operator-conversation-item .conversation-copy strong, .operator-conversation-item .conversation-copy > span, .operator-conversation-item .conversation-copy small, .conversation-date, .conversation-time, .operator-brand small, .operator-list-title span) { color: #c1d0c4; }
html[data-theme="dark"] .operator-conversation-item .conversation-copy strong { color: #edf5ef; }
html[data-theme="dark"] :is(.search-box input, .operator-list-tools .search-box input, .operator-composer textarea, .conversation-list-more) { border-color: var(--line); color: var(--ink); background: #24372b; }
html[data-theme="dark"] :is(.filter-chip, .conversation-flag-label, .triage-window-badge.is-waiting) { color: #c0d1c4; background: #283b2f; }
html[data-theme="dark"] :is(.filter-chip.active, .operator-list-tools .filter-chip.active, .triage-window-badge, .mark-all-read) { border-color: #4c7751; color: #cbefac; background: #2a4931; }
html[data-theme="dark"] .triage-window-badge.is-expired { border-color: #84515d; color: #ffc1ce; background: #432a32; }
html[data-theme="dark"] :is(.internal-chat-tab, .new-private-chat, .department-chat-tab, .expand-list, .private-chat-context, .department-chat-header-actions #openDepartmentChatStandalone, .department-chat-media-preview, .support-ticket-media-preview, .internal-variable-menu) { border-color: #405846; color: #d9e9dc; background: #23352a; }
html[data-theme="dark"] .internal-chat-tab.active { border-color: #a1d76e; color: #d9f6b6; background: #31503a; box-shadow: inset 0 -2px #a1d76e; }
html[data-theme="dark"] :is(.department-chat-attachment, .support-ticket-media, .department-chat-image, .message-reactions > span, .chat-history-more .button) { border-color: #405846; color: #d9eadc; background: #2b4032; }
html[data-theme="dark"] .operator-messages .message-bubble, html[data-theme="dark"] .message-bubble { border-color: #405348; color: #e9f3eb; background: #26382e; }
html[data-theme="dark"] .operator-messages .message-row.outbound .message-bubble, html[data-theme="dark"] .message-row.outbound .message-bubble { border-color: #4e926d; color: #f7fff7; background: #246848; }
html[data-theme="dark"] .message-row.outbound .message-reply-quote strong { color: #f7fff7; }
html[data-theme="dark"] :is(.message-meta, .internal-message small) { color: #b9cabc; }
html[data-theme="dark"] .internal-message { border-color: #43564a; color: #c6d7ca; background: #28372e; }
html[data-theme="dark"] .internal-message strong { color: #e3efe5; }
html[data-theme="dark"] :is(.composer-reply-slot, .composer-reply-preview, .conversation-read-only-notice, .transfer-panel) { border-color: #405846; color: #dcebdd; background: #25382a; }
html[data-theme="dark"] .transfer-panel { background: linear-gradient(120deg, #25372b, #2b4230); }
html[data-theme="dark"] :is(.quick-reply-menu, .chat-action-menu, .message-context-menu, .conversation-context-menu, .private-chat-context-menu) { border-color: #45604a; color: var(--ink); background: #202f26; }
html[data-theme="dark"] .private-chat-context-menu > strong { color: #b8cbb9; }
html[data-theme="dark"] .private-chat-context-menu button small { color: #bbcfbe; }
html[data-theme="dark"] :is(.quick-reply-menu button, .chat-action-menu button, .message-context-menu > button, .private-chat-context-menu button) { color: #e0ede2; background: #2a3e30; }
html[data-theme="dark"] :is(.quick-reply-menu button:hover, .chat-action-menu button:hover, .message-context-menu > button:hover, .private-chat-context-menu button:hover) { background: #36523b; }
html[data-theme="dark"] :is(.message-context-menu > button.danger, .private-chat-context-menu button.danger, .clear-private-notes, .message-delivery-failure) { border-color: #835260; color: #ffb9c5; background: #432a33; }
html[data-theme="dark"] :is(.message-context-menu > button.danger:hover, .private-chat-context-menu button.danger:hover) { background: #58313e; }
html[data-theme="dark"] :is(.conversation-context-menu .mark-unread-action, .note-button.has-note) { border-color: #7d673d; color: #ffda92; background: #433721; }
html[data-theme="dark"] .conversation-context-menu .send-template-action { border-color: #52758b; color: #b9e2f8; background: #253c4b; }
html[data-theme="dark"] :is(.blacklist-reason-field, .conversation-context-menu .blacklist-reason-field) { border-color: #667568; color: #e9f1e8; background: #2c392e; }
html[data-theme="dark"] :is(.blacklist-reason-field textarea, .conversation-context-menu .blacklist-reason-field textarea) { border-color: #5b6b5f; color: var(--ink); background: #202e25; }
html[data-theme="dark"] .blacklist-reason-field small { color: #bdcbbc; }
html[data-theme="dark"] .message-row.deleted .message-bubble { color: #aabbad; background: #25342b; }
html[data-theme="dark"] .message-order-toggle { border-color: #405846; color: #d9e9dc; background: #294032; }
html[data-theme="dark"] .message-order-toggle:hover, html[data-theme="dark"] .message-order-toggle:focus-visible { border-color: #a7d873; color: #e4f8d2; background: #365641; }
html[data-theme="dark"] .new-private-chat:hover, html[data-theme="dark"] .new-private-chat:focus-visible { border-color: #a7d873; color: #e4f8d2; background: #365641; }
html[data-theme="dark"] .department-chat-messages article { color: #e8f2e9; background: #24372b; box-shadow: inset 0 0 0 1px #3b5141; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-1 { --internal-author-color: #ff9dc3; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-2 { --internal-author-color: #85dfcf; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-3 { --internal-author-color: #aab9ff; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-4 { --internal-author-color: #ffc58b; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-5 { --internal-author-color: #d6b1ff; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-6 { --internal-author-color: #8ddde9; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-7 { --internal-author-color: #ffa5ae; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-8 { --internal-author-color: #b8e697; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-9 { --internal-author-color: #e0bca6; }
html[data-theme="dark"] .department-chat-messages article.internal-author-tone-10 { --internal-author-color: #b5d5e0; }
html[data-theme="dark"] .internal-date-separator { color: #b8cbb9; }
html[data-theme="dark"] .internal-date-separator::before, html[data-theme="dark"] .internal-date-separator::after { background: #405846; }
html[data-theme="dark"] .department-chat-messages .internal-date-separator span { border-color: #405846; color: #c7d8c9; background: #2a4031; }
html[data-theme="dark"] .department-chat-messages .internal-rich-text a { color: #9ed6ff; }
html[data-theme="dark"] .department-chat-messages .internal-rich-text a:hover { color: #cceaff; }
html[data-theme="dark"] .department-chat-messages .internal-rich-text .internal-mention { color: #b5e9fa; background: #294b57; }
html[data-theme="dark"] .department-chat-messages .message-reply-quote { border-left-color: #9bd46a; color: #d8e8db; background: #304638; }
html[data-theme="dark"] .department-chat-messages .message-reply-quote strong { color: #c4ee94; }
html[data-theme="dark"] .department-chat-source { border-color: #4f7757; color: #c8efb9; background: #2d4b34; }
html[data-theme="dark"] .department-chat-messages article:hover .department-chat-delete, html[data-theme="dark"] .department-chat-delete:focus-visible { color: #ffb9d1; background: #4a2f3d; }
html[data-theme="dark"] .private-people-list > button, html[data-theme="dark"] .internal-seen-by-list > article { border-color: #405846; color: #e9f3eb; background: #26382d; }
html[data-theme="dark"] .private-people-list > button:hover, html[data-theme="dark"] .private-people-list > button:focus-visible { border-color: #99d279; color: #f2faf0; background: #345340; }
html[data-theme="dark"] .private-people-list small, html[data-theme="dark"] .internal-seen-by-list small { color: #b4c8b8; }
html[data-theme="dark"] .internal-mention-suggestions { border-color: #456654; color: #e6f1e8; background: #1d3026; }
html[data-theme="dark"] .internal-mention-option { color: #e6f1e8; }
html[data-theme="dark"] .internal-mention-option:hover, html[data-theme="dark"] .internal-mention-option.active { color: #f0faee; background: #345743; }
html[data-theme="dark"] .internal-mention-option small { color: #b5c9b9; }

/* Support: the urgent and status colors are deliberately light on dark surfaces. */
html[data-theme="dark"] :is(.support-ticket-card, .support-ticket-list, .support-ticket-detail, .support-ticket-empty, .support-ticket-row) { border-color: #415549; color: #eaf4ec; background: #213128; }
html[data-theme="dark"] :is(.support-ticket-row:hover, .support-ticket-row.active, .support-ticket-row.has-unread) { border-color: #89c569; color: #f0f8ed; background: #2b4933; }
html[data-theme="dark"] .support-ticket-table-head { color: #c8d9cc; background: #2a3d31; }
html[data-theme="dark"] .support-ticket-table-head > span + span { border-color: #526959; }
html[data-theme="dark"] .support-ticket-resize-handle::after { background: #9fbea3; }
html[data-theme="dark"] .support-ticket-resize-handle:hover, html[data-theme="dark"] .support-ticket-resize-handle:focus-visible { background: #38583f; }
html[data-theme="dark"] :is(.support-ticket-date b, .support-ticket-protocol, .support-ticket-empty strong, .support-ticket-requester strong) { color: #e5f0e6; }
html[data-theme="dark"] .department-chat-messages .support-ticket-date b { color: #e0ece0; }
html[data-theme="dark"] .support-ticket-protocol small { color: #b4c7b8; }
html[data-theme="dark"] :is(.support-ticket-requester, .support-ticket-dashboard .support-ticket-activity, .support-ticket-modal .support-ticket-activity, .support-ticket-modal .support-ticket-description) { border-color: #415749; color: #e8f2e9; background: #283a2e; }
html[data-theme="dark"] :is(.support-ticket-dashboard .support-ticket-activity.activity-status, .support-ticket-modal .support-ticket-activity.activity-status) { border-left-color: #bea2f4; background: #342c43; }
html[data-theme="dark"] .support-ticket-modal-title { border-color: var(--line); background: rgba(27, 41, 34, .97); }
html[data-theme="dark"] :is(.support-ticket-status.status-open, .support-ticket-card.card-open strong) { color: #ffabb7; background: #452932; }
html[data-theme="dark"] .support-ticket-card.card-open strong { background: transparent; }
html[data-theme="dark"] :is(.support-ticket-status.status-answered, .support-ticket-card.card-progress strong) { color: #b5e5ff; background: #263e4a; }
html[data-theme="dark"] .support-ticket-status.status-implementation { color: #ffda94; background: #473822; }
html[data-theme="dark"] .support-ticket-status.status-validation { color: #dac5ff; background: #3b3151; }
html[data-theme="dark"] .support-ticket-status.status-completed { color: #aee8c0; background: #274335; }
html[data-theme="dark"] .support-ticket-card.card-progress strong { color: #ffcf86; background: transparent; }
html[data-theme="dark"] .support-ticket-card.card-validation strong { color: #d7bfff; }
html[data-theme="dark"] .support-ticket-card.card-completed strong { color: #a9e5b9; }
html[data-theme="dark"] :is(.support-ticket-category.category-urgent, .support-ticket-list-actions .support-ticket-urgent-filter, .support-ticket-list-actions .support-ticket-urgent-filter b) { color: #ff9eab; }
html[data-theme="dark"] .support-ticket-category.category-bug { color: #ff9eab; }
html[data-theme="dark"] .support-ticket-category.category-backlog { color: #a8c8f4; }
html[data-theme="dark"] .support-ticket-category.category-change { color: #ffd48a; }
html[data-theme="dark"] .support-ticket-category.category-epic { color: #d4b4ff; }
html[data-theme="dark"] .support-ticket-category.category-improvement { color: #a8e4bd; }
html[data-theme="dark"] .support-ticket-category.category-upgrade { color: #9edafa; }

/* Contacts, broadcasts, preferences and confirmation dialogs. */
html[data-theme="dark"] :is(.modal-backdrop, .image-lightbox-backdrop) { background: rgba(5, 11, 7, .78); }
html[data-theme="dark"] .operator-inbox-mode .operator-contacts-page { color: var(--ink); background: #15231b; }
html[data-theme="dark"] .contacts-page .page-header :is(h1, p) { color: var(--ink); }
html[data-theme="dark"] .contacts-page .page-header p { color: #b8cbbd; }
html[data-theme="dark"] .contacts-page :is(.contacts-toolbar, .contact-filter-panel, .contacts-pagination) { border-color: #405648; color: #dcebdd; background: #213329; }
html[data-theme="dark"] .contacts-page .contact-filter-panel label { color: #c5d8c8; }
html[data-theme="dark"] .contacts-page .contact-item { border-color: #3b5142; color: #e8f3e9; background: #213128; }
html[data-theme="dark"] .contacts-page .contact-item:hover { background: #2a4031; }
html[data-theme="dark"] .contacts-page .contact-item.is-blocked { background: #372b2c; }
html[data-theme="dark"] .contacts-page .contact-item.is-blocked:hover { background: #473135; }
html[data-theme="dark"] .contacts-page .contact-company-inline { color: #b8d6c0; }
html[data-theme="dark"] .contacts-page .contact-blocked-badge { border-color: #925361; color: #ffc0ca; background: #462b34; }
html[data-theme="dark"] .contacts-page .contact-flag-button { border-color: #496350; color: #c7d9cb; background: #2b3d31; }
html[data-theme="dark"] .contact-type-field legend { color: #dcebdd; }
html[data-theme="dark"] .contact-type-field label { border-color: #48614d; color: #e4f0e6; background: #273a2d; }
html[data-theme="dark"] .contact-type-field label:has(input:checked) { border-color: #a7d873; color: #eaffda; background: #31513a; box-shadow: 0 0 0 2px rgba(167, 216, 115, .16); }
html[data-theme="dark"] .contact-flag-options .flag-none { border-color: #506556; color: #d1e2d4; background: #293b30; }
html[data-theme="dark"] .contact-flag-options .flag-option i { background: rgba(20, 36, 26, .48); }
html[data-theme="dark"] :is(.contact-modal, .emoji-catalog, .notification-sound-setting, .internal-profile-photo-setting, .notification-sound-toggle) { border-color: var(--line); color: var(--ink); background: #1c2b23; }
html[data-theme="dark"] :is(.notification-sound-toggle, .notification-sound-setting, .internal-profile-photo-setting) { background: #25372b; }
html[data-theme="dark"] :is(.contact-item, .broadcast-contact-list, .broadcast-contact-choice, .broadcast-history-item, .backup-item, .meta-template-card, .meta-window-choice-card, .operator-permission-list label) { border-color: #3b5141; color: var(--ink); background: #23342a; }
html[data-theme="dark"] .template-group-card { border-color: #455f47; background: linear-gradient(135deg, #25382b, #304a32); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
html[data-theme="dark"] .template-group-card[data-template-group="commercial"] { border-color: #3f6260; background: linear-gradient(135deg, #25382f, #284944); }
html[data-theme="dark"] .template-group-card:hover, html[data-theme="dark"] .template-group-card:focus-visible { border-color: #91c965; background: linear-gradient(135deg, #2c4431, #365a3a); }
html[data-theme="dark"] .template-group-card[data-template-group="commercial"]:hover, html[data-theme="dark"] .template-group-card[data-template-group="commercial"]:focus-visible { border-color: #6dc3b2; background: linear-gradient(135deg, #2c443d, #326158); }
html[data-theme="dark"] .template-group-card .template-group-icon { color: #c2ed9e; background: #3b5e38; }
html[data-theme="dark"] .template-group-card[data-template-group="commercial"] .template-group-icon { color: #9bdfd1; background: #315b54; }
html[data-theme="dark"] .template-group-card .template-group-copy { color: #f0f8ef; }
html[data-theme="dark"] .template-group-card .template-group-copy small { color: #bed2c0; }
html[data-theme="dark"] .template-group-card .template-group-arrow { color: #b1df84; }
html[data-theme="dark"] .template-group-card[data-template-group="commercial"] .template-group-arrow { color: #96d9ca; }
html[data-theme="dark"] :is(.broadcast-contact-choice:has(input:checked), .meta-template-card:has(input:checked), .operator-permission-list label:has(input:checked)) { border-color: #8bc76a; background: #2b4932; }
html[data-theme="dark"] :is(.broadcast-select-all, .triage-template-detail, .triage-template-preview, .triage-binding-summary > span, .dual-channel-summary > span, .broadcast-detail-variations article, .variable-chip, .broadcast-ai-note, .broadcast-shared-attachment, .backup-file-picker input) { border-color: #3e5845; color: #e6f0e7; background: #283b2e; }
html[data-theme="dark"] :is(.broadcast-contact-notes, .contact-last-sent .contact-last-sent-text, .triage-template-detail p, .triage-template-preview p, .broadcast-detail-variations p, .broadcast-detail-section h3, .operator-permission-list strong, .backup-schedule-status b) { color: #e0eee2 !important; }
html[data-theme="dark"] :is(.contact-last-sent .contact-last-sent-label, .contact-last-sent time, .broadcast-history-numbers b, .meta-template-card small, .meta-template-card p, .operator-permission-list small, .broadcast-ai-note small, .broadcast-shared-attachment small) { color: #b8cbb9; }
html[data-theme="dark"] :is(.broadcast-status, .backup-source, .broadcast-sent-indicator) { color: #c6e9c3; background: #2e4934; }
html[data-theme="dark"] .broadcast-status.is-cancelled { color: #ffb2bf; background: #462b34; }
html[data-theme="dark"] .broadcast-status.is-queued { color: #ffda94; background: #443822; }
html[data-theme="dark"] .broadcast-history-item.is-legacy { background: #253128; }
html[data-theme="dark"] .broadcast-monitor { border-color: #416449; color: var(--ink); background: rgba(30, 47, 35, .97); }
html[data-theme="dark"] .broadcast-monitor small { color: #bfeab0; }
html[data-theme="dark"] .operator-conversation-item .conversation-copy .triage-list-label { color: #ffb5d8; background: #43283a; }
html[data-theme="dark"] :is(.conversation-flag-indicator.flag-urgent, .conversation-flag-label.flag-urgent, .flag-option.flag-urgent, .contact-flag-button.flag-urgent) { color: #ffa8b7 !important; border-color: #8a5060; background: #462b35; }
html[data-theme="dark"] :is(.conversation-flag-indicator.flag-document_pending, .conversation-flag-label.flag-document_pending, .flag-option.flag-document_pending, .contact-flag-button.flag-document_pending) { color: #ffb4d3 !important; border-color: #825267; background: #432b39; }
html[data-theme="dark"] :is(.conversation-flag-indicator.flag-follow_up, .conversation-flag-label.flag-follow_up, .flag-option.flag-follow_up, .contact-flag-button.flag-follow_up) { color: #ffd497 !important; border-color: #8a6b3c; background: #453723; }
html[data-theme="dark"] :is(.conversation-flag-indicator.flag-candidate, .conversation-flag-label.flag-candidate, .flag-option.flag-candidate, .contact-flag-button.flag-candidate) { color: #a9e5fc !important; border-color: #4d7d8b; background: #263f49; }
html[data-theme="dark"] :is(.conversation-flag-indicator.flag-company, .conversation-flag-label.flag-company, .flag-option.flag-company, .contact-flag-button.flag-company) { color: #c2edaa !important; border-color: #597b4d; background: #2d4530; }
html[data-theme="dark"] :is(.conversation-flag-indicator.flag-new_client, .conversation-flag-label.flag-new_client, .flag-option.flag-new_client, .contact-flag-button.flag-new_client) { color: #d6bdff !important; border-color: #786391; background: #3b304e; }
html[data-theme="dark"] :is(.custom-permission-summary, .role-pill.role-superadmin) { color: #dfc0ff !important; background: #3c3150; }
html[data-theme="dark"] .role-pill.role-manager { color: #b7dcff !important; background: #2b4052; }
html[data-theme="dark"] .role-pill.role-operator { color: #c7eba8 !important; background: #30452f; }
html[data-theme="dark"] :is(.info-banner, .backup-safety-note) { border-color: #4f704e; color: #d4f0be; background: #2a432e; }
html[data-theme="dark"] .toast { color: #f1f8f1; background: #273b2c; }
html[data-theme="dark"] .toast.error { color: #fff; background: #a52f47; }
html[data-theme="dark"] .operator-messages::-webkit-scrollbar-track, html[data-theme="dark"] .contact-modal::-webkit-scrollbar-track { background: #223329; }
html[data-theme="dark"] .operator-messages::-webkit-scrollbar-thumb, html[data-theme="dark"] .contact-modal::-webkit-scrollbar-thumb { border-color: #223329; background: #69816e; }

/* Small controls and previews that use fixed light colors in the base theme. */
html[data-theme="dark"] :is(.emoji-palette button, .emoji-categories button, .operator-emoji-preview, .composer-media-preview, .quick-reply-thumb b, .private-chat-context, .support-ticket-back, .broadcast-sent-toggle-indicator, .broadcast-detail-attachment) { border-color: #405846; color: #e3eee5; background: #283b2e; }
html[data-theme="dark"] :is(.emoji-categories button.active, .emoji-catalog-grid button:hover, .emoji-catalog-grid button:focus-visible, .broadcast-contact-context-menu > button.active, .meta-window-choice-card:hover, .meta-window-choice-card:focus-visible, .variable-chip:hover) { border-color: #8cc66f; color: #e7f9df; background: #31513a; }
html[data-theme="dark"] .emoji-search > span { color: #adbfaf; }
html[data-theme="dark"] .quick-reply-row { border-color: #3c5142; }
html[data-theme="dark"] .quick-reply-item small { color: #b6c9b9; }
html[data-theme="dark"] .quick-reply-actions button { color: #c9dccd !important; }
html[data-theme="dark"] .quick-reply-actions button:hover { color: #d7f8cf !important; background: #35543c !important; }
html[data-theme="dark"] .quick-reply-actions button:last-child:hover { color: #ffbdcb !important; background: #472d38 !important; }
html[data-theme="dark"] .quick-reply-create { border-color: #405846 !important; color: #b8e69c !important; }
html[data-theme="dark"] :is(.status-badge.private, .conversation-context-menu .flag-none) { border-color: #6a5984; color: #dec8fa; background: #392f4a; }
html[data-theme="dark"] .broadcast-contact-context-menu > small { color: #b7c9ba; }
html[data-theme="dark"] .broadcast-detail-section h3 { color: #e8f3ea; }
html[data-theme="dark"] .broadcast-detail-variations small { color: #bce995; }
html[data-theme="dark"] .broadcast-detail-recipients > span { border-color: #3d5443; }
