/* Main navigation and a thumb-friendly phone navigation sheet. */
.m-bottom-nav,.m-navigation-title { display:none; }
.m-nav-link:focus-visible,.m-bottom-link:focus-visible { outline:3px solid var(--m-primary); outline-offset:3px; }
@media (max-width:1023px) {
  .member-app.m-mobile-open .m-app-header { z-index:30; }
}

@media (max-width:767px) {
  .member-app { padding-bottom:calc(70px + env(safe-area-inset-bottom,0px)); }
  .member-app .m-topbar { height:64px; gap:8px; padding:0 12px; }
  .member-app .m-topbar-title { min-width:0; gap:0; }
  .member-app .m-topbar .m-mobile-nav-toggle { display:none; }
  .member-app .m-topbar .m-brand { gap:7px; min-width:0; }
  .member-app .m-topbar .m-brand img { width:28px; height:28px; }
  .member-app .m-topbar .m-brand>span { font-size:18px; letter-spacing:0; }
  .member-app .m-topbar .m-brand small { display:none; }
  .member-app .m-topbar-tools { gap:0; flex:0 0 auto; }
  .member-app .m-topbar-tools>.m-icon-button,.member-app .m-top-menu>.m-icon-button,.member-app .m-account-button { width:44px; min-width:44px; height:44px; padding:10px; justify-content:center; }
  .member-app .m-account-button .m-avatar { width:30px; height:30px; }
  .member-app .m-topbar .m-local-mark,.member-app .m-topbar .m-workspace-label,.member-app .m-account-button>span:not(.m-avatar) { display:none; }
  .member-app .m-dropdown { max-width:calc(100vw - 24px); }

  .m-bottom-nav { position:fixed; inset:auto 0 0; z-index:18; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px)); background:var(--m-panel); border-top:1px solid var(--m-border); box-shadow:0 -4px 18px #17233d07; }
  .member-app .m-bottom-link { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:4px; min-width:0; min-height:52px; padding:5px 2px; border:0; border-radius:12px; color:var(--m-muted); background:transparent; text-align:center; font-size:10px; line-height:1.3; font-weight:550; cursor:pointer; transition:color .15s,background .15s,transform .15s; }
  .m-bottom-link .m-icon { width:21px; height:21px; }
  .m-bottom-link span { white-space:nowrap; }
  .member-app .m-bottom-link:hover { background:var(--m-hover); }
  .member-app .m-bottom-link:active { transform:scale(.97); }
  .member-app .m-bottom-link.is-active { color:var(--m-primary); background:var(--m-active); font-weight:650; }
  .member-app .m-bottom-link[href="#/shop"] { color:#3861f9; }
  .member-app .m-bottom-link[href="#/invite"] { color:#7c3aed; }
  .member-app .m-bottom-link[href="#/invite"].is-active { background:#f2ebff; }

  .member-app .m-sidebar { inset:auto 0 0; z-index:25; width:100%; max-height:min(640px,calc(100dvh - 76px)); border:1px solid var(--m-border); border-bottom:0; border-radius:24px 24px 0 0; padding-bottom:env(safe-area-inset-bottom,0px); transform:translateY(100%); box-shadow:0 -12px 48px #17233d19; overscroll-behavior:contain; }
  .member-app.m-mobile-open .m-sidebar { transform:translateY(0); }
  .member-app .m-sidebar .m-drawer-heading { padding:12px 16px 8px 20px; min-height:64px; border:0; flex:0 0 auto; }
  .member-app .m-sidebar .m-drawer-heading .m-brand { display:none; }
  .member-app .m-navigation-title { display:block; font-size:18px; font-weight:650; }
  .member-app .m-sidebar .m-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:8px 16px 18px; align-items:stretch; }
  .member-app .m-sidebar .m-nav-link { display:flex; min-width:0; min-height:58px; gap:10px; margin:0; padding:12px; border:1px solid var(--m-border); border-radius:12px; background:var(--m-panel); font-size:13px; }
  .member-app .m-sidebar .m-nav-link span { min-width:0; white-space:normal; overflow-wrap:anywhere; line-height:1.4; }
  .member-app .m-sidebar .m-nav-link .m-icon { width:20px; height:20px; flex-shrink:0; }
  .member-app .m-sidebar .m-nav-link.is-active { background:var(--m-active); border-color:var(--m-primary); }
  .member-app .m-sidebar .m-nav-link:hover { background:var(--m-hover); }
  .member-app .m-sidebar .m-user-card { display:none; }
  .member-app .m-mobile-scrim { z-index:20; }
  html[data-theme="dark"] .member-app .m-bottom-link[href="#/shop"] { color:#92adff; }
  html[data-theme="dark"] .member-app .m-bottom-link[href="#/invite"] { color:#c3a0ff; }
  html[data-theme="dark"] .member-app .m-bottom-link[href="#/invite"].is-active { background:#33234f; }
}

@media (min-width:1024px) {
  .member-app .m-sidebar .m-nav { overflow-x:auto; }
  .member-app .m-sidebar .m-nav-link { flex-shrink:0; }
}
@media (min-width:1024px) and (max-width:1279px) {
  .member-app .m-sidebar .m-nav { gap:6px; padding-right:28px; padding-left:28px; justify-content:space-between; }
  .member-app .m-sidebar .m-nav-link { font-size:12px; gap:5px; }
  .member-app .m-sidebar .m-nav-link .m-icon { width:16px; height:16px; }
}

@media (prefers-reduced-motion:reduce) {
  .m-sidebar,.m-bottom-link { transition:none!important; }
}
