/* App-like phone shell, at Adi's request: no pinch or double-tap zoom, no sideways
   drift, no rubber-band bounce of the whole page. Panes still scroll inside. */
html, body { overscroll-behavior: none; touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html { height: 100%; overflow: hidden; }
body.orbit-v27 { width: 100vw; max-width: 100vw; overflow: hidden; }
/* Fill the whole screen. 100dvh or 100% can come out shorter than the screen on iPhone (home
   screen app, or a stale value after a foldable opens), which left an empty band at the bottom. */
html { background: var(--o-bg, #000); }
html[data-theme="light"] { background: var(--o-bg, #fff); }
body.orbit-v27,
body.orbit-v27 .sidebar,
body.orbit-v27[data-view="subject"] .app-header,
body.orbit-v27 main,
body.orbit-v27[data-view="subject"] main,
body.orbit-v27 #sidebarResize,
body.orbit-v27.sidebar-open #sidebarBackdrop { height: auto !important; top: 0 !important; bottom: 0 !important; max-height: none !important; }
/* These are all position: fixed. Pinning top and bottom (with height auto) sizes them the way the
   pop-ups are sized, which do reach the bottom on the opened iPhone Duo. A height of 100% or 100dvh
   can keep a stale, shorter value after the screen unfolds, which left an empty band at the bottom. */
body.orbit-v27 main, body.orbit-v27 .sidebar, body.orbit-v27 .app-header { overflow-x: hidden; }
body.orbit-v27 button, body.orbit-v27 a, body.orbit-v27 [role="button"] { touch-action: manipulation; }
/* iOS zooms in when a field under 16px gets focus. Keep every field at 16px or more on touch screens. */
@media (pointer: coarse), (max-width: 900px) {
  body.orbit-v27 input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  body.orbit-v27 select,
  body.orbit-v27 textarea { font-size: max(16px, 1em) !important; }
}

/* Home-screen app: size the page to the full screen, not a viewport iOS may have left
   short after unfolding, rotating or closing the keyboard. */
@media (display-mode: standalone) {
  html { height: 100lvh; min-height: 100%; }
}
