/* Isolated audit responsive patch; no payment or automation changes. */
@media (max-width: 63.99rem) {
  .page-audit .thomas-stage-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-audit .thomas-step,
  .page-audit .thomas-stage-button {
    min-width: 0;
  }
  .page-audit .thomas-stage-button {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 23rem) {
  .page-audit .thomas-stage-steps {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 34rem) {
  /* Give the third-party questionnaire the whole available page width.
     Google Forms' own 320px overflow remains outside site CSS control. */
  .page-audit-intake .audit-intake__form {
    width: calc(100% + 2rem);
    margin-inline: -1rem;
    padding: 1rem 0;
    border-inline: 0;
    border-radius: 0;
  }
  .page-audit-intake .audit-intake__form > h2,
  .page-audit-intake .audit-intake__form > [data-form-loading] {
    width: auto;
    margin-inline: 1rem;
    overflow-wrap: anywhere;
  }
  .page-audit-intake .audit-intake__form iframe {
    max-width: 100%;
  }
}

/* Google Forms keeps each Other-response input wrapper at a 200px minimum.
   A fitting iframe plus a focusable scroll region preserves every field. */
@media (max-width: 23rem) {
  .page-audit-intake .audit-intake__form {
    overflow-x: auto;
  }
  .page-audit-intake .audit-intake__form iframe {
    min-width: 340px;
  }
}
.page-audit-intake .audit-intake__form:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

/* Keep full-size fallback accessible after zoom narrows the layout viewport. */
.page-audit-intake .audit-intake__form {
  overflow-x: auto;
}
.page-audit-intake [data-audit-full-size] {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}

/* Keep cross-origin keyboard focus in a real, visible scrolling viewport.
   The previous 325rem frame made the entire form one offscreen rectangle.
   Native iframe scrolling retains every question and confirmation document. */
.page-audit-intake .audit-intake__form iframe,
.page-audit-intake .audit-intake__form.is-submitted iframe {
  height: clamp(12rem, 60vh, 40rem);
  height: clamp(12rem, 60svh, 40rem);
  scroll-margin-block: 7rem 1rem;
}

/* Isolated high-zoom/short-viewport presentation repair.
   Give the unchanged cross-origin form almost the full reading viewport.
   The duplicate wrapper heading remains available to assistive technology. */
@media (max-height: 30rem) {
  html:has(body.page-audit) { scroll-behavior: auto; }
  html:has(body.page-audit-intake) { scroll-padding-top: 0; }
  .page-audit-intake .site-header { position: static; transform: none; }
  .page-audit-intake .audit-intake__form > h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .page-audit-intake .audit-intake__form iframe,
  .page-audit-intake .audit-intake__form.is-submitted iframe {
    height: max(4rem, calc(100vh - 2rem));
    height: max(4rem, calc(100svh - 2rem));
    scroll-margin-block: 1rem;
  }
}
