/* Phone navigation: bottom tab bar (mnav.js). Desktop and tablets keep the sidebar. */
#mnav { display: none; }
@media (max-width: 760px) {
  :root { --nav-h: calc(58px + env(safe-area-inset-bottom, 0px)); }
  body:not(.signed-out) .sidebar { display: none !important; }
  body:not(.signed-out) #mnav { display: grid; }
  body:not(.signed-out) main, body:not(.signed-out) #main { padding-bottom: calc(var(--nav-h) + 24px); }
  #mnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom, 0px);
    grid-template-columns: repeat(5, 1fr); background: rgba(10,12,16,.97); border-top: 1px solid var(--line); }
  #mnav a, #mnav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px;
    background: none; border: 0; color: var(--muted); font: inherit; font-size: 10.5px; letter-spacing: .01em; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  #mnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  #mnav .on { color: var(--text); }
  #mnav .on svg { stroke: #3fe6cf; }
  #mnav .mnav-plus { display: grid; place-items: center; width: 34px; height: 26px; border-radius: 9px; background: var(--accent, #00dcc4); color: #0b0d12; }
  #mnav .mnav-plus svg { width: 18px; height: 18px; stroke-width: 2.4; stroke: #0b0d12; }
  #mnav .mnav-dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: #00dcc4; box-shadow: 0 0 0 2px #0a0c10; }
  /* every page footer (players, transports, save bars) and the progress dock sit on top of the tab bar */
  .procbar { left: 0 !important; }
  .procbar:not([style*="bottom"]) { bottom: var(--nav-h); }
  #transport, #upTransport, #sndTransport, #arrFoot, .drawer-foot, #mFoot, #cxFoot, #vsFoot, [data-foot] { bottom: var(--nav-h) !important; }
  .mnav-sheet { position: fixed; inset: 0; z-index: 75; }
  .mnav-scrim { position: absolute; inset: 0; background: rgba(5,6,9,.55); opacity: 0; transition: opacity .2s; }
  .mnav-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--panel); border-top: 1px solid var(--line2); border-radius: 18px 18px 0 0;
    padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .22s ease; overscroll-behavior: contain; }
  .mnav-sheet.open .mnav-scrim { opacity: 1; }
  .mnav-sheet.open .mnav-panel { transform: none; }
  .mnav-grab { display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line2); margin: 2px auto 10px; }
  .mnav-panel h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 6px 6px; text-transform: uppercase; letter-spacing: .06em; }
  .mnav-panel button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 8px 10px; background: none; border: 0; border-radius: 12px;
    color: var(--text); font: inherit; text-align: left; }
  .mnav-panel button:active { background: var(--panel2); }
  .mnav-panel svg { width: 22px; height: 22px; flex: none; fill: none; stroke: #3fe6cf; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mnav-panel b { display: block; font-size: 15px; font-weight: 600; }
  .mnav-panel small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
}
@media (max-width: 760px) {
  /* nothing may make a page wider than the phone (it made the browser zoom out and pushed the tab bar off screen) */
  #main, main { overflow-x: clip; max-width: 100vw; }
  .cx-tabs { overflow-x: auto; scrollbar-width: none; }
  .cx-tabs::-webkit-scrollbar { display: none; }
  .cx-tabs [role=tab] { flex: none; white-space: nowrap; padding: 12px 8px; font-size: 13.5px; }
}
#mbar { display: none; }
@media (max-width: 760px) {
  body:not(.signed-out) #mbar { display: flex; position: sticky; top: 0; z-index: 35; align-items: center; justify-content: space-between; height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 16px 0; background: rgba(10,12,16,.97); border-bottom: 1px solid var(--line); }
  #mbar.hide { display: none !important; }
  .mbar-logo { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 17px; }
  .mbar-me { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #00dcc4; color: #0b0d12; font-weight: 700; font-size: 14px; text-decoration: none; }
  .mbar-me img { width: 100%; height: 100%; object-fit: cover; }
}
