:root{font:16px system-ui,sans-serif;color:#192e39;background:#eef2f4}*{box-sizing:border-box}body{margin:0}header{background:#192e39;color:white;padding:24px max(20px,calc((100% - 980px)/2));border-bottom:3px solid #bc7940}h1{font-size:24px}h2{font-size:20px;margin:0 0 18px}h3{font-size:17px}main{max-width:1020px;margin:auto;padding:20px}section,.material,.photo{background:white;border:1px solid #d5dfe3;border-radius:14px;padding:20px;margin-bottom:18px}.heading,.actions{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}.actions{justify-content:flex-end}.heading h2{margin:0}.heading{margin-bottom:18px}button{font:600 14px system-ui;min-height:44px;padding:10px 18px;border:1px solid #9aaeb8;border-radius:8px;background:#f6f8f9;color:#192e39;cursor:pointer}button:disabled{opacity:.5;cursor:wait}label{display:block;font-weight:600;margin:14px 0}input,textarea,select{display:block;font:inherit;width:100%;padding:11px;border:1px solid #9aaeb8;border-radius:7px;margin-top:7px}textarea{min-height:100px;resize:vertical}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.notice{padding:12px;border-left:3px solid #bc7940;background:#fff7ee}#elapsed{display:block;text-align:center;font-size:40px;font-variant-numeric:tabular-nums;margin:22px}.centered{justify-content:center}.photo img{width:100%;max-height:300px;object-fit:contain}.photo input[type=checkbox]{display:inline;width:auto;margin:0 8px}#feedback{position:static;background:#192e39;color:white;border-radius:8px;padding:12px}#feedback:empty{display:none}.error{background:#8d2525!important}.visit-row{display:flex;justify-content:space-between;gap:15px;border-top:1px solid #d5dfe3;padding:16px 0;align-items:center}.summary-text{white-space:pre-wrap;overflow-wrap:anywhere}#summary img{width:100%;max-height:500px;object-fit:contain}@media(max-width:600px){.grid{grid-template-columns:1fr;gap:0}main{padding:12px}section{padding:16px}.actions{gap:8px}button{padding:10px 12px}.heading{align-items:flex-start}}[hidden]{display:none!important}
:root dialog{width:min(680px,calc(100% - 24px));max-height:90dvh;border:1px solid #9aaeb8;border-radius:14px;padding:20px;color:#192e39}dialog::backdrop{background:#192e3970}#reportDialog{width:min(1000px,calc(100% - 24px))}#printReportContent img{max-width:100%;max-height:650px;object-fit:contain}#includeCharge{width:auto;display:inline;margin-right:8px}button[aria-pressed=true]{background:#e9d2bd;border-color:#bc7940}#nextServiceOptions{display:grid;grid-template-columns:repeat(5,1fr)}#nextServiceOptions button{padding:10px 4px}#printReportContent h3{border-bottom:1px solid #bc7940;padding-bottom:8px;break-after:avoid}#printReportContent img{break-inside:avoid}@media print{@page{size:letter;margin:15mm}body>header,body>main,body>dialog:not(#reportDialog){display:none!important}#reportDialog{position:static;display:block!important;width:100%;max-width:none;max-height:none;height:auto;margin:0;padding:0;border:0;overflow:visible}#reportDialog>.heading,#reportDialog>.report-help{display:none}#printReportContent{display:block}.summary-text{white-space:pre-wrap}html,body{background:white;color:#192e39}}
@media print{#reportDialog::backdrop{display:none!important}#reportDialog{border-radius:0!important;box-shadow:none!important}}
#nextServiceOptions{align-items:stretch}#nextServiceOptions button{min-height:64px;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.25}
.report-brand{display:flex;align-items:center;gap:20px;background:#172b37;padding:20px;border-bottom:2px solid #d29a66;color:white;margin-bottom:24px;break-inside:avoid}#printReportContent .report-brand img{width:130px;height:auto;flex-shrink:0}.report-brand h1{font-size:23px;margin:0 0 8px}.report-brand h2{font-size:18px;margin:0}@media(max-width:520px){.report-brand{flex-wrap:wrap;padding:16px}.report-brand h1{font-size:21px}}@media print{.report-brand{-webkit-print-color-adjust:exact;print-color-adjust:exact}}
@media print{:root{background:#fff!important}#reportDialog,#printReportContent{background:#fff!important}#reportDialog::backdrop{background:transparent!important}}
@media print{#pdfStatus{display:none!important}}
.desktop-report{font:11pt Arial,sans-serif;color:#1b2934}.desktop-report .desktop-report-header{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);align-items:center;gap:18px;background:#172b37;padding:18px;border-bottom:3px solid #d29a66;margin-bottom:22px}.desktop-report .report-company{display:flex;align-items:center;gap:14px;min-width:0}#printReportContent .report-company img{width:105px;height:auto;max-width:35%;flex-shrink:0}.report-company h1{font:bold 23pt/1.13 Arial,sans-serif;margin:0;color:white}.report-company h1 span{display:block}.desktop-report .report-contact{min-width:0;text-align:right}.desktop-report .report-contact h3{font-size:12pt;border:0;color:#f2d1b2;margin:0 0 6px;padding:0}.desktop-report .report-contact p{font-size:10pt;margin:4px 0;color:white;overflow-wrap:anywhere}.desktop-report .report-title{font-size:20pt;margin:22px 0 12px;border-bottom:2px solid #d29a66;padding-bottom:5px}.desktop-report .report-identity{display:grid;grid-template-columns:1fr 1fr;gap:25px;margin:20px 0;padding:14px;background:#f5f7f8}.desktop-report .report-identity>div{min-width:0}.desktop-report .report-identity h3{font-size:12pt;border:0;margin:0 0 8px;padding:0}.desktop-report p{white-space:pre-wrap;line-height:1.5;overflow-wrap:anywhere;margin:7px 0}.desktop-report .report-section{border:0;border-radius:0;padding:0;background:transparent;margin:22px 0 0}.desktop-report .report-section h2{font-size:14pt;border-bottom:1px solid #d29a66;padding-bottom:5px;margin:0 0 7px;break-after:avoid}.desktop-report figure{break-inside:avoid;margin:18px 0;padding:10px;border:1px solid #d7dfe3;border-radius:7px}.desktop-report figure img{display:block;max-width:100%;max-height:160mm;width:auto;height:auto;object-fit:contain;margin:auto}.desktop-report figcaption{white-space:pre-wrap;font-size:10pt;line-height:1.4;margin-top:8px}.desktop-report footer{border-top:1px solid #d29a66;margin-top:22px;padding-top:9px;font-size:9pt;color:#61707b}#summary{scroll-margin-top:16px}@media screen and (max-width:520px){.desktop-report .desktop-report-header{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);padding:12px;gap:10px}.desktop-report .report-company{display:block}.desktop-report .report-company h1{font-size:18px}.desktop-report .report-company img{width:80px!important;max-width:100%!important;margin-bottom:8px}.desktop-report .report-contact p{font-size:10px}.desktop-report .report-contact h3{font-size:13px}.desktop-report .report-identity{display:block}.desktop-report .report-identity>div+div{margin-top:20px}}@media print{.desktop-report-header{-webkit-print-color-adjust:exact;print-color-adjust:exact}}
#printReportContent .report-identity h3,#printReportContent .report-contact h3{border:0;padding:0}
#printReportContent .report-section h2{border:0;padding:0;margin-bottom:8px}#printReportContent .report-section:not(.report-photos){border-bottom:1px solid #d29a66;padding-bottom:12px;margin-bottom:18px}
.offline-nav{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:18px}.offline-nav a{display:block;min-height:44px;padding:12px 16px;border:1px solid #9aaeb8;border-radius:8px;background:white;color:#192e39;text-decoration:none}.month-controls{display:grid;grid-template-columns:44px minmax(180px,240px) 44px;justify-content:center;align-items:center;gap:8px;margin:20px 0}.month-controls h3{margin:0;text-align:center}.month-controls button{padding:8px}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;margin-bottom:24px}.calendar-grid>span{text-align:center;font-size:12px;padding:8px 0}.calendar-day{padding:5px;min-height:66px;display:flex;flex-direction:column;gap:5px;align-items:center;justify-content:center;min-width:0;font-size:14px}.calendar-day small{font-size:10px}.outside-month{opacity:.5}.calendar-day[data-today=true]{outline:2px solid #a36a3e;outline-offset:-3px}#customerSection,#scheduleSection,#visitsSection{scroll-margin-top:12px}input[readonly]{background:#f4f6f7}@media(max-width:420px){.month-controls{grid-template-columns:44px minmax(150px,210px) 44px;gap:4px}.calendar-day{min-height:60px;padding:4px;font-size:13px}}
.offline-nav button[aria-current=page],.workspace-tabs button[aria-current=page]{background:#e9d2bd;border-color:#a36a3e}.visit-workspace{min-width:0}.workspace-tabs{display:flex;flex-wrap:wrap;gap:8px}.workspace-tabs button{flex:1 1 105px;min-height:44px}.visit-workspace input,.visit-workspace textarea,.visit-workspace select{min-width:0;max-width:100%}dialog form,dialog label{min-width:0;max-width:100%}dialog input,dialog select,dialog textarea{box-sizing:border-box;min-width:0;min-inline-size:0;max-width:100%;width:100%}dialog .grid{grid-template-columns:repeat(2,minmax(0,1fr))}dialog .grid>*{min-width:0}dialog input[type=date]{appearance:none;-webkit-appearance:none;display:block;text-align:left}dialog input[type=date]::-webkit-date-and-time-value{text-align:left;min-width:0}dialog{overflow-x:hidden;overscroll-behavior-x:none;touch-action:pan-y}#appointmentForm{width:100%}@media(max-width:600px){dialog .grid{grid-template-columns:minmax(0,1fr)}}

header{position:relative}#openSettings{display:block;margin-left:auto}dialog{overscroll-behavior:contain;overflow-y:auto;-webkit-overflow-scrolling:touch}#settingsDialog>section{margin:0;border:0;padding:0}#settingsDialog .actions{justify-content:flex-end}

#nextServiceOptions button{flex-direction:column;gap:2px}

/* Rapid taps activate controls without the browser double-tap zoom gesture. */
button,.offline-nav a{touch-action:manipulation}

.app-header{display:flex;align-items:center;gap:16px}.app-header .app-logo{width:76px;height:76px;object-fit:contain;flex-shrink:0}.app-header h1{font-size:24px;margin:0 0 7px}.app-header p{margin:0;font-size:15px}.offline-nav #openSettings{margin-left:auto}@media(max-width:600px){.app-header{padding:18px 16px;gap:12px}.app-header .app-logo{width:58px;height:58px}.app-header h1{font-size:20px}}

/* Keep iOS native date controls inside the same card width as other fields. */
#visitForm section,#visitForm label{min-width:0}
#visitForm input[type=date]{appearance:none;-webkit-appearance:none;display:block;min-width:0;min-inline-size:0;width:100%;max-width:100%;text-align:left}
#visitForm input[type=date]::-webkit-date-and-time-value{min-width:0;text-align:left}
main{padding-bottom:calc(88px + env(safe-area-inset-bottom, 0px))}
#visitForm>.actions{padding-bottom:12px}

.material-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px;margin-bottom:10px}.material-row>div:first-child{min-width:0;overflow-wrap:anywhere}.material-row p{margin:6px 0 0;font-size:14px;color:#526672}.material-row .actions{flex-shrink:0}#materialError:empty{display:none}@media(max-width:600px){.material-row{flex-wrap:wrap}.material-row .actions{margin-left:auto}}

#workspaceIdentity{min-width:0;overflow-wrap:anywhere}#workspaceIdentity p{margin:8px 0 0;font-size:14px}#workspaceIdentity a{color:inherit;text-underline-offset:3px}#visitDateSection label{margin:0}

#materialDialog{top:max(12px, env(safe-area-inset-top, 0px));bottom:auto;margin:0 auto;max-height:calc(100dvh - 24px)}
.material-pricing-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}.material-pricing-grid label{min-width:0}#materialDialog input[readonly]{background:#f4f6f7}

.payment-options{display:flex;gap:6px;margin-left:auto}.payment-options button{min-height:44px}.finance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.finance-grid label{min-width:0;font-size:14px}.finance-grid output{display:block;margin-top:7px;padding:12px 0;min-height:44px;font-size:16px;font-weight:600;overflow-wrap:anywhere}.finance-grid input{min-height:44px}.finance-source{font-size:13px;color:#526672;margin:0 0 18px}.finance-total-row{display:flex;justify-content:space-between;align-items:baseline;gap:14px;padding:12px 0;border-top:1px solid #d5dfe3}.finance-grand-total{font-size:19px;font-weight:700;border-top:2px solid #bc7940}.finance-total-row strong{white-space:nowrap}#financeError:empty{display:none}@media(max-width:420px){.finance-grid{gap:10px}.finance-grid label{font-size:13px}.finance-grid output{font-size:15px}.finance-grid input{padding:10px 7px}.payment-options button{padding:10px}}

.ios-switch{position:relative;flex-shrink:0;margin-left:auto;width:52px;min-width:52px;height:32px;min-height:32px;padding:0;border:0;border-radius:18px;background:#b3bec3}.ios-switch span{position:absolute;top:3px;left:3px;width:26px;height:26px;border-radius:50%;background:white;box-shadow:0 1px 3px #0003;transition:transform .15s}.ios-switch[aria-checked=true]{background:#a96e3d}.ios-switch[aria-checked=true] span{transform:translateX(20px)}.ios-switch:focus-visible{outline:3px solid #192e39;outline-offset:3px}.finance-source{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.finance-source button{font-size:12px;padding:6px 10px;min-height:36px}.finance-grid input{font:inherit;width:100%}@media(prefers-reduced-motion:reduce){.ios-switch span{transition:none}}

#settingsDialog{width:min(560px,calc(100% - 24px))}#settingsDialog .settings-section{padding:20px 0;border-bottom:1px solid #d5dfe3;border-radius:0}#settingsDialog .settings-section h3{margin:0 0 8px;font-size:16px}#settingsDialog .settings-section p{font-size:14px;line-height:1.5;color:#526672;margin:0 0 14px}#settingsDialog .settings-section p:last-child{margin-bottom:0}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px}.settings-row>div{min-width:0}.settings-row>button{flex-shrink:0}.settings-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px}#settingsDialog #backupStatus{font-size:12px;margin-top:12px}#settingsDialog #importCustomers{width:100%}#settingsFeedback:empty{display:none}#settingsFeedback:not(:empty){padding:12px;background:#eef2f4;border-radius:8px;font-size:14px}

.app-version{margin:18px 0 0;text-align:center;font-size:12px;color:#637781}

.finance-source>button{margin-left:auto}.finance-source>span:empty{display:none}

#visitList .visit-row{display:grid;grid-template-columns:minmax(0,1fr) 152px;gap:12px;align-items:center}#visitList .visit-row>span{min-width:0;overflow-wrap:anywhere}#visitList .visit-row>button{width:152px;min-width:152px;max-width:152px;height:44px;min-height:44px;max-height:44px;padding:10px 12px;white-space:nowrap;line-height:22px}

#customerEditorDialog{width:min(760px,calc(100% - 24px));border:2px solid #b87333}#customerEditorForm h2{margin-bottom:20px}.customer-contact-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.customer-company{grid-column:1/-1}.customer-properties-heading{margin:22px 0 12px}.customer-properties-heading h3{margin:0}#customerProperties fieldset{min-width:0;margin:16px 0;padding:16px;border:1px solid #d7dfe3;border-radius:10px}#customerProperties legend{font-weight:600;padding:0 7px;font-size:15px}.customer-address-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 14px}.customer-address-grid label{min-width:0}.property-remove{display:block;margin-left:auto}.customer-editor-actions{margin-top:20px}.customer-editor-actions button{min-width:140px}#customerEditorError:empty{display:none}#customerList .heading h3{margin:0;overflow-wrap:anywhere}#customerList .heading{align-items:center}#customerList .heading button{flex-shrink:0}#customerList .visit-row{display:grid;grid-template-columns:minmax(0,1fr) 152px}#customerList .visit-row>span{overflow-wrap:anywhere}#customerList .visit-row>button{width:152px;white-space:nowrap}@media(max-width:700px){.customer-contact-grid,.customer-address-grid{grid-template-columns:minmax(0,1fr)}.customer-editor-actions button{min-width:0;flex:1}}

#saveCustomerEditor{background:#b87333;border-color:#b87333;color:white}

.contact-link{color:inherit;text-underline-offset:3px;overflow-wrap:anywhere}#customerList .visit-row>.contact-link{min-width:0}

.offline-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.offline-nav button,.offline-nav #openSettings{margin:0;width:100%;min-width:0;min-height:56px;height:56px;padding:8px 5px;font-size:13px;line-height:18px;white-space:normal}.parts-table{width:100%;border-collapse:collapse;table-layout:fixed}.parts-table th,.parts-table td{text-align:center;padding:14px 8px;overflow-wrap:anywhere;border-bottom:1px solid #d5dfe3}.parts-table th:first-child{width:30%}.parts-table td small{display:block;margin-top:5px;color:#526672}.parts-table button{min-width:70px}.part-picker-row{display:flex;justify-content:space-between;align-items:center;gap:14px;background:#fff;border:1px solid #d5dfe3;border-radius:12px;padding:14px;margin:12px 0}.part-picker-row>div{min-width:0;overflow-wrap:anywhere}.part-picker-row p{font-size:14px;margin:6px 0 0;color:#526672}.part-picker-row button{flex-shrink:0}#partsSection{scroll-margin-top:12px}@media(max-width:600px){.parts-table,.parts-table tbody{display:block}.parts-table thead{display:none}.parts-table tr{display:block;border:1px solid #d5dfe3;border-radius:12px;padding:14px;margin:12px 0}.parts-table td{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;text-align:right;border:0;padding:8px 0}.parts-table td::before{content:attr(data-label);text-align:left;font-weight:600;font-size:13px}.parts-table td:first-child{display:block;text-align:left}.parts-table td:first-child::before{display:none}.parts-table td:last-child{display:flex;justify-content:flex-end}.parts-table td small{font-size:13px}}

#materialDialog[data-mode=library] .material-pricing-grid{grid-template-columns:repeat(3,minmax(0,1fr))}@media(max-width:600px){#materialDialog[data-mode=library] .material-pricing-grid{grid-template-columns:minmax(0,1fr)}}

html.modal-open{overflow:hidden;overscroll-behavior:none}dialog:modal{overscroll-behavior:contain;overflow-y:auto}body{position:static}

.app-header{--header-logo-size:clamp(52px,calc(30vw - 40px),112px);position:relative;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;gap:0;min-height:calc(var(--header-logo-size) + 36px)}.app-header .app-logo{position:absolute;left:max(20px,calc((100% - 980px)/2));top:50%;transform:translateY(-50%);width:var(--header-logo-size);height:var(--header-logo-size)}.app-header>div{width:100%;text-align:center;min-width:0}.app-header h1{font-size:clamp(14px,4.2vw,24px);line-height:1.25;white-space:nowrap}@media(max-width:600px){.app-header{padding:18px 16px}.app-header .app-logo{left:16px}.app-header p{font-size:14px}}

:root dialog.scrollable-dialog{padding:0;overflow:hidden;bottom:auto;margin:0 auto}
dialog.scrollable-dialog>form{overflow:hidden;min-width:0}
dialog.scrollable-dialog .dialog-fields{display:block;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:0 20px 16px}
dialog.scrollable-dialog .dialog-fields>label:first-child{margin-top:0}
dialog.scrollable-dialog>form>.actions{border-top:1px solid #d5dfe3;background:white}
dialog.scrollable-dialog>.heading{background:white;border-bottom:1px solid #d5dfe3}
dialog.short-viewport .dialog-fields{padding:0 16px 12px}
dialog.short-viewport>form>h2{font-size:18px;line-height:1.25}
@media print{#reportDialog.scrollable-dialog{max-height:none!important;overflow:visible!important;position:static!important;padding:0!important}#reportDialog .dialog-fields{max-height:none!important;overflow:visible!important;padding:0!important}}

.label-scan-actions{display:flex;justify-content:flex-end;margin:10px 0}.label-scan-status{font-size:13px;color:#526672;line-height:1.4}.label-scan-status:empty{display:none}.label-scan-actions+ .label-scan-status{margin:8px 0}details:has(>textarea[aria-label="Text read from label"]){margin:12px 0}details textarea{min-height:100px;font-size:13px}

#labelScanDialog{width:min(620px,calc(100% - 24px))}.label-frame-tools{display:flex;justify-content:flex-end;gap:8px;margin:12px 0}.label-frame-image{position:relative;width:fit-content;max-width:100%;margin:0 auto}.label-frame-image canvas{display:block;max-width:100%;max-height:min(440px,45dvh);width:auto;height:auto;touch-action:none;border-radius:6px}.label-corner{position:absolute;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;transform:translate(-50%,-50%);opacity:0;pointer-events:none}.label-corner:focus-visible{opacity:1;background:#ffffff80;outline:3px solid #b87333}.label-scan-status{overflow-wrap:anywhere}#labelScanForm>.actions button{min-width:110px}

.photo-selection{position:relative;display:block;width:100%;padding:0;border:3px solid transparent;border-radius:10px;overflow:hidden;background:#eef2f4;touch-action:manipulation}.photo-selection img{display:block;width:100%;margin:0;max-height:420px;object-fit:contain}.photo-selection[aria-pressed=true]{border-color:#b87333;background:#eef2f4}.photo-selection-badge{position:absolute;right:10px;top:10px;display:grid;place-items:center;width:28px;height:28px;border:2px solid #667782;border-radius:50%;background:#fffffff0;color:white;font-size:20px;line-height:1;box-shadow:0 1px 4px #0003}.photo-selection[aria-pressed=true] .photo-selection-badge{background:#b87333;border-color:#b87333}.photo-selection:focus-visible{outline:3px solid #192e39;outline-offset:3px}.photo-selection:disabled{opacity:1;cursor:default}.photo-selection-status{font-size:13px;color:#526672;line-height:1.4;margin:8px 0 0}
.equipment-card-details{display:grid;grid-template-columns:minmax(100px,.45fr) minmax(0,1fr);gap:10px 16px;margin:0 0 18px;font-size:15px;line-height:1.45}.equipment-card-details dt{font-weight:600;color:#526672}.equipment-card-details dd{margin:0;min-width:0;overflow-wrap:anywhere}.equipment-card>.actions{justify-content:flex-end;margin-left:auto}.equipment-card>.actions button{min-height:44px}@media(max-width:360px){.equipment-card-details{grid-template-columns:100px minmax(0,1fr);gap:10px;font-size:14px}}
