/* Focused entry keeps the real input and its validation in the same form. */
@media(any-pointer:coarse) and (max-width:1400px) {
  /* One continuous white surface behind the native keyboard. Its editing area
     can shrink, while the normal form fits above the browser controls. */
  body .quote-dialog {
    top:0; bottom:auto;
    height:100lvh; min-height:0;
    overflow:clip;
  }
  body .quote-dialog > .quote-form {
    position:relative; top:0; left:0; right:0;
    height:100dvh; min-height:0; max-height:none; overflow:clip;
  }
  /* Content gives up height before the bottom actions do. */
  body .quote-dialog .cart-layout { flex:1 1 0; min-height:0; }
  body .quote-dialog .cart-footer { flex:0 0 auto; padding-bottom:max(12px,env(safe-area-inset-bottom)); }
  body .quote-dialog.is-typing .cart-progress { display:grid; flex:none; margin-bottom:0; }
  body .quote-dialog.is-typing .cart-meter { display:none; }
  body .quote-dialog.is-typing .cart-top { top:14px; position:absolute; }
  body .quote-dialog.is-typing .cart-layout { display:block; padding:24px 16px 16px; scroll-padding-top:24px; }
  body .quote-dialog.is-typing .cart-body { padding:0; }
  body .quote-dialog.is-typing :is(.cart-context,.cart-step > h2,.cart-address-phase > h2) { display:none; }
  body .quote-dialog.is-typing .cart-step { min-height:0; padding:0; animation:none; }
  body .quote-dialog.is-typing #cart-vehicle-step .cart-vehicle-fields,
  body .quote-dialog.is-typing #cart-contact-step .cart-contact-content,
  body .quote-dialog.is-typing .cart-address-phase { min-height:0; padding:0; margin:0; }
  body .quote-dialog.is-typing .cart-entry-field:not(.is-entry-active),
  body .quote-dialog.is-typing .cart-notes:not(.is-entry-active) { display:none; }
  body .quote-dialog.is-typing .cart-field-label { margin:0 0 12px; font-size:16px; }
  body .quote-dialog.is-typing :is(input,textarea) { font-size:16px; }
  body .quote-dialog.is-typing .cart-contact-fields { display:block; margin:0; }
  body .quote-dialog.is-typing :is(.cart-contact-bottles,.cart-privacy-note) { display:none; }
  /* Actions stay out of the keyboard's way and return in their original position. */
  body .quote-dialog.is-typing .cart-footer { display:none; }
  body .quote-dialog.is-typing .cart-address-heading,
  body .quote-dialog.is-typing :is(.cart-map-panel,.cart-utilities,.cart-travel-result,.cart-map-status,.cart-manual-address) { display:none; }
  body .quote-dialog.is-typing .cart-address-entry { margin:0; padding:0; }
  body .quote-dialog.is-typing .cart-address-combobox { margin:0; }
  body .quote-dialog.is-typing[data-entry="location"] .cart-location-field { border-radius:8px; }
  body .quote-dialog.is-typing[data-entry="location"] .cart-unit-disclosure { display:none; }
  body .quote-dialog.is-typing[data-entry="unit"] .cart-address-entry > :not(.cart-unit-disclosure) { display:none; }
  body .quote-dialog.is-typing[data-entry="unit"] .cart-unit-disclosure { margin:0; border:0; background:transparent; }
  body .quote-dialog.is-typing .cart-address-suggestions:not([hidden]) {
    position:relative; inset:auto; width:100%; margin:8px 0 0; padding:0;
    max-height:var(--entry-options-height,240px); box-shadow:none; border:0; background:#fff;
  }
  body .quote-dialog.is-typing .cart-address-suggestions [role="option"] { min-height:64px; }
  /* Center the comments group once through layout, with safe native overflow. */
  body .quote-dialog.is-typing[data-entry="notes"] .cart-layout { display:flex; }
  body .quote-dialog.is-typing[data-entry="notes"] .cart-body { display:flex; flex:1 0 auto; }
  body .quote-dialog.is-typing[data-entry="notes"] #cart-vehicle-step { flex:1; }
  body .quote-dialog.is-typing[data-entry="notes"] #cart-vehicle-step .cart-vehicle-fields { flex:1; }
  body .quote-dialog.is-typing[data-entry="notes"] .cart-notes { display:block; margin:auto 0; padding:0; }
  body .quote-dialog.is-typing .cart-comment-options { gap:6px; margin:0 0 12px; }
  body .quote-dialog.is-typing .cart-comment-options button { min-height:36px; padding:6px 10px; font-size:12px; }
  body .quote-dialog.is-typing .cart-notes textarea { min-height:96px; height:96px; resize:none; overflow:auto; touch-action:pan-y; }
}

/* A readable receipt, using the site's typography and a single quiet rule per row. */
body .quote-dialog .cart-request-tools { margin:14px 80px 0 24px; }
body .quote-dialog .cart-request-tools button {
  justify-content:flex-start; gap:0; min-height:44px; padding:8px 0; border:0;
  border-radius:0 !important; background:transparent; color:#fff; font-size:15px;
  text-decoration:underline; text-underline-offset:5px; text-decoration-color:#777;
}
body .quote-dialog .cart-finish-details { padding:24px; background:#101010; }
body .quote-dialog .cart-finish-details h3 { margin:24px 0 16px; font-size:32px; letter-spacing:-.03em; }
body .quote-dialog .cart-finish-details .cart-complete-summary { display:block; padding:0; border:0; border-radius:0; background:transparent; }
body .quote-dialog .cart-finish-details .cart-complete-summary > div {
  display:grid; grid-template-columns:110px minmax(0,1fr); gap:16px;
  padding:16px 0; margin:0; border:0; border-bottom:1px solid #333; min-width:0;
}
body .quote-dialog .cart-finish-details .cart-complete-summary dt { color:#bbb; font-size:14px; line-height:1.5; }
body .quote-dialog .cart-finish-details .cart-complete-summary dd { display:block; color:#fff; font-size:15px; line-height:1.5; }
body .quote-dialog .cart-receipt-actions { display:flex; gap:24px; margin:16px 0; }
body .quote-dialog .cart-receipt-actions button { padding:8px 0; border:0; background:transparent; text-decoration:underline; text-underline-offset:5px; font-size:14px; }
body .quote-dialog .cart-finish-details .cart-complete-note { font-size:14px; line-height:1.6; }

/* Confirmation uses one plain white action. */
body .quote-confirmation-dialog .quote-confirmation-actions [data-confirm] {
  border:0; background:#fff; color:#111; font-weight:600;
}

/* Form controls respond immediately; content never slides underneath a fixed bar. */
body .quote-dialog .cart-layout { overflow-anchor:none; scroll-behavior:auto; touch-action:pan-y; }
body .quote-dialog .cart-step { animation:none; }
body .quote-dialog[open] { animation:connect-reveal 120ms cubic-bezier(0,0,.2,1); }
body .quote-dialog.is-closing { animation:connect-dismiss 100ms ease-out both; }
@keyframes connect-reveal { from { opacity:.85; } to { opacity:1; } }
@keyframes connect-dismiss { to { opacity:0; } }
body .quote-dialog :is(.cart-progress button,.cart-back,.dialog-submit,.dialog-close,.cart-comment-options button) { transition:background-color 100ms ease,color 100ms ease; scale:1; }
body .quote-dialog :is(.cart-progress button,.cart-back,.dialog-submit,.dialog-close,.cart-comment-options button):hover { scale:1; }
body .quote-confirmation-dialog .quote-confirmation-actions [data-confirm]:focus { outline:none; box-shadow:none; }
body .quote-confirmation-dialog .quote-confirmation-actions [data-confirm]:focus-visible { background:#eee; text-decoration:underline; text-underline-offset:4px; }
@media(prefers-reduced-motion:reduce) {
  body .quote-dialog[open],body .quote-dialog.is-closing { animation:none; }
}

/* Contact actions use a quiet text focus cue, without a surrounding highlight. */
body :is(.services-contact-open,.footer-contact-open,.cart-finish-cancel,.cart-request-help):focus { outline:none; box-shadow:none; }
body :is(.services-contact-open,.footer-contact-open,.cart-finish-cancel,.cart-request-help):focus-visible { text-decoration:underline; text-underline-offset:4px; }
