/* ==========================================================================
   Touch optimizations — Sprint A.7
   ==========================================================================
   Two cross-cutting fixes that decuple the mobile feel without touching
   any individual page:

   1. Tap targets ≥ 44 px (Apple HIG / WCAG 2.5.5) on coarse pointers
      (phones, tablets). Buttons/links smaller than that are notoriously
      hard to hit and force users to zoom.

   2. Native form inputs at ≥ 16 px on mobile to STOP iOS Safari's
      auto-zoom-on-focus. Below 16 px the OS zooms the page in to make
      the focused field readable, which throws the layout off.

   Scoped to (pointer: coarse) so we don't touch desktop where 32 px
   buttons are perfectly clickable with a mouse.
   ========================================================================== */

@media (pointer: coarse) {
  /* Generic button-ish elements — Tailwind .btn family, native buttons,
     submit inputs, and ARIA-roled clickables. */
  button:not(.tiptap-toolbar button):not(.mobile-bnav__tab):not(.spec-chat-panel__icon-btn):not([class*="bnav__"]),
  .btn,
  [role="button"]:not([class*="tab"]),
  input[type="submit"],
  input[type="button"],
  input[type="reset"] {
    min-height: 44px;
  }

  /* Links rendered as buttons via .btn classes — same target rule. */
  a.btn,
  a.btn-primary,
  a.btn-secondary,
  a.btn-outline,
  a.btn-ghost,
  a.btn-accent,
  a.btn-coral {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Form inputs — bump to 16 px to stop iOS Safari zoom-on-focus.
     We also bump padding so the visual height matches the 44 px target. */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  input[type="month"],
  input[type="week"],
  textarea,
  select {
    font-size: 16px;
    min-height: 44px;
  }

  /* `select` needs explicit padding because the user-agent stylesheet
     ignores min-height in some browsers. */
  select {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  /* Disable double-tap zoom on the main interactive surfaces so taps
     feel snappy. iOS only — the property is ignored elsewhere. */
  button,
  .btn,
  a,
  [role="button"],
  input[type="checkbox"],
  input[type="radio"] {
    touch-action: manipulation;
  }
}

/* The bottom nav from Sprint A.4 already sets its own sizes; we exclude
   it above so the 56 px FAB doesn't get inflated. The same goes for
   the Tiptap toolbar (32 px buttons by design — they're always next to
   each other) and the spec chat panel's icon buttons (28 px in a tight
   header). */
