/* ========================================================================
   GaliVue V5.1.112 — COMPACT WORKSPACE RAILS
   Presentation-only structural correction.

   Compact authenticated workspace contract:
   - one top workspace rail, anchored to the non-scrolling app shell;
   - one bottom mobile nav, preserved exactly from V5.1.110;
   - only the middle workspace content scrolls;
   - integrated account/support pages remain below the same top rail.

   JS moves the existing .workspace-head out of the scrolling
   .gv39-dashboard-main and into #dashboardPanel on compact screens. No clone,
   no duplicate IDs, and no alternate account controls are introduced.
   ======================================================================== */

@media (max-width:1100px) {
  #dashboardPanel.gv51112-rails-ready {
    --gv51112-head-h:70px;
    position:relative!important;
    overflow:hidden!important;
  }

  #dashboardPanel.gv51112-rails-ready .gv39-dashboard-layout {
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  /* The header is a direct child of the non-scrolling app shell after the
     V5.1.112 relocation script runs. Absolute positioning here is deliberate:
     unlike fixed/sticky it cannot inherit a transformed/scrolling containing
     block from the workspace content. */
  #dashboardPanel.gv51112-rails-ready > .workspace-head,
  #dashboardPanel.gv51112-rails-ready > .workspace-head.gv5158-has-app-slot {
    position:absolute!important;
    inset:0 0 auto 0!important;
    z-index:260!important;
    width:auto!important;
    max-width:none!important;
    min-width:0!important;
    height:var(--gv51112-head-h)!important;
    min-height:var(--gv51112-head-h)!important;
    margin:0!important;
    padding:0 clamp(16px,3vw,28px)!important;
    box-sizing:border-box!important;
    transform:none!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:.55rem!important;
    background:rgba(251,250,246,.98)!important;
    border-bottom:1px solid rgba(222,217,207,.92)!important;
    box-shadow:0 5px 18px rgba(24,23,20,.035)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }

  /* Main is the only vertical scroller. Reserve exactly one header rail above
     its first destination and keep the existing bottom-nav padding untouched. */
  #dashboardPanel.gv51112-rails-ready .gv39-dashboard-main {
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    padding-top:calc(var(--gv51112-head-h) + 10px)!important;
    scroll-padding-top:calc(var(--gv51112-head-h) + 10px)!important;
    overscroll-behavior-y:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }

  /* Integrated account/support layers are positioned by the existing runtime
     from workspace-head.bottom. Their content keeps enough room above the
     already-fixed mobile nav. */
  #dashboardPanel.gv51112-rails-ready.gv3936-account-shell + .gv3935-docked-account-page,
  .modal-layer.gv3935-docked-account-page > .modal-panel {
    scroll-padding-bottom:calc(90px + env(safe-area-inset-bottom))!important;
  }
}

@media (max-width:767px) {
  #dashboardPanel.gv51112-rails-ready {
    --gv51112-head-h:calc(62px + env(safe-area-inset-top));
  }

  #dashboardPanel.gv51112-rails-ready > .workspace-head,
  #dashboardPanel.gv51112-rails-ready > .workspace-head.gv5158-has-app-slot {
    padding:max(0px,env(safe-area-inset-top)) 14px 0!important;
  }

  #dashboardPanel.gv51112-rails-ready .gv39-dashboard-main {
    padding-top:calc(var(--gv51112-head-h) + 8px)!important;
  }
}

@media (orientation:landscape) and (max-height:600px) and (max-width:1100px) {
  #dashboardPanel.gv51112-rails-ready {
    --gv51112-head-h:54px;
  }
}
