/* CoolTechAir Unified Theme v20260629b */
:root{
  --cta-navy:#07182e;--cta-navy-2:#102947;--cta-blue:#1473e6;--cta-cyan:#14b8d4;
  --cta-green:#129766;--cta-amber:#e9a319;--cta-red:#dc4545;--cta-ink:#152238;
  --cta-muted:#66768b;--cta-line:#dbe5ef;--cta-soft:#f3f7fb;--cta-white:#fff;
  --cta-shadow:0 8px 24px rgba(15,45,76,.07);--cta-radius:8px;--cta-control-radius:6px;
}
html.cooltech-theme,html.cooltech-theme body{letter-spacing:0!important}
html.cooltech-theme body{
  font-family:'Sarabun','Noto Sans Thai',Tahoma,Arial,sans-serif!important;
  color:var(--cta-ink);
}
html.cooltech-theme:not(.theme-public) body{background:var(--cta-soft)}
html.cooltech-theme h1,html.cooltech-theme h2,html.cooltech-theme h3,
html.cooltech-theme h4,html.cooltech-theme h5,html.cooltech-theme h6,
html.cooltech-theme .page-title,html.cooltech-theme .card-title{
  font-family:'Kanit','Sarabun',sans-serif;letter-spacing:0!important;
}
html.cooltech-theme :where(.card,.panel,.content-card,.section-card,.stat-card,.summary-card,.filter-card,
.detail-panel,.detail-stat,.round-card,.category-card,.profile-card,.receipt-card,.equipment-card,
.module-hero,.summary-metric-card,.sidebar-card,.pcard,.modal-content,.alert,.notice){
  border-radius:var(--cta-radius)!important;
}
html.cooltech-theme :where(.card,.panel,.content-card,.section-card,.stat-card,.summary-card,.filter-card,
.detail-panel,.profile-card,.receipt-card,.equipment-card):not(.no-theme-surface){
  border-color:var(--cta-line);
}
html.cooltech-theme :where(.btn,button,input[type=button],input[type=submit],input[type=reset]){
  border-radius:var(--cta-control-radius)!important;letter-spacing:0!important;
}
html.cooltech-theme :where(.form-control,.form-select,.field,.pub-input,input[type=text],input[type=search],
input[type=email],input[type=password],input[type=tel],input[type=number],input[type=date],input[type=datetime-local],textarea,select){
  border-radius:var(--cta-control-radius)!important;letter-spacing:0!important;
}
html.cooltech-theme :where(.form-control,.form-select,.field,.pub-input,input,textarea,select):focus{
  border-color:var(--cta-blue)!important;box-shadow:0 0 0 3px rgba(20,115,230,.11)!important;outline:0;
}
html.cooltech-theme :where(.btn-primary,.pub-btn.primary,.btn.primary){
  background:var(--cta-blue)!important;border-color:var(--cta-blue)!important;color:#fff!important;
  box-shadow:none!important;
}
html.cooltech-theme :where(.btn-primary,.pub-btn.primary,.btn.primary):hover{background:#0d63c8!important}
html.cooltech-theme :where(.btn-success){background:var(--cta-green)!important;border-color:var(--cta-green)!important}
html.cooltech-theme :where(.btn-warning){background:var(--cta-amber)!important;border-color:var(--cta-amber)!important;color:#172033!important}
html.cooltech-theme :where(.btn-danger){background:var(--cta-red)!important;border-color:var(--cta-red)!important}
html.cooltech-theme :where(table,.table){border-color:var(--cta-line)}
html.cooltech-theme :where(table,.table) th{
  color:#5e7086;background:#f1f5f9;border-color:var(--cta-line);font-weight:700;letter-spacing:0!important;
}
html.cooltech-theme :where(table,.table) td{border-color:#e8eef4}
html.cooltech-theme :where(.badge,.pill,.chip,.equipment-pill,.round-status,.priority-badge){border-radius:5px!important}
html.cooltech-theme ::selection{color:#fff;background:var(--cta-blue)}
html.cooltech-theme *{scrollbar-width:thin;scrollbar-color:#b8c7d6 transparent}
html.cooltech-theme *::-webkit-scrollbar{width:7px;height:7px}
html.cooltech-theme *::-webkit-scrollbar-thumb{background:#b8c7d6;border-radius:8px}
html.cooltech-theme *::-webkit-scrollbar-track{background:transparent}

/* Shared internal application surfaces */
html.theme-admin .admin-content,
html.theme-technician body,
html.theme-customer body,
html.theme-qr body,
html.theme-dev body{background:var(--cta-soft)}
html.theme-admin .admin-sidebar,
html.theme-technician .tech-shell-nav,
html.theme-customer .customer-topnav,
html.theme-qr .qr-shell-nav{background:var(--cta-navy)!important}
html.theme-admin .admin-topbar,
html.theme-technician .tech-shell-links,
html.theme-customer .customer-quick-nav{border-color:var(--cta-line)!important}
html.theme-technician .tech-shell-links,
html.theme-customer .customer-quick-nav{background:#fff!important}
html.theme-technician .tech-shell-links a,
html.theme-customer .customer-quick-nav a{border-radius:6px!important;color:#53657b!important}
html.theme-technician .tech-shell-links a.active,
html.theme-technician .tech-shell-links a:hover,
html.theme-customer .customer-quick-nav a.active,
html.theme-customer .customer-quick-nav a:hover{
  color:var(--cta-blue)!important;background:#eaf3ff!important;
}
html.theme-technician .tech-shell-icon,
html.theme-customer .customer-brand-icon,
html.theme-qr .qr-shell-icon,
html.theme-public .public-brand-mark{
  border-radius:7px!important;background:linear-gradient(145deg,var(--cta-blue),var(--cta-cyan))!important;
}
html.theme-qr .qr-shell-actions a{border-radius:6px!important}
html.theme-auth body{background:linear-gradient(145deg,#edf7fc,#f8fbfd)!important}
html.theme-auth :where(.login-card,.auth-card,.register-card,.otp-card,.reset-card){
  border-radius:8px!important;border:1px solid var(--cta-line)!important;box-shadow:var(--cta-shadow)!important;
}
html.theme-dev :where(.dev-shell,.portal-shell,.dashboard-shell){border-radius:8px!important}
html.theme-public :where(.public-nav,.public-hero,.pub-section,.pub-card){border-radius:8px!important}

/* Consistent responsive density */
@media(max-width:900px){
  html.cooltech-theme :where(.container,.page-container,.content-wrapper){max-width:100%}
  html.cooltech-theme :where(.card-body,.panel-body,.section-body){padding:14px}
  html.cooltech-theme :where(.btn,button){min-height:34px}
}
@media(max-width:520px){
  html.cooltech-theme :where(.card,.panel,.content-card,.section-card,.stat-card){border-radius:7px!important}
  html.cooltech-theme :where(.btn,button){font-size:12px}
}
@media print{
  html.cooltech-theme body{background:#fff!important;color:#000!important}
  html.cooltech-theme :where(.card,.panel,.content-card,.section-card,.receipt-card){
    box-shadow:none!important;background:#fff!important;border-color:#bbb!important;
  }
  html.cooltech-theme .admin-sidebar,
  html.cooltech-theme .admin-topbar,
  html.cooltech-theme .tech-shell-nav,
  html.cooltech-theme .customer-topnav,
  html.cooltech-theme .customer-quick-nav,
  html.cooltech-theme .qr-shell-nav{display:none!important}
}
/* STABLE_PROFILE_AVATARS_20260629 */
html.cooltech-theme :where(.user-avatar,.tech-shell-avatar,.customer-user-avatar,.profile-avatar,.topbar-user .user-avatar){
  aspect-ratio:1!important;flex-shrink:0!important;overflow:hidden!important;contain:layout paint;
}
html.cooltech-theme :where(.user-avatar,.tech-shell-avatar,.customer-user-avatar,.profile-avatar,.topbar-user .user-avatar) img{
  width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;
  object-fit:cover!important;object-position:center!important;display:block!important;
}

/* ─────────────────────────────────────────────────────────────────────────
   DARK THEME SYSTEM (Antigravity Light/Dark Mode Functionality)
   ───────────────────────────────────────────────────────────────────────── */

html[data-theme="dark"]:not(.theme-force-dark) {
  /* Unified UI Variables */
  --cta-navy: #090d16;
  --cta-navy-2: #111827;
  --cta-blue: #3b82f6;
  --cta-cyan: #06b6d4;
  --cta-green: #10b981;
  --cta-amber: #f59e0b;
  --cta-red: #ef4444;
  --cta-ink: #f1f5f9;
  --cta-muted: #94a3b8;
  --cta-line: #2d3748;
  --cta-soft: #0f172a;
  --cta-white: #1e293b;
  --cta-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);

  /* Admin Header Variables */
  --page-bg: #0b0f19;
  --card-bg: #111827;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #1e293b;

  /* Dashboard Theme Variables */
  --da-bg: #0b0f19;
  --da-surface: #111827;
  --da-surface-soft: #0f172a;
  --da-border: #1e293b;
  --da-border-soft: #182235;
  --da-ink: #f1f5f9;
  --da-muted: #94a3b8;
  --da-faint: #64748b;
  --da-primary: #3b82f6;
  --da-primary-dark: #1d4ed8;
  --da-primary-soft: rgba(59, 130, 246, 0.15);
  --da-success: #10b981;
  --da-warning: #f59e0b;
  --da-danger: #ef4444;
  --da-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  --da-shadow-soft: 0 3px 12px rgba(0, 0, 0, .2);

  /* Public Theme Variables */
  --pub-navy: #090d16;
  --pub-navy2: #111827;
  --pub-blue: #3b82f6;
  --pub-cyan: #06b6d4;
  --pub-green: #10b981;
  --pub-amber: #f59e0b;
  --pub-ink: #f1f5f9;
  --pub-muted: #94a3b8;
  --pub-line: #1e293b;
  --pub-soft: #0b0f19;
  --pub-white: #111827;

  /* Technician Theme Variables */
  --tech-sidebar-bg: #090d16;
  --tech-sidebar-surface: #111827;
  --tech-sidebar-text: #94a3b8;
  --tech-page-bg: #0b0f19;
  --tech-border: #1e293b;

  /* Customer Theme Variables */
  --customer-sidebar-bg: #090d16;
  --customer-sidebar-surface: #111827;
  --customer-sidebar-text: #94a3b8;
  --customer-sidebar-active: #1e293b;
  --customer-sidebar-accent: #3b82f6;

  /* Local variables for standalone views */
  --bg: #0b0f19;
  --card: #111827;
  --border: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --soft: #0d1527;
  --navy: #090d16;
  --navy2: #111827;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --green: #10b981;
  --amber: #f59e0b;
  --ink: #f1f5f9;
  --line: #1e293b;
  --white: #111827;
  
  scrollbar-color: #475569 transparent;
}

/* Scrollbars in Dark Mode */
html[data-theme="dark"]:not(.theme-force-dark) *::-webkit-scrollbar-thumb {
  background: #475569;
}

/* Page Layout Backgrounds */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  body, .admin-content, .tech-workspace, .customer-public-nav, .customer-public-links,
  .customer-sidebar, .tech-sidebar, .admin-sidebar, .care-band, .assurance, .public-main,
  .customer-mobile-bar, .tech-mobile-bar, dialog, dialog::backdrop, .hero-shell::before
) {
  background-color: var(--cta-soft) !important;
  color: var(--cta-ink) !important;
}

/* Card Surface Dark Theme overrides */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .pub-card, .detail-item,
  .card, .panel, .content-card, .section-card, .stat-card, .summary-card, .filter-card,
  .detail-panel, .detail-stat, .round-card, .category-card, .profile-card, .receipt-card,
  .equipment-card, .module-hero, .summary-metric-card, .sidebar-card, .pcard, .modal-content,
  .notice, .dialog-section, .weather-strip, .metric, .summary-item, .contact-cell,
  .history-panel, .cp-asset, .record-cell, .announcement, .pane, .rooms-pane, .news-pane,
  .news-scroll, .conversation-head, .messages, .send-area, .dialog-head, .dialog-body,
  .mobile-record, .finance-group, .work-panel, .job-card, .focus-job, .care-step,
  .shop-item, .shop-card, .promo-box, .identity-head, .crm-form, .finance-list,
  .history-list, .room-list, .room-item, .msg, .bubble, .announcement-meta, .check-row,
  .multi-users, .form-stack, .room-search, .send-form, .dialog-action, .record-top,
  .record-grid, .finance-grid, .finance-group, .finance-list, .finance-row, .legacy-customer,
  .legacy-head, .contact-band, .legacy-metrics, .history-tools, .history-search, .history-item,
  .history-date, .history-main, .history-extra, .customer-hub, .hub-head, .hub-actions,
  .filter-actions, .hub-metrics, .c360-head, .identity-head, .summary, .sum-icon,
  .c360-layout, .side-stack, .info-list, .info-row, .crm-form, .data-tabs, .section-head,
  .table-shell, .data-table, .row-link, .mobile-data, .mobile-record, .cp-container,
  .cp-head, .cp-actions, .cp-metrics, .cp-layout, .cp-stack, .cp-form, .cp-assets, .cp-list,
  .quick-nav, .chat-bar, .rooms-pane, .news-pane, .chat-pane, .topnav, .weather-strip, .wcard
) {
  background-color: var(--cta-white) !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}

/* Headers & Toolbars background */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .panel-title, .data-tabs, .data-table th, .table th, .work-toolbar, .job-actions,
  .conversation-head, .news-pane h3, .finance-group h3, .pane-head, .section-head,
  .c360-head, .workspace-head, .history-tools, .cp-head, .topnav
) {
  background-color: var(--cta-navy-2) !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}

/* Input Fields Dark Theme overrides */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  input, select, textarea, .form-control, .form-select, .field, .pub-input,
  .crm-form input, .crm-form select, .field input, .field select, .room-search input,
  .send-form textarea, .public-search input, .cp-asset input
) {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(input, select, textarea)::placeholder {
  color: #64748b !important;
}

/* Text elements & headings overrides (prevents text vanishing) */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .pub-faq summary, .pub-list-item p,
  strong, h1, h2, h3, h4, h5, h6, .page-title, .card-title,
  .brand-name, .brand-icon, .user-name, .room-name,
  .brand-copy strong, .profile-copy strong, .user-info strong,
  .c360-head h1, .history-tools h2, .dialog-head h2, .section-head h2,
  .pane-title, .panel-title, .summary-item strong, .metric strong,
  .stat-card strong, .job-title strong, .focus-job h2, .info-row strong,
  .record-cell strong, .contact-cell strong, .announcement strong,
  .main-text, .weather-temp, .weather-detail strong, .tech-side-brand-copy strong,
  .tech-side-profile-copy strong, .customer-brand-copy strong, .customer-profile-copy strong,
  .brand-name span, .cp-name, .history-date strong, .history-main strong,
  .news-pane h3, .finance-group h3, .weather-strip strong
) {
  color: var(--cta-ink) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  small, span, p, label, .sub-text, .text-secondary, .stat-label,
  .nav-section-label, .pane-count, .room-preview, .msg-time, .announcement-meta,
  .history-date span, .history-main span, .history-detail, .record-cell span,
  .contact-cell small, .metric small, .summary-item small, .info-row span,
  .weather-desc, .weather-detail small, .weather-loading, .focus-meta span,
  .job-title span, .job-info span, .result-line, .empty span, .cp-key, .cp-badge.off
) {
  color: var(--cta-muted) !important;
}

/* Tables Dark Theme overrides */
html[data-theme="dark"]:not(.theme-force-dark) :where(table, .table, .data-table) {
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(table, .table, .data-table) th {
  background-color: #0f172a !important;
  color: var(--cta-muted) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(table, .table, .data-table) td {
  border-color: var(--cta-line) !important;
  color: var(--cta-ink) !important;
  background-color: transparent !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(table, .table, .data-table) tbody tr:hover td {
  background-color: #1e293b !important;
}

/* Sidebar and Navigation links overrides in dark mode */
html[data-theme="dark"]:not(.theme-force-dark) .admin-sidebar,
html[data-theme="dark"]:not(.theme-force-dark) .tech-sidebar,
html[data-theme="dark"]:not(.theme-force-dark) .customer-sidebar {
  background: var(--cta-navy) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .admin-sidebar a,
html[data-theme="dark"]:not(.theme-force-dark) .tech-sidebar a,
html[data-theme="dark"]:not(.theme-force-dark) .customer-sidebar a {
  color: var(--cta-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .admin-sidebar a:hover,
html[data-theme="dark"]:not(.theme-force-dark) .tech-sidebar a:hover,
html[data-theme="dark"]:not(.theme-force-dark) .customer-sidebar a:hover {
  background: var(--cta-navy-2) !important;
  color: #fff !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .admin-sidebar a.active,
html[data-theme="dark"]:not(.theme-force-dark) .tech-sidebar a.active,
html[data-theme="dark"]:not(.theme-force-dark) .customer-sidebar a.active {
  background: rgba(59, 130, 246, 0.2) !important;
  color: var(--cta-blue) !important;
}

/* Topbar override */
html[data-theme="dark"]:not(.theme-force-dark) .admin-topbar {
  background: var(--cta-white) !important;
  border-color: var(--cta-line) !important;
}

/* Buttons style corrections */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .cbtn, .wbtn, .btn:not(.btn-primary):not(.btn-success):not(.btn-warning):not(.btn-danger),
  .pub-btn:not(.primary), .data-tab, .filter-tab, .bar-btn:not(.primary), .icon-btn,
  .quick-nav a, .hub-btn:not(.primary), .lbtn:not(.primary), .detail-toggle, .row-link
) {
  background-color: #1e293b !important;
  color: var(--cta-ink) !important;
  border-color: #334155 !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .cbtn:hover, .wbtn:hover, .btn:not(.btn-primary):not(.btn-success):not(.btn-warning):not(.btn-danger):hover,
  .pub-btn:not(.primary):hover, .data-tab:hover, .filter-tab:hover, .bar-btn:not(.primary):hover,
  .icon-btn:hover, .quick-nav a:hover, .hub-btn:not(.primary):hover, .lbtn:not(.primary):hover,
  .detail-toggle:hover, .row-link:hover, .pub-card:hover, .detail-item:hover
) {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #fff !important;
}

/* Active states for tabs / navigation links */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .data-tab.active, .filter-tab.active, .quick-nav a.active
) {
  background-color: rgba(59, 130, 246, 0.25) !important;
  color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

/* Auth Pages Dark Theme overrides */
html[data-theme="dark"]:not(.theme-force-dark).theme-auth :where(.auth-panel-right, .auth-wrap, .login-card, .auth-card, .register-card, .otp-card, .reset-card) {
  background-color: var(--cta-white) !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark).theme-auth :where(.input-auth, input) {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

/* Active quick nav & shell links */
html[data-theme="dark"]:not(.theme-force-dark).theme-technician .tech-shell-links,
html[data-theme="dark"]:not(.theme-force-dark).theme-customer .customer-quick-nav {
  background: var(--cta-white) !important;
}
html[data-theme="dark"]:not(.theme-force-dark).theme-technician .tech-shell-links a,
html[data-theme="dark"]:not(.theme-force-dark).theme-customer .customer-quick-nav a {
  color: var(--cta-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark).theme-auth body {
  background: var(--cta-soft) !important;
}

/* Floating theme toggle button */
.floating-theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--cta-blue);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.floating-theme-toggle:hover {
  transform: scale(1.08) rotate(15deg);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* Public navbar theme toggle styling */
.public-theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.3s ease;
}
.public-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* Compare Page Dark Theme overrides */
html[data-theme="dark"]:not(.theme-force-dark) :where(.compare-picker-card, .compare-table) {
  background: var(--cta-white) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .air-image {
  background: radial-gradient(circle at center, rgba(255,255,255,0.12) 0%, transparent 70%) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .compare-table th {
  background: linear-gradient(135deg, #0f172a, #1e293b) !important;
  color: var(--cta-muted) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .compare-table td {
  border-color: var(--cta-line) !important;
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .compare-table tr:hover td {
  background: linear-gradient(135deg, #1e293b, #0f172a) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .air-tags span {
  background: #1e293b !important;
  color: var(--cta-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-input[disabled] {
  background: #0f172a !important;
  color: var(--cta-muted) !important;
}

/* Public & Marketing Pages Dark Theme overrides */
html[data-theme="dark"]:not(.theme-force-dark) :where(.pub-section-head) {
  background: var(--cta-navy-2) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-section-head h2 {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-section-head h2 i {
  background: #1e293b !important;
  color: var(--cta-cyan) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-section-head p {
  color: var(--cta-muted) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) .pub-card {
  background: var(--cta-white) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-card:hover {
  background: #2d3748 !important;
  border-color: var(--cta-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-card::after {
  box-shadow: none !important;
}

html[data-theme="dark"]:not(.theme-force-dark) .pub-card-icon {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--cta-blue) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
  box-shadow: none !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-card:nth-child(3n+2) .pub-card-icon {
  background: rgba(16, 185, 129, 0.15) !important;
  color: var(--cta-green) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .pub-card:nth-child(3n) .pub-card-icon {
  background: rgba(245, 158, 11, 0.15) !important;
  color: var(--cta-amber) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) .detail-item {
  background: var(--cta-white) !important;
  border-color: var(--cta-line) !important;
  border-left: 3px solid var(--cta-cyan) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .detail-item:hover {
  background: #2d3748 !important;
  border-left-color: var(--cta-blue) !important;
  box-shadow: none !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .detail-item strong {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .detail-item span {
  color: var(--cta-muted) !important;
}

/* Landing Page overrides */
html[data-theme="dark"]:not(.theme-force-dark) :where(.shop-grid, .assurance-item) {
  background: var(--cta-white) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .shop-item:hover {
  background: #2d3748 !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .assurance-item:hover {
  background: #2d3748 !important;
  border-color: var(--cta-cyan) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .care-step:nth-child(1) .care-icon { background: rgba(59, 130, 246, 0.15) !important; color: var(--cta-blue) !important; }
html[data-theme="dark"]:not(.theme-force-dark) .care-step:nth-child(2) .care-icon { background: rgba(16, 185, 129, 0.15) !important; color: var(--cta-green) !important; }
html[data-theme="dark"]:not(.theme-force-dark) .care-step:nth-child(3) .care-icon { background: rgba(245, 158, 11, 0.15) !important; color: var(--cta-amber) !important; }
html[data-theme="dark"]:not(.theme-force-dark) .care-step:nth-child(4) .care-icon { background: rgba(124, 58, 237, 0.15) !important; color: #a78bfa !important; }

/* Public Products Page (/products) Dark Theme overrides */
html[data-theme="dark"]:not(.theme-force-dark) :where(.sidebar-card, .search-wrap, .sort-select, .view-toggle, .product-card) {
  background-color: var(--cta-white) !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-header {
  background: var(--cta-navy-2) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-header span {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-header-icon {
  background: #1e293b !important;
  color: var(--cta-cyan) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-cat {
  color: var(--cta-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-cat:hover {
  background: #1e293b !important;
  color: var(--cta-blue) !important;
  border-color: var(--cta-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-cat.active {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--cta-blue) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-cat-count {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--cta-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-action-btn {
  background: var(--cta-white) !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .sidebar-action-btn:hover {
  background: #1e293b !important;
  color: var(--cta-blue) !important;
  border-color: var(--cta-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .search-wrap button {
  background: #1e293b !important;
  border-left-color: var(--cta-line) !important;
  color: var(--cta-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .search-wrap button:hover {
  background: #2d3748 !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .view-btn {
  color: var(--cta-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .view-btn.active {
  background: #2d3748 !important;
  color: var(--cta-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .results-title {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .results-badge {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--cta-blue) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .product-media {
  background: radial-gradient(circle at center, rgba(255,255,255,0.12) 0%, transparent 70%) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .product-media::before {
  background: linear-gradient(0deg, rgba(15,23,42,0.8) 0%, transparent 100%) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .brand-pill {
  background: #0f172a !important;
  color: var(--cta-cyan) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .product-name {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .product-tag {
  background: #1e293b !important;
  color: var(--cta-muted) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .product-tag.btu-tag {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--cta-blue) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .warranty-pill {
  background: #1e293b !important;
  color: var(--cta-muted) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .warranty-pill strong {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .product-card:hover .warranty-pill {
  background: #2d3748 !important;
  border-color: var(--cta-cyan) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .qty-input {
  background: #1e293b !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .products-empty h3 {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .empty-icon {
  background: rgba(59, 130, 246, 0.15) !important;
  color: var(--cta-blue) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
/* Public page balance pass - aligned with BTU calculator */
html[data-theme="dark"]:not(.theme-force-dark) :where(.calc-card,.recommend-panel,.size-card,.tip,.compare-picker-card,.air-choice,.product-card,.sidebar-card,.detail-item,.pub-card) {
  background: var(--cta-white) !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.calc-card-head,.recommend-head,.sidebar-header,.pub-section-head) {
  background: linear-gradient(180deg, #111c31, #0f172a) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.calc-card-head h2,.recommend-head h2,.detail-item strong,.tip strong,.size-card strong,.product-name,.products-empty h3,.compare-picker-title) {
  color: var(--cta-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.field-help,.tip span,.size-card span,.compare-hint,.product-install,.result-note,.detail-item span) {
  color: var(--cta-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.product-media,.air-image) {
  background: linear-gradient(160deg, #111827, #0f172a) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.product-media img,.air-image img) {
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.28)) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.input-with-unit .pub-input,.range-value,.preset-btn) {
  background: #0f172a !important;
  color: var(--cta-ink) !important;
  border-color: var(--cta-line) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .preset-btn.active,
html[data-theme="dark"]:not(.theme-force-dark) .preset-btn:hover {
  color: #fff !important;
  background: linear-gradient(135deg, var(--cta-blue), var(--cta-cyan)) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .input-unit {
  color: var(--cta-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .theme-toggle,
html[data-theme="dark"]:not(.theme-force-dark) .public-theme-toggle {
  background: rgba(15,23,42,.88) !important;
  border-color: rgba(148,163,184,.24) !important;
  color: #e0f2fe !important;
}
html[data-theme="light"] :where(.product-media img,.air-image img) {
  mix-blend-mode: normal;
}
/* DASHBOARD_LIGHT_DARK_COMPAT_20260711
   Shared overrides for every dashboard surface. Keeps light mode intact and
   normalizes dark mode for admin, executive, pipeline, dev, customer, and technician dashboards. */
html[data-theme="dark"]:not(.theme-force-dark) {
  color-scheme: dark;
  --dashboard-bg: #0b1020;
  --dashboard-bg-soft: #0f172a;
  --dashboard-surface: #111827;
  --dashboard-surface-2: #162033;
  --dashboard-surface-3: #1e293b;
  --dashboard-border: #2b3a50;
  --dashboard-border-soft: #223047;
  --dashboard-ink: #eef5ff;
  --dashboard-muted: #9fb0c6;
  --dashboard-faint: #708197;
  --dashboard-blue: #60a5fa;
  --dashboard-cyan: #22d3ee;
  --dashboard-green: #34d399;
  --dashboard-amber: #fbbf24;
  --dashboard-red: #fb7185;
  --dashboard-purple: #a78bfa;
  --dashboard-shadow: 0 16px 42px rgba(0,0,0,.38);
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  body,
  .admin-content,
  .dash,
  .page,
  .page-wrap,
  .tech-workspace,
  .module-wrap,
  .pipeline-full-width,
  .customer-dashboard,
  .customer-hub,
  .dashboard-shell,
  .dev-shell,
  .portal-shell
) {
  background: var(--dashboard-bg) !important;
  color: var(--dashboard-ink) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .admin-topbar,
  .topbar,
  .customer-topnav,
  .tech-shell-nav,
  .quick-nav,
  .customer-quick-nav,
  .tech-shell-links,
  .sales-workspace-toolbar,
  .work-toolbar,
  .card-head,
  .sec-head,
  .panel-head,
  .section-head,
  .list-head,
  .cal-head,
  .module-hero,
  .pipeline-table-shell,
  .pipeline-view-switch,
  .jc-head,
  .jc-section-head,
  .jc-richbar,
  .jc-summary,
  .jc-footer,
  .job-actions
) {
  background: var(--dashboard-surface-2) !important;
  color: var(--dashboard-ink) !important;
  border-color: var(--dashboard-border) !important;
  box-shadow: none !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .card,
  .content-card,
  .panel,
  .section-card,
  .stat-card,
  .summary-card,
  .filter-card,
  .scard,
  .sec,
  .system-group,
  .system-link,
  .qa-card,
  .mode-card,
  .quick-card,
  .metric,
  .work-panel,
  .job-card,
  .focus-job,
  .weather-strip,
  .latest-banner,
  .module-hero,
  .summary-metric-card,
  .pipeline-full-width .summary-metric-card,
  .kanban-column,
  .kanban-column-header,
  .kanban-cards,
  .kanban-card,
  .kanban-card-billing,
  .kanban-card-follow,
  .kanban-card-note,
  .kanban-empty-placeholder,
  .calendar-deal,
  .pipeline-table-shell,
  .pipeline-modal .modal-content,
  .jc-modal-card,
  .jc-section,
  .jc-todo-list,
  .jc-items-table-wrap,
  .item,
  .notice,
  .no-data,
  .warn-data
) {
  background: var(--dashboard-surface) !important;
  color: var(--dashboard-ink) !important;
  border-color: var(--dashboard-border) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.22) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .dash-hero,
  .weather-strip,
  .latest-banner,
  .dev-badge
) {
  background: linear-gradient(135deg,#07111f 0%,#0b2a45 52%,#0f5fa8 100%) !important;
  color: #fff !important;
  border-color: rgba(96,165,250,.28) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .scard:hover,
  .sec:hover,
  .system-link:hover,
  .qa-card:hover,
  .mode-card:hover,
  .quick-card:hover,
  .job-card:hover,
  .kanban-card:hover,
  .calendar-deal:hover,
  .item:hover
) {
  background: var(--dashboard-surface-2) !important;
  border-color: #3d5270 !important;
  box-shadow: var(--dashboard-shadow) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  h1,h2,h3,h4,h5,h6,
  .dash-hero h1,
  .hero h1,
  .workspace-head h1,
  .module-hero h1,
  .sec-title,
  .card-title,
  .system-group h3,
  .system-link,
  .qa-title,
  .mode-card h2,
  .quick-card,
  .scard-num,
  .stat-value,
  .metric strong,
  .job-title strong,
  .job-info strong,
  .focus-job h2,
  .kanban-card-title,
  .kanban-card-value,
  .pipeline-table-title,
  .jc-title-head,
  .jc-static-val,
  .jc-summary-row span:last-child,
  .item strong,
  .dtbl td strong
) {
  color: var(--dashboard-ink) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  p,small,label,span,
  .dash-hero p,
  .hero p,
  .workspace-head p,
  .module-hero p,
  .scard-lbl,
  .qa-sub,
  .mode-card p,
  .system-link .arr,
  .metric small,
  .focus-meta,
  .job-title span,
  .job-info span,
  .kanban-card-customer,
  .kanban-card-follow,
  .kanban-card-note,
  .kanban-column-value,
  .pipeline-filter-result,
  .pipeline-table-sub,
  .jc-label,
  .jc-footer-meta,
  .item p,
  .dtbl td small
) {
  color: var(--dashboard-muted) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  input,select,textarea,
  .field,.form-control,.form-select,.search,
  .search-row input,
  .work-search input,
  .pipeline-search input,
  .pipeline-filter-select,
  .jc-input,
  .jc-item-input,
  .jc-pct-input,
  .jc-richtext,
  .jc-todo-row input[type="text"]
) {
  background-color: var(--dashboard-surface-3) !important;
  color: var(--dashboard-ink) !important;
  border-color: #394b63 !important;
  box-shadow: none !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(input,select,textarea,.field,.jc-richtext)::placeholder {
  color: var(--dashboard-faint) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .btn:not(.primary):not(.btn-primary):not(.btn-success):not(.btn-warning):not(.btn-danger),
  .btn-hero,
  .btn-hero-ghost,
  .wbtn:not(.primary),
  .nbtn,
  .topbar-link,
  .topbar-badge,
  .sidebar-toggle,
  .filter-tab,
  .pipeline-view-btn,
  .pipeline-zoom-btn,
  .jc-btn:not(.jc-btn-save):not(.jc-btn-danger),
  .jc-stage-btn:not(.active),
  .jc-add-btn,
  .ilink,
  .ibtn-org
) {
  background: var(--dashboard-surface-3) !important;
  color: var(--dashboard-ink) !important;
  border-color: #3a4d65 !important;
  box-shadow: none !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .btn:not(.primary):not(.btn-primary):not(.btn-success):not(.btn-warning):not(.btn-danger):hover,
  .wbtn:not(.primary):hover,
  .nbtn:hover,
  .topbar-link:hover,
  .topbar-badge:hover,
  .sidebar-toggle:hover,
  .filter-tab:hover,
  .pipeline-view-btn:hover,
  .pipeline-zoom-btn:hover,
  .jc-btn:not(.jc-btn-save):not(.jc-btn-danger):hover,
  .jc-stage-btn:not(.active):hover,
  .jc-add-btn:hover
) {
  background: #26344a !important;
  color: #fff !important;
  border-color: #56708e !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .filter-tab.active,
  .pipeline-view-btn.active,
  .data-tab.active,
  .tab.active,
  .quick-nav a.active
) {
  background: rgba(96,165,250,.20) !important;
  color: var(--dashboard-blue) !important;
  border-color: rgba(96,165,250,.42) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  table,.table,.dtbl,.pipeline-table,.jc-items-table,.data-table
) {
  background: var(--dashboard-surface) !important;
  border-color: var(--dashboard-border) !important;
  color: var(--dashboard-ink) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  table th,.table th,.dtbl thead th,.pipeline-table th,.jc-items-table th,.data-table th
) {
  background: var(--dashboard-surface-2) !important;
  color: var(--dashboard-muted) !important;
  border-color: var(--dashboard-border) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  table td,.table td,.dtbl td,.pipeline-table td,.jc-items-table td,.data-table td
) {
  background: transparent !important;
  color: var(--dashboard-ink) !important;
  border-color: var(--dashboard-border-soft) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .dtbl tbody tr,.pipeline-table tr,.jc-items-table tr
) {
  background: transparent !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .dtbl tbody tr:hover,.pipeline-table tr:hover,.jc-items-table tr:hover
) {
  background: rgba(96,165,250,.08) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .si-blue,.pill-blue,.qa-blue,.mode-admin .mode-icon
) { color: var(--dashboard-blue) !important; border-color: rgba(96,165,250,.32) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .si-green,.pill-green,.qa-green,.mode-tech .mode-icon
) { color: var(--dashboard-green) !important; border-color: rgba(52,211,153,.32) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .si-amber,.pill-amber,.qa-amber,.mode-customer .mode-icon
) { color: var(--dashboard-amber) !important; border-color: rgba(251,191,36,.32) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .si-purple,.pill-purple,.qa-purple,.mode-organization .mode-icon
) { color: var(--dashboard-purple) !important; border-color: rgba(167,139,250,.32) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(.qa-rose,.db-danger,.priority-badge.high) {
  color: var(--dashboard-red) !important;
  border-color: rgba(251,113,133,.34) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .si-blue,.si-green,.si-amber,.si-purple,
  .scard-icon,.system-group h3 i,.card-title i,
  .mode-icon,.metric-icon,.pipeline-full-width .summary-metric-card .metric-icon
) {
  background: rgba(96,165,250,.12) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .kanban-column,.kanban-cards
) {
  background: color-mix(in srgb, var(--lane-bg, #1e293b) 16%, var(--dashboard-surface) 84%) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .kanban-column-header {
  background: color-mix(in srgb, var(--lane-bg, #1e293b) 18%, var(--dashboard-surface-2) 82%) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .kanban-column-badge {
  background: rgba(255,255,255,.08) !important;
  color: var(--dashboard-muted) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .kanban-cards.drag-over {
  background: rgba(96,165,250,.14) !important;
  border-color: var(--dashboard-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .priority-badge.normal,.db-gray,.pipeline-stage-chip,.status.assigned,.status.cancelled
) {
  background: rgba(148,163,184,.16) !important;
  color: var(--dashboard-muted) !important;
  border-color: rgba(148,163,184,.24) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .db-blue,.status.on_site,.pipeline-stage-chip
) {
  background: rgba(96,165,250,.16) !important;
  color: var(--dashboard-blue) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .db-green,.db-success,.priority-badge.low,.status.servicing,.status.admin_approved
) {
  background: rgba(52,211,153,.15) !important;
  color: var(--dashboard-green) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .db-amber,.status.accepted
) {
  background: rgba(251,191,36,.15) !important;
  color: var(--dashboard-amber) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .status.completed
) {
  background: rgba(167,139,250,.16) !important;
  color: var(--dashboard-purple) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .status.revision,.db-danger,.kanban-card-follow.overdue,.item.low
) {
  background: rgba(251,113,133,.14) !important;
  color: var(--dashboard-red) !important;
  border-color: rgba(251,113,133,.32) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) .topbar-theme-toggle,
html[data-theme="dark"]:not(.theme-force-dark) .public-theme-toggle,
html[data-theme="dark"]:not(.theme-force-dark) .floating-theme-toggle {
  background: #1f2b40 !important;
  color: #f8fafc !important;
  border-color: #40536d !important;
}

html[data-theme="light"] :where(.dash,.page,.tech-workspace,.module-wrap) {
  color-scheme: light;
}
/* SCHEDULE_LIGHT_DARK_COMPAT_20260711
   Dark-mode polish for /admin/schedule calendar, job list, and assignment details. */
html[data-theme="dark"]:not(.theme-force-dark) :where(
  .sch-page,
  .sch-layout
) {
  color: var(--dashboard-ink, #eef5ff) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .sch-hero h1,
  .job-name,
  .dbox-v,
  .day-num,
  .cal-day,
  .filter-group .form-control,
  .inline-assign select
) {
  color: var(--dashboard-ink, #eef5ff) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .sch-hero p,
  .job-svc,
  .job-note,
  .jm,
  .dbox-l,
  .dbox-s,
  .dsection h3,
  .dsection p,
  .img-thumb span,
  .filter-group label,
  .list-head-left span,
  .cal-dow
) {
  color: var(--dashboard-muted, #9fb0c6) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .filter-card,
  .cal-card,
  .cal-body,
  .list-card,
  .list-body,
  .job-item,
  .job-panel,
  .dbox,
  .img-thumb,
  .inline-assign,
  .sch-empty
) {
  background: var(--dashboard-surface, #111827) !important;
  border-color: var(--dashboard-border, #2b3a50) !important;
  color: var(--dashboard-ink, #eef5ff) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.22) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(
  .cal-head,
  .list-head
) {
  background: linear-gradient(135deg,#06111f,#10243d) !important;
  border-color: var(--dashboard-border, #2b3a50) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.cal-head strong,.list-head-left strong) {
  color: #ffffff !important;
}

html[data-theme="dark"]:not(.theme-force-dark) .cal-day {
  background: var(--dashboard-surface-2, #162033) !important;
  border-color: var(--dashboard-border, #2b3a50) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .cal-day:hover {
  background: rgba(96,165,250,.16) !important;
  border-color: var(--dashboard-blue, #60a5fa) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .cal-day.empty {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .cal-day.today {
  background: rgba(52,211,153,.14) !important;
  border-color: var(--dashboard-green, #34d399) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .cal-day.selected {
  background: rgba(96,165,250,.20) !important;
  border-color: var(--dashboard-blue, #60a5fa) !important;
  box-shadow: 0 0 0 2px rgba(96,165,250,.20) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .cal-day.has-work:not(.selected):not(.today) {
  background: #172238 !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .day-count,
html[data-theme="dark"]:not(.theme-force-dark) .cal-count-tag {
  background: rgba(34,211,238,.14) !important;
  color: var(--dashboard-cyan, #22d3ee) !important;
  border-color: rgba(34,211,238,.28) !important;
}

html[data-theme="dark"]:not(.theme-force-dark) .job-sum:hover {
  background: rgba(96,165,250,.08) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .job-item[open] {
  border-color: var(--dashboard-blue, #60a5fa) !important;
  box-shadow: 0 10px 30px rgba(37,99,235,.16) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .job-panel {
  border-top-color: var(--dashboard-border, #2b3a50) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) .inline-assign {
  background: rgba(96,165,250,.10) !important;
  border-color: rgba(96,165,250,.28) !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.filter-group .form-control,.inline-assign select) {
  background: var(--dashboard-surface-3, #1e293b) !important;
  color: var(--dashboard-ink, #eef5ff) !important;
  border-color: #3a4d65 !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(.btn-sch-outline,.btn-action-o,.btn-xs) {
  background: var(--dashboard-surface-3, #1e293b) !important;
  color: var(--dashboard-ink, #eef5ff) !important;
  border-color: #3a4d65 !important;
}
html[data-theme="dark"]:not(.theme-force-dark) :where(.btn-sch-outline:hover,.btn-action-o:hover,.btn-xs:hover) {
  background: #26344a !important;
  color: #ffffff !important;
  border-color: #56708e !important;
}

html[data-theme="dark"]:not(.theme-force-dark) :where(.s-success) { background: rgba(52,211,153,.16) !important; color: var(--dashboard-green, #34d399) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(.s-primary) { background: rgba(96,165,250,.16) !important; color: var(--dashboard-blue, #60a5fa) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(.s-warning) { background: rgba(251,191,36,.16) !important; color: var(--dashboard-amber, #fbbf24) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(.s-danger) { background: rgba(251,113,133,.16) !important; color: var(--dashboard-red, #fb7185) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(.s-info) { background: rgba(34,211,238,.16) !important; color: var(--dashboard-cyan, #22d3ee) !important; }
html[data-theme="dark"]:not(.theme-force-dark) :where(.s-gray) { background: rgba(148,163,184,.16) !important; color: var(--dashboard-muted, #9fb0c6) !important; }
/* ALL_PAGES_LIGHT_DARK_COMPAT_20260711
   Broad light/dark compatibility for non-dashboard pages: documents, products, QR, chat, profile, customer, technician, and public tools. */
@media screen {
  html[data-theme="dark"]:not(.theme-force-dark) body {
    background: #081320 !important;
    color: var(--dashboard-ink, #eef5ff) !important;
    color-scheme: dark;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .admin-content,.main-content,.page-content,.content,.container,.wrap,.workspace,.app-shell,
    .admin-page,.page,.portal-page,.customer-page,.technician-page,.dev-page,.public-page,
    .auth-page,.chat-page,.profile-page,.qr-page,.equipment-page,.documents-page,.products-page,
    .settings-page,.notifications-page,.business-page,.system-page,.crm-page,.quotation-page,
    .invoice-page,.receipt-page,.compare-page,.calculator-page,.knowledge-page,.marketing-page
  ) {
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .card,.content-card,.panel,.section-card,.module-card,.info-card,.summary-card,.metric-card,
    .stat-card,.mini-card,.feature-card,.action-card,.menu-card,.dashboard-card,.data-card,
    .product-card,.air-card,.compare-card,.result-card,.dealer-card,.contact-card,.about-card,
    .brochure-card,.knowledge-card,.customer-card,.user-card,.team-card,.company-card,.org-card,
    .equipment-card,.qrcode-card,.qr-card,.scanner-card,.profile-card,.upload-card,.crop-card,
    .chat-card,.conversation-card,.message-card,.thread-card,.notification-card,.booking-card,
    .job-card,.job-item,.service-card,.history-card,.expense-card,.parts-card,.receipt-card,
    .invoice-card,.quotation-card,.document-card,.document-shell,.document-panel,.business-card,
    .table-card,.list-card,.filter-card,.search-card,.form-card,.modal-card,.dialog-card,
    .empty-card,.hero-card,.portal-card,.role-card,.legacy-card,.report-card,.chart-card
  ) {
    background: var(--dashboard-surface, #111827) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
    box-shadow: 0 12px 34px rgba(0,0,0,.22) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .card-header,.panel-header,.section-header,.table-header,.list-header,.modal-header,
    .drawer-header,.chat-header,.profile-header,.doc-header,.business-header,.page-header,
    .toolbar,.tool-bar,.filter-bar,.action-bar,.nav-bar,.topbar,.app-topbar,.admin-topbar,
    .mobile-topbar,.customer-topbar,.technician-topbar
  ) {
    background: color-mix(in srgb, var(--dashboard-surface-2, #162033) 86%, #0ea5e9 14%) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    h1,h2,h3,h4,h5,h6,.title,.page-title,.section-title,.card-title,.panel-title,
    .item-title,.product-title,.job-title,.customer-name,.company-name,.profile-name,
    .document-title,.invoice-title,.quotation-title,.receipt-title,.table-title,.form-title,
    .strong,.label-title
  ) {
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    p,small,.muted,.sub,.subtitle,.desc,.description,.hint,.help,.meta,.caption,.eyebrow,
    .label,.form-label,.field-label,.table-subtitle,.card-subtitle,.page-subtitle,
    .empty-text,.secondary-text,.text-muted,.note,.breadcrumb,.breadcrumb a
  ) {
    color: var(--dashboard-muted, #9fb0c6) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    input,select,textarea,.form-control,.form-select,.input,.select,.textarea,.field,
    .search,.search-input,.filter-input,.qty-input,.price-input,.date-input,.number-input,
    .comment-input,.chat-input,.message-input,.upload-input,.editable-field
  ) {
    background: var(--dashboard-surface-3, #1e293b) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
    border-color: #3a4d65 !important;
    box-shadow: none !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    input,textarea,.form-control,.search-input,.filter-input,.chat-input,.message-input
  )::placeholder {
    color: #7f91aa !important;
    opacity: 1 !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    table,.table,.data-table,.admin-table,.items-table,.document-table,.invoice-table,
    .quotation-table,.receipt-table,.product-table,.customer-table,.user-table,.equipment-table,
    .table-wrap,.table-wrapper,.table-shell,.grid-table
  ) {
    background: var(--dashboard-surface, #111827) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(thead,tr,th,td) {
    border-color: var(--dashboard-border, #2b3a50) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(thead,th,.table-head,.table-row.head) {
    background: var(--dashboard-surface-2, #162033) !important;
    color: var(--dashboard-muted, #9fb0c6) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(tbody tr,.table-row,.list-row,.data-row) {
    background: transparent !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(tbody tr:hover,.table-row:hover,.list-row:hover,.data-row:hover) {
    background: rgba(96,165,250,.08) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .btn,.button,.icon-btn,.action-btn,.primary-btn,.secondary-btn,.ghost-btn,.outline-btn,
    .btn-outline,.btn-soft,.tab,.tab-link,.data-tab,.filter-tab,.chip,.pill,.badge,
    .status-badge,.role-badge,.qtab,.nav-pill,.menu-btn,.tool-btn,.upload-btn
  ) {
    border-color: #3a4d65 !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .btn-outline,.secondary-btn,.ghost-btn,.outline-btn,.tab,.tab-link,.data-tab,.filter-tab,
    .chip,.pill,.nav-pill,.menu-btn,.tool-btn,.icon-btn:not(.primary):not(.btn-primary)
  ) {
    background: var(--dashboard-surface-3, #1e293b) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .tab.active,.tab-link.active,.data-tab.active,.filter-tab.active,.chip.active,.nav-pill.active,
    .btn-primary,.primary-btn,.active-tab,.is-active,.selected
  ) {
    background: linear-gradient(135deg,#2563eb,#0891b2) !important;
    color: #ffffff !important;
    border-color: rgba(34,211,238,.42) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .sidebar,.admin-sidebar,.mobile-sidebar,.customer-sidebar,.technician-sidebar,.side-nav,
    .drawer,.offcanvas,.dropdown-menu,.dropdown-panel,.menu-panel,.popover,.tooltip-panel
  ) {
    background: #07111f !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .sidebar a,.admin-sidebar a,.mobile-sidebar a,.customer-sidebar a,.technician-sidebar a,
    .side-nav a,.nav-link,.menu-link,.dropdown-item
  ) {
    color: var(--dashboard-muted, #9fb0c6) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .sidebar a.active,.admin-sidebar a.active,.mobile-sidebar a.active,.customer-sidebar a.active,
    .technician-sidebar a.active,.side-nav a.active,.nav-link.active,.menu-link.active,
    .sidebar a:hover,.admin-sidebar a:hover,.mobile-sidebar a:hover,.customer-sidebar a:hover,
    .technician-sidebar a:hover,.side-nav a:hover,.nav-link:hover,.menu-link:hover
  ) {
    background: rgba(37,99,235,.20) !important;
    color: #ffffff !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .modal,.modal-content,.dialog,.dialog-content,.drawer-content,.sheet,.sheet-content,
    .toast,.toast-card,.alert,.notice,.callout
  ) {
    background: var(--dashboard-surface, #111827) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .message-bubble,.chat-message,.ai-message,.bot-message,.chat-reply
  ) {
    background: #1d2940 !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .message-bubble.mine,.chat-message.mine,.user-message,.outgoing
  ) {
    background: linear-gradient(135deg,#2563eb,#4f46e5) !important;
    color: #ffffff !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .img-frame,.image-frame,.preview-frame,.avatar-frame,.logo-frame,.upload-zone,.dropzone,
    .file-drop,.qr-preview,.scanner-box,.camera-box,.cropper-wrap,.crop-preview
  ) {
    background: var(--dashboard-surface-2, #162033) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
    color: var(--dashboard-muted, #9fb0c6) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .success,.badge-success,.status-success,.paid,.done,.completed
  ) { color: var(--dashboard-green, #34d399) !important; }
  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .warning,.badge-warning,.status-warning,.pending,.waiting,.overdue-soft
  ) { color: var(--dashboard-amber, #fbbf24) !important; }
  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .danger,.badge-danger,.status-danger,.error,.failed,.overdue
  ) { color: var(--dashboard-red, #fb7185) !important; }
  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .info,.badge-info,.status-info,.blue,.cyan
  ) { color: var(--dashboard-cyan, #22d3ee) !important; }

  html[data-theme="dark"]:not(.theme-force-dark) :where(hr,.divider,.separator,.line) {
    border-color: var(--dashboard-border, #2b3a50) !important;
    background: var(--dashboard-border, #2b3a50) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(.empty-state,.empty,.no-data) {
    background: rgba(148,163,184,.08) !important;
    color: var(--dashboard-muted, #9fb0c6) !important;
    border-color: rgba(148,163,184,.22) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .paper,.print-page,.print-sheet,.document-paper,.invoice-paper,.receipt-paper,
    .quotation-paper,.billing-paper,.tax-paper,.thermal-paper,.a4-page,.doc-print-area
  ) {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #e5e7eb !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .paper,.print-page,.print-sheet,.document-paper,.invoice-paper,.receipt-paper,
    .quotation-paper,.billing-paper,.tax-paper,.thermal-paper,.a4-page,.doc-print-area
  ) :where(h1,h2,h3,h4,h5,h6,p,small,span,div,td,th,label,strong) {
    color: inherit !important;
  }
}

@media screen and (max-width: 768px) {
  html[data-theme]:not(.theme-force-dark) :where(
    .card,.content-card,.panel,.section-card,.product-card,.customer-card,.job-card,
    .receipt-card,.invoice-card,.quotation-card,.document-card,.profile-card,.chat-card,
    .table-card,.filter-card,.form-card
  ) {
    border-radius: 14px !important;
  }

  html[data-theme]:not(.theme-force-dark) :where(
    .table-wrap,.table-wrapper,.table-shell,.document-table,.invoice-table,.quotation-table,
    .receipt-table,.product-table,.customer-table,.equipment-table
  ) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  html[data-theme]:not(.theme-force-dark) :where(input,select,textarea,.form-control,.form-select,.btn,.button) {
    min-height: 42px;
  }
}
/* TARGET_PAGES_LIGHT_DARK_COMPAT_20260711
   Specific polish for /admin/customers, /chat, and /admin/job-reviews. */
@media screen {
  html[data-theme="dark"]:not(.theme-force-dark) :where(.customer-hub,.review-hero,.review-filter,.stat-row,.chat-app) {
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .hub-head h1,.panel-heading h2,.review-hero h1,.section-head h2,.report-title,
    .person strong,.cell-main,.detail-box strong,.room-name,.conversation-name strong,
    .pane-title,.dialog-head h2,.dialog-title
  ) {
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .hub-head p,.panel-heading p,.review-hero p,.report-meta,.legacy-meta,.cell-sub,
    .metric small,.empty,.room-preview,.room-time,.conversation-name small,.msg-name,
    .msg-time,.conversation-empty p,.send-hint,.announcement-meta,.news-empty,
    .detail-box span,.detail-note,.text-muted,.small
  ) {
    color: var(--dashboard-muted, #9fb0c6) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .filter-panel,.hub-panel,.metric,.review-stat,.section-card,.report-item,.legacy-item,
    .detail-box,.mobile-card,.mobile-stat,.pane,.rooms-pane,.news-pane,.conversation-head,
    .send-area,dialog,.dialog-section,.multi-users,.announcement,.flash
  ) {
    background: var(--dashboard-surface, #111827) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,.18) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .source-tabs,.panel-heading,.section-head,.pane-head,.dialog-head,.legacy-detail
  ) {
    background: var(--dashboard-surface-2, #162033) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .filter-form input,.filter-form select,.review-filter input,.room-search input,
    .send-form textarea,.field
  ) {
    background: var(--dashboard-surface-3, #1e293b) !important;
    border-color: #3a4d65 !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(
    .filter-form input,.review-filter input,.room-search input,.send-form textarea,.field
  )::placeholder {
    color: #8393aa !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(.hub-btn,.open-row,.icon-btn,.bar-btn,.dialog-action) {
    border-color: #3a4d65 !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) :where(.hub-btn:not(.primary),.open-row,.icon-btn) {
    background: var(--dashboard-surface-3, #1e293b) !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) :where(.hub-btn:hover,.open-row:hover,.icon-btn:hover) {
    background: rgba(96,165,250,.16) !important;
    color: #ffffff !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(.source-tab,.count-chip,.report-meta span,.legacy-meta span,.area-chip) {
    background: rgba(148,163,184,.12) !important;
    border-color: rgba(148,163,184,.22) !important;
    color: var(--dashboard-muted, #9fb0c6) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .source-tab.active {
    background: rgba(37,99,235,.22) !important;
    color: #bfdbfe !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .source-tab.active .count-chip {
    background: rgba(96,165,250,.20) !important;
    color: #dbeafe !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) :where(.customer-table th) {
    background: var(--dashboard-surface-2, #162033) !important;
    color: var(--dashboard-muted, #9fb0c6) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) :where(.customer-table td) {
    color: var(--dashboard-ink, #eef5ff) !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .customer-table tbody tr:hover {
    background: rgba(96,165,250,.08) !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) .workspace {
    background: #0b1727 !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .chat-bar {
    background: #06111f !important;
    border-color: var(--dashboard-border, #2b3a50) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) :where(.room-item:hover,.legacy-summary:hover) {
    background: rgba(96,165,250,.10) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .room-item.active,
  html[data-theme="dark"]:not(.theme-force-dark) .legacy-item[open] {
    background: rgba(37,99,235,.16) !important;
    border-color: rgba(96,165,250,.45) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .messages {
    background: linear-gradient(180deg,#0b1727,#101c2e) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .bubble {
    background: #172238 !important;
    border-color: #2b3a50 !important;
    color: var(--dashboard-ink, #eef5ff) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .mine .bubble {
    background: linear-gradient(135deg,#2563eb,#0891b2) !important;
    border-color: rgba(125,211,252,.36) !important;
    color: #ffffff !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .announcement {
    background: rgba(251,191,36,.10) !important;
    border-color: rgba(251,191,36,.30) !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .announcement strong {
    color: #fde68a !important;
  }
  html[data-theme="dark"]:not(.theme-force-dark) .announcement p {
    color: #e2e8f0 !important;
  }

  html[data-theme="dark"]:not(.theme-force-dark) dialog::backdrop {
    background: rgba(2,6,23,.72) !important;
  }

  html[data-theme="light"] :where(.customer-hub,.review-hero,.chat-app) {
    color-scheme: light;
  }
}

@media screen and (max-width: 760px) {
  .customer-hub .hub-head,
  .review-hero {
    gap: 10px !important;
  }
  .customer-hub .hub-actions,
  .review-hero [data-context-actions="job-reviews"] {
    width: 100%;
  }
  .customer-hub .hub-btn,
  .review-hero .btn {
    min-height: 40px;
  }
  .chat-app .rooms-pane {
    min-height: 220px;
  }
  .chat-app .chat-pane {
    min-height: calc(100vh - 330px) !important;
  }
}
/* MOBILE_SAFETY_ALL_PAGES_20260712
   Final responsive guardrail for admin, customer, technician, public, QR, chat,
   document editor, pipeline, and AI panels. Keeps pages usable on phones. */
@media screen and (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden !important;
  }

  html :where(*, *::before, *::after) {
    min-width: 0;
  }

  html :where(img, svg, video, canvas, iframe) {
    max-width: 100%;
  }

  html :where(
    .admin-content,.main-content,.page-content,.content,.container,.wrap,.workspace,
    .module-wrap,.admin-page,.customer-page,.technician-page,.dev-page,.public-page,
    .qr-page,.profile-page,.chat-page,.documents-page,.document-editor,.business-page
  ) {
    width: 100% !important;
    max-width: 100% !important;
  }

  html :where(
    .admin-content,.main-content,.page-content,.content,.container,.wrap,
    .module-wrap,.public-wrap,.customer-shell,.tech-shell
  ) {
    padding-left: clamp(10px, 3vw, 16px) !important;
    padding-right: clamp(10px, 3vw, 16px) !important;
  }

  html :where(
    .grid,.form-grid,.meta-grid,.doc-head-grid,.doc-bottom,.notes,.detail-grid,
    .summary-grid,.stats-grid,.stat-row,.cards-grid,.qgrid,.system-grid,.ai-grid,
    .profile-layout,.customer-layout,.tech-layout,.cart-layout,.checkout-layout,
    .product-layout,.compare-layout,.public-grid,.category-grid,.modal-grid,
    .product-modal-grid,.sch-layout,.dashboard-grid,.org-grid,.company-grid
  ) {
    grid-template-columns: 1fr !important;
  }

  html :where(
    .hub-metrics,.pipeline-summary-cards,.summary-cards,.metric-grid,.quick-grid,
    .product-grid,.air-grid,.dealer-grid,.brochure-grid,.knowledge-grid,
    .equipment-grid,.receipt-grid,.invoice-grid,.quotation-grid,.report-grid
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html :where(
    .module-hero,.page-hero,.hero,.profile-hero,.product-hero,.public-hero,
    .hub-head,.review-hero,.card-head,.section-head,.panel-head,.sec-head,
    .toolbar,.tool-bar,.action-bar,.filter-bar,.sales-workspace-toolbar,
    .doc-edit-top,.conversation-head,.topbar,.admin-topbar
  ) {
    align-items: stretch !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  html :where(
    .btn-line,.btn-row,.button-row,.actions,.hub-actions,.filter-actions,
    .doc-edit-actions,.topbar-right,.chat-actions,.product-actions,.head-actions
  ) {
    flex-wrap: wrap !important;
    max-width: 100% !important;
  }

  html :where(
    input,select,textarea,.field,.form-control,.form-select,.input,.select,
    .textarea,.search-input,.filter-input,.jc-input,.pub-input
  ) {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 16px !important;
  }

  html :where(
    .btn,.button,.doc-btn,.hub-btn,.bar-btn,.primary-btn,.secondary-btn,
    .action-btn,.filter-btn,.submit-btn
  ) {
    max-width: 100%;
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  html :where(
    .table-wrap,.table-wrapper,.table-shell,.tbl-wrap,.doc-table-wrap,
    .pipeline-table-shell,.ai-result-table-wrap,.float-ai-result-table-wrap,
    .customer-table-wrap,.receipt-table-wrap,.invoice-table-wrap,.quotation-table-wrap
  ) {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  html :where(
    table,.table,.data-table,.customer-table,.pipeline-table,.editable-table,
    .items-table,.document-table,.invoice-table,.quotation-table,.receipt-table,
    .ai-result-table,.float-ai-result-table
  ) {
    max-width: none !important;
  }

  html :where(th,td) {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  html :where(
    dialog,.modal,.modal-content,.modal-dialog,.dialog,.dialog-content,
    .pipeline-modal .modal-content,.product-modal-content,.floating-ai-chat,
    .customer-dropdown,.dropdown-panel,.drawer,.sheet
  ) {
    max-width: calc(100vw - 18px) !important;
  }

  html :where(.modal,.pipeline-modal,.product-modal) {
    padding: 8px !important;
    align-items: flex-end !important;
  }

  html :where(.modal-content,.modal-dialog,.dialog-content,.pipeline-modal .modal-content) {
    width: 100% !important;
    border-radius: 14px 14px 0 0 !important;
    max-height: calc(100dvh - 18px) !important;
    overflow: auto !important;
  }

  html :where(.paper,.print-page,.print-sheet,.document-paper,.invoice-paper,.receipt-paper,
    .quotation-paper,.billing-paper,.tax-paper,.thermal-paper,.a4-page,.doc-print-area) {
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  body.pipeline-jobboard {
    overflow: auto !important;
  }

  body.pipeline-jobboard :where(.admin-content,.module-wrap) {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.pipeline-jobboard #pipelineBoardView,
  body.pipeline-jobboard .kanban-board-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  body.pipeline-jobboard .kanban-board {
    min-width: max-content !important;
  }

  body.pipeline-jobboard .kanban-column,
  .pipeline-full-width .kanban-column {
    flex-basis: min(82vw, 300px) !important;
    width: min(82vw, 300px) !important;
  }

  .floating-ai-widget {
    right: 12px !important;
    bottom: 12px !important;
  }

  .floating-ai-chat {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 78px !important;
    width: auto !important;
    height: min(560px, calc(100dvh - 96px)) !important;
  }

  .chat-app {
    min-height: 100dvh !important;
  }

  .chat-app .workspace {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .chat-app .rooms-pane {
    height: auto !important;
    max-height: 38dvh !important;
  }

  .chat-app .chat-pane {
    height: auto !important;
    min-height: 52dvh !important;
  }

  .chat-app .messages {
    min-height: 44dvh !important;
    max-height: 58dvh !important;
  }

  .doc-edit-actions,
  .filter-form,
  .review-filter,
  .ai-chat-input-area,
  .floating-ai-input {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .floating-ai-input {
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
  }

  .public-nav,.site-nav,.main-nav,.customer-quick-nav,.tech-shell-links {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .public-nav a,.site-nav a,.main-nav a,.customer-quick-nav a,.tech-shell-links a {
    white-space: nowrap !important;
  }
}

@media screen and (max-width: 560px) {
  html :where(h1,.page-title,.module-hero h1,.public-hero h1,.hero-title) {
    font-size: clamp(22px, 8vw, 30px) !important;
    line-height: 1.12 !important;
    overflow-wrap: anywhere;
  }

  html :where(h2,.section-title,.card-title,.panel-title) {
    font-size: clamp(17px, 5.5vw, 22px) !important;
    line-height: 1.2 !important;
  }

  html :where(
    .hub-metrics,.pipeline-summary-cards,.summary-cards,.metric-grid,.quick-grid,
    .product-grid,.air-grid,.dealer-grid,.brochure-grid,.knowledge-grid,
    .equipment-grid,.receipt-grid,.invoice-grid,.quotation-grid,.report-grid,
    .stat-row,.qgrid,.system-grid
  ) {
    grid-template-columns: 1fr !important;
  }

  html :where(
    .card,.content-card,.panel,.section-card,.sec,.module-hero,.page-hero,
    .filter-panel,.hub-panel,.profile-card,.chat-card,.document-card
  ) {
    border-radius: 12px !important;
  }

  html :where(
    .card-body,.sec-body,.panel-body,.module-hero,.page-hero,.profile-hero,
    .doc-head-grid,.meta-grid,.doc-bottom,.admin-content
  ) {
    padding: 12px !important;
  }

  .topbar-left h3,
  .admin-topbar-title,
  .admin-topbar-title h1,
  .admin-topbar-title h2 {
    max-width: 52vw !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .admin-sidebar .brand-name,
  .brand-name {
    font-size: 15px !important;
    line-height: 1.05 !important;
  }

  .admin-sidebar .brand-sub,
  .brand-sub {
    font-size: 9px !important;
  }

  .product-card img,
  .air-card img,
  .product-media img,
  .air-image img,
  .thumb {
    object-fit: contain !important;
  }
}