/* iPhone / PWA installed-mode layout authority.
   Loaded last so standalone mode no longer inherits competing mobile nav rules. */
@media (max-width:850px){
 body.mate-pwa{
  --mobile-nav-height:78px;
  min-height:100dvh;
  padding-top:env(safe-area-inset-top,0px);
  box-sizing:border-box;
 }
 body.mate-pwa>main{
  margin-left:0!important;
  width:100%!important;
  max-width:none!important;
  padding-left:14px!important;
  padding-right:14px!important;
  padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom,0px) + 20px)!important;
  box-sizing:border-box!important;
 }
 body.mate-pwa>aside{
  position:fixed!important;
  inset:auto 0 0 0!important;
  width:100%!important;
  height:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom,0px))!important;
  min-height:0!important;
  padding:6px max(6px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px))!important;
  border-right:0!important;
  border-top:1px solid var(--line)!important;
  box-sizing:border-box!important;
  z-index:1000!important;
 }
 body.mate-pwa>aside .logo,
 body.mate-pwa>aside .world,
 body.mate-pwa>aside .account,
 body.mate-pwa #mateAuxNav{display:none!important}
 body.mate-pwa>aside>nav{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:2px!important;
  width:100%!important;
  height:64px!important;
  margin:0!important;
  align-items:stretch!important;
 }
 body.mate-pwa>aside>nav button{
  min-width:0!important;
  width:auto!important;
  margin:0!important;
  padding:5px 2px 4px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  font-size:20px!important;
  line-height:1!important;
  overflow:hidden!important;
 }
 body.mate-pwa>aside>nav button span{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  font-size:10px!important;
  line-height:1.05!important;
  white-space:normal!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  text-align:center!important;
 }
 body.mate-pwa>aside>nav .nav-badge{top:0!important;right:calc(50% - 24px)!important}
 body.mate-pwa main>header{padding-top:max(8px,env(safe-area-inset-top,0px))!important}
 body.mate-pwa .mate-account-menu{
  max-width:calc(100vw - 16px)!important;
  bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom,0px) + 8px)!important;
 }
 body.mate-pwa .layout .actions{
  bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom,0px))!important;
 }
 body.mate-pwa.mate-mobile-chat>main{
  top:env(safe-area-inset-top,0px)!important;
  height:calc(var(--mate-vh,100dvh) - var(--mobile-nav-height) - env(safe-area-inset-bottom,0px) - env(safe-area-inset-top,0px))!important;
 }
 body.mate-pwa.mate-mobile-chat.mate-keyboard-open>main{
  top:var(--mate-vtop,0px)!important;
  height:var(--mate-vh,100dvh)!important;
 }
}
