/* ========================================================================
   GaliVue V5.1.131 — TABLET HEADER BALANCE

   Scope: authenticated tablet workspace presentation only (768–1100px).
   V5.1.129 phone/mobile geometry and V5.1.130 tablet body/dock geometry remain
   untouched.

   Contract:
     GaliVue | page title | GaliVue App / Install | language | profile

   - one physical 70px top rail;
   - five visible header items use one shared vertical centre;
   - the five items are distributed as five explicit tablet grid cells;
   - the initial Dashboard viewport settles at its real top so the complete
     Welcome card begins below the fixed rail;
   - no bottom-nav, workflow, auth, API, D1/R2 or backend changes.
   ======================================================================== */

@media (min-width:768px) and (max-width:1100px) {
  html body #dashboardPanel {
    --gv51131-tablet-head-h:70px;
  }

  /* Five explicit visual cells. Breaking only the two structural wrappers into
     display:contents lets the existing real controls participate in one grid;
     no duplicate header controls are created. */
  html body #dashboardPanel .workspace-head,
  html body #dashboardPanel .workspace-head.gv5158-has-app-slot,
  html body #dashboardPanel.gv51112-rails-ready > .workspace-head,
  html body #dashboardPanel.gv51112-rails-ready > .workspace-head.gv5158-has-app-slot {
    height:var(--gv51131-tablet-head-h)!important;
    min-height:var(--gv51131-tablet-head-h)!important;
    padding:0 clamp(20px,2.8vw,30px)!important;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:max-content max-content max-content max-content max-content!important;
    grid-template-rows:1fr!important;
    align-items:center!important;
    justify-content:space-between!important;
    column-gap:clamp(12px,1.6vw,20px)!important;
    row-gap:0!important;
  }

  html body #dashboardPanel .workspace-head > .workspace-brand,
  html body #dashboardPanel .workspace-head.gv5158-has-app-slot > .workspace-brand,
  html body #dashboardPanel .workspace-head > .workspace-head-actions,
  html body #dashboardPanel .workspace-head.gv5158-has-app-slot > .workspace-head-actions {
    display:contents!important;
  }

  html body #dashboardPanel .workspace-head .workspace-brand-mark {
    grid-column:1!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:start!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    padding:0!important;
    position:static!important;
    transform:none!important;
  }
  html body #dashboardPanel .workspace-head .workspace-brand-mark img {
    display:block!important;
    width:auto!important;
    height:27px!important;
    max-width:94px!important;
    margin:0!important;
    transform:none!important;
  }

  html body #dashboardPanel .workspace-head .workspace-brand-copy {
    grid-column:2!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:center!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:0!important;
    max-width:190px!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    padding:0!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    text-align:center!important;
  }
  html body #dashboardPanel .workspace-head .workspace-brand-copy > small,
  html body #dashboardPanel .workspace-head .workspace-client-portal-shortcut {
    display:none!important;
  }
  html body #dashboardPanel .workspace-head .workspace-title-nav,
  html body #dashboardPanel .workspace-head #dashboardTitle {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:0!important;
    max-width:190px!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    padding:0!important;
    position:static!important;
    inset:auto!important;
    transform:none!important;
    text-align:center!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  html body #dashboardPanel .workspace-head > .gv5158-app-slot,
  html body #dashboardPanel .workspace-head.gv5158-has-app-slot > .gv5158-app-slot {
    grid-column:3!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:center!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    position:relative!important;
  }
  html body #dashboardPanel .workspace-head .gv5158-app-strip {
    height:42px!important;
    max-width:220px!important;
    margin:0!important;
  }

  html body #dashboardPanel .workspace-head .workspace-photographer-ref,
  html body #dashboardPanel .workspace-head #openNewProject {
    display:none!important;
  }

  html body #dashboardPanel .workspace-head .workspace-language-switcher {
    grid-column:4!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:center!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    transform:none!important;
  }

  html body #dashboardPanel .workspace-head .profile-menu-wrap {
    grid-column:5!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:end!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    position:relative!important;
  }
  html body #dashboardPanel .workspace-head .profile-avatar-button {
    align-self:center!important;
    width:42px!important;
    min-width:42px!important;
    height:42px!important;
    min-height:42px!important;
    margin:0!important;
    transform:none!important;
  }

  /* Preserve V5.1.130's body geometry, but make the top reserve explicit in
     the same ownership layer as the balanced header. */
  html body #dashboardDialog #dashboardPanel.gv51112-rails-ready .gv39-dashboard-main,
  html body #dashboardDialog #dashboardPanel .gv39-dashboard-main {
    padding-top:calc(var(--gv51131-tablet-head-h) + 16px)!important;
    scroll-padding-top:calc(var(--gv51131-tablet-head-h) + 16px)!important;
  }
}
