/* App feel (28-Oct-2026): the Rx app and its home-screen apps (?solo=) should feel like native apps on the iPhone home screen and the
   Mac Dock. Linked by shell.php AFTER every other stylesheet. Owned by core (modules/core.json); tested by test_appfeel.js.
   Rules: nothing here changes the browser-tab layout except the safe-area padding (0 everywhere but a notched phone in landscape);
   the touch rules apply only to the installed app (display-mode: standalone), and never to clinical text, inputs or tables. */

/* 1. Smooth page changes: same-site cross-document view transitions (Safari 18.2+, Chrome 126+); others just load as before.
      Opted in only when the person has not asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 150ms; animation-timing-function: ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* 2. viewport-fit=cover (shell.php): on a notched iPhone turned sideways the page would run under the notch; keep it clear.
      env() is 0 on every other screen, so nothing moves there. */
html { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }

/* 3. The installed app (home screen / Dock). */
@media (display-mode: standalone) {
  html, body { overscroll-behavior-y: none; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; }
  /* the main app's phone controls and the home-screen apps' bar sit below the status bar / notch */
  .smenu, .smback { top: calc(10px + env(safe-area-inset-top, 0px)); }
  .smenu { left: calc(10px + env(safe-area-inset-left, 0px)); }
  header.top, .hometop { padding-top: env(safe-area-inset-top, 0px); }   /* content-box: the bar keeps its height, the inset is added above */
  .side { padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); }
  .solobar { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  /* long-press on a link, button or icon does not pop the browser's link menu (text and inputs keep it) */
  a, button, .btn, .ic, .solobar img, .side img, [role="button"], [role="tab"] { -webkit-touch-callout: none; }
  /* bars, tabs and buttons do not get selected by a stray long-press; page text, inputs and tables stay selectable */
  .solobar, .side, .smenu, .smback, .hnav, nav.tabs, .subtabs, .dtabs, .hometop, header.top, button, .btn, [role="tab"] { -webkit-user-select: none; user-select: none; }
  input, textarea, select, [contenteditable], table, main p, main li, td, th { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
}
