/* GritHQ Alpha4.87 — Home PrimaryDock parity
   Scope: shared mobile shell (native iOS host + installed PWA).
   Goal: Home uses the exact same compact dock geometry/alignment as Train,
   Progress, and Profile. No page-layout or workout changes. */
@media (max-width:959px) {
  /* Keep Home as a normal scrollable page module. */
  body.home-mode:not(.workout-mode) .main-content {
    grid-row:2!important;
    min-height:0!important;
    height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
  }

  /* Match the proven Train / Progress / Profile dock geometry exactly.
     Safe-area space stays below the compact dock instead of enlarging Home. */
  body.home-mode:not(.workout-mode) .bottom-nav,
  html.ios-standalone body.home-mode:not(.workout-mode) .bottom-nav {
    grid-row:3!important;
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    transform:none!important;
    width:auto!important;
    height:58px!important;
    min-height:58px!important;
    max-height:58px!important;
    margin:6px max(10px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important;
    padding:4px!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    align-items:stretch!important;
    align-self:end!important;
    box-sizing:border-box!important;
  }

  /* Remove the Home-only grid-button treatment and use the same centered
     icon/label stack as the other three primary tabs. */
  body.home-mode:not(.workout-mode) .bottom-nav .nav-btn,
  html.ios-standalone body.home-mode:not(.workout-mode) .bottom-nav .nav-btn {
    position:relative!important;
    width:100%!important;
    min-width:0!important;
    min-height:48px!important;
    margin:0!important;
    padding:3px 2px!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    gap:2px!important;
    box-sizing:border-box!important;
  }

  body.home-mode:not(.workout-mode) .bottom-nav .nav-btn svg,
  html.ios-standalone body.home-mode:not(.workout-mode) .bottom-nav .nav-btn svg {
    display:block!important;
    margin:0 auto!important;
    flex:0 0 auto!important;
  }

  body.home-mode:not(.workout-mode) .bottom-nav .nav-btn small,
  html.ios-standalone body.home-mode:not(.workout-mode) .bottom-nav .nav-btn small {
    display:block!important;
    width:100%!important;
    margin:0!important;
    text-align:center!important;
  }
}
