/* ═══════════════════════════════════════════════════════════════════
   mc-app.css — shared phone + native-app polish, loaded on every page
   (right after js/native-bridge.js). Keep rules generic and low-risk;
   page-specific fixes belong in the page. See documents/MOBILE_APP.md.
   html.mc-native / html.mc-native-ios are set by js/native-bridge.js.
   ═══════════════════════════════════════════════════════════════════ */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: rgba(56, 189, 248, 0.15); }

/* App shell feel: no page-level rubber-band behind fixed layouts, no
   long-press callouts on UI chrome, no accidental text selection on buttons. */
html.mc-native, html.mc-native body { overscroll-behavior-y: none; }
html.mc-native button, html.mc-native [role="button"], html.mc-native nav a { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

@media (max-width: 720px) {
  /* iOS zooms the page when a focused field is < 16px. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  select, textarea { font-size: 16px !important; }

  /* Never scroll sideways. */
  html, body { max-width: 100%; overflow-x: hidden; }
  @supports (overflow: clip) { html, body { overflow-x: clip; } }
  img, video, canvas, svg, iframe { max-width: 100%; }
  pre, code, .mono { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }

  /* Content must not hide behind the mc-nav bottom tab bar (~58px + home indicator). */
  body:has(> #mcnav-tabbar) { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important; }

  /* The floating Logoff pill overlaps every page header on phones — sign out
     lives on the Portal page. Logged-out "Login" stays. */
  #auth-container:has(.logout-button) { display: none !important; }
  #auth-container { top: calc(10px + env(safe-area-inset-top, 0px)) !important; }
}

/* Notch / home-indicator safe areas for full-bleed fixed bars */
#mcnav-tabbar { padding-left: max(4px, env(safe-area-inset-left, 0px)); padding-right: max(4px, env(safe-area-inset-right, 0px)); }
