/* RBS Desk v5.1.14 — Client Mobile Stability: scroll real + sem clipping */
@media (max-width:820px){
  /* O shell ocupa exatamente a viewport dinâmica. */
  body.portal-client,
  body.portal-client #app,
  body.portal-client .v1813-client-shell,
  body.portal-client .v1813-client-stage{
    width:100%!important;
    height:100dvh!important;
    max-height:100dvh!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  body.portal-client .v1813-client-stage{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:max-content minmax(0,1fr) max-content!important;
    align-items:stretch!important;
    align-content:stretch!important;
  }

  /* ÚNICA região rolável: o conteúdo entre header e Tab Bar. */
  body.portal-client .v1813-client-stage > main.page#mainContent,
  body.portal-client .v1813-client-stage > .page{
    grid-row:2!important;
    align-self:stretch!important;
    justify-self:stretch!important;
    width:100%!important;
    height:100%!important;
    block-size:100%!important;
    max-height:100%!important;
    min-height:0!important;
    min-block-size:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
    contain:none!important;
    clip:auto!important;
    padding:12px max(12px,env(safe-area-inset-right)) 28px max(12px,env(safe-area-inset-left))!important;
    scroll-padding-bottom:28px!important;
  }

  /* Nenhum wrapper interno pode cortar cards/listas do Portal. */
  body.portal-client .v1813-client-stage > .page > *,
  body.portal-client .v187-client-page,
  body.portal-client .v189-client-tickets,
  body.portal-client .v189-client-groups,
  body.portal-client .v189-client-status-group,
  body.portal-client .v189-client-status-group > div{
    height:auto!important;
    max-height:none!important;
    min-height:0!important;
    overflow:visible!important;
    contain:none!important;
    clip:auto!important;
  }

  /* Cards e textos respeitam a largura útil e quebram linha no iPhone. */
  body.portal-client .v189-client-ticket{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow:visible!important;
  }
  body.portal-client .v189-ticket-main,
  body.portal-client .v189-ticket-main > strong,
  body.portal-client .v189-ticket-main > small{
    min-width:0!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
  }

  /* Chrome fixo fora da rolagem. */
  body.portal-client .v1813-client-topbar{
    grid-row:1!important;
    flex:0 0 auto!important;
  }
  body.portal-client .v1813-client-mobile-nav{
    grid-row:3!important;
    flex:0 0 auto!important;
  }

  /* Chat permanece acima da Tab Bar sem virar overlay de página. */
  body.portal-client .client-chat-widget-root{pointer-events:none!important}
  body.portal-client .cw-launcher,
  body.portal-client .cw-panel{pointer-events:auto!important}
}
