/* Shared consumer-dialog geometry. Do not change visibility, stacking order,
   content, or handlers here; legacy feature exclusions remain authoritative. */
:is(
  #summaryOverlay, #partsSheet, #recallOverlay, #garageOverlay,
  #pricingOverlay, #addShopOverlay, #maintLogOverlay, #onboardOverlay,
  #vehNeedOverlay, #signInGateModal, #iosInstallModal, #shopDirOverlay,
  #quoteSheet, #repairPalSheet, #shopApplySheet
) {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  /* Override the old inline bottom-sheet geometry without touching open/close. */
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  overflow: auto;
  overscroll-behavior: contain;
}

:is(
  #summaryOverlay, #partsSheet, #recallOverlay, #garageOverlay,
  #pricingOverlay, #addShopOverlay, #maintLogOverlay, #onboardOverlay,
  #vehNeedOverlay, #signInGateModal, #iosInstallModal, #shopDirOverlay,
  #quoteSheet, #repairPalSheet, #shopApplySheet
) > :first-child {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  flex-shrink: 0;
  margin: 0;
  border-radius: 20px !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Old sheet transforms, including inline onboarding transforms, must not
     displace a visible panel from the viewport center. */
  transform: none !important;
}

/* Preserve existing narrow dialog widths; cap the three formerly full-width sheets. */
#summarySheet, #garageSheet, #partsSheetInner { max-width: 620px; }
#shopDirPanel, #quotePanel, #shopApplyPanel, #repairPalPanel, #iosInstallPanel {
  border-bottom: 1.5px solid var(--border);
}

/* Native input min-content widths must not push application rows sideways on
   phones. Keep the existing rows and compact State/ZIP widths, not clipped fields. */
#shopApplyPanel .qsheet-field { min-width: 0; }
#shopApplyPanel :is(input:not([type="checkbox"]), textarea, select) {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
