/* Shared readable text and selected dropdown messages. */
:where(main, form, section, article, dialog, [role="dialog"], .portal-shell) { min-width:0; }
:where(p, label, legend, summary, button, a, h1, h2, h3, h4, small, dt, dd, li, td, th, .note, .message, .error, .alert, .price-row, .payment-summary-row) { overflow-wrap:anywhere; word-break:normal; }
:where(.field, .form-grid > *, .portal-grid > *, .price-row > *, .payment-summary-row > *, .commercial-room-row > *) { min-width:0; max-width:100%; }
:where(textarea) { white-space:pre-wrap; overflow-wrap:anywhere; max-width:100%; box-sizing:border-box; }
:where(button, .button, .btn, .portal-home-link, .mobile-job-trigger, .mobile-job-options button, .total-box .price-row strong, .workflow-payment .payment-summary-row strong) { white-space:normal !important; overflow-wrap:anywhere; text-overflow:clip; height:auto; }
.wrapped-select { position:relative; display:block; min-width:0; max-width:100%; width:100%; box-sizing:border-box; }
.wrapped-select[hidden] { display:none !important; }
.wrapped-select-caption { display:block; box-sizing:border-box; width:100%; min-width:0; white-space:normal; overflow-wrap:anywhere; word-break:normal; pointer-events:none; }
.wrapped-select::after { content:"⌄"; position:absolute; right:12px; top:50%; transform:translateY(-50%); pointer-events:none; }
.wrapped-select > select { position:absolute !important; inset:0; width:100% !important; height:100% !important; min-height:0 !important; margin:0 !important; opacity:0; cursor:pointer; }
.wrapped-select:focus-within { outline:3px solid #bd963a; outline-offset:2px; border-radius:8px; }
.wrapped-select.is-disabled { opacity:.65; }
.wrapped-select.is-disabled > select { cursor:default; }

/* Complete messages remain readable even beside compact native inputs. */
.field-readable-message{display:block;min-width:0;max-width:100%;box-sizing:border-box;white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:normal;margin:6px 0 0;padding:8px 10px;border:1px solid #c9d5e6;border-radius:8px;background:#f5f8fc;color:#071d55;font:inherit;line-height:1.45;}
.field-readable-message[hidden]{display:none!important;}
textarea,textarea::placeholder{white-space:pre-wrap!important;overflow-wrap:anywhere!important;word-break:normal;}

/* Scrubber DO! standard: all entered values and placeholders are solid black. */
:root{--muted:#000000;--text-muted:#000000;--muted-text:#000000;--placeholder-color:#000000;}
:where(input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),textarea,select,select option,.wrapped-select-caption,.field-readable-message,[contenteditable="true"]){color:#000000!important;-webkit-text-fill-color:#000000!important;}
input::placeholder,textarea::placeholder{color:#000000!important;-webkit-text-fill-color:#000000!important;opacity:1!important;}
input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#000000!important;-webkit-text-fill-color:#000000!important;opacity:1!important;}
input::-moz-placeholder,textarea::-moz-placeholder{color:#000000!important;opacity:1!important;}
input:disabled,textarea:disabled,select:disabled,button:disabled,.wrapped-select.is-disabled,.availability-days label.availability-day-disabled{opacity:1!important;}
/* The real native dropdown remains transparent behind its black, wrapping caption. */
.wrapped-select>select,.wrapped-select>select:disabled{opacity:0!important;}

/* Read-only record values use the same solid black as editable input values. */
dd,.customer-submission dd,#customerSubmission dd,.business-value,.record-value{color:#000000!important;}

/* Mobile readability: preserve the existing colors and native form controls. */
@media screen {
 html body dialog[open]{box-sizing:border-box;max-width:calc(100% - 28px);max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;}
 html body :is(.modal-card,.schedule-success-dialog){box-sizing:border-box;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;}
 html body .page-popup-shell{height:100vh;height:100dvh;}
 html body :is(.brand-dialog-actions,.record-view-actions,.dialog-actions,.scope-actions,.saved-quote-actions,.schedule-grid)>*{min-width:0;max-width:100%;box-sizing:border-box;}
}
@media screen and (max-width:1100px){
 :where(input,select,textarea,button,a[href],[tabindex]){scroll-margin-block:96px;}
 :where(.form-grid,.schedule-grid,.career-step,.scope-measurement-grid)>*{min-width:0;}
 html body input:is([type="date"],[type="time"]){min-inline-size:0;max-inline-size:100%;box-sizing:border-box;}
 html body :is(.brand-dialog-actions,.record-view-actions,.dialog-actions,.scope-actions,.saved-quote-actions){flex-wrap:wrap;gap:12px;}
}
@media screen and (pointer:coarse){
 /* Avoid Safari's automatic focus zoom without reducing the viewport scale. */
 input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),select,textarea{font-size:16px;}
}

/* Phone landscape: navigation and branding scroll away with each document. */
@media screen and (orientation:landscape) and (max-width:1100px) and (max-height:600px){
 html body :is(header,nav,.page-popup-toolbar,.dialoghead,.app-section-nav,.check-shell .tools){position:static!important;top:auto!important;bottom:auto!important;}
}

/* Frequency menus keep the native touch target and picker, including iOS. */
#quote-frequency, #quote-post-construction-maintenance-frequency, .commercial-room-frequency, .commercial-task-frequency {position:static!important;opacity:1!important;appearance:auto!important;-webkit-appearance:menulist!important;min-height:44px;max-width:100%;box-sizing:border-box;}

/* Quote dropdown captions must not inherit compact native Safari styling. */
#quote-form .wrapped-select-caption {
  min-height:48px!important;
  height:auto!important;
  padding:13px 40px 13px 14px!important;
  border:1px solid #b8c9df!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#000!important;
  -webkit-text-fill-color:#000!important;
  font-size:16px!important;
  line-height:1.35!important;
  font-weight:400!important;
  white-space:normal!important;
  overflow-wrap:anywhere!important;
}
#quote-form #quote-frequency,
#quote-form #quote-post-construction-maintenance-frequency,
#quote-form .commercial-room-frequency,
#quote-form .commercial-task-frequency {
  width:100%;min-height:48px!important;padding:13px 14px;
  border:1px solid #b8c9df;border-radius:10px;background:#fff;
  color:#000;font-size:16px;line-height:1.35;
}

/* Commercial area frequency opens visible tap choices while its original field validates. */
.commercial-frequency-picker{display:block;position:relative;min-width:0;width:100%;}
#quote-form .commercial-frequency-trigger{display:block;position:relative;width:100%;min-height:48px;padding:13px 40px 13px 14px;border:1px solid #b8c9df;border-radius:10px;background:#fff;color:#000;font:inherit;font-size:16px;line-height:1.35;font-weight:400;text-align:left;white-space:normal;overflow-wrap:anywhere;cursor:pointer;}
.commercial-frequency-trigger::after{content:'⌄';position:absolute;right:14px;top:14px;pointer-events:none;}
.commercial-frequency-trigger[aria-invalid=true]{border:2px solid #a11212!important;}
.commercial-frequency-choices{display:grid;gap:4px;max-height:240px;overflow-y:auto;margin-top:6px;padding:6px;border:1px solid #b8c9df;border-radius:10px;background:#fff;}
.commercial-frequency-choices[hidden]{display:none!important;}
.commercial-frequency-choices button{min-height:44px;padding:10px;border:1px solid transparent;border-radius:6px;background:#fff;color:#000;text-align:left;font:inherit;white-space:normal;overflow-wrap:anywhere;cursor:pointer;}
.commercial-frequency-choices button.is-selected{border-color:#0752cc;background:#eef5ff;}
#quote-form .commercial-room-frequency.commercial-frequency-native{position:absolute!important;width:1px!important;height:1px!important;min-height:0!important;padding:0!important;margin:0!important;opacity:0!important;pointer-events:none!important;clip-path:inset(50%);}

/* Yellow highlight follows the currently selected field on every device. */
html body :is(input:not([type=hidden]),select,textarea,[contenteditable=true]):focus,
html body :is(.commercial-frequency-trigger,.mobile-job-trigger):focus,
html body button:focus-visible {
 outline:3px solid #f6c527!important;outline-offset:2px!important;
}
html body :is(.wrapped-select,.date-control-boundary):focus-within {
 outline:3px solid #f6c527!important;outline-offset:2px!important;
}
/* The visible wrapper carries the highlight for transparent native controls. */
html body .wrapped-select>select:focus,
html body .date-control-boundary>input:focus,
html body .commercial-frequency-native:focus {
 outline:none!important;
}
