/* V82 — trava estrutural da barra inferior.
   A sobreposição das capturas mostrou ~14–15 px físicos de diferença:
   no PWA estreito o Mapa reservava 72 CSS px na linha inferior,
   enquanto as telas internas reservavam 68 CSS px.
   Este arquivo é carregado por último e unifica a linha inferior. */

@media (display-mode:standalone) and (max-width:390px){
  /* Preserva a altura própria de cada cabeçalho, mas usa a MESMA linha inferior. */
  .app.map-screen-active{
    grid-template-rows:148px minmax(0,1fr) calc(68px + env(safe-area-inset-bottom)) !important;
  }
  .app:not(.map-screen-active){
    grid-template-rows:74px minmax(0,1fr) calc(68px + env(safe-area-inset-bottom)) !important;
  }

  .bottom-nav,
  .app.map-screen-active .bottom-nav,
  .app:not(.map-screen-active) .bottom-nav{
    box-sizing:border-box !important;
    height:calc(68px + env(safe-area-inset-bottom)) !important;
    min-height:calc(68px + env(safe-area-inset-bottom)) !important;
    max-height:calc(68px + env(safe-area-inset-bottom)) !important;
    padding:0 0 env(safe-area-inset-bottom) !important;
    margin:0 !important;
    align-self:stretch !important;
  }

  .bottom-nav > button,
  .bottom-nav > button.active,
  .app.map-screen-active .bottom-nav > button,
  .app:not(.map-screen-active) .bottom-nav > button{
    box-sizing:border-box !important;
    height:68px !important;
    min-height:68px !important;
    max-height:68px !important;
    margin:0 !important;
    padding:6px 3px 4px !important;
    gap:3px !important;
    grid-template-rows:27px 14px !important;
    align-content:center !important;
    transform:none !important;
  }

  .bottom-nav .nav-icon,
  .bottom-nav > button.active .nav-icon{
    width:27px !important;
    height:27px !important;
    margin:0 !important;
    transform:none !important;
  }
  .bottom-nav .nav-icon svg,
  .bottom-nav > button.active .nav-icon svg{
    width:26px !important;
    height:26px !important;
  }
  .bottom-nav > button b,
  .bottom-nav > button.active b{
    height:14px !important;
    min-height:14px !important;
    line-height:14px !important;
    margin:0 !important;
    transform:none !important;
  }

  /* O botão central participa da mesma linha e não pode ganhar deslocamento por tela. */
  .quick-action-dock{
    height:68px !important;
    min-height:68px !important;
    max-height:68px !important;
    align-self:start !important;
    margin:0 !important;
    transform:none !important;
  }
  .quick-action-dock summary{
    margin-top:-17px !important;
  }
}

/* Também garante igualdade em PWA mobile maior. */
@media (display-mode:standalone) and (min-width:391px) and (max-width:720px){
  .app.map-screen-active{
    grid-template-rows:148px minmax(0,1fr) calc(72px + env(safe-area-inset-bottom)) !important;
  }
  .app:not(.map-screen-active){
    grid-template-rows:76px minmax(0,1fr) calc(72px + env(safe-area-inset-bottom)) !important;
  }
  .bottom-nav,
  .app.map-screen-active .bottom-nav,
  .app:not(.map-screen-active) .bottom-nav{
    height:calc(72px + env(safe-area-inset-bottom)) !important;
    min-height:calc(72px + env(safe-area-inset-bottom)) !important;
    max-height:calc(72px + env(safe-area-inset-bottom)) !important;
  }
  .bottom-nav > button,
  .bottom-nav > button.active{
    height:72px !important;
    min-height:72px !important;
    max-height:72px !important;
  }
  .quick-action-dock{
    height:72px !important;
    min-height:72px !important;
    max-height:72px !important;
  }
}
