/* ==========================================================================
   v1.2.0-fix316
   Headquarters mobile header hotfix + explicit readable admin copy.
   Loaded after fix315.
   ========================================================================== */

/* ---- Explicit readability: fix315 generic selectors did not override
        several highly-specific historical 9-12px declarations. ------------ */
.store-admin-body .headquarters-scope-guide article>div>span,
.store-admin-body .headquarters-feature-grid article>span,
.store-admin-body .company-dashboard-heading p,
.store-admin-body .headquarters-add-store-card p{
  font-size:14px!important;
  line-height:1.65!important;
}
.store-admin-body .headquarters-scope-guide b,
.store-admin-body .headquarters-feature-grid article>b{
  font-size:16px!important;
  line-height:1.45!important;
}
.store-admin-body .headquarters-add-store-card>div>span{
  font-size:11px!important;
}
.store-admin-body main.wrap p,
.store-admin-body main.wrap .sub{
  font-size:14px;
  line-height:1.65;
}

/* ---- Headquarters-specific mobile drawer -------------------------------- */
.fix316-headquarters-nav{
  position:fixed;
  inset:0;
  z-index:220;
  display:grid;
  grid-template-columns:minmax(0,1fr) min(410px,92vw);
  background:rgba(0,0,0,.58);
}
.fix316-headquarters-nav[hidden]{
  display:none!important;
}
.fix316-headquarters-nav-backdrop{
  min-width:0;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
}
.fix316-headquarters-nav-panel{
  display:flex;
  flex-direction:column;
  min-width:0;
  height:100dvh;
  overflow:hidden;
  background:#f7f4ed;
  color:#171717;
  box-shadow:-18px 0 50px rgba(0,0,0,.28);
}
.fix316-headquarters-nav-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:62px;
  padding:9px 12px 9px 16px;
  border-bottom:1px solid #ded8cf;
  background:#fff;
}
.fix316-headquarters-nav-title{
  display:grid;
  gap:1px;
  min-width:0;
}
.fix316-headquarters-nav-title b{
  font-size:18px;
}
.fix316-headquarters-nav-title span{
  color:#706a62;
  font-size:13px;
}
.fix316-headquarters-nav-close{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:46px;
  min-height:46px;
  margin:0;
  padding:0;
  border:1px solid #ddd6cc;
  border-radius:12px;
  background:#f5f2ec;
  color:#171717;
  font-size:24px;
  font-weight:900;
  cursor:pointer;
}
.fix316-headquarters-nav-content{
  flex:1;
  overflow:auto;
  padding:12px 12px calc(20px + env(safe-area-inset-bottom));
}
.fix316-headquarters-nav-content .headquarters-session-actions{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-auto-flow:row!important;
  width:100%!important;
  gap:9px!important;
  margin:0 0 12px!important;
}
.fix316-headquarters-nav-content .headquarters-session-actions>*{
  width:100%!important;
  max-width:none!important;
  min-height:50px!important;
  margin:0!important;
}
.fix316-headquarters-nav-content .headquarters-scope-switcher{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:8px!important;
}
.fix316-headquarters-nav-content .headquarters-navigation{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-auto-flow:row!important;
  width:100%!important;
  max-width:none!important;
  gap:9px!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
}
.fix316-headquarters-nav-content .headquarters-navigation .headquarters-nav-button,
.fix316-headquarters-nav-content .headquarters-session-actions .tab,
.fix316-headquarters-nav-content .headquarters-session-actions .state-btn,
.fix316-headquarters-nav-content .headquarters-session-actions .btn{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-height:50px!important;
  padding:11px 13px!important;
  white-space:normal!important;
  text-align:center!important;
  font-size:15px!important;
}
body.fix316-headquarters-nav-open{
  overflow:hidden!important;
}

/* ---- Truly compact headquarters header ---------------------------------- */
@media(max-width:760px){
  body.store-admin-body.platform-impersonation-active{
    --platform-banner-offset:38px!important;
  }
  .store-admin-body .platform-impersonation-banner{
    min-height:38px!important;
    padding:3px 8px!important;
    gap:7px!important;
  }
  .store-admin-body .platform-impersonation-banner b{
    font-size:11px!important;
  }
  .store-admin-body .platform-impersonation-banner button{
    min-height:32px!important;
    padding:5px 9px!important;
    font-size:11px!important;
  }

  .store-admin-body .headquarters-topbar .wrap{
    display:grid!important;
    grid-template-columns:36px minmax(0,1fr) auto!important;
    grid-template-rows:54px!important;
    align-items:center!important;
    column-gap:9px!important;
    row-gap:0!important;
    min-height:54px!important;
    padding:3px 10px!important;
  }
  .store-admin-body .headquarters-topbar .wrap::before{
    grid-column:1!important;
    grid-row:1!important;
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    flex-basis:34px!important;
    align-self:center!important;
    background-image:url('/assets/brand/misemaru-symbol.webp')!important;
  }
  .store-admin-body .headquarters-topbar .headquarters-heading{
    grid-column:2!important;
    grid-row:1!important;
    display:block!important;
    min-width:0!important;
    align-self:center!important;
  }
  .store-admin-body .headquarters-topbar .headquarters-heading .staff-order-kicker,
  .store-admin-body .headquarters-topbar .headquarters-heading .sub{
    display:none!important;
  }
  .store-admin-body .headquarters-topbar .headquarters-heading .brand{
    margin:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:18px!important;
    line-height:1.2!important;
  }

  /* Critical fix: headquarters does NOT use .top-actions. */
  .store-admin-body .headquarters-topbar .wrap>.headquarters-session-actions,
  .store-admin-body .headquarters-topbar .wrap>.headquarters-navigation{
    display:none!important;
  }

  .store-admin-body .headquarters-topbar .fix315-mobile-menu-toggle{
    grid-column:3!important;
    grid-row:1!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:96px!important;
    max-width:none!important;
    min-height:44px!important;
    margin:0!important;
    padding:8px 11px!important;
    white-space:nowrap!important;
    writing-mode:horizontal-tb!important;
    font-size:14px!important;
    line-height:1!important;
  }
  .store-admin-body .headquarters-topbar .fix315-mobile-menu-toggle>span{
    display:inline!important;
    white-space:nowrap!important;
    writing-mode:horizontal-tb!important;
  }

  .store-admin-body .headquarters-scope-guide article>div>span,
  .store-admin-body .headquarters-feature-grid article>span,
  .store-admin-body .company-dashboard-heading p,
  .store-admin-body .headquarters-add-store-card p{
    font-size:15px!important;
    line-height:1.65!important;
  }
  .store-admin-body .headquarters-scope-guide b,
  .store-admin-body .headquarters-feature-grid article>b{
    font-size:17px!important;
  }
  .store-admin-body main.wrap p,
  .store-admin-body main.wrap .sub{
    font-size:15px;
  }
}

@media(max-width:560px){
  .fix316-headquarters-nav{
    grid-template-columns:42px minmax(0,1fr);
  }
}

@media(max-width:390px){
  .store-admin-body .headquarters-topbar .wrap{
    grid-template-columns:34px minmax(0,1fr) auto!important;
    column-gap:7px!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }
  .store-admin-body .headquarters-topbar .fix315-mobile-menu-toggle{
    min-width:88px!important;
    padding-left:9px!important;
    padding-right:9px!important;
    font-size:13px!important;
  }
}
