/* Frank member app · phone behaviours (loaded last by index, login, start and waitlist).
   Nothing here changes what a Figma frame draws. It removes the tells that make a web app feel like a web page
   on a phone: tap flashes, sticky hover, zoom on focus, selectable buttons, pull-to-refresh in the installed app.
   Tokens from ../../css/base.css. Hover styles in home.css, home-more.css and start.css are gated to
   (hover: hover) and (pointer: fine), so a tap never leaves one stuck. */

/* No grey flash on tap; press feedback below replaces it. No text inflation in landscape. */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }

/* Taps fire at once (no double-tap-zoom wait) on everything tappable. */
a, button, label, summary, [role="button"], [role="option"], [role="tab"], [role="radio"], [role="checkbox"] { touch-action: manipulation; }

/* Controls aren't text: a long press never selects a label or opens the link callout. Content stays selectable. */
button, summary, [role="button"], [role="tab"],
.hf-tab, .hf-row, .hf-btn, .hf-switch, .hf-link, .hf-back__m, .hf-vc__hit, .hf-cal__d, .hf-range__t,
.hm-btn, .sf-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* Press feedback on touch: the control answers as the finger lands, not when it lifts.
   Buttons keep their own scale (home.css); rows, cards, links and tabs dim. Opacity only. */
@media (pointer: coarse) {
  a, button, [role="button"], [role="option"] { transition: opacity var(--dur-press) var(--ease-out), transform var(--dur-press) var(--ease-out); }
  a:active, button:active, [role="button"]:active, [role="option"]:active { opacity: .55; }
  .hf-btn:active, .hm-btn:active, .sf-btn:active { opacity: 1; transform: scale(.98); }
  .hf-btn:disabled:active, .hm-btn:disabled:active, .sf-btn:disabled:active, button:disabled:active { opacity: inherit; transform: none; }
  /* A visit card is pressed through its full-card link: dim the card, not the invisible link. */
  .hf-vc:has(.hf-vc__hit:active) { opacity: .7; }

  /* Small text controls ("Change", "Remove", "Edit", "Show", the home switcher, rating chips) keep their drawn
     size but take a finger-sized target: an invisible margin of touch around each (WCAG 2.5.8). */
  .hf-link, .hf-link-strong, .hm-linkbtn, .hm-showcode, .hf-switch, .hm-chip { position: relative; }
  .hf-link::after, .hf-link-strong::after, .hm-linkbtn::after, .hm-showcode::after, .hf-switch::after { content: ""; position: absolute; inset: -12px -8px; }
  .hm-chip::after { content: ""; position: absolute; inset: -6px -3px; }

  /* iOS zooms the page when a focused field's text is under 16px, and doesn't zoom back. Fields are 14px in
     Figma; on touch they render at 16px so the page never jumps. Zoom itself stays on (WCAG 1.4.4). */
  input, textarea, select,
  .hm-field__input, .hm-composer__field input, .sf-field__input, .composer textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  a, button, [role="button"], [role="option"] { transition: none; }
  .hf-btn:active, .hm-btn:active, .sf-btn:active { transform: none; }
}

/* A sheet scrolls by itself: reaching its end never drags the page behind it. */
.hf-sheet, .hf-sheet__body, .hm-menu, .sf-sugg, .hm-suggest { overscroll-behavior: contain; }

/* Bottom-pinned bars keep clear of the home indicator (home.css already does this for the tab bar,
   .hf-sticky and sheet footers; these are the rest). The inset is 0 wherever there is no indicator. */
.hm-foot, .sf-ft, .sf-sticky { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.sf-bnav { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.sf-progress { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
.sf-home-sticky { bottom: calc(69px + env(safe-area-inset-bottom, 0px)); }
.hm-toast { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
.hm-composer { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 959px) {
  /* A conversation keeps the tab bar (Figma 10b): the message box sits on top of it, so the bar carries the inset. */
  body.hf-thread .hm-composer { bottom: calc(69px + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; }
  body.hf-detail.hf-thread .hf-main { padding-bottom: calc(69px + env(safe-area-inset-bottom, 0px)); }
}

/* Installed to the home screen (Add to Home Screen): no browser bars, so behave like an app.
   Pulling down doesn't reload, and the page keeps clear of the status bar and home indicator. */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
  body.hf, body.sf-body { padding-top: env(safe-area-inset-top, 0px); }
  body.hf { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
}
