/* ==========================================================================
   The app, as an app (the user, 2026-11-12: "is there a way to make this feel
   like a native app … it kind of feels like a website" — then "make sure
   these changes [are] only for mobile screens … cell phones, and tablets").

   EVERY rule below is for the installed app (html.is-app, set before the first
   paint by assets/js/app-mode.js) on a phone or a tablet: a touch screen up
   to a large tablet held sideways. A desktop or laptop, and the website in an
   ordinary browser, never see any of it.

   1. Browser habits off — tap flashes, text selected by pressing a button,
      double-tap zoom, Chrome's pull-to-refresh and edge glow.
   2. The app bar — the site's top bars become a compact 56px bar with a back
      arrow on inner screens (includes/pwa.php mim_app_back()); the menu stays,
      so nothing that is not on a tab is lost. Tablets get the phone menu.
   3. No website footer.
   4. The bottom tabs on tablets too (app-shell.css draws them on phones).
   5. Screens change like an app's: the content cross-fades, the app bar and
      the tabs stay put (cross-document view transitions; app-mode.js skips
      them anywhere else, and reduced motion turns them off).
   ========================================================================== */
.app-back { display: none; }

@media (pointer: coarse) and (max-width: 1366px) {
  /* ---- 1. browser habits off */
  html.is-app { -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior-y: none; }
  html.is-app body { overscroll-behavior-y: none; }
  html.is-app :is(header.site, header.topbar, header.oe-top, header.sv-top, .app-tabs, button, .btn) { -webkit-user-select: none; user-select: none; }

  /* ---- 2. the app bar: the back arrow */
  html.is-app .app-back { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: -10px; border-radius: 50%; color: #fff; text-decoration: none; }
  html.is-app .app-back svg { width: 24px; height: 24px; }
  html.is-app .app-back:active { background: rgba(255, 255, 255, .14); }
  html.is-app .app-back:focus-visible { outline: 3px solid #f2b632; outline-offset: -3px; }

  /* the site's bar (public pages) */
  html.is-app header.site .site-in { width: calc(100% - 24px); }
  html.is-app header.site .nav { height: 56px; gap: 4px; }
  html.is-app header.site .logo img { height: 30px; }
  html.is-app header.site .burger { border: 0; border-radius: 50%; width: 44px; height: 44px; margin-right: -8px; }
  html.is-app header.site .burger:active { background: rgba(255, 255, 255, .14); }
  html.is-app:has(header.site) { scroll-padding-top: 64px; }
  /* tablets wider than the phone menu's 1020px: the same menu, under the bar */
  html.is-app header.site nav, html.is-app header.site .signin, html.is-app header.site .head-cta { display: none; }
  html.is-app header.site .burger { display: grid; place-items: center; }
  html.is-app header.site .nav.open nav { display: block; position: absolute; top: 56px; left: -12px; right: -12px; background: #061330; padding: 8px 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  html.is-app header.site .nav.open ul { display: grid; gap: 4px; }
  html.is-app header.site .nav.open ul a { display: block; padding: 12px 0; font-size: 17px; }
  html.is-app header.site .nav.open ul a::after { display: none; }
  html.is-app header.site .nav.open ul a.on { color: #f2b632; }
  html.is-app header.site .m-only { display: list-item; }

  /* the member pages' bar (white): the arrow in navy; tablets get the phone menu */
  html.is-app header.topbar { min-height: 56px; padding: 6px 12px; gap: 6px; }
  html.is-app header.topbar .app-back { color: var(--navy-900, #0a1c44); }
  html.is-app header.topbar .app-back:active { background: var(--bg-soft, #f3f6fb); }
  html.is-app header.topbar .menu-btn { border-color: transparent; background: none; border-radius: 50%; }
  html.is-app header.topbar .menu-btn:active { background: var(--bg-soft, #f3f6fb); }
  html.is-app:has(header.topbar) { scroll-padding-top: 64px; }
  html.is-app .shell { grid-template-columns: 1fr; background: none; }
  html.is-app .shell:has(.sidebar.dark) { grid-template-columns: 1fr; background: none; }
  html.is-app .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 80; transform: translateX(-100%); transition: transform .25s, visibility 0s .25s; visibility: hidden; }
  html.is-app .sidebar.open { transform: none; visibility: visible; transition: transform .25s; box-shadow: 20px 0 50px -20px rgba(6, 19, 48, .4); }
  html.is-app .menu-btn { display: grid; }
  html.is-app .topbar .search { display: none; }

  /* the sign-up, coming-soon and survey pages' bar: the logo alone, compact */
  html.is-app :is(header.oe-top, header.sv-top) { flex-wrap: nowrap; justify-content: flex-start; gap: 4px; min-height: 56px; padding: 6px 12px; }
  html.is-app :is(.oe-top-tag, .sv-top-tag) { display: none; }
  html.is-app :is(.oe-brand, .sv-brand) img { height: 30px; }

  /* the pages' own "back to the list" links: the bar's arrow does that now */
  html.is-app :is(p.ev-back, p.cl-back, nav.crumbs, p.back) { display: none; }

  /* ---- 3. no website footer */
  html.is-app :is(.oe-foot, footer.dark#contact, .sv-footer) { display: none; }

  /* ---- 4. the bottom tabs on tablets too, centred */
  html.is-app .app-tabs { display: grid; padding-left: max(0px, calc((100% - 640px) / 2)); padding-right: max(0px, calc((100% - 640px) / 2)); }
  html.is-app .app-tabs-gap { display: block; }

  /* ---- 5. screens change like an app's */
  @view-transition { navigation: auto; }
  html.is-app :is(header.site, header.topbar, header.oe-top, header.sv-top) { view-transition-name: app-bar; }
  html.is-app .app-tabs { view-transition-name: app-tabs; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
