/* Smiles To Miles — Responsive & Rendering Safety Layer V1
 * Loaded after the central design system. This file intentionally avoids visual
 * redesigns and only adds defensive mobile/responsive behaviour.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.stm-site {
  overflow-x: clip;
}

body.stm-site img,
body.stm-site svg,
body.stm-site video,
body.stm-site canvas,
body.stm-site iframe {
  max-width: 100%;
}

body.stm-site img,
body.stm-site video {
  height: auto;
}

body.stm-site :where(.row, [class*="grid"], [class*="shell"], [class*="inner"], [class*="content"]) > * {
  min-width: 0;
}

body.stm-site :where(h1,h2,h3,h4,h5,h6,p,a,span,small,strong,label,button) {
  overflow-wrap: break-word;
}

body.stm-site :where(input, select, textarea, button) {
  max-width: 100%;
}

@media (max-width: 767.98px) {
  /* 16px prevents iOS Safari from zooming the viewport when a form field gains focus. */
  body.stm-site input:not([type="checkbox"]):not([type="radio"]),
  body.stm-site select,
  body.stm-site textarea {
    font-size: 16px;
  }

  /* Keep primary interactive controls comfortably tappable without changing their visual theme. */
  body.stm-site :where(button, .stm-btn, a.stm-btn, input[type="submit"], input[type="button"]) {
    min-height: 44px;
  }

  body.stm-site table {
    max-width: 100%;
  }

  body.stm-site .table-responsive,
  body.stm-site [class*="table-wrap"] {
    -webkit-overflow-scrolling: touch;
  }

  /* Shared hero actions stay inside the viewport on narrow phones. */
  body.stm-site .stm-hero-actions,
  body.stm-site .stm-central-hero__actions {
    max-width: 100%;
  }

  body.stm-site .stm-hero-actions > *,
  body.stm-site .stm-central-hero__actions > * {
    min-width: 0;
  }
}

@media (max-width: 479.98px) {
  body.stm-site .stm-hero-actions,
  body.stm-site .stm-central-hero__actions {
    width: 100%;
  }

  body.stm-site .stm-hero-actions .stm-btn,
  body.stm-site .stm-central-hero__actions .stm-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  body.stm-site *,
  body.stm-site *::before,
  body.stm-site *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
