/* G10D: Mobile browser viewport clearance. Intentional browser-only CSS;
   installed PWA standalone, desktop, app handlers, subscriptions and calendar untouched.
   Sources: G10C root/client HTML and signed November Sandbox23s/R31 mobile CSS. */
@media screen and (max-width:760px) and (display-mode:browser){
  /* The Owner/Coach Sandbox23s shell uses 12px on Safari vs >=60px in PWA.
     Fit content into the compact Safari browser viewport and avoid its bars. */
  html[data-slpt-app="sandbox23s-production"] .app,
  html[data-slpt-app="sandbox23s"] .app{
    height:100vh;height:100svh;max-height:100svh;
  }
  html[data-slpt-app="sandbox23s-production"] .workspace,
  html[data-slpt-app="sandbox23s"] .workspace{
    box-sizing:border-box;
    height:100svh!important;max-height:100svh!important;
    padding-top:max(52px,calc(14px + env(safe-area-inset-top,0px)))!important;
    padding-bottom:max(32px,calc(14px + env(safe-area-inset-bottom,0px)))!important;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  html[data-slpt-app="sandbox23s-production"] .topbar,
  html[data-slpt-app="sandbox23s"] .topbar{
    position:sticky;top:0;min-height:48px;z-index:30;
  }
  html[data-slpt-app="sandbox23s-production"] .mobile-drawer,
  html[data-slpt-app="sandbox23s"] .mobile-drawer{
    top:max(58px,calc(12px + env(safe-area-inset-top,0px)))!important;
    bottom:max(22px,calc(12px + env(safe-area-inset-bottom,0px)))!important;
    overflow-y:auto;
  }
  /* The retained R31 Client route already uses 100svh and a CSS touch-topbar
     variable. Add clearance there, without changing the standalone nav height. */
  html[data-context="app-wide"][data-ui-device="mobile"]:is([data-audience="client"],[data-audience="app_only"]){
    --ui2-touch-safe-top:max(14px,env(safe-area-inset-top,0px));
  }
  html[data-context="app-wide"][data-ui-device="mobile"]:is([data-audience="client"],[data-audience="app_only"]) #appView .ui2-mobile-nav{
    bottom:max(10px,env(safe-area-inset-bottom,0px))!important;
  }
  html[data-context="app-wide"][data-ui-device="mobile"]:is([data-audience="client"],[data-audience="app_only"]) #appView .ui2-content{
    padding-bottom:calc(var(--ui2-touch-nav,68px) + 36px + env(safe-area-inset-bottom,0px))!important;
  }
}
