/* Shared safeguards for narrow windows, browser zoom and short viewports. */
main,
.site-footer,
.mobile-menu,
.modal-panel,
.cookie-banner,
.toast {
  overflow-wrap: anywhere;
}

.inner-hero-grid > *,
.service-grid > *,
.plan-grid > *,
.mobile-nav-row > * {
  min-width: 0;
}

.btn {
  max-width: 100%;
  text-align: center;
}

.accordion button {
  align-items: center;
  gap: 16px;
}

.accordion button i {
  flex: 0 0 1em;
  line-height: 1;
  text-align: center;
}

.cookie-banner {
  max-height: calc(100vh - 40px);
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.dropdown-menu {
  max-height: calc(100vh - var(--header-height) - 50px);
  max-height: calc(100svh - var(--header-height) - 50px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-menu,
.modal-panel {
  overscroll-behavior: contain;
}

.toast {
  width: max-content;
  max-width: calc(100% - 28px);
  text-align: center;
}

@media (max-width: 720px) {
  .treatment-row {
    grid-template-columns: 45px minmax(0, 1fr) 48px;
  }

  .cookie-banner {
    max-height: calc(100vh - 20px);
    max-height: calc(100svh - 20px);
  }
}

@media (max-width: 360px) {
  .inner-hero h1,
  .legal-hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .treatment-row {
    grid-template-columns: 28px minmax(0, 1fr) 40px;
    gap: 10px;
  }

  .treatment-row .round-arrow {
    width: 40px;
    height: 40px;
  }

  .service-card,
  .plan-card,
  .wide-service,
  .emergency-panel,
  .statement-panel,
  .generation-copy,
  .inclusive-feature-copy,
  .experience-card,
  .practitioner-note,
  body[data-page="straightening"] #options .service-card {
    padding-inline: 22px;
  }

  .emergency-panel .btn-light {
    min-width: 0;
  }
}
