/* Mobile topbar navigation: keep only 4 important sections on phones.
   Desktop remains unchanged. */
@media (max-width: 860px){
  :root{
    --mobile-topbar-title-height: 40px;
    --mobile-topbar-nav-height: 42px;
    --mobile-topbar-side-gap: 8px;
    --mobile-app-bar-height: calc(var(--mobile-safe-top, env(safe-area-inset-top, 0px)) + var(--mobile-topbar-title-height) + var(--mobile-topbar-nav-height) + 10px);
  }

  .topbar{
    display:block !important;
    padding: calc(var(--mobile-safe-top, env(safe-area-inset-top, 0px)) + 4px) var(--mobile-topbar-side-gap) 6px !important;
    min-height: var(--mobile-app-bar-height) !important;
    height: var(--mobile-app-bar-height) !important;
  }

  .topbar::after{
    top: calc(var(--mobile-safe-top, env(safe-area-inset-top, 0px)) + 19px) !important;
    font-size: 14px !important;
  }

  .mobile-menu-toggle,
  #btnToggle,
  .sidebar,
  .shell::after{
    display:none !important;
  }

  .mobile-sections-bar{
    position:absolute;
    left: var(--mobile-topbar-side-gap);
    right: var(--mobile-topbar-side-gap);
    bottom: 7px;
    display:grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 6px;
    align-items: stretch;
    z-index: 2;
    direction: rtl;
  }

  .mobile-sections-bar__btn{
    min-width:0;
    min-height: var(--mobile-topbar-nav-height);
    height: var(--mobile-topbar-nav-height);
    padding: 0 4px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.14);
    color: rgba(255,255,255,.92);
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    font: 800 11px/1.15 var(--taif-font-family, system-ui, sans-serif);
    letter-spacing: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background .18s ease, transform .12s ease, border-color .18s ease, box-shadow .18s ease;
    white-space: normal;
    overflow: hidden;
  }

  .mobile-sections-bar__btn:active{
    transform: scale(.985);
  }

  .mobile-sections-bar__btn.is-active{
    background: rgba(255,255,255,.28);
    border-color: rgba(255,255,255,.34);
    color: #fff;
    box-shadow: 0 8px 18px rgba(15,23,42,.18), inset 0 1px 0 rgba(255,255,255,.18);
  }

  .mobile-sections-bar__label{
    display:block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .content{
    padding-top: var(--mobile-trail-height) !important;
  }
}
