/* Appearance is a local preference. Photos, video, emoji and QR pixels retain their colors. */
.sidebar-appearance { padding: 10px; display: grid; gap: 8px; }
.sidebar-appearance label { font-size: 11px; color: #c8bed8; }
.sidebar-appearance select { width: 100%; background: #30283f; color: #f5f0ff; border-color: #79698b; min-height: 44px; font-size: 12px; }
.appearance-settings select { width: 100%; min-height: 44px; }
.appearance-settings .input-help { margin-top: 9px; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #17141f; --ink: #f0edf7; --muted: #b7adc6; --line: #494054;
  --forest: #e1d5fa; --forest-deep: #13101b; --green: #c6b4ff;
  --mint: #35284a; --mint-pale: #2b2339; --danger: #ffacb7;
  --heyjo-violet: #7659de; --heyjo-violet-dark: #6850c4;
  --surface: #211d2a; --surface-raised: #2b2536; --surface-hover: #382e46;
  --accent-text: #c6b4ff; --warning-bg: #3a2d1d; --warning-text: #f0c68a;
}
:root[data-theme="dark"] :is(.chat-header,.chat-toolbar,.chat-library-panel,.chat-info-panel,.message-bubble,.content-card,.composer,.composer-tray,.message-action-panel,.dialog,.tag-result) { background: var(--surface); border-color: var(--line); color: var(--ink); }
:root[data-theme="dark"] :is(.composer-tray,.message-action-panel,.dialog) { box-shadow: 0 16px 45px #0005; }
:root[data-theme="dark"] .dialog::backdrop { background: #090710b3; }
:root[data-theme="dark"] .message.own .message-bubble { background: #35284a; border-color: #5b4574; }
:root[data-theme="dark"] :is(.chat-heading>p,.chat-empty p,.message-bottom,.message-fingerprint,.message-status,.message-action-panel .message-fingerprint,.date-divider,.composer-meta,.chat-mode-label,.dialog p,.dialog-eyebrow,.dialog label,.field-help,.input-help,.field-caption,.library-heading p,.chat-info-panel>p,.start-content>p,.start-content>.text-button,.eyebrow,.start-facts div>span:last-child,.prototype-footer,.relay-details summary,.tag-result-labels,.card-caption,.vote-details,.content-card .content-label,.content-card .card-progress,.history-navigation span,.satellite-candidates span,.device-row small,.dialog .settings-caution,.dialog .profile-context,.fatal-view p,.composer-studio span,.content-tools button small) { color: var(--muted); }
:root[data-theme="dark"] :is(.icon-button,.message-actions>summary,.message-tags .tag-add,.workspace-toggle,.composer-studio button,.content-tools button,.content-tools button>svg,.tag-result-open,.message-context-link,.fact-symbol,.chat-header>.mobile-menu,.text-button) { color: var(--accent-text); }
:root[data-theme="dark"] .text-button { text-decoration-color: #8874b0; }
:root[data-theme="dark"] .text-button:hover { color: #ece1ff; }
:root[data-theme="dark"] :is(.button-secondary,.content-tools button,.content-card .card-action,.card-action,.tag-context,.date-divider,.conversation-notice,.content-filters,.fingerprint-card,.caution-card,.invited-room,.relay-destinations li,.hub-stats>div,.hub-cards article,.fun-compose,.device-row,.pair-code,.hub-task,.pair-guide,.spark-button,.prototype-footer,.local-suggestion,.composer-add) { background: var(--surface-raised); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] :is(.fingerprint-card>span,.caution-card p,.local-suggestion button,.local-suggestion .suggestion-dismiss,.hub-stats strong,.fingerprint-card>strong) { color: var(--accent-text); }
:root[data-theme="dark"] :is(.chat-avatar,.sender-avatar,.large-avatar,.empty-icon) { background: #3c2f52; color: #e0ceff; }
:root[data-theme="dark"] :is(.button-secondary:hover:not(:disabled),.content-tools button:hover,.content-card .card-action:hover,.card-action:hover:not(:disabled),.message-actions>summary:hover,.message-actions[open]>summary,.message-tags .tag-add:hover,.icon-button:hover,.workspace-toggle:hover,.composer-add:hover,.composer-add[aria-expanded=true],.suggestion-dismiss:hover) { background: var(--surface-hover); color: var(--ink); border-color: #79698b; }
:root[data-theme="dark"] :is(.workspace-toggle[aria-expanded=true],.content-filters button[aria-pressed=true],.hub-tabs button[aria-selected=true],.card-action.checked,.content-card .card-action.checked) { background: #43325b; color: #efe6ff; border-color: #a48acc; }
:root[data-theme="dark"] :is(.content-filters button,.hub-tabs button) { color: var(--muted); }
:root[data-theme="dark"] :is(.chat-filter-state,.reply-reference,.reply-draft) { background: #31263f; color: #e0cfff; border-color: #ab8cdd; }
:root[data-theme="dark"] .chat-filter-state button { color: #e0cfff; }
:root[data-theme="dark"] .chat-info-panel .conversation-notice { background: none; color: var(--muted); }
:root[data-theme="dark"] :is(.message-tags .tag-chip,.tag-chip.shared,.reaction-chip) { background: #33283f; color: #decbf7; border-color: #6e567e; }
:root[data-theme="dark"] .reaction-chip[aria-pressed=true] { background: #493064; color: #f2e8ff; border-color: #bb99f3; }
:root[data-theme="dark"] :is(.message-tags .tag-chip.private,.tag-chip.private) { background: #3a301e; color: #efda9a; border-color: #8c7950; }
:root[data-theme="dark"] :is(.tag-add,.message-removed) { color: var(--muted); border-color: #79698b; }
:root[data-theme="dark"] .message-removed { background: var(--surface-raised); }
:root[data-theme="dark"] .message-actions .message-delete { color: var(--danger); }
:root[data-theme="dark"] :is(.dialog input:not([type=checkbox]):not([type=radio]),.dialog textarea,.dialog select,.tag-filter-bar select,select) { background: #191620; color: var(--ink); border-color: #79698b; }
:root[data-theme="dark"] .dialog input::placeholder,
:root[data-theme="dark"] .dialog textarea::placeholder,
:root[data-theme="dark"] .composer textarea::placeholder { color: #aca0bb; }
:root[data-theme="dark"] :is(.composer:focus-within,.dialog input:focus,.dialog textarea:focus) { border-color: #c4a3ff; box-shadow: 0 0 0 3px #ab85ef26; }
:root[data-theme="dark"] :is(button,a,summary,input,textarea,select):focus-visible { outline-color: #c4a3ff; }
:root[data-theme="dark"] .send-button:disabled { background: #3b324b; color: #b9a9cc; }
:root[data-theme="dark"] :is(.outbox-notice,.invalid-notice) { background: var(--warning-bg); color: var(--warning-text); border-color: #806541; }
:root[data-theme="dark"] :is(.outbox-notice .text-button,.message-status.pending,.chat-heading>p.offline,.business-badge) { color: var(--warning-text); }
:root[data-theme="dark"] .dialog .form-error { background: #42232c; color: #ffb8c0; border-color: #875062; }
:root[data-theme="dark"] :is(.dialog fieldset,.dialog .relay-details,.satellite-candidates li,.history-navigation,#network-dialog hr) { border-color: var(--line); }
:root[data-theme="dark"] .date-divider:before,:root[data-theme="dark"] .date-divider:after { background: var(--line); }
:root[data-theme="dark"] .messages-scroll { scrollbar-color: #675477 transparent; }
:root[data-theme="dark"] .message.message-context-target { background: #daf9751a; box-shadow: 0 0 0 8px #daf9751a; outline-color: #bad866; }
:root[data-theme="dark"] .message.message-context-target>:is(.message-bubble,.content-card) { border-color: #bad866; }
:root[data-theme="dark"] .toast { background: #342b43; color: var(--ink); border-color: #9276b4; }
:root[data-theme="dark"] .dark-brand { color: var(--ink); }
:root[data-theme="dark"] .noscript-notice { background: var(--paper); color: var(--ink); }
/* QR quiet zones must remain white and scannable in both modes. */
.cyfy-qr { color-scheme: light; background: #fff; }
@media (forced-colors: active) { .cyfy-qr { forced-color-adjust: none; } }
