/* Explore Goa mobile form stability patch.
 * Prevents iOS Safari from auto-zooming form controls and ensures focused
 * fields never create horizontal page overflow in Partner Portal, Community
 * Feedback, Utility Core, Elementor/WPForms, or standard theme forms.
 */
@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  html {
    width: 100%;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body.eg-app-page,
  body.egpp-page,
  body.egcf-page,
  body.egpp-standalone {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  /* Every layer in a form/grid must be allowed to shrink within the viewport. */
  .egpp-app,
  .egpp-main-wrap,
  .egpp-content,
  .egpp-form-card,
  .egpp-listing-form,
  .egpp-step,
  .egpp-field-grid,
  .egpp-two-cols,
  .egpp-coordinate-box,
  .egpp-hours-table,
  .egcf-main,
  .egcf-container,
  .egcf-card,
  .egcf-form,
  .egcf-two,
  .eguc-engine,
  .eguc-search-form,
  .wpforms-container,
  .elementor-form,
  form {
    min-width: 0;
    max-width: 100%;
  }

  .egpp-field-grid > *,
  .egpp-two-cols > *,
  .egpp-step > *,
  .egcf-two > *,
  .egcf-form > *,
  .wpforms-field,
  .elementor-field-group,
  form > label {
    min-width: 0;
    max-width: 100%;
  }

  /*
   * iOS Safari zooms the visual viewport when a focused control computes below
   * 16px. 17px avoids rounding below that threshold on large-DPR iPhones while
   * remaining visually consistent with the existing mobile form design.
   */
  .egpp-standalone input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]),
  .egpp-standalone textarea,
  .egpp-standalone select,
  .egcf-form input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]),
  .egcf-form textarea,
  .egcf-form select,
  .eguc-engine input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]),
  .eguc-engine textarea,
  .eguc-engine select,
  .wpforms-container input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]),
  .wpforms-container textarea,
  .wpforms-container select,
  .elementor-form input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]),
  .elementor-form textarea,
  .elementor-form select,
  body.eg-app-page main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]),
  body.eg-app-page main textarea,
  body.eg-app-page main select {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 17px !important;
    line-height: 1.35 !important;
    transform: none !important;
    touch-action: manipulation;
  }

  /* Keep the focus treatment inside the control instead of outside its width. */
  .egpp-standalone input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]):focus,
  .egpp-standalone textarea:focus,
  .egpp-standalone select:focus,
  .egcf-form input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]):focus,
  .egcf-form textarea:focus,
  .egcf-form select:focus,
  .eguc-engine input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]):focus,
  .eguc-engine textarea:focus,
  .eguc-engine select:focus,
  .wpforms-container input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]):focus,
  .wpforms-container textarea:focus,
  .wpforms-container select:focus,
  .elementor-form input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]):focus,
  .elementor-form textarea:focus,
  .elementor-form select:focus,
  body.eg-app-page main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="hidden"]):not([type="file"]):not([type="color"]):not([type="image"]):focus,
  body.eg-app-page main textarea:focus,
  body.eg-app-page main select:focus {
    outline: 0 !important;
    box-shadow: inset 0 0 0 2px rgba(10, 143, 125, .22) !important;
  }

  /* Contain intentional horizontal components without allowing page drift. */
  .egpp-content,
  .egpp-form-card,
  .egcf-main,
  .egcf-card {
    overflow-x: clip;
  }

  .egpp-stepper {
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: contain;
  }

  .egpp-stepper,
  .eguc-intent-chips,
  .eg-app-category-strip {
    -webkit-overflow-scrolling: touch;
  }
}
