/* Bottom navigation is part of the fixed-height app shell. Reports keep
   their own scrolling area, and no overlay covers the last report row. */
.hd-mobile-bottom-nav { display:none; }

@media (max-width:750px) {
  .shell > .workspace > .hd-mobile-bottom-nav {
    display:flex;
    flex:0 0 auto;
    position:relative;
    z-index:40;
    direction:rtl;
    align-items:stretch;
    justify-content:space-around;
    gap:2px;
    width:100%;
    min-height:calc(65px + env(safe-area-inset-bottom, 0px));
    padding:5px 7px max(6px, env(safe-area-inset-bottom, 0px));
    border-top:1px solid #ece7e9;
    background:#fff;
    box-shadow:0 -4px 18px rgba(30,24,29,.045);
  }

  .hd-mobile-bottom-nav > a,
  .hd-mobile-bottom-nav > button {
    position:relative;
    display:flex;
    flex:1 1 0;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    min-width:0;
    max-width:132px;
    min-height:51px;
    margin:0;
    padding:4px 2px;
    border:0;
    border-radius:11px;
    background:transparent;
    color:#737781;
    text-decoration:none;
    font:650 10px/1.5 Vazirmatn,Tahoma,sans-serif;
    white-space:nowrap;
    cursor:pointer;
    transition:background-color .15s ease,color .15s ease;
    -webkit-tap-highlight-color:transparent;
  }

  .hd-mobile-bottom-nav > a svg,
  .hd-mobile-bottom-nav > button svg {
    display:block;
    flex:0 0 auto;
    width:22px;
    height:22px;
  }
  .hd-mobile-bottom-nav > a span,
  .hd-mobile-bottom-nav > button span {
    display:block;
    overflow:hidden;
    max-width:100%;
    text-overflow:ellipsis;
  }
  .hd-mobile-bottom-nav > a.active,
  .hd-mobile-bottom-nav > button[aria-expanded="true"] {
    background:#fcf1f3;
    color:#aa3348;
    font-weight:800;
  }
  .hd-mobile-bottom-nav > a.active::before,
  .hd-mobile-bottom-nav > button[aria-expanded="true"]::before {
    content:"";
    position:absolute;
    top:-6px;
    right:25%;
    left:25%;
    height:3px;
    border-radius:0 0 4px 4px;
    background:#b23c4d;
  }
  .hd-mobile-bottom-nav > a:hover,
  .hd-mobile-bottom-nav > button:hover {background:#fbf4f6;color:#9f3648}
  .hd-mobile-bottom-nav > a:focus-visible,
  .hd-mobile-bottom-nav > button:focus-visible {
    outline:2px solid #ac4051;
    outline-offset:-2px;
  }

  /* Accounts that can reach every permitted page from the bottom bar
     should never see the redundant mobile drawer, including after restoring
     a previously open drawer state. Desktop navigation is unchanged. */
  .shell.hd-no-overflow-nav > .side,
  .shell.hd-no-overflow-nav > .hd-sidebar-backdrop {display:none!important}

  /* The bottom bar replaces the duplicate hamburger in the mobile header.
     The full permission-scoped sidebar still opens from «بیشتر». */
  .shell > .workspace > .header .hd-mobile-trigger {display:none}

  /* Keep PWA install/update notices above the mobile navigation. */
  .hd-pwa-invite,
  .hd-pwa-update {
    bottom:calc(78px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width:360px) {
  .hd-mobile-bottom-nav > a,
  .hd-mobile-bottom-nav > button {font-size:9px;gap:2px;padding-inline:1px}
  .hd-mobile-bottom-nav > a svg,
  .hd-mobile-bottom-nav > button svg {width:20px;height:20px}
}
@media (prefers-reduced-motion:reduce) {
  .hd-mobile-bottom-nav > a,
  .hd-mobile-bottom-nav > button {transition:none}
}
