/* Main navigation (design Q): icon tabs in the header (desktop) and a fixed bottom bar (phone). */
.mn{display:flex; align-items:center; position:relative;}
.mn-item{position:relative; display:inline-flex; align-items:center; gap:8px; color:var(--navy-soft); text-decoration:none; font:700 14px/1 'Inter',sans-serif; transition:color .15s, background .15s;}
.mn-item svg{width:21px; height:21px; flex:none;}
a.mn-item:hover{color:var(--navy);}
.mn-item.is-on{color:var(--blue);}
/* the Menu tab: the member's round photo instead of an icon */
.mn-av{position:relative; width:25px; height:25px; flex:none; border-radius:50%; overflow:hidden; display:grid; place-items:center; background:var(--blue-tint); color:var(--blue-dark); font:700 11px/1 'Sora','Inter',sans-serif; box-shadow:0 0 0 1.5px var(--border-soft);}
.mn-av img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover;}
.mn-item.is-on .mn-av{box-shadow:0 0 0 2px var(--blue);}
.mn-item.is-soon{opacity:.5; cursor:default;}
.mn-item:focus-visible{outline:2px solid var(--blue); outline-offset:2px;}
html[lang="ar"] .mn-item,html[lang="ja"] .mn-item{font-family:inherit;}

/* desktop: its own row under the header; icon over name. The current tab gets a small capsule around its icon. */
header .nav > .nav-spacer{flex:1;}
.mn-row{position:sticky; top:80px; z-index:59; height:61px; box-sizing:border-box; background:var(--white); border-bottom:1px solid var(--border-soft);}
.mn-row .wrap{display:flex; justify-content:center; height:100%;}
.mn-top{--w:100px; gap:4px; align-items:stretch; height:100%;}
.mn-top .mn-item{flex-direction:column; justify-content:center; flex:0 0 var(--w); box-sizing:border-box; gap:3px; padding:0; font-size:11.5px; font-weight:700; border-radius:12px; transition:color .2s;}
/* the icon sits in a 46 x 28 slot; the capsule is drawn behind that slot */
.mn-top .mn-item::before{content:""; position:absolute; top:calc(50% - 21px); inset-inline-start:50%; width:46px; height:28px; margin-inline-start:-23px; border-radius:999px; background:transparent; transition:background .25s, box-shadow .25s; pointer-events:none;}
.mn-top .mn-item svg{position:relative; display:block; width:19px; height:19px; margin-block:4.5px; transition:color .2s;}
.mn-top .mn-av{position:relative; width:21px; height:21px; margin-block:3.5px; font-size:10px; transition:box-shadow .2s;}
.mn-top a.mn-item:hover{color:var(--navy);}
.mn-top a.mn-item:not(.is-on):hover::before{background:color-mix(in srgb, var(--navy) 7%, transparent);}
.mn-top a.mn-item:hover svg,.mn-top a.mn-item:hover .mn-av{animation:mnwig .55s ease both;}
.mn-top .mn-item.is-on{color:var(--navy);}
.mn-top .mn-item.is-on svg{color:var(--teal);}
.mn-top .mn-item.is-on .mn-av{box-shadow:0 0 0 2px var(--teal);}
.mn-top .mn-item.is-on:not(:hover) svg,.mn-top .mn-item.is-on:not(:hover) .mn-av{animation:mndrop .6s cubic-bezier(.3,1.6,.5,1) .12s both;}
.mn-top .mn-item.is-on::before{background:linear-gradient(180deg, color-mix(in srgb, var(--teal) 16%, transparent), color-mix(in srgb, var(--teal) 4%, transparent)); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--teal) 22%, transparent);}
@keyframes mnwig{0%{transform:none;} 30%{transform:translateY(-3px) rotate(-12deg) scale(1.12);} 60%{transform:translateY(-2px) rotate(9deg) scale(1.12);} 100%{transform:translateY(-1px) rotate(0) scale(1.1);}}
@keyframes mndrop{0%{transform:translateY(-9px) scale(.8); opacity:0;} 100%{transform:none; opacity:1;}}
.mn-top .mn-soon{position:absolute; top:5px; inset-inline-end:6px; font:700 8px/1 'JetBrains Mono',monospace; letter-spacing:.5px; text-transform:uppercase; padding:2px 5px; border-radius:999px; background:color-mix(in srgb, var(--blue) 16%, transparent); color:var(--blue-dark);}
@media (prefers-reduced-motion:reduce){ .mn-top .mn-item::before,.mn-top .mn-item svg,.mn-top .mn-av{transition:none;} .mn-top .mn-item svg,.mn-top .mn-av{animation:none !important;} }

/* the gliding capsule (js/navglide.js); until it runs, the current tab draws its own plain one above */
.mn-gl{position:absolute; pointer-events:none; opacity:0; transition:left .45s cubic-bezier(.3,1.35,.45,1), top .2s ease, opacity .2s;}
.mn.glide-ready .mn-gl{opacity:1;}
.mn-gl{width:46px; height:28px; border-radius:999px; background:linear-gradient(180deg, color-mix(in srgb, var(--teal) 16%, transparent), color-mix(in srgb, var(--teal) 4%, transparent)); box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--teal) 22%, transparent);}
.mn.has-glide .mn-item.is-on::before{display:none;}
@media (prefers-reduced-motion:reduce){ .mn-gl{transition:none;} }

/* phone: flush bar at the bottom, the current tab gets a rounded gradient tab on the bar's top edge */
.mn-bottom{display:none;}
@media (max-width:720px){
  .mn-row{display:none;}
  .mn-bottom{display:grid; grid-template-columns:repeat(5,1fr); position:fixed; inset-inline:0; bottom:0; z-index:80; padding:8px 6px calc(8px + env(safe-area-inset-bottom)); background:color-mix(in srgb, var(--white) 92%, transparent); border-top:1px solid color-mix(in srgb, var(--border-soft) 70%, transparent);}
  .mn-bottom .mn-item{flex-direction:column; justify-content:center; gap:4px; padding:4px 2px; font-size:10.5px; font-weight:600; min-width:0;}
  .mn-bottom .mn-item::before{content:""; position:absolute; top:1.5px; inset-inline-start:50%; width:46px; height:28px; margin-inline-start:-23px; border-radius:999px; background:transparent; transition:background .2s; pointer-events:none;}
  .mn-bottom .mn-item svg{position:relative;}
  .mn-bottom a.mn-item:not(.is-on):active::before{background:color-mix(in srgb, var(--navy) 7%, transparent);}
  .mn-bottom a.mn-item:active svg,.mn-bottom a.mn-item:active .mn-av{animation:mnwig .55s ease both;}
  .mn-bottom .mn-t{max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
  .mn-bottom .mn-item svg{width:23px; height:23px;}
  .mn-bottom .mn-av{width:26px; height:26px;}
  .mn-bottom .mn-item.is-on{color:var(--blue);}
  .mn-bottom .mn-soon{display:none;}
  body.has-mn{padding-bottom:calc(66px + env(safe-area-inset-bottom));}
  /* frosted glass, like the iOS tab bar: the page scrolls under the bar and shows through, blurred */
  @supports ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){
    .mn-bottom{background:color-mix(in srgb, var(--white) 90%, transparent); -webkit-backdrop-filter:blur(24px) saturate(1.9); backdrop-filter:blur(24px) saturate(1.9); box-shadow:inset 0 .5px 0 rgb(128 128 128 / .3);}
  }
  .fd-toast{bottom:84px;}
}

/* only the top bar (logo...) hides on scroll down and returns on scroll up (js/navhide.js); the section row stays pinned */
header{transition:transform .28s ease;}
.mn-row{transition:top .28s ease, background-color .28s ease, box-shadow .28s ease;}
html.nav-instant header,html.nav-instant .mn-row{transition:none;}
html.nav-hidden header{transform:translateY(-100%);}
html.nav-hidden .mn-row{top:0;}
/* with the top bar gone, the row becomes frosted glass: the page scrolls under it and shows through, blurred (like the iOS bars) */
html.nav-hidden .mn-row{background:color-mix(in srgb, var(--white) 92%, transparent); border-bottom-color:color-mix(in srgb, var(--border-soft) 70%, transparent);}
@supports ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){
  html.nav-hidden .mn-row{background:color-mix(in srgb, var(--white) 90%, transparent); -webkit-backdrop-filter:blur(24px) saturate(1.9); backdrop-filter:blur(24px) saturate(1.9); box-shadow:inset 0 -.5px 0 rgb(128 128 128 / .3), 0 12px 30px -22px rgb(0 0 0 / .5);}
}

/* unread number on the Chats tab: a capsule, the digits optically centred (a little more room above than below, since digits sit high in their line) */
.mn-badge{position:absolute; top:1px; inset-inline-start:calc(50% + 7px); min-width:18px; height:18px; box-sizing:border-box; padding:1.5px 5px 0; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; background:#e5484d; color:#fff; font:700 10.5px/1 'Inter',sans-serif; font-variant-numeric:tabular-nums; border:2px solid var(--white,#fff); box-shadow:0 0 0 .5px color-mix(in srgb, var(--navy,#000) 12%, transparent);}
.mn-badge[hidden]{display:none;}
.mn-top .mn-badge{top:5px; inset-inline-start:calc(50% + 6px);}
