/* DriverLog AU V8.9.0 — Bottom Navigation Stability Hotfix 8
   Targeted fix only: prevents the mobile/tablet/split-screen bottom menu from
   stretching, shrinking vertically, or crushing labels when the viewport narrows.
   Desktop/left-sidebar styling is intentionally untouched. */

@media (max-width:899px){
  body.driverlog-pro-web:not(.auth-locked){
    padding-bottom:calc(74px + env(safe-area-inset-bottom))!important;
  }
  body.driverlog-pro-web:not(.auth-locked) #appShell>main{
    padding-bottom:calc(92px + env(safe-area-inset-bottom))!important;
  }

  body.driverlog-pro-web:not(.auth-locked) #appShell>nav{
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:auto!important;
    bottom:0!important;
    width:100vw!important;
    height:calc(66px + env(safe-area-inset-bottom))!important;
    min-height:calc(66px + env(safe-area-inset-bottom))!important;
    max-height:calc(66px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
    z-index:190!important;

    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:center!important;
    align-content:center!important;
    justify-content:flex-start!important;
    gap:3px!important;

    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
    scroll-snap-type:x proximity!important;

    padding:5px max(5px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left))!important;
    background:rgba(255,255,255,.985)!important;
    border-top:1px solid #c7d4e2!important;
    box-shadow:0 -5px 18px rgba(15,23,42,.11)!important;
    contain:layout paint!important;
  }

  body.driverlog-pro-web:not(.auth-locked) #appShell>nav::-webkit-scrollbar{
    display:none!important;
    width:0!important;
    height:0!important;
  }

  body.driverlog-pro-web:not(.auth-locked) #appShell>nav button{
    flex:0 0 68px!important;
    width:68px!important;
    min-width:68px!important;
    max-width:68px!important;
    height:54px!important;
    min-height:54px!important;
    max-height:54px!important;
    align-self:center!important;

    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:3px!important;

    margin:0!important;
    padding:4px 3px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    writing-mode:horizontal-tb!important;
    text-orientation:mixed!important;
    word-break:keep-all!important;

    border-radius:10px!important;
    transform:none!important;
    scroll-snap-align:center!important;
    touch-action:manipulation!important;
  }

  body.driverlog-pro-web:not(.auth-locked) #appShell>nav button:hover,
  body.driverlog-pro-web:not(.auth-locked) #appShell>nav button:active,
  body.driverlog-pro-web:not(.auth-locked) #appShell>nav button.active{
    transform:none!important;
    height:54px!important;
    min-height:54px!important;
    max-height:54px!important;
  }

  body.driverlog-pro-web:not(.auth-locked) #appShell>nav button .nav-icon{
    display:block!important;
    flex:0 0 auto!important;
    font-size:18px!important;
    line-height:19px!important;
    margin:0!important;
  }

  body.driverlog-pro-web:not(.auth-locked) #appShell>nav button .nav-label{
    display:block!important;
    flex:0 0 auto!important;
    width:100%!important;
    margin:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    text-align:center!important;
    font-size:9.5px!important;
    font-weight:750!important;
    line-height:11px!important;
    writing-mode:horizontal-tb!important;
    word-break:keep-all!important;
  }
}

/* Split-screen laptop and larger tablet widths can centre all seven items without
   changing their touch size. */
@media (min-width:520px) and (max-width:899px){
  body.driverlog-pro-web:not(.auth-locked) #appShell>nav{
    justify-content:center!important;
  }
}

/* Small phones keep the same stable geometry and simply swipe horizontally. */
@media (max-width:519px){
  body.driverlog-pro-web:not(.auth-locked) #appShell>nav{
    justify-content:flex-start!important;
  }
  body.driverlog-pro-web:not(.auth-locked) #appShell>nav button{
    flex-basis:66px!important;
    width:66px!important;
    min-width:66px!important;
    max-width:66px!important;
  }
}
