/* ============================================================================
   Native touch hygiene — imported by style.css, clinician-app.css, landing.css
   so every surface (student, clinician, admin, auth/marketing) gets it.
   Kills the "website in a WebView" tells on iOS/Android: gray tap flashes,
   long-press callouts/text-selection on controls, double-tap zoom delay on
   interactive elements, and whole-document rubber-banding behind fixed
   chrome when running inside Capacitor.
   ============================================================================ */

html {
  -webkit-tap-highlight-color: transparent;
}

a,
label,
summary,
button,
select,
[role="button"],
[role="tab"],
input[type="button"],
input[type="submit"],
input[type="checkbox"],
input[type="radio"] {
  touch-action: manipulation;
}

nav a,
button,
summary,
[role="button"],
[role="tab"],
input[type="button"],
input[type="submit"] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Notice bubbles are role="button" for keyboard activation but carry real
   content (room changes, phone numbers) users need to copy — opt back in. */
.messages-bubble[role="button"] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

/* Native runtime only (main.js toggles .is-capacitor on <html>): stop the
   document itself from rubber-banding — fixed headers/tab bars visibly
   detach during the bounce. Inner scrollers keep their own momentum. */
html.is-capacitor,
html.is-capacitor body {
  overscroll-behavior-y: none;
}

/* iOS auto-zooms the page when a focused control's font-size is under 16px,
   which is why the old viewport lock (user-scalable=no) existed. Floor input
   text at 16px on native instead, so the lock can go and pinch-zoom comes
   back for low-vision users. The :not(#pp):not(#pp) hack lifts specificity
   to (2,1,2) so this !important beats page-sheet !important rules (e.g. the
   navbar search at 0.9rem !important in style.css). max(16px, 1em) keeps
   anything intentionally larger. */
html.is-capacitor input:not(#pp):not(#pp),
html.is-capacitor select:not(#pp):not(#pp),
html.is-capacitor textarea:not(#pp):not(#pp) {
  font-size: max(16px, 1em) !important;
}

/* Cross-document View Transitions are deliberately NOT opted into.

   PlacementFlow used to carry `@view-transition { navigation: auto; }` here so
   the browser would crossfade full-page navigations. Measured in Chrome 153
   against the real shipped documents, that opt-in never produced a working
   transition into app.html (Today) — 0/10 runs — and failed roughly 2/10 on
   every other student hop. Each failure is a browser-internal abort:

     InvalidStateError: Transition was aborted because of invalid state.
     ViewTransition opt-in disabled

   The rejecting promise is the INCOMING document's internal ready promise.
   Chrome hands the page no object for it (`pagereveal`'s event.viewTransition is
   null in exactly these cases), so no page-level `.catch()` can observe it: it
   always surfaces as an uncaught rejection, and shared/error-capture.js then
   writes it to client_errors. Opting MORE documents in does not help — the
   failing hops already had the identical opt-in on both sides.

   Because the outgoing document is what starts a cross-document transition,
   removing the opt-in removes the whole failure mode: no transition is ever
   started, so none can be aborted. Navigation falls back to the browser's
   ordinary immediate page swap, which is what main.js's ppNativeNavigate
   already performs without waiting on any animation.

   Do not re-add `@view-transition` without first proving, in a real browser
   across a full navigation matrix, that it no longer aborts. See
   docs/features/web-performance-reliability-20260918/ROOT_CAUSE_REPORT.md
   (PROBLEM D) and scripts/web-navigation-view-transition.test.js, which fails
   if any shipped document re-introduces the opt-in. */
