/* Resolved dark mode only. Keep light mode and sender party colours intact. */
:root[data-theme="dark"]{color-scheme:dark;background:#000!important;color:#f5f5f5!important;--uc-bg:#000!important;--uc-surface:#000!important;--uc-field:#000!important;--uc-ink:#f5f5f5!important;--uc-muted:#c7c7c7!important;--uc-line:#555!important;--uc-brand:#245479!important;--uc-focus:#9dccff!important;--ct-surface:#000!important;--ct-chat:#000!important;--ct-ink:#f5f5f5!important;--ct-chat-ink:#f5f5f5!important;--ct-muted:#c7c7c7!important;--ct-link:#9dccff!important;--cs-bg:#000!important;--cs-surface:#000!important;--cs-ink:#f5f5f5!important;--cs-muted:#c7c7c7!important;--cs-border:#555!important;--cs-soft:#181818!important;--cs-pattern:none!important;--cs-accent:#9dccff!important}
:root[data-theme="dark"] body.flat-directory{--flat-surface:#000!important;--flat-rail:#000!important;--flat-fill:#000!important;--flat-ink:#f5f5f5!important;--flat-muted:#c7c7c7!important;--flat-soft:#181818!important;--flat-line:#555!important}
:root[data-theme="dark"] body,:root[data-theme="dark"] body.room-directory .shell,:root[data-theme="dark"] body.room-directory :is(.topbar,.layout,.rooms,.chat,.messages,.flat-rail,.flat-list-tools,.flat-list-footer,.customer-directory,.customer-consult-tools,.work-menu-shell,#customerConsultSidebar,#customerConsultFolder,#messages){background:#000!important;background-image:none!important;color:#f5f5f5}
:root[data-theme="dark"] body.room-directory #customerConsultSidebar#customerConsultSidebar>header,:root[data-theme="dark"] body.room-directory #customerConsultSidebar#customerConsultSidebar .customer-directory>header{background:#000!important;color:#f5f5f5!important}
:root[data-theme="dark"] body.room-directory #customerConsultSidebar#customerConsultSidebar>header :is(h2,button),:root[data-theme="dark"] body.room-directory #customerConsultSidebar#customerConsultSidebar .customer-directory>header h2{color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory :is(dialog,.compact-chat-menu-panel,.personal-style-dialog){background-color:#000!important;color:#f5f5f5!important;border-color:#777!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory dialog article{background:#000!important;border-color:#666!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory dialog :is(h1,h2,h3,p,b,strong,label,legend,summary,span,small){color:inherit!important;-webkit-text-fill-color:currentColor!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory dialog>p{color:#c7c7c7!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory :is(button,input,textarea,select){background-color:#000!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important;border-color:#727272!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory :is(input,textarea)::placeholder{color:#bfbfbf!important;-webkit-text-fill-color:#bfbfbf!important;opacity:1!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory button:disabled{color:#b0b0b0!important;-webkit-text-fill-color:#b0b0b0!important;border-color:#454545!important;opacity:1!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory button:not(:disabled):hover{background-color:#181818!important}
:root[data-theme="dark"][data-chat-style] body.flat-directory :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid #9dccff!important;outline-offset:2px!important}
:root[data-theme="dark"] body.flat-directory dialog .dialog-error,:root[data-theme="dark"] body.flat-directory dialog [role="alert"]{color:#ffb4ab!important;-webkit-text-fill-color:#ffb4ab!important}

:root[data-theme="dark"][data-chat-style] body #composer#composer#composer button{background:#000!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important}

/* A one-pixel inner edge separates a black app from a black desktop. */
:root[data-theme="dark"][data-window-edge="outer"]::after{content:"";position:fixed;inset:0;border:1px solid #626262;pointer-events:none;z-index:2147483647;box-sizing:border-box}
:root[data-theme="dark"] body{--cs-paper:#000!important;--cs-panel:#000!important;--cs-line:#555!important;--cs-ink:#f5f5f5!important;--cs-muted:#c7c7c7!important}
:root[data-theme="dark"] body :is(.customer-purchases,.purchase-list,.purchase-head,.purchase-card){background:#000!important;color:#f5f5f5!important;border-color:#555!important}
:root[data-theme="dark"] body .customer-purchases :is(.purchase-scope,[role="status"],small){color:#c7c7c7!important}
:root[data-theme="dark"] body .customer-purchases :is(a,summary){color:#9dccff!important}
:root[data-theme="dark"] body .customer-purchases :is(input,button,select){background:#000!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important;border-color:#666!important}
:root[data-theme="dark"] body .customer-purchases iframe{background:#000!important;border-color:#555!important;color-scheme:dark}

/* Pair control backgrounds and ink in the directory and embedded conversation alike. */
:root[data-theme="dark"] body :is(button,input,textarea,select){background-color:#000!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important;border-color:#727272!important}
:root[data-theme="dark"] body :is(input,textarea)::placeholder{color:#bfbfbf!important;-webkit-text-fill-color:#bfbfbf!important;opacity:1!important}
:root[data-theme="dark"] body button:disabled{color:#b0b0b0!important;-webkit-text-fill-color:#b0b0b0!important;opacity:1!important}
:root[data-theme="dark"] body button:not(:disabled):hover{background-color:#181818!important}
:root[data-theme="dark"] body :is(button,input,textarea,select,a,summary):focus-visible{outline:2px solid #9dccff!important;outline-offset:2px!important}
:root[data-theme="dark"] body :is(button,input,textarea,select) :is(span,strong,small,b,i){color:inherit!important;-webkit-text-fill-color:currentColor!important}
/* Bubble ink intentionally remains dark on pale company/customer bubbles. */
:root[data-theme="dark"] body #messages#messages :is(.message-bubble,.bubble) :is(button.long-message-toggle,button.reply-preview){background:#181818!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important;border:1px solid #727272!important;opacity:1!important}
:root[data-theme="dark"] body #messages#messages :is(.message-bubble,.bubble) :is(button.long-message-toggle,button.reply-preview):hover{background:#292929!important}
:root[data-theme="dark"] body #messages#messages :is(button.long-message-toggle,button.reply-preview) :is(span,strong,small,b,i){color:inherit!important;-webkit-text-fill-color:currentColor!important}
:root[data-theme="dark"] body :is(.chat-design-own-avatar,.room-avatar,.message-avatar){background-color:#181818!important;color:#c8e0ff!important;-webkit-text-fill-color:#c8e0ff!important}
:root[data-theme="dark"] body :is(#messageContextMenu,#contextMenu,#emojiPicker,.compact-chat-menu-panel,.personal-style-dialog){background:#000!important;color:#f5f5f5!important;border-color:#727272!important}
:root[data-theme="dark"] body :is(#messageContextMenu,#contextMenu,.compact-chat-menu-panel,dialog) :is(label,legend,h1,h2,h3,p,summary){color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important}

:root[data-theme="dark"] body dialog,:root[data-theme="dark"] body dialog article{background:#000!important;color:#f5f5f5!important;border-color:#727272!important}

:root[data-theme="dark"] body #composer#composer#composer button{background:#000!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important}
:root[data-theme="dark"] body #composer#composer#composer button:disabled{color:#b0b0b0!important;-webkit-text-fill-color:#b0b0b0!important;opacity:1!important}

:root[data-theme="dark"] body :is(.room-notice-bar,.reply-bar,.incoming-alert,#messageSearchPanel,.chat-style-preview,.chat-style-preview p){background:#000!important;color:#f5f5f5!important;border-color:#727272!important}
:root[data-theme="dark"] body :is(.room-notice-bar,.reply-bar,.incoming-alert,#messageSearchPanel,.chat-style-preview) :is(p,span,strong,small,label){color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important}

/* Editable fields sit a shade above the pure-black conversation surface. */
:root[data-theme="dark"]{--uc-field:#181818!important}
:root[data-theme="dark"] body.flat-directory{--flat-fill:#181818!important}
:root[data-theme="dark"] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]),textarea,select){background:#181818!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important;border-color:#555!important}
:root[data-theme="dark"] body #composer#composer#composer :is(input,textarea,select){background:#181818!important;color:#f5f5f5!important;-webkit-text-fill-color:#f5f5f5!important;border-color:#555!important}
:root[data-theme="dark"] body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]),textarea,select):focus{background:#202020!important;border-color:#86b8e8!important}
:root[data-theme="dark"] body #composer#composer#composer :is(input,textarea,select):focus{background:#202020!important;border-color:#86b8e8!important}
