/* Phone and tablet navigation (stage 5). Loaded after zap-nav.css.
   Under 1024px the bottom bar has five fixed slots: Home, Loads, Carriers (dispatcher) or Fleet
   (carrier), Invoices and More. Brokers, Costs, Charges and Settings open from the More sheet
   (zap-mobile-nav.js). Their .nav-btn[data-screen] buttons stay in the page, only hidden here, so
   navTo(), the tour and the checklist keep finding and clicking them. The desktop sidebar is
   untouched: the only rule above 1024px hides More. */

@media (max-width:1023.98px){
  .bottom-nav{
    left:0!important;right:0!important;transform:none!important;width:100%!important;max-width:none!important;
    overflow:hidden!important;border-left:0!important;border-right:0!important;border-radius:0;z-index:60;
    padding:4px 4px calc(4px + env(safe-area-inset-bottom,0px))!important
  }
  .bottom-nav .nav-btn{flex:1 1 0!important;min-width:0!important;min-height:52px!important;padding:6px 2px!important}
  .bottom-nav .nav-btn span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bottom-nav .nav-btn[data-screen="brokers"],.bottom-nav .nav-btn[data-screen="expenses"],
  .bottom-nav .nav-btn[data-screen="charges"],.bottom-nav .nav-btn[data-screen="settings"]{display:none!important}
  .bottom-nav .nav-btn[data-screen="dashboard"]{order:1}
  .bottom-nav .nav-btn[data-screen="loads"]{order:2}
  .bottom-nav .nav-btn[data-screen="carriers"],.bottom-nav .nav-btn[data-screen="fleet"]{order:3}
  .bottom-nav .nav-btn[data-screen="invoices"]{order:4}
  .bottom-nav #zmnMore{order:5}
  /* More stands for the screen you are on when that screen lives in the sheet */
  .bottom-nav #zmnMore.zmn-current{background:var(--zap-nav-active-bg);color:var(--zap-nav-active-text)}
  .bottom-nav #zmnMore.zmn-current span{font-weight:600}
  .bottom-nav .nav-btn:focus-visible,.zmn-item:focus-visible{outline:2px solid var(--zap-action);outline-offset:-2px}

  /* Room for the bar (60px) and the iPhone home indicator; floating notices sit above it */
  .app-shell{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))!important}
  .load-save-bottom{bottom:calc(68px + env(safe-area-inset-bottom,0px))!important}
  #toastContainer{bottom:calc(72px + env(safe-area-inset-bottom,0px))!important;left:12px;right:12px!important;align-items:flex-end}
  #zapUpdateBanner{bottom:calc(72px + env(safe-area-inset-bottom,0px))!important}
  /* both showing: toasts stack above the "New version available" banner instead of behind it */
  body:has(#zapUpdateBanner) #toastContainer{bottom:calc(140px + env(safe-area-inset-bottom,0px))!important}

  /* Typing: the on-screen keyboard is up, so the bar steps aside instead of covering fields */
  body.zmn-typing .bottom-nav,body.zmn-typing #zmnSheet,body.zmn-typing #zmnShade{display:none!important}
  body.zmn-typing .app-shell{padding-bottom:24px!important}
  body.zmn-typing .load-save-bottom{bottom:env(safe-area-inset-bottom,0px)!important}
  body.zmn-typing #toastContainer,body.zmn-typing #zapUpdateBanner{bottom:calc(12px + env(safe-area-inset-bottom,0px))!important}
}
@media (min-width:1024px){#zmnMore,#zmnSheet,#zmnShade{display:none!important}}

#zmnShade{position:fixed;inset:0;z-index:58;background:rgba(0,0,0,.45)}
#zmnSheet{
  position:fixed;left:0;right:0;bottom:calc(61px + env(safe-area-inset-bottom,0px));z-index:59;
  max-height:calc(100vh - 140px);overflow:auto;padding:8px 8px 10px;
  background:var(--zap-panel);border-top:1px solid var(--zap-border);border-radius:12px 12px 0 0;box-shadow:var(--zap-overlay-shadow)
}
#zmnSheet[hidden],#zmnShade[hidden]{display:none}
#zmnSheet h2{margin:4px 8px 6px;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--zap-muted)}
.zmn-item{display:flex;align-items:center;gap:12px;width:100%;min-height:48px;padding:0 12px;border:0;border-radius:6px;background:transparent;color:var(--zap-text);font-size:16px;font-weight:500;text-align:left;cursor:pointer}
.zmn-item+.zmn-item{margin-top:2px}
.zmn-item .nav-icon{width:20px;height:20px;flex:0 0 auto}
.zmn-item.active{background:var(--zap-nav-active-bg);color:var(--zap-nav-active-text);font-weight:600}
