/* Vchat Core 0.55.12-alpha
   PWA icon separation + hard mobile keyboard/zoom stabilization.
   This file is intentionally loaded last. */

html.vchat-app-document,
html.vchat-app-document body.vchat-public-page{
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
  -webkit-text-size-adjust:100%!important;
  text-size-adjust:100%!important;
  overscroll-behavior:none!important;
}

@media (hover:none) and (pointer:coarse), (max-width:1024px){
  html.vchat-app-document{
    position:relative!important;
    width:100%!important;
    max-width:100vw!important;
    height:100%!important;
    min-height:100%!important;
    overflow:hidden!important;
    touch-action:pan-x pan-y!important;
  }

  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked{
    position:fixed!important;
    inset:0!important;
    width:100%!important;
    max-width:100vw!important;
    height:100%!important;
    min-height:100%!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    overscroll-behavior:none!important;
    touch-action:pan-x pan-y!important;
  }

  /* Anchor the whole app to VisualViewport. When the keyboard makes Safari pan
     the visual viewport, offsetTop/offsetLeft are applied back to the app so the
     composer does not disappear above or below the visible area. */
  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-frontend-app{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--vchat-visual-width,100vw)!important;
    max-width:var(--vchat-visual-width,100vw)!important;
    height:var(--vchat-visual-height,100dvh)!important;
    min-height:var(--vchat-visual-height,100dvh)!important;
    max-height:var(--vchat-visual-height,100dvh)!important;
    margin:0!important;
    overflow:hidden!important;
    transform:translate3d(var(--vchat-visual-left,0px),var(--vchat-visual-top,0px),0)!important;
    transform-origin:0 0!important;
    overscroll-behavior:none!important;
    touch-action:pan-x pan-y!important;
  }

  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-app-main{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
    grid-template-rows:68px minmax(0,1fr)!important;
  }

  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-app-section{
    min-height:0!important;
    max-height:100%!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
  }

  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-app-section.vchat-inbox-section{
    height:100%!important;
    max-height:100%!important;
    overflow:hidden!important;
  }

  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-inbox-shell{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
  }

  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-chat-panel{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
    grid-template-rows:auto auto auto minmax(0,1fr) auto!important;
  }

  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-chat-timeline,
  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-conversation-list,
  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-modal-body,
  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-notification-drawer>div{
    min-height:0!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
  }

  /* The composer remains a grid row of the chat panel. It does not use viewport
     positioning of its own, so the keyboard can only shrink the timeline. */
  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-composer-wrap{
    position:relative!important;
    inset:auto!important;
    z-index:20!important;
    flex:none!important;
    width:100%!important;
    margin:0!important;
    padding-bottom:max(8px,env(safe-area-inset-bottom))!important;
    background:#fff!important;
    transform:none!important;
  }

  /* HARD iOS/Android focus-zoom guard. Every editable control on every Vchat
     screen renders at >=16 CSS px before focus. */
  html.vchat-app-document body.vchat-public-page input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]),
  html.vchat-app-document body.vchat-public-page textarea,
  html.vchat-app-document body.vchat-public-page select,
  html.vchat-app-document body.vchat-public-page [contenteditable="true"],
  html.vchat-app-document body.vchat-public-page [contenteditable=""]{
    font-size:16px!important;
    line-height:1.35!important;
    -webkit-text-size-adjust:100%!important;
    text-size-adjust:100%!important;
    touch-action:pan-x pan-y!important;
    transform:translateZ(0)!important;
  }

  /* Explicitly override old release rules that used manipulation (which allows
     pinch zoom on some browsers). */
  html.vchat-app-document body.vchat-public-page .vchat-frontend-app,
  html.vchat-app-document body.vchat-public-page .vchat-frontend-app *,
  html.vchat-app-document body.vchat-public-page button,
  html.vchat-app-document body.vchat-public-page a,
  html.vchat-app-document body.vchat-public-page [role="button"]{
    touch-action:pan-x pan-y!important;
  }

  html.vchat-app-document body.vchat-public-page .vchat-chat-timeline,
  html.vchat-app-document body.vchat-public-page .vchat-conversation-list,
  html.vchat-app-document body.vchat-public-page .vchat-app-section:not(.vchat-inbox-section),
  html.vchat-app-document body.vchat-public-page .vchat-modal-body{
    touch-action:pan-y!important;
  }

  /* No browser page scroll while the keyboard is active. */
  html.vchat-app-document body.vchat-public-page.vchat-keyboard-active{
    overflow:hidden!important;
    overscroll-behavior:none!important;
  }
}

@media (max-height:560px) and (orientation:landscape){
  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-app-main{
    grid-template-rows:58px minmax(0,1fr)!important;
  }
  html.vchat-app-document body.vchat-public-page.vchat-mobile-app-locked .vchat-app-header{
    height:58px!important;
    min-height:58px!important;
  }
}
