/* Round 88b: phone fit for the public tool pages (the app's web view opens these).
   Additive and phone-only: nothing here applies above 600px, so desktop is unchanged.
   Linked LAST in each page's <head>. Pages with their own app-style layout (image-tool, camera) do not link this file. */
@media (max-width: 600px) {
  html { -webkit-text-size-adjust: 100%; }
  body {
    max-width: 100%;
    overflow-wrap: anywhere;                       /* long words/URLs wrap instead of widening the page */
    padding-bottom: env(safe-area-inset-bottom);   /* clear the home indicator */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  img, video { max-width: 100%; height: auto; }
  canvas, svg, iframe { max-width: 100%; }
  pre, code { max-width: 100%; }
  pre { overflow-x: auto; }
  table { max-width: 100%; }

  /* Tap targets >= 44px */
  button, .btn, summary, [role="button"], select,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="color"]):not([type="file"]) {
    min-height: 44px;
  }
  button, .btn, [role="button"] { min-width: 44px; }
  .back, .back-link, .footer-link, .pray-cta, #my-likes-link, #leave-setup {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  /* 16px stops iOS zooming into a focused field (and the sideways scroll that follows) */
  select, textarea,
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]):not([type="color"]):not([type="file"]) {
    font-size: 16px !important;
  }
  input, select, textarea { max-width: 100%; }

  /* Rich/legal text: tables become stacked cards instead of a sideways scroller */
  .doc table, .doc thead, .doc tbody, .doc tr, .doc th, .doc td { display: block; width: auto; max-width: 100%; }
  .doc thead { position: absolute; left: -9999px; }
  .doc tr { border: 1px solid #e3e5e9; border-radius: 8px; margin: 0 0 10px; padding: 6px 10px; }
  .doc td, .doc th { border: 0; padding: 3px 0; }
  .doc pre { overflow-x: auto; }
  .doc { padding: 18px 16px; }

  /* Chip rows wrap instead of scrolling sideways (vom categories, prayer-wall filters). Reading-plan's day strip is 180-365 chips and stays a scroller. */
  #vom-nav { position: static; flex-wrap: wrap; overflow-x: visible; }
  #vom-nav button { flex: 0 1 auto; white-space: normal; }
  .filter-bar { flex-wrap: wrap; overflow-x: visible; }
  .verse-actions { flex-wrap: wrap; overflow-x: visible; }
  /* embed-guide code samples wrap rather than scroll */
  pre { white-space: pre-wrap; word-break: break-all; }
  body > main { overflow-x: hidden; }
}
