:root{color-scheme:light;--surface:#fff;--surface-muted:#f1f6fa;--text:#123e57;--muted:#526c7e;--border:#bed1df;--accent:#006297;--on-accent:#fff;--danger:#a52332;--success:#176343;--warning:#845007;--focus:#c56910;--page:#e8eff5;--rmt-ink:var(--text);--rmt-muted:var(--muted);--rmt-border:var(--border);--rmt-blue:var(--accent)}
html[data-theme=dark]{color-scheme:dark;--surface:#142c3c;--surface-muted:#1d384a;--text:#e5f0f6;--muted:#b6cad7;--border:#4a687b;--accent:#83d6fc;--on-accent:#08283a;--danger:#ffafb5;--success:#a3e4bb;--warning:#f1d093;--focus:#ffbc77;--page:#0d202e;--rmt-canvas:var(--page);--rmt-surface:var(--surface);--rmt-teal:var(--accent);--rmt-red:var(--danger);--rmt-amber:var(--warning);--rmt-ink:var(--text);--rmt-muted:var(--muted);--rmt-border:var(--border);--rmt-blue:var(--accent)}
.theme-control-065{display:flex;align-items:center;gap:.4rem;margin:0}.theme-control-065 label{display:flex;align-items:center;gap:.4rem;margin:0;font-size:.8rem}.theme-control-065 select{width:auto;min-height:38px;padding:.4rem .5rem}.theme-control-065 .theme-status-065{flex-basis:100%;font-size:.75rem;max-width:24rem;margin:.25rem 0}.theme-control-065 button{font-size:.75rem;min-height:38px;padding:.35rem .6rem}.theme-control-065:has(.theme-status-065:not([hidden])){flex-wrap:wrap}
html[data-theme=dark],html[data-theme=dark] body,html[data-theme=dark] body>main{background:var(--page);color:var(--text)}
html[data-theme=dark][data-layout] :is(.panel,.order,.customer-row-063,.reopen-confirm-063,.history-visit,.job-feed-card,.personal-calendar,.calendar,.welcome-card-061,.home-shortcut,.customer-card,.facility-card,.context-box,.expense-choice,.expense-card,.day-plan-shared,.login-content-062,.login-choice-062,.modal,.modal-content,.service-form,.form-section,.service-section,fieldset){background:var(--surface);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] :is(.customer-details-063,.quiet,.form-grid,.annual-values-063>div,.annual-other-063>div,.summary,.expense-summary,.context-summary,.form-context,.service-context,.repair-items,.day-plan-help,.calendar-day,.day-cell,.month-cell,.calendar-grid,.calendar-week,.calendar-header){background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] :is(h1,h2,h3,h4,h5,h6,label,legend,dt,dd,.street-address,.customer-open,.customer-open strong,.annual-reference-063 dd,.economy-header p,.economy-header h2,.economy-header h3){color:var(--text)}
html[data-theme=dark][data-layout] :is(p,small,.muted,.quiet,.tag,.annual-company-063,.annual-meta-063,.annual-source-note-063,.directory-count-063,.customer-row-hint-063){color:var(--muted)}
html[data-theme=dark][data-layout] :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea){background:#102736;color:var(--text);border-color:var(--border)}
html[data-theme=dark] input::placeholder,html[data-theme=dark] textarea::placeholder{color:#9bb4c5;opacity:1}
html[data-theme=dark] input:disabled,html[data-theme=dark] select:disabled,html[data-theme=dark] textarea:disabled{opacity:.75}
html[data-theme=dark] :is(button,.secondary,a.secondary){background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark] :is(button,.secondary):hover{background:#2a4d63}
html[data-theme=dark] :is(button.primary,a.primary,button[aria-pressed=true],.job-tabs button[aria-selected=true]){background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
html[data-theme=dark] :is(a,.text-button,.phone-link,.facility-open){color:var(--accent)}
html[data-theme=dark] :is(.notice,.office-note,.repair-notice,.billing-notice){background:#193e56;color:#d6edfc;border-color:#5e92b1}
html[data-theme=dark] :is(.success,.all-done,.status-chip.accepted,.status-chip.done){background:#174334;color:var(--success);border-color:#53896a}
html[data-theme=dark] :is(.error,#error,[role=alert],.status-chip.error){background:#482c35;color:var(--danger);border-color:#9c606a}
html[data-theme=dark] :is(.warning,.status-chip.pending,.status-chip.followup){background:#473b23;color:var(--warning);border-color:#8c7547}
html[data-theme=dark] :is(table,tbody,tr,td,th){border-color:var(--border)}
html[data-theme=dark] th{background:#244457;color:var(--text)}
html[data-theme=dark] td{background:var(--surface);color:var(--text)}
html[data-theme=dark] :is(.calendar-event,.cal-event,.calendar-job,.calendar-cell.today,.calendar-day.today,.customer-details-063 .facility-row-063.selected,.stop.selected){background:#244b63;color:var(--text);border-color:#78bcdf}
html[data-theme=dark][data-layout] .finance-metric-065[data-negative=true] p.finance-value-065{color:var(--danger)}
html[data-theme=dark] .economy-header{background:var(--surface)}
html[data-theme=dark] .leaflet-popup-content-wrapper,html[data-theme=dark] .leaflet-popup-tip{background:var(--surface);color:var(--text)}
html[data-theme=dark] .leaflet-control-zoom a{background:var(--surface);color:var(--text)}
html[data-theme=dark] .leaflet-control-attribution{background:rgba(255,255,255,.88);color:#234657}
html[data-theme=dark] .leaflet-control-attribution a{color:#00588a}
html[data-theme=dark] .rmt-report,html[data-theme=dark] .service-report,html[data-theme=dark] .report-print{color-scheme:light;background:#fff;color:#123e57}
html[data-theme=dark] :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--focus);outline-offset:3px}
/* Integrated service, receipt, report preview and shared calendar surfaces. */
html[data-theme=dark][data-layout] :is(.universal-service,.report,.receipt-first,.receipt-preview,.expense-totals,.expense-line,.service-calendar,.calendar-detail,.calendar-month-day,.calendar-selected-day,.execution-customer,.saved-trip,.job-feed-empty,.service-job,.quick-save,.upload,.search){background:var(--surface);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] :is(.universal-service details[open],.calendar-month-day.outside,.calendar-appointment,.expense-choice-icon,.date-box,.metric-icon,.metric-icon-061,.card-icon,.worklist-status,.report-delivery){background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] :is(.calendar-month-day.today,.calendar-month-day.selected,.calendar-appointment.person-b,.execution-customer.is-selected,.execution-customer.is-done,.next-stop){background:#244b63;color:var(--text);border-color:#78bcdf}
html[data-theme=dark][data-layout] :is(.universal-service,.report,.expense-form,.calendar-detail,.service-calendar) :is(summary,strong,b,span,li){color:var(--text)}
html[data-theme=dark][data-layout] :is(.universal-service .hint,.expense-form .hint,.map-legend,.job-progress-label,.job-feed-action>span,.service-job .grow small){color:var(--muted)}
html[data-theme=dark][data-layout] .quick-options button{background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] .quick-options button[aria-pressed=true]{background:#174334;color:var(--success);border-color:#53896a}
html[data-theme=dark][data-layout] .quick-options button:nth-child(2)[aria-pressed=true]{background:#482c35;color:var(--danger);border-color:#9c606a}
html[data-theme=dark][data-layout] :is(.badge.good,.report .badge.good){background:#174334;color:var(--success);border-color:#53896a}
html[data-theme=dark][data-layout] :is(.badge.warning,.service-warning,.position-confirmation,.compact-messages details){background:#473b23;color:var(--warning);border-color:#8c7547}
html[data-theme=dark][data-layout] :is(.badge.danger,.report .badge.danger){background:#482c35;color:var(--danger);border-color:#9c606a}
html[data-theme=dark][data-layout] .calendar-day-picker [aria-pressed=true]{background:#244b63!important;color:var(--text);border-color:#78bcdf!important}
html[data-theme=dark][data-layout] .expense-form input[type=file]::file-selector-button{background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] :is(.modal-backdrop,.report-backdrop,.calendar-detail-backdrop){background:#04131dcc}
/* These service surfaces inherit older high-specificity rules from integration.css. */
html[data-layout] #content .inventory-part-card>header{background:var(--surface-muted);color:var(--text);border-color:var(--border);border-radius:8px;padding:.65rem .8rem}
html[data-layout] #content .inventory-part-card>header strong{color:var(--text)}
html[data-layout] .report-finish .recipient-choices button.recipient-none{color:var(--muted)}
html[data-theme=dark][data-layout] .portal-top #page-title{color:var(--text)}
html[data-theme=dark][data-layout] :is(.municipality-label,.test-badge){background:var(--surface-muted);color:var(--muted);border-color:var(--border)}
html[data-theme=dark][data-layout] .order-progress span{color:var(--muted)}
html[data-theme=dark][data-layout] .expense-choice-cards button{background:var(--surface-muted)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-theme=dark][data-layout] .expense-choice-cards button :is(b,span,small){color:var(--text)}
html[data-theme=dark][data-layout] input[type=file]{background:#102736;color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] input[type=file]::file-selector-button{background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] .back-button{color:var(--accent)!important}
html[data-theme=dark][data-layout] .order-customers .stop{background:var(--surface);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] .order-customers .stop.selected{background:#244b63;border-color:#78bcdf}
html[data-theme=dark][data-layout] .order-customers .stop .stop-select,
html[data-theme=dark][data-layout] .order-customers .stop .stop-select:hover,
html[data-theme=dark][data-layout] .order-customers .stop .stop-select:focus{color:var(--text)!important}
html[data-theme=dark][data-layout] .order-customers .stop .stop-select[aria-pressed=true]::after{color:var(--success)}
html[data-theme=dark][data-layout] :is(.stop-state,.stop-actions-061,.selection-actions-061,.customer-actions-061,.service-details-content){background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] .report-finish{background:var(--surface);color:var(--text);border-color:var(--border);border-top-color:var(--accent)}
html[data-theme=dark][data-layout] .report-finish :is(h3,legend,label){color:var(--text)}
html[data-theme=dark][data-layout] .report-finish :is(p,.autosave-status){color:var(--muted)}
html[data-theme=dark][data-layout] .report-finish .recipient-choices button{background:var(--surface-muted);color:var(--text);border-color:var(--border)}
html[data-theme=dark][data-layout] .report-finish .recipient-choices button[aria-pressed=true]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
html[data-theme=dark][data-layout] :is(.status-chip.accepted,.status-chip.complete,.status-chip.done,.autosave-status[data-state=saved]){background:#174334;color:var(--success);border-color:#53896a}
html[data-theme=dark][data-layout] :is(.status-chip.active,.status-chip.repair,.status-chip.followup){background:#473b23;color:var(--warning);border-color:#8c7547}
html[data-theme=dark][data-layout] :is(.status-chip.requested,.status-chip.declined,.autosave-status[data-state=error]){background:#482c35;color:var(--danger);border-color:#9c606a}
@media(max-width:700px){.theme-control-065{max-width:100%;justify-content:flex-end}.theme-control-065 label>span{font-size:.75rem}.portal-preferences{flex-wrap:wrap}.theme-control-065 .theme-status-065{max-width:100%}}
@media print{html[data-theme],html[data-theme] body,html[data-theme] body>main{color-scheme:light!important;background:#fff!important;color:#000!important;--surface:#fff;--surface-muted:#f6f6f6;--text:#111;--muted:#444;--border:#aaa;--accent:#075984;--on-accent:#fff;--rmt-ink:#111;--rmt-muted:#444;--rmt-border:#aaa;--rmt-blue:#075984}.theme-control-065,.portal-preferences{display:none!important}html[data-theme=dark] :is(.panel,.order,fieldset,table,tbody,tr,td,th,section,article,div,p,h1,h2,h3,h4,h5,h6,dl,dt,dd,label,legend,small){background:#fff!important;color:#111!important;border-color:#aaa!important}html[data-theme=dark] :is(input,select,textarea){background:#fff!important;color:#111!important}}

/* 068: keep mobile report labels and card gaps legible in dark screen mode. */
@media screen and (max-width:600px){
 html[data-theme=dark][data-layout] .report-062 .report-table-062,
 html[data-theme=dark][data-layout] .report-062 .report-table-062 tbody{background:transparent;}
 html[data-theme=dark][data-layout] .report-062 .report-table-062 tbody tr{background:var(--surface);border-color:var(--border);}
 html[data-theme=dark][data-layout] .report-062 .report-table-062 tbody tr:nth-child(even){background:var(--surface-muted);}
 html[data-theme=dark][data-layout] .report-062 .report-table-062 td{background:transparent;color:var(--text);}
 html[data-theme=dark][data-layout] .report-062 .report-table-062 td::before{color:var(--muted);}
}

/* Report header: do not inherit the light app-header surface in dark screen mode. */
@media screen{
 html[data-theme=dark][data-layout] .report-062 .report-title-062{background:var(--surface);}
 html[data-theme=dark][data-layout] .report-062 .report-title-062 .eyebrow{color:var(--muted);}
 html[data-theme=dark][data-layout] .report-062 .report-title-062 .report-test-label-062{background:var(--surface-muted);color:var(--muted);}
}

/* The two report-only inset surfaces also retain light backgrounds by default. */
@media screen{
 html[data-theme=dark][data-layout] .report-062 :is(.report-advanced-062,.report-important-062){background:var(--surface-muted);}
}
