/* Neutral dark surfaces shared by Master, Owner, client and authentication. Light rules untouched. */
html:root[data-theme=dark] body.up-body[data-user-template][data-page]{--up-bg:#0b0b0b!important;--mp-bg:#0b0b0b!important;--up-card:#161616!important;--mp-card:#161616!important;--up-text:#f3f4f6!important;--mp-text:#f3f4f6!important;--up-muted:#b6b6b6!important;--up-border:#393939!important;--mp-border:#393939!important;background:#0b0b0b!important}
html:root[data-theme=dark],body.dark{color-scheme:dark;--bg:#0b0b0b;--surface:#161616;--ink:#f3f4f6;--text:#f3f4f6;--muted:#b6b6b6;--border:#393939;--card:#161616;--body-bg:#0b0b0b;--card-bg:#161616;--blue-light:#242424;--primary:#80aaff;--shadow:0 10px 30px #0005;background:#0b0b0b!important;color:#f3f4f6!important}
html:root[data-theme=dark] :is(body,.owner-app,.owner-main,.main-shell,.page,.client-page,.v2-main,.app-main,.auth-page,.auth-shell,.mp-admin-body){background-color:#0b0b0b!important;background-image:none!important;color:#f3f4f6}
html:root[data-theme=dark] :is(.sidebar,.topbar,.owner-sidebar,.owner-topbar,.mp-side,.mp-mobile-head,.surface,.card,.iw-card,.drawer,.modal-content,.modal-body,.modal-header,.modal-footer,.command-dialog,.confirm-dialog,.content-studio-item,.content-studio-preview,.table-wrap,.table-scroll,.mc-modal,.mc-drawer,.mc-table-wrap,.gateway-card,.ticket-card,.login-card,.auth-card,.auth-box,dialog),body.dark :is(.sidebar,.topbar,.card,.modal,.table-wrap){background:#161616!important;background-image:none!important;color:#f3f4f6!important;border-color:#393939!important}
html:root[data-theme=dark] :is(input:not([type=color]),select,textarea,.action-menu,.dropdown-menu,.mc-menu nav,.mc-form,.mc-button,.icon-button,.icon-btn,.quiet-button,.table-scroll table,.admin-table th,.admin-table td,thead,tbody,tr,td,th){background-color:#1c1c1c!important;color:#f3f4f6!important;border-color:#393939!important}
html:root[data-theme=dark] :is(h1,h2,h3,h4,label,legend,.cell-title,.brand,.brand-name,.record-grid dd,.section-heading,.drawer-header){color:#f3f4f6!important}
html:root[data-theme=dark] :is(.muted,.subtitle,small,.page-footer,.workspace-footer,.record-grid dt,input::placeholder,textarea::placeholder){color:#b6b6b6!important}
html:root[data-theme=dark] :is(.sidebar a,.owner-sidebar a,.nav-item){color:#d4d4d4!important}
html:root[data-theme=dark] :is(.sidebar a[aria-current],.sidebar a.active,.owner-sidebar a.active,.sidebar a:hover,.owner-sidebar a:hover,tr:hover td){background-color:#292929!important;color:#fff!important}
html:root[data-theme=dark] :is(.button.primary,.btn-primary,.iw-primary,button[type=submit]){background-color:#315bd6!important;color:#fff!important;border-color:#6288f1!important}
html:root[data-theme=dark] :is(.notice,.alert,.iw-note){background:#242424;color:#eee;border-color:#555}
html:root[data-theme=dark] :focus-visible{outline:2px solid #a9c3ff;outline-offset:3px}
html:root[data-theme=dark] dialog::backdrop{background:#000b}
html:root[data-theme=dark] :is(.experience-stat,.experience-banner){background:var(--item-dark-background,#171717)!important;color:var(--item-dark-ink,#f3f4f6)!important}
html:root[data-theme=dark] body[data-user-template][data-page]{--mp-bg:#0b0b0b!important;--up-bg:#0b0b0b!important;--up-soft:#0b0b0b!important;--mp-soft:#0b0b0b!important;--up-login-background:#0b0b0b!important;--mp-card:#161616!important;--mpv2-card:#161616!important;--up-card:#161616!important;--up-surface:#161616!important;--up-header:#161616!important;--up-sidebar:#161616!important;--up-modal:#161616!important;--theme-footer:#161616!important;--up-selector:#242424!important;--up-field:#1c1c1c!important;--up-table-head:#242424!important;--mp-text:#f3f4f6!important;--up-text:#f3f4f6!important;--up-ink:#f3f4f6!important;--up-header-ink:#f3f4f6!important;--up-sidebar-ink:#f3f4f6!important;--theme-field-ink:#f3f4f6!important;--theme-table-ink:#f3f4f6!important;--theme-modal-ink:#f3f4f6!important;--theme-page-ink:#f3f4f6!important;--theme-footer-ink:#b6b6b6!important;--mp-muted:#b6b6b6!important;--up-muted:#b6b6b6!important;--mp-border:#393939!important;--up-border:#393939!important;--up-line:#393939!important;--up-field-line:#393939!important;--up-accent:#a9c3ff!important;--theme-bg-image:none!important;}
html:root[data-theme=dark] body[data-user-template][data-page] :is(.up-public-header,.up-public-nav,.up-auth-card,.up-auth-panel,.up-auth-form,.mpv2-sidebar,.mpv2-header,.mpv2-topbar,.mpv2-card,.up-modal,.up-workspace-panel,.experience-bottom-nav){background:#161616!important;background-image:none!important;color:#f3f4f6!important;border-color:#393939!important}
