/* =====================================================================================
   GlowAuth mobile slide-out sidebar
   Phones / narrow windows only (<= 960px). Above that the original top navigation is untouched.
   Performance: only transform, opacity and visibility are animated; no blur, no filters, no stagger.
   ===================================================================================== */

/* Desktop: the sidebar does not exist. */
.msb,.msb-scrim{display:none}

@media (max-width:960px){
  /* The top-bar tab strip is replaced by the sidebar on small screens. */
  #dashboardNav{display:none!important}

  .msb-scrim{
    display:block;
    position:fixed;
    inset:0;
    z-index:139;
    background:rgba(2,2,2,.74);
    opacity:0;
    visibility:hidden;
    transition:opacity .22s ease,visibility 0s linear .22s;
    -webkit-tap-highlight-color:transparent;
  }

  .msb{
    display:flex;
    flex-direction:column;
    position:fixed;
    top:0;
    bottom:0;
    left:0;
    z-index:140;
    width:min(86vw,328px);
    height:100%;
    height:100dvh;
    padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
    background:
      radial-gradient(260px 200px at 0% 0%,rgba(85,85,85,.3),transparent 70%),
      linear-gradient(180deg,#0d0d0d 0%,#070707 100%);
    border-right:1px solid rgba(139,139,139,.24);
    border-radius:0 26px 26px 0;
    transform:translate3d(-100%,0,0);
    visibility:hidden;
    transition:transform .3s cubic-bezier(.22,.8,.24,1),visibility 0s linear .3s;
    contain:layout paint style;
    overscroll-behavior:contain;
  }

  body.mobile-tabs-open .msb-scrim{opacity:1;visibility:visible;transition-delay:0s}
  body.mobile-tabs-open .msb{transform:none;visibility:visible;transition-delay:0s}

  /* ---- Header ---- */
  .msb-head{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:18px 16px 14px 20px;
  }
  .msb-brand{display:flex;align-items:center;gap:12px;min-width:0}
  .msb-mark{
    display:grid;
    place-items:center;
    flex:0 0 auto;
    width:42px;
    height:42px;
    border:1px solid rgba(147,147,147,.34);
    border-radius:14px;
    background:rgba(113,113,113,.14);
  }
  .msb-mark img{width:28px;height:28px;display:block}
  .msb-brand-copy{display:grid;gap:3px;min-width:0}
  .msb-brand-copy strong{font-size:1.2rem;font-weight:800;letter-spacing:-.03em;line-height:1;color:var(--text)}
  .msb-brand-copy strong span{background:var(--grad-text);-webkit-background-clip:text;background-clip:text;color:transparent}
  .msb-brand-copy small{font-size:.7rem;font-weight:600;letter-spacing:.04em;color:var(--muted-2);white-space:nowrap}
  .msb-close{
    display:grid;
    place-items:center;
    flex:0 0 auto;
    width:42px;
    height:42px;
    padding:0;
    border:1px solid rgba(139,139,139,.28);
    border-radius:14px;
    background:rgba(113,113,113,.08);
    color:var(--text-2);
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
  .msb-close .ga-icon-svg{width:18px;height:18px}
  .msb-close:active{background:rgba(113,113,113,.22)}

  /* ---- Navigation ---- */
  .msb-nav{
    flex:1 1 auto;
    min-height:0;
    display:flex;
    flex-direction:column;
    gap:4px;
    padding:4px 12px 12px 14px;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .msb-nav::-webkit-scrollbar{display:none}

  .msb-label{
    display:flex;
    align-items:center;
    gap:10px;
    margin:14px 8px 6px;
    color:var(--muted-2);
    font-size:.64rem;
    font-weight:800;
    letter-spacing:.16em;
  }
  .msb-label:first-child{margin-top:4px}
  .msb-label::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,rgba(139,139,139,.28),transparent)}

  .msb-item{
    position:relative;
    display:flex;
    align-items:center;
    gap:14px;
    width:100%;
    min-height:56px;
    padding:9px 12px;
    border:1px solid transparent;
    border-radius:16px;
    background:transparent;
    color:var(--text-2);
    font:inherit;
    text-align:left;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
    touch-action:manipulation;
  }
  .msb-item:active{background:rgba(113,113,113,.12);transform:scale(.985)}

  .msb-icon{
    display:grid;
    place-items:center;
    flex:0 0 auto;
    width:38px;
    height:38px;
    border:1px solid rgba(139,139,139,.2);
    border-radius:12px;
    background:rgba(113,113,113,.1);
    color:var(--v1);
  }
  .msb-icon .ga-icon-svg{width:19px;height:19px}

  .msb-copy{display:grid;gap:2px;min-width:0}
  .msb-copy strong{font-size:.95rem;font-weight:700;line-height:1.2;color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .msb-copy small{font-size:.72rem;font-weight:500;line-height:1.25;color:var(--muted-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

  /* Active tab: soft tint, a slim accent bar on the left edge and a filled icon tile. */
  .msb-item.is-active{
    color:#fff;
    border-color:rgba(147,147,147,.34);
    background:linear-gradient(90deg,rgba(113,113,113,.28),rgba(113,113,113,.07));
  }
  .msb-item.is-active::before{
    content:"";
    position:absolute;
    left:-14px;
    top:14px;
    bottom:14px;
    width:4px;
    border-radius:0 4px 4px 0;
    background:linear-gradient(180deg,#dcdcdc,#717171);
  }
  .msb-item.is-active .msb-icon{
    border-color:transparent;
    background:var(--grad);
    color:#fff;
    box-shadow:0 6px 16px rgba(85,85,85,.4);
  }
  .msb-item.is-active .msb-copy small{color:var(--text-2)}

  /* ---- Footer ---- */
  .msb-foot{flex:0 0 auto;padding:10px 14px 16px}
  .msb-shop{
    display:flex;
    align-items:center;
    gap:12px;
    width:100%;
    padding:12px 12px 12px 14px;
    border:1px solid rgba(147,147,147,.3);
    border-radius:18px;
    background:linear-gradient(135deg,rgba(113,113,113,.2),rgba(97,97,97,.08));
    color:var(--text);
    font:inherit;
    text-align:left;
    cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
  .msb-shop:active{background:rgba(113,113,113,.3)}
  .msb-shop-icon{display:grid;place-items:center;flex:0 0 auto;width:36px;height:36px;border-radius:12px;background:var(--grad);color:#fff}
  .msb-shop-icon .ga-icon-svg{width:18px;height:18px}
  .msb-shop-copy{display:grid;gap:2px;flex:1;min-width:0}
  .msb-shop-copy strong{font-size:.92rem;font-weight:800}
  .msb-shop-copy small{font-size:.72rem;font-weight:500;color:var(--muted)}
  .msb-chevron{width:18px;height:18px;color:var(--v1)}

  .msb-item:focus-visible,.msb-close:focus-visible,.msb-shop:focus-visible{outline:2px solid var(--v1);outline-offset:2px}

  /* The floating Shop button would sit above the scrim; it is hidden while the sidebar is open. */
  body.mobile-tabs-open .shop-fab{display:none}
}

/* Short screens (landscape phones): tighter header and rows so everything stays reachable by scrolling. */
@media (max-width:960px) and (max-height:520px){
  .msb-head{padding-top:10px;padding-bottom:8px}
  .msb-item{min-height:48px;padding-top:6px;padding-bottom:6px}
  .msb-foot{padding-bottom:10px}
}

/* Very narrow phones. */
@media (max-width:340px){
  .msb{width:min(92vw,300px)}
  .msb-brand-copy small{display:none}
}

/* Lean mode and reduced motion: shorter or no transitions. */
html[data-perf="low"] .msb{transition-duration:.18s,0s;transition-delay:0s,.18s}
html[data-perf="low"] .msb-scrim{transition-duration:.14s,0s}
@media (prefers-reduced-motion:reduce){
  .msb,.msb-scrim{transition:none!important}
}
