/* Fixed workflow colors are not user-customizable. */
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.case-description-block,.master-description,.case-description-heading>span,.role-badge,.private-tag,.photo-upload-section,.calendar-filters-bar){background:var(--surface-raised)!important;color:var(--ink)!important;border-color:var(--line)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.case-description-text,.master-comment-text,.job-card-meta,.comment-text-content){color:var(--ink)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.priority.high,.priority.urgent,.bulk-remove,.part-remove,.btn.danger-outline,.btn.outline,.low-stock-badge){background:#45302d!important;color:#ffe1c1!important;border-color:#88604d!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .priority.normal{background:#304054!important;color:#dae6f5!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .gallery-controls,html:is([data-theme=dark],[data-color-scheme=dark]) .gallery-controls *{color:#fff!important}
.case-status-summary{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px}
.comment-short,.comment-full,.comment-body p{color:var(--personal-commentColor)!important;font-size:var(--personal-commentSize)!important}
.comment-author-row time{color:var(--personal-timeColor)!important}
@media(max-width:720px){.detail-panel .desktop-contact-action{display:none!important}html[data-environment=testing] .mobile-bottom-nav{bottom:22px!important}}
html:is([data-theme=dark],[data-color-scheme=dark]) .form-grid label,html:is([data-theme=dark],[data-color-scheme=dark]) .case-picker-label{color:var(--personal-text)!important}
.profile-card label:has([name=removeProfilePhoto]){display:flex;flex-direction:row;align-items:center;gap:8px}
.profile-card [name=removeProfilePhoto]{width:18px!important;height:18px!important;min-height:18px!important}
.firebase-emulator-warning{pointer-events:none!important}
.modal.release-bulk{max-height:calc(100dvh - 60px)!important;overflow-y:auto!important;min-height:0!important}
.release-bulk .bulk-actions{position:sticky;bottom:-10px;background:#fff;z-index:3;padding:12px;box-shadow:0 -4px 12px #172b421a}
.bulk-picker-column{display:flex;flex-direction:column;gap:6px;min-width:0}
.bulk-picker-column .bulk-apply{min-height:25px}
.popup-picker summary[hidden]{display:none!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .release-bulk .bulk-actions{background:var(--surface,#202d3e)}
html:is([data-theme=dark],[data-color-scheme=dark]) .case-picker-label,html:is([data-theme=dark],[data-color-scheme=dark]) .release-bulk p{color:var(--personal-text)!important}

/* Personal appearance never targets workflow status badges. */
:root{--personal-accent:#2474d5;--personal-text:#172b42;--personal-titleColor:#172b42;--personal-commentColor:#536578;--personal-timeColor:#405d78;--personal-fontSize:14px;--personal-titleSize:21px;--personal-commentSize:12px;--personal-timeSize:12px}
body,.content{color:var(--personal-text)}
h1,h2,h3{color:var(--personal-titleColor)}
.comment-text,.comment-text-content,#commentText,#commentEditText{font-size:var(--personal-commentSize)!important}
.comment-size-setting{display:grid;gap:10px;min-width:0}
.comment-size-setting>span{font-size:12px;font-weight:600}
.comment-size-stepper{display:flex;align-items:center;gap:8px;width:fit-content;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff)}
.comment-size-stepper button{width:44px;height:44px;border:0;border-radius:8px;background:var(--bg,#f3f6fa);color:var(--ink);font-size:24px;cursor:pointer}
.comment-size-stepper button:disabled{opacity:.4;cursor:default}
.comment-size-stepper output{min-width:64px;text-align:center;font-variant-numeric:tabular-nums;font-weight:700;color:var(--ink)}
.comment-size-preview{padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);overflow-wrap:anywhere}
.comment-size-preview>span{display:block;margin-bottom:8px;font-size:11px;color:var(--muted)}
.comment-size-preview p{margin:0;line-height:1.6;color:var(--personal-commentColor)!important;font-size:var(--personal-commentSize)!important}
.job-time,.technician-case-card>div:first-child>b{color:var(--personal-timeColor)!important;font-weight:800}
.btn.primary{background:var(--personal-accent)!important;border-color:var(--personal-accent)!important}
.appearance-card,.approval-queue{margin:16px;padding:20px}.appearance-card input[type=color]{width:100%;height:40px}
html:is([data-theme=dark],[data-color-scheme=dark]){color-scheme:dark}
html:is([data-theme=dark],[data-color-scheme=dark]) body,html:is([data-theme=dark],[data-color-scheme=dark]) .app,html:is([data-theme=dark],[data-color-scheme=dark]) .content{background:var(--bg,#121c29)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .team-card,html:is([data-theme=dark],[data-color-scheme=dark]) .modal,html:is([data-theme=dark],[data-color-scheme=dark]) .calendar-panel,html:is([data-theme=dark],[data-color-scheme=dark]) .day-panel,html:is([data-theme=dark],[data-color-scheme=dark]) .detail-panel,html:is([data-theme=dark],[data-color-scheme=dark]) .sidebar,html:is([data-theme=dark],[data-color-scheme=dark]) .case-selection-popover,html:is([data-theme=dark],[data-color-scheme=dark]) .job-card,html:is([data-theme=dark],[data-color-scheme=dark]) .technician-case-card{background:var(--surface,#202d3e)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) input,html:is([data-theme=dark],[data-color-scheme=dark]) select,html:is([data-theme=dark],[data-color-scheme=dark]) textarea{background:var(--theme-input,#152132)!important;color:#e4ebf5}
html:is([data-theme=dark],[data-color-scheme=dark]) .calendar-grid .day{background:var(--surface,#202d3e)}
.release-bulk{width:min(1500px,96vw)!important;max-width:96vw!important}
.release-bulk .bulk-row,.release-bulk .bulk-master{display:grid!important;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;padding:16px;margin-bottom:12px;border:1px solid #b8cce0;border-radius:10px}
.release-bulk label{display:flex;flex-direction:column;gap:5px;font-size:12px}
.release-bulk input,.release-bulk select{width:100%;min-height:38px}
.release-bulk input[type=checkbox]{width:auto;min-height:initial}
.release-bulk .multi-options label{flex-direction:row;align-items:center}
.bulk-master-panel{margin-bottom:16px}.bulk-master-panel>summary{padding:12px;font-weight:700;cursor:pointer}
.bulk-apply{border:1px solid #b8cce0;border-radius:5px;background:#eaf3ff;color:#174e89;padding:5px;font-size:11px}
.release-bulk .bulk-remove{align-self:end;justify-self:end}
@media(max-width:720px){.release-bulk .bulk-row,.release-bulk .bulk-master{grid-template-columns:repeat(2,minmax(0,1fr));padding:10px}.release-bulk .case-selection-popover{width:92vw}.appearance-card .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.status.new,.calendar-event.new{--status-hue:#c5d7e6;background:#c5d7e626!important;border-color:#c5d7e680!important;color:color-mix(in srgb,#c5d7e6 52%,#172b42)!important}
.status.booked,.calendar-event.booked{--status-hue:#2563eb;background:#2563eb26!important;border-color:#2563eb80!important;color:color-mix(in srgb,#2563eb 52%,#172b42)!important}
.status.tech-complete,.calendar-event.tech-complete{--status-hue:#10b981;background:#10b98126!important;border-color:#10b98180!important;color:color-mix(in srgb,#10b981 52%,#172b42)!important}
.status.parts-required,.calendar-event.parts-required{--status-hue:#f59e0b;background:#f59e0b26!important;border-color:#f59e0b80!important;color:color-mix(in srgb,#f59e0b 52%,#172b42)!important}
.status.awaiting-parts,.calendar-event.awaiting-parts{--status-hue:#eab308;background:#eab30826!important;border-color:#eab30880!important;color:color-mix(in srgb,#eab308 52%,#172b42)!important}
.status.part-arrived,.calendar-event.part-arrived{--status-hue:#06b6d4;background:#06b6d426!important;border-color:#06b6d480!important;color:color-mix(in srgb,#06b6d4 52%,#172b42)!important}
.status.pending-approval,.calendar-event.pending-approval{--status-hue:#8b5cf6;background:#8b5cf626!important;border-color:#8b5cf680!important;color:color-mix(in srgb,#8b5cf6 52%,#172b42)!important}
.status.complete,.calendar-event.complete{--status-hue:#107836;background:#10783626!important;border-color:#10783680!important;color:color-mix(in srgb,#107836 52%,#172b42)!important}
.status.cancelled,.calendar-event.cancelled{--status-hue:#dc2626;background:#dc262626!important;border-color:#dc262680!important;color:color-mix(in srgb,#dc2626 52%,#172b42)!important}
.status.invoiced,.calendar-event.invoiced{--status-hue:#6416a8;background:#6416a826!important;border-color:#6416a880!important;color:color-mix(in srgb,#6416a8 52%,#172b42)!important}
.testing-mode-banner{position:fixed;bottom:0;left:0;right:0;z-index:50000;padding:5px;text-align:center;background:#ffdf73;color:#312500;font:700 12px system-ui;pointer-events:none}
.release-priority{display:block;margin:12px 0;max-width:240px}
.pickup-summary{font-size:12px;font-weight:700;color:#805500;background:#fff4cf;border-radius:6px;padding:5px}
.desktop-contact-action{display:none}
.gallery-viewport{overflow:auto;max-height:70dvh;max-width:90vw;overscroll-behavior:contain}
.gallery-viewport img{display:block;margin:auto;max-width:100%;max-height:70dvh;object-fit:contain}
.gallery-zoom{display:flex;justify-content:center;gap:8px;margin:10px}
.gallery-zoom button{padding:8px 14px;min-height:40px;border-radius:8px;cursor:pointer}
@media(min-width:721px){.mobile-contact-action{display:none!important}.desktop-contact-action{display:flex;align-items:center;gap:6px;overflow-wrap:anywhere}.contact-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:4px;min-width:28px;min-height:28px;border:0;border-radius:4px;background:transparent;text-decoration:none;cursor:pointer}}
@media(max-width:720px){.calendar-content,.calendar-panel,.calendar-grid,.calendar-grid .days{touch-action:pan-y!important;overscroll-behavior-y:auto!important}.calendar-panel{overflow-y:visible!important;max-height:none!important}.calendar-content{overflow-y:auto!important;-webkit-overflow-scrolling:touch}.calendar-grid button{touch-action:pan-y!important}}
/* Refined light/dark surfaces. Status hues remain fixed; only backgrounds are translucent. */
html[data-theme=light]{color-scheme:light}
html:is([data-theme=dark],[data-color-scheme=dark]){--ink:#e4ebf5;--muted:#b5c4d5;--line:#39495b;--bg:#121c29;--blue-pale:#253c57;--surface:#202d3e;--surface-raised:#28384c}
html:is([data-theme=dark],[data-color-scheme=dark]) body :is(p,span,b,strong,small,label,summary,h1,h2,h3,h4,td,th,dt,dd,time,a,button){color:var(--ink)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.app-shell,.workspace,.main-area,.content,.calendar-panel,.dashboard,.all-jobs){background:var(--bg)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.topbar,.sidebar,.mobile-bottom-nav,.day-panel,.detail-panel,.detail-top,.modal,.modal-actions,.filters,.calendar-filters,.calendar-grid,.day-cell,.job-card,.technician-case-card,.metric,.dash-card,.team-card,.profile-card,.table-wrap,.all-jobs tr,.job-search,.link-card,.inventory-card,.map-filter-card,.today-part-card,.empty-state,.payroll-view-card,.payroll-report-cards article,.case-selection-popover,.multi-options,.comment-box,.comment-editor,.status-history,.subcase-list article,.view-switch,.bulk-actions,.auth-card){background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(input,select,textarea,.selection-trigger,.round-btn,.btn.ghost,.modal-close,.case-picker-head button,.bulk-apply,.photo-attach,.add-photo,.new-job-link,.clear-filters){background:var(--theme-input,#152132)!important;color:var(--ink)!important;border-color:var(--theme-input-line,#52677f)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(input,textarea)::placeholder{color:#aabbd0!important;opacity:1}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.weekdays,th,.global-search,.day-cell.muted,.tech-label b,.bar-row div,.payroll-grid-header,.payroll-grid-row>*:first-child,.payroll-report-cards dl div,.admin-status-control,.part-state){background:var(--surface-raised)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.day-cell.day-selected,.day-cell:hover,.job-card.selected,.job-card:hover,.technician-case-card:hover,tbody tr:hover,.view-switch button.active,.nav-item.active){background:var(--theme-selected,#304b69)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .day-cell.muted .date-num{color:#91a3b9!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.btn.primary,.btn.primary *, .today .date-num){color:#fff!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.status,.calendar-event){background:color-mix(in srgb,var(--status-hue,#c5d7e6) 22%,transparent)!important;color:color-mix(in srgb,var(--status-hue,#c5d7e6) 38%,#fff)!important;border-color:color-mix(in srgb,var(--status-hue,#c5d7e6) 65%,transparent)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.pickup-summary,.pickup-banner,.locked-banner,.payroll-rule-note){background:#3a3427!important;color:#ffe0a0!important;border-color:#877346!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.comment-short,.comment-full,.comment-body p){color:#c4d1e3!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.job-time,.technician-case-card>div:first-child>b,.comment-author-row time){color:color-mix(in srgb,var(--personal-timeColor) 65%,#fff)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.testing-mode-banner,.testing-mode-banner *){color:#312500!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .calendar-pane-resizer span{background:var(--surface-raised,#28384c);border-color:#66788e}
.detail-client>div:last-child{min-width:0;flex:1}
@media(min-width:721px){
 .detail-client .desktop-contact-action{display:flex!important;align-items:center;justify-content:flex-start;gap:6px;width:100%}
 .detail-client .desktop-contact-action>span{display:inline!important;flex:0 1 auto;width:auto;min-width:0;margin:0;overflow-wrap:anywhere}
 .detail-client .desktop-contact-action>.contact-icon{display:inline-flex!important;flex:0 0 28px;width:28px;height:28px;min-height:28px;margin:0;line-height:1}
}
.customer-priority-row{display:grid;grid-template-columns:minmax(90px,1fr) minmax(0,2fr);gap:10px;align-items:start;min-width:0}
.customer-priority-row>label,.customer-priority-row input,.customer-priority-row select{min-width:0;width:100%}
.customer-priority-row .release-priority{margin:0;max-width:none}
.release-bulk{width:min(1220px,96vw)!important;padding:20px!important}
.release-bulk .bulk-row,.release-bulk .bulk-master{grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;padding:10px;margin-bottom:8px;align-items:start}
.release-bulk input,.release-bulk select,.release-bulk .selection-trigger{height:34px;min-height:34px;font-size:12px;padding:5px 8px}
.release-bulk label,.release-bulk .case-picker-field{gap:4px;font-size:11px}
.release-bulk .case-picker-field>small{display:none}
.release-bulk .bulk-apply{min-height:24px;padding:3px;font-size:10px}
.release-bulk .bulk-actions{padding:8px;margin-top:8px}
.bulk-master-panel{margin-bottom:8px}.bulk-master-panel>summary{padding:8px;font-size:12px}
.release-bulk>p{margin-bottom:8px!important}
.technician-case-card .case-status-summary{display:flex;flex-direction:row;justify-content:flex-start;flex-wrap:nowrap;gap:5px;min-width:0}
.case-status-summary .status,.case-status-summary .pickup-summary{position:static;display:inline-flex;align-items:center;font-size:10px;line-height:1.3;padding:5px 7px;border-radius:12px;white-space:nowrap;margin:0}
.pickup-summary{background:#f59e0b26;color:#76500c}
.attendance-reports{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:22px;align-items:start}
.attendance-report{min-width:0}
.attendance-report summary{display:flex;align-items:center;justify-content:space-between;gap:8px;cursor:pointer;font-size:13px;font-weight:700}
.attendance-report summary:before{content:'▸';color:var(--muted)}.attendance-report[open] summary:before{content:'▾'}
.attendance-report summary span{flex:1}.attendance-report summary b{font-size:25px}
.attendance-report>p{font-size:11px;color:var(--muted)}
.attendance-case-list{max-height:260px;overflow:auto}
.attendance-case-list article{display:grid;gap:4px;border-top:1px solid var(--line);padding:10px 0;font-size:12px;overflow-wrap:anywhere}
.attendance-case-list small{color:var(--muted)}
/* Small-screen overlays must stay entirely above the page and above the bottom navigation. */
html{--mobile-footer-space:64px}html[data-environment=testing]{--mobile-footer-space:86px}
html:is([data-theme=dark],[data-color-scheme=dark]) .copy-case{background:var(--surface-raised,#28384c)!important;color:#e4ebf5!important;border-color:var(--theme-input-line,#52677f)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .part-row,html:is([data-theme=dark],[data-color-scheme=dark]) .part-row.used{background:#243b39!important;color:#e4ebf5!important;border-color:#42655e!important}
.detail-panel .comments .comment p,.detail-panel .comment-short,.detail-panel .comment-full{font-size:var(--personal-commentSize)!important}
@media(max-width:720px){
 .modal-layer:not(.gallery-layer){inset:0 0 var(--mobile-footer-space) 0!important;z-index:200!important;padding:8px 0 0!important;overflow:hidden;align-items:end}
 .modal-layer .modal,.modal-layer .modal.release-bulk{max-height:calc(100dvh - var(--mobile-footer-space) - 8px)!important;animation:none!important;overflow-y:auto!important;min-height:0}
 .customer-priority-row>label{display:flex;flex-direction:column;justify-content:flex-end;min-height:64px}
 .customer-priority-row>label>input,.customer-priority-row>label>select{margin-top:auto;flex-shrink:0}
}

/* Optimisation v13: localized progress and offline-sync feedback. */
.data-loading{margin:10px 0;color:var(--personal-timeColor,#405d78);font-weight:700;font-size:13px}
.sync-pending{display:inline-flex;margin-top:6px;padding:3px 8px;border-radius:999px;background:rgba(37,99,235,.12);color:#2563eb;font-size:11px;font-weight:800}
:is([data-theme="dark"],[data-color-scheme="dark"]) .sync-pending{background:rgba(96,165,250,.18);color:#93c5fd}
.filters input,.filters select{min-width:0;max-width:100%}
@media(max-width:1100px){.release-bulk .bulk-row,.release-bulk .bulk-master{grid-template-columns:repeat(3,minmax(0,1fr))}.technician-case-card{grid-template-columns:100px minmax(0,1fr)}.technician-case-card .case-status-summary{grid-column:2;justify-self:start}}
@media(max-width:720px){
 /* Snapshot refreshes replace the panel DOM. Never replay a sheet-entry animation. */
 .detail-panel,.detail-panel .detail-scroll{animation:none!important;transition:none!important}
 .detail-panel{transform:none!important;opacity:1!important}
 .detail-client .desktop-contact-action{display:none!important}
 .release-bulk{width:100%!important;max-width:100%!important;padding:16px 10px!important}
 .release-bulk .bulk-row,.release-bulk .bulk-master{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;padding:8px}
 .release-bulk input,.release-bulk select,.release-bulk .selection-trigger{min-height:38px;font-size:16px}
 .release-bulk .case-selection-popover{width:calc(100vw - 24px);max-height:70dvh}
 .customer-priority-row{grid-column:1/-1!important;grid-template-columns:minmax(90px,1fr) minmax(0,2fr);gap:8px}
 .technician-case-card{grid-template-columns:76px minmax(0,1fr);gap:8px}
 .technician-case-card .case-status-summary{grid-column:1/-1;justify-self:start}
 .technician-case-card h3{font-size:15px!important}
 .appearance-card{margin:12px 0;padding:16px}.appearance-card .form-grid{grid-template-columns:1fr}
 .appearance-card .btn{height:auto;min-height:40px}
 .attendance-reports{grid-template-columns:1fr;gap:8px}.attendance-report{padding:12px}
 .calendar-toolbar,.dashboard-actions,.case-create-actions{max-width:100%;flex-wrap:wrap}
 .detail-scroll{overflow-x:hidden}.detail-scroll>h2{overflow-wrap:anywhere}
 .part-actions{flex-wrap:wrap}.part-row{min-width:0}.part-row>div{min-width:0;overflow-wrap:anywhere}
 .filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
/* Follow-up: static reports, complete stock surfaces, and one mobile scroll owner. */
.attendance-total{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px;font-weight:700}
.attendance-total b{font-size:28px}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.appliance-model-ticket,.today-case-group,.stock-location-row,.taxonomy-row){background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.today-case-heading,.model-quantity-grid>div,.stock-total,.stock-location-row.returned){background:var(--surface-raised)!important;color:var(--ink)!important;border-color:var(--line)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) :is(.appliance-model-ticket>div,.today-line,.stock-adjust-form){color:var(--ink)!important;border-color:var(--line)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .appliance-model-ticket>div i{color:#f4ce8d!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .appliance-model-ticket:hover{background:#2b4055!important;border-color:#6caaa9!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .today-case-heading:hover{background:var(--theme-selected,#304b69)!important}
html{--testing-banner-space:0px;--mobile-footer-space:calc(70px + env(safe-area-inset-bottom,0px))}
html[data-environment=testing]{--testing-banner-space:22px;--mobile-footer-space:calc(92px + env(safe-area-inset-bottom,0px))}
@media(max-width:720px){
 .main-area,.admin-sidebar~.main-area{height:calc(100dvh - var(--mobile-footer-space))!important;min-height:0!important;overflow:hidden!important;display:flex;flex-direction:column}
 .main-area .topbar{flex:0 0 59px}
 .main-area .content,.admin-sidebar~.main-area .content{flex:1 1 0;height:auto!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;touch-action:pan-y;-webkit-overflow-scrolling:touch}
 .admin-sidebar~.main-area .calendar-content{display:block!important}
 .calendar-content>.calendar-panel,.calendar-content>.day-panel{height:auto!important;min-height:0!important;max-height:none!important}
 .calendar-content>.day-panel .schedule-list{height:auto!important;max-height:none!important;overflow:visible!important;touch-action:pan-y}
 .sidebar.admin-sidebar.sidebar-open{inset:0 0 var(--mobile-footer-space) 0!important;min-height:0!important;height:auto!important;overflow-y:auto!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;filter:none!important;transform:none!important;contain:none!important;animation:none!important}
 .sidebar .mobile-bottom-nav{position:fixed!important;inset:auto 0 var(--testing-banner-space) 0!important;height:calc(70px + env(safe-area-inset-bottom,0px))!important;transform:none!important;margin:0!important}
 .sidebar.sidebar-open .mobile-bottom-nav .nav-item{min-height:0!important;border:0!important;box-shadow:none!important}
 .detail-panel:not(.empty-detail){display:flex;flex-direction:column;bottom:var(--mobile-footer-space)!important}
 .detail-panel .detail-top{flex-shrink:0}
 .detail-panel .detail-scroll{flex:1;min-height:0;height:auto!important;overflow-y:auto!important}
 .inventory-page,.today-parts-page,.appliance-model-grid,.today-case-groups{min-width:0;max-width:100%}
 .today-case-heading,.today-line,.appliance-model-ticket{overflow-wrap:anywhere}
}
/* Technician dark-mode status actions use their own clear outcome colors. */
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status="Tech Complete"]{
  background:#123f37!important;border-color:#319980!important;color:#d8fff4!important;
}
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status="Parts Required"]{
  background:#4a3515!important;border-color:#d79628!important;color:#fff0c9!important;
}
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status="Cancelled"]{
  background:#4a2028!important;border-color:#df5365!important;color:#ffe0e5!important;
}
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status]:hover{
  filter:brightness(1.16);
}

/* Keep technician outcomes evenly spaced instead of clustered at the left edge. */
.tech-sidebar~.main-area .status-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  width:100%;
}
.tech-sidebar~.main-area .status-actions [data-status]{
  width:100%;
  min-width:0;
  justify-content:center;
  padding-inline:6px;
}
@media(max-width:360px){
  .tech-sidebar~.main-area .status-actions{gap:6px}
  .tech-sidebar~.main-area .status-actions [data-status]{font-size:9px;padding-inline:3px}
}

/* Prevent iOS and installed mobile web apps from zooming when controls receive focus. */
@media(max-width:720px){
  input,select,textarea{font-size:16px!important}
  #commentText,#commentEditText{font-size:max(16px,var(--personal-commentSize,12px))!important}
}

/* Final UI/PWA pass: standalone safe areas, predictable overlays and focus. */
:root{
  --safe-area-top:env(safe-area-inset-top,0px);
  --safe-area-right:env(safe-area-inset-right,0px);
  --safe-area-bottom:env(safe-area-inset-bottom,0px);
  --safe-area-left:env(safe-area-inset-left,0px);
}

.sync-pending{align-self:flex-start;flex:0 0 auto;white-space:nowrap}
.modal{max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
.toast{z-index:320!important}
:is(button,a,input,select,textarea,summary,[role="button"],[role="separator"]):focus-visible{
  outline:3px solid #43a5ff!important;
  outline-offset:2px!important;
}
:is(.global-search,.job-search,.comment-box,.comment-editor):focus-within{
  border-color:#3d8fd8!important;
  box-shadow:0 0 0 3px rgba(61,143,216,.2)!important;
}
.case-row-open{display:block;width:100%;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
.case-row-open:focus-visible{position:relative;z-index:1;border-radius:5px}
.calendar-content>.empty-detail{display:grid;place-items:center;padding:30px;text-align:center;color:var(--muted)}

/* Preserve the fixed status palette while improving small-label contrast. */
html[data-theme=light] .status.new{color:#40576c!important}
html[data-theme=light] .status.awaiting-parts{color:#705800!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .mobile-bottom-nav .nav-item:not(.active){color:#c7d2df!important}

@supports(-webkit-touch-callout:none){
  select{-webkit-appearance:menulist!important;appearance:auto!important}
  input[type="date"],input[type="time"]{-webkit-appearance:auto!important;appearance:auto!important}
}

@media(max-width:720px){
  .main-area .topbar{
    flex-basis:calc(59px + var(--safe-area-top))!important;
    height:calc(59px + var(--safe-area-top))!important;
    padding-top:var(--safe-area-top)!important;
    padding-left:max(15px,var(--safe-area-left))!important;
    padding-right:max(15px,var(--safe-area-right))!important;
  }
  .admin-sidebar~.main-area>.content:not(.calendar-content){padding-top:max(14px,calc(var(--safe-area-top) + 10px))!important}
  .admin-sidebar~.main-area>.calendar-content>.calendar-panel{padding-top:max(14px,calc(var(--safe-area-top) + 10px))!important}
  .sidebar.admin-sidebar.sidebar-open{padding-top:max(24px,calc(var(--safe-area-top) + 14px))!important}
  .tech-sidebar~.main-area .detail-panel:not(.empty-detail){top:calc(59px + var(--safe-area-top))!important}
  .admin-sidebar~.main-area .detail-panel:not(.empty-detail){top:var(--safe-area-top)!important}

  /* A modal owns the whole screen. Navigation stays visible after it closes. */
  .modal-layer,.modal-layer:not(.gallery-layer),.gallery-layer{
    inset:0!important;
    width:100%!important;
    height:100dvh!important;
    z-index:200!important;
    padding:max(8px,var(--safe-area-top)) max(8px,var(--safe-area-right)) max(8px,var(--safe-area-bottom)) max(8px,var(--safe-area-left))!important;
    align-items:end!important;
    overflow:hidden!important;
  }
  .modal-layer .modal,.modal-layer .modal.release-bulk{
    width:100%!important;
    max-width:100%!important;
    max-height:calc(100dvh - var(--safe-area-top) - var(--safe-area-bottom) - 16px)!important;
    border-radius:18px 18px 10px 10px!important;
    padding-bottom:max(24px,calc(var(--safe-area-bottom) + 14px))!important;
  }
  .gallery-modal{height:calc(100dvh - var(--safe-area-top) - var(--safe-area-bottom) - 16px)!important;max-height:100%!important}
  .gallery-close{top:max(8px,var(--safe-area-top));right:max(8px,var(--safe-area-right))}
  .gallery-controls{padding-bottom:var(--safe-area-bottom)}
  .toast{left:max(12px,var(--safe-area-left))!important;right:max(12px,var(--safe-area-right))!important;bottom:calc(var(--mobile-footer-space) + 12px)!important}
  .round-btn,.status-actions .btn,.photo-attach,.gallery-controls button,.modal-close,.gallery-close,.comment-admin button{min-width:44px;min-height:44px}
}

@media(min-width:721px) and (max-width:930px){
  .sidebar:not(.sidebar-open){width:65px!important;flex:0 0 65px!important;overflow:hidden!important;padding-inline:7px!important}
  .sidebar:not(.sidebar-open) .brand{justify-content:center!important;width:100%!important;padding-inline:0!important;overflow:hidden!important}
  .sidebar:not(.sidebar-open) .brand-copy,.sidebar:not(.sidebar-open) .nav-label,.sidebar:not(.sidebar-open) .sidebar-footer,.sidebar:not(.sidebar-open) .nav-count{display:none!important}
  .sidebar:not(.sidebar-open) nav{width:100%!important;overflow:hidden!important}
  .sidebar:not(.sidebar-open) .nav-item,.sidebar:not(.sidebar-open) .nav-item:not(.active){justify-content:center!important;width:100%!important;min-width:0!important;padding-inline:5px!important;font-size:0!important;overflow:hidden!important}
  .sidebar:not(.sidebar-open) .nav-item .icon{flex:0 0 auto;font-size:20px!important}
}

@supports not (height:100dvh){
  .modal{max-height:calc(100vh - 32px)}
  @media(max-width:720px){
    .modal-layer,.modal-layer:not(.gallery-layer),.gallery-layer{height:100vh!important}
    .modal-layer .modal,.modal-layer .modal.release-bulk{max-height:calc(100vh - var(--safe-area-top) - var(--safe-area-bottom) - 16px)!important}
  }
}

/* Reference ALBA login: photographic desktop split, stacked mobile welcome. */
html[data-theme=auth],html[data-theme=auth] body{background:#edf7fc!important;color-scheme:light}
.new-alba-auth.auth-page{display:flex;align-items:center;justify-content:center;width:100%;height:calc(100dvh - var(--testing-banner-space));min-height:0;padding:max(24px,var(--safe-area-top)) max(24px,var(--safe-area-right)) max(24px,var(--safe-area-bottom)) max(24px,var(--safe-area-left));overflow-x:hidden;overflow-y:auto;background:radial-gradient(ellipse at top left,#fff,#e3f3fe)!important;color:#080d49}
.auth-brand-filter{position:absolute;pointer-events:none}
.new-alba-auth .auth-layout{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(320px,1fr);width:min(1320px,100%);min-height:min(740px,calc(100dvh - 80px));margin:auto;border:1px solid #d0e1ef;border-radius:20px;background:#fff;box-shadow:0 18px 48px #285c8530;overflow:hidden}
.new-alba-auth .auth-scene{position:relative;isolation:isolate;min-width:0;min-height:620px;overflow:hidden;background:#cfe8f7}
.new-alba-auth .auth-scene-photo{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover;object-position:60% bottom}
.new-alba-auth .auth-scene::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,rgba(250,253,255,.88),rgba(250,253,255,.44) 28%,transparent 57%);-webkit-mask-image:linear-gradient(to bottom,#000 0 70%,transparent 90%);mask-image:linear-gradient(to bottom,#000 0 70%,transparent 90%)}
.new-alba-auth .auth-logo-frame{position:absolute;left:6.5%;top:6%;width:clamp(135px,15vw,190px);aspect-ratio:2;overflow:hidden}
.new-alba-auth .new-alba-logo{position:absolute;width:131.4%;max-width:none;height:auto;left:-16%;top:-75.2%;margin:0;filter:url(#alba-logo-ink)}
.new-alba-auth .auth-scene-copy{position:absolute;left:6.5%;top:27%;max-width:48%}
.new-alba-auth .auth-service-line{margin:0 0 26px;font-size:clamp(13px,1.15vw,17px);font-weight:800;line-height:1.45;letter-spacing:2px;text-transform:uppercase;color:#080d49}
.new-alba-auth .auth-service-line::before{content:"";display:block;width:32px;height:2px;margin-bottom:18px;background:linear-gradient(90deg,#0062ff 65%,#00cbd9 65%)}
.new-alba-auth .auth-benefits{display:grid;gap:22px;list-style:none;padding:0;margin:0}
.new-alba-auth .auth-benefits li{display:flex;align-items:center;gap:16px}
.new-alba-auth .auth-benefits .icon{display:grid;place-items:center;width:54px;height:54px;flex:0 0 54px;border:1px solid #76bcff;border-radius:50%;background:#ebf8ffb8;color:#005dff}
.new-alba-auth .auth-benefits .icon svg{width:27px;height:27px}
.new-alba-auth .auth-benefits strong{display:block;margin-bottom:5px;font-size:11px;font-weight:800;letter-spacing:1.5px;text-transform:uppercase}
.new-alba-auth .auth-benefits span:not(.icon){display:block;font-size:12px;line-height:1.4;color:#52649d}
.new-alba-auth .auth-location{position:absolute;right:7%;bottom:5%;padding:14px 18px;border:1px solid #ddeffc70;border-radius:16px;background:#253954b3;color:#fff;backdrop-filter:blur(12px)}
.new-alba-auth .auth-location>span{display:flex;align-items:center;gap:8px;font-size:12px;letter-spacing:2px;text-transform:uppercase}
.new-alba-auth .auth-location small{display:block;margin-top:8px;font-size:8px;letter-spacing:1.7px;text-transform:uppercase}
.new-alba-auth .auth-toronto-script{display:none}
.new-alba-auth .auth-card{display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;min-width:0;width:100%;max-width:none;margin:0;padding:48px clamp(24px,3vw,44px) 32px;border:0;border-radius:20px 0 0 20px;background:#fff!important;box-shadow:-8px 0 24px #647ca012;text-align:center;color:#080d49!important}
.new-alba-auth .auth-kicker{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 0 46px;font:700 10px/1.5 var(--font);letter-spacing:1.7px;text-transform:uppercase;color:#52649d}
.new-alba-auth .auth-kicker i{width:9px;height:9px;flex:0 0 9px;border-radius:50%;background:#00a99b}
.new-alba-auth .auth-heading{width:100%;margin:0 0 54px}
.new-alba-auth .auth-card h1{margin:0 0 12px;font:800 clamp(27px,2.6vw,39px)/1.15 Manrope,sans-serif!important;letter-spacing:-1.2px;color:#080d49!important}
.new-alba-auth .auth-intro{margin:0;font-size:17px;line-height:1.55;color:#6372a6!important}
.new-alba-auth .auth-card #googleSignIn{display:flex;align-items:center;justify-content:center;gap:12px;position:relative;width:100%;height:auto;min-height:56px;padding:14px 18px;border:1px solid #edf0f5;border-radius:12px;background:#fff!important;box-shadow:0 5px 16px #35557729;color:#080d49!important;font:700 15px/1.4 var(--font);cursor:pointer;transition:box-shadow .15s ease,background .15s ease}
.new-alba-auth .auth-card #googleSignIn:hover{background:#f5faff!important;box-shadow:0 6px 20px #35557738}
.new-alba-auth .auth-card #googleSignIn:disabled{opacity:.65;cursor:wait}
.new-alba-auth .google-signin-mark{width:24px;height:24px;flex:0 0 24px}
.new-alba-auth .auth-arrow{margin-left:auto;font-size:24px;font-weight:400;color:#253a88}
.new-alba-auth .auth-divider{width:48px;height:1px;margin:34px auto 28px;background:#a5b3d8}
.new-alba-auth .auth-access-note{margin:0;font-size:12px;line-height:1.65;color:#5c6da3}
.new-alba-auth .auth-access-note p{margin:12px 0 0}
.new-alba-auth .auth-secure{display:flex;align-items:center;justify-content:center;gap:8px;color:#080d49;font-size:13px;font-weight:700}
.new-alba-auth .auth-secure svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.new-alba-auth .auth-build{display:block;margin-top:44px;font-size:11px;line-height:1.5;color:#5c6da3}
.new-alba-auth .auth-error{width:100%;margin:18px 0 0;padding:12px;border:1px solid #f1bcc7;border-radius:8px;background:#fff1f3;color:#92233c;overflow-wrap:anywhere;font-size:13px}
@media(min-width:761px) and (max-width:1050px){
  .new-alba-auth .auth-layout{grid-template-columns:minmax(0,1.15fr) minmax(300px,1fr)}
  .new-alba-auth .auth-benefits li{gap:10px}
  .new-alba-auth .auth-benefits .icon{width:42px;height:42px;flex-basis:42px}
  .new-alba-auth .auth-scene-copy{max-width:60%}
  .new-alba-auth .auth-benefits{display:none}
  .new-alba-auth .auth-signature{display:none}
  .new-alba-auth .auth-location{left:6.5%;right:auto}
}
@media(max-width:760px){
  .new-alba-auth.auth-page{display:block;padding:0;background:#fff!important}
  .new-alba-auth .auth-layout{display:flex;flex-direction:column;min-height:100%;width:100%;border:0;border-radius:0;box-shadow:none}
  .new-alba-auth .auth-scene{flex:0 0 auto;height:clamp(280px,43svh,430px);min-height:0}
  .new-alba-auth .auth-scene-photo{object-position:60% 36%}
  .new-alba-auth .auth-scene::after{background:linear-gradient(180deg,rgba(240,250,255,.28),transparent 58%,rgba(0,12,43,.66));-webkit-mask-image:none;mask-image:none}
  .new-alba-auth .auth-logo-frame{top:calc(20px + var(--safe-area-top));left:max(24px,var(--safe-area-left));width:clamp(112px,28vw,160px)}
  .new-alba-auth .auth-toronto-script{display:block;position:absolute;right:max(26px,var(--safe-area-right));top:calc(14px + var(--safe-area-top));margin:0;font:400 clamp(24px,6.4vw,33px)/.94 Caveat,'Segoe Script',cursive;text-align:center;color:#0043cd;transform:rotate(-12deg)}
  .new-alba-auth .auth-toronto-script::after{content:"";display:block;width:32px;height:2px;margin:12px 0 0 auto;background:linear-gradient(90deg,#0054ff 70%,#00d6e8 70%);transform:rotate(12deg)}
  .new-alba-auth .auth-scene-copy{top:auto;bottom:36px;left:max(24px,var(--safe-area-left));max-width:75%}
  .new-alba-auth .auth-service-line{margin:0;font-size:12px;line-height:1.45;letter-spacing:2px;color:#fff}
  .new-alba-auth .auth-service-line::before{display:none}
  .new-alba-auth .auth-benefits,.new-alba-auth .auth-location,.new-alba-auth .auth-kicker{display:none}
  .new-alba-auth .auth-card{flex:1 0 auto;justify-content:flex-start;width:100%;margin-top:-20px;padding:22px max(24px,var(--safe-area-right)) calc(20px + var(--safe-area-bottom)) max(24px,var(--safe-area-left));border-radius:22px 22px 0 0;box-shadow:none}
  .new-alba-auth .auth-heading{margin-bottom:30px}
  .new-alba-auth .auth-card h1{font-size:28px!important;letter-spacing:-.9px;margin-bottom:8px}
  .new-alba-auth .auth-intro{font-size:15px;line-height:1.5}
  .new-alba-auth .auth-card #googleSignIn{max-width:400px;min-height:54px;font-size:14px;gap:10px}
  .new-alba-auth .auth-divider{display:none}
  .new-alba-auth .auth-access-note{margin-top:28px;font-size:11px}
  .new-alba-auth .auth-secure{font-size:12px}
  .new-alba-auth .auth-build{margin-top:auto;padding-top:28px;font-size:10px}
}
@media(max-width:360px){
  .new-alba-auth .auth-card{padding-inline:max(20px,var(--safe-area-left)) max(20px,var(--safe-area-right))}
  .new-alba-auth .auth-card #googleSignIn{font-size:13px;padding-inline:12px}
}
@media(prefers-reduced-motion:reduce){.new-alba-auth .auth-card #googleSignIn{transition:none}}


@media(min-width:1301px){
  .calendar-pane-resizer{inset:0 auto 0 0!important}
}

/* Softer backgrounds only: fixed status hues and readable text stay intact. */
html:not(:is([data-theme=dark],[data-color-scheme=dark])) body :is(.status,.calendar-event){
  background:color-mix(in srgb,var(--status-hue,#c5d7e6) 8%,transparent)!important;
  border-color:color-mix(in srgb,var(--status-hue,#c5d7e6) 28%,transparent)!important;
}
html:is([data-theme=dark],[data-color-scheme=dark]) body :is(.status,.calendar-event){
  background:color-mix(in srgb,var(--status-hue,#c5d7e6) 12%,transparent)!important;
  border-color:color-mix(in srgb,var(--status-hue,#c5d7e6) 30%,transparent)!important;
}
html:not([data-theme=auth]) .btn.primary{
  background:color-mix(in srgb,var(--personal-accent,#2474d5) 78%,#28384c)!important;
  border-color:color-mix(in srgb,var(--personal-accent,#2474d5) 64%,#28384c)!important;
  color:#fff!important;
}
html:is([data-theme=dark],[data-color-scheme=dark]) .btn.primary{background:color-mix(in srgb,var(--personal-accent,#2474d5) 42%,#28384c)!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status="Tech Complete"]{background:color-mix(in srgb,#10b981 12%,#202d3e)!important;border-color:#447569!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status="Parts Required"]{background:color-mix(in srgb,#f59e0b 12%,#202d3e)!important;border-color:#877143!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status="Cancelled"]{background:color-mix(in srgb,#dc2626 12%,#202d3e)!important;border-color:#92545b!important}
html:is([data-theme=dark],[data-color-scheme=dark]) .tech-sidebar~.main-area .status-actions [data-status]:hover{filter:brightness(1.08)}
.theme-setting{display:flex;align-items:center;gap:12px}.theme-toggle{width:46px;height:46px;min-width:46px;justify-content:center}.theme-toggle .icon{width:23px;height:23px}
