/* RBS Desk v5.1.12 — Client Login Recovery + Mobile Chat Restore */
@media (max-width:820px){
  /* Restaura o launcher do Chat para Cliente mobile sem reintroduzir o antigo dock de navegação. */
  body.portal-client .client-chat-widget-root{
    pointer-events:none!important;
    z-index:9500!important;
  }
  body.portal-client .cw-launcher{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    position:fixed!important;
    right:max(14px,env(safe-area-inset-right))!important;
    bottom:calc(76px + env(safe-area-inset-bottom) + 10px)!important;
    z-index:9502!important;
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:transparent!important;
  }
  body.portal-client .cw-panel{
    pointer-events:auto!important;
    right:max(10px,env(safe-area-inset-right))!important;
    bottom:calc(76px + env(safe-area-inset-bottom) + 70px)!important;
    width:min(390px,calc(100vw - 20px))!important;
    height:min(600px,calc(100dvh - 170px - env(safe-area-inset-top)))!important;
    max-height:calc(100dvh - 170px - env(safe-area-inset-top))!important;
    z-index:9501!important;
  }
  /* Durante digitação o teclado/compositor ganha prioridade visual. */
  body.portal-client.chat-client-composing .cw-launcher{
    display:none!important;
    pointer-events:none!important;
  }
  /* Wizard de novo chamado continua com chat acessível, mas acima da Tab Bar. */
  body.portal-client.portal-wizard-active .cw-launcher{
    bottom:calc(76px + env(safe-area-inset-bottom) + 10px)!important;
  }
  body.portal-client.portal-wizard-active .cw-panel{
    bottom:calc(76px + env(safe-area-inset-bottom) + 70px)!important;
  }
}
