/* Health Pace mobile polish. Presentation only: no layout is redesigned, nothing here changes behaviour. */

/* Notched phones: content respects the status bar, camera cut-out and home indicator (needs viewport-fit=cover). */
html {
  -webkit-tap-highlight-color: transparent; /* no grey flash on tap */
  -webkit-text-size-adjust: 100%;           /* stop iOS inflating text after rotation */
  text-size-adjust: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* No accidental sideways scroll from an element a few pixels too wide. */
html, body { max-width: 100%; }
body { overflow-x: hidden; } /* on body only: setting it on html as well can break scrolling in some browsers */
img, svg, video { max-width: 100%; }

/* Removes the old 300 ms tap delay and double-tap zoom on controls, without blocking pinch zoom on text. */
a, button, [role="button"], input, select, textarea, label, summary { touch-action: manipulation; }

/* Touch screens only: 44 x 44 px minimum for controls, so desktop admin screens keep their compact look. */
@media (pointer: coarse) {
  button, [role="button"], input[type="button"], input[type="submit"], select { min-height: 44px; }
  button, [role="button"] { min-width: 44px; }
  input[type="range"] { min-height: 44px; }
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], textarea { min-height: 44px; }
}

/* Press feedback on touch devices. transform and opacity are composited on the GPU: no layout or paint cost. */
@media (hover: none) {
  button, [role="button"], a.btn, .btn { transition: transform .12s ease, opacity .12s ease; }
  button:active, [role="button"]:active, a.btn:active, .btn:active { transform: scale(.97); opacity: .9; }
}

/* Respect the phone's "reduce motion" accessibility setting. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Smooth momentum scrolling inside scrollable panels on older iOS. */
.scroll, [data-scroll], .chat-messages { -webkit-overflow-scrolling: touch; }
