/* GattoMusic 2.0 - Build 9.79
   Chat em três regiões: cabeçalho fixo, mensagens roláveis, rodapé fixo.
   Não usa position:fixed global no cabeçalho da conversa; a fixação é estrutural
   dentro do painel, preservando Chrome/Chromium, Firefox e mobile. */

body.chat-view-active .content,
body.chat-view-active .view-content,
body.chat-view-active .chat-workspace-panel,
body.chat-view-active .chat-shell,
body.chat-view-active .chat-conversation{
  min-height:0!important;
  max-height:100%!important;
  overflow:hidden!important;
}

body.chat-view-active .chat-conversation{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr) auto auto!important;
  align-content:stretch!important;
}

/* Cabeçalho superior: nunca entra na rolagem das mensagens. */
body.chat-view-active .chat-conversation-header{
  position:relative!important;
  inset:auto!important;
  flex:0 0 auto!important;
  align-self:start!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:visible!important;
  z-index:40!important;
}

/* A única rolagem vertical da conversa fica aqui. */
body.chat-view-active .chat-message-list{
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable!important;
}

body.chat-view-active .chat-typing-indicator{
  flex:0 0 auto!important;
}

/* Quando o compositor está no rodapé dedicado, o compositor duplicado do painel
   central permanece fora do fluxo como nas builds anteriores. */
body.chat-view-active.chat-footer-active .chat-conversation>.chat-composer,
body.chat-view-active.chat-footer-active .chat-conversation>.chat-message-splitter{
  display:none!important;
}

/* Rodapé do Chat: viewport-anchored pela barra já existente e sem rolagem do
   cartão/rodapé. Somente previews específicos podem ter rolagem própria. */
body.chat-view-active.chat-footer-active .player-bar.chat-mode{
  position:fixed!important;
  overflow:hidden!important;
}
body.chat-view-active.chat-footer-active .player-bar.chat-mode .chat-footer-mode,
body.chat-view-active.chat-footer-active .player-bar.chat-mode .chat-footer-shell{
  min-height:0!important;
  max-height:100%!important;
  overflow:hidden!important;
}
body.chat-view-active.chat-footer-active .chat-footer-shell{
  display:grid!important;
  grid-template-rows:auto auto minmax(0,1fr)!important;
  align-content:stretch!important;
}
body.chat-view-active.chat-footer-active .chat-footer-shell>.chat-conversation-boundary-controls,
body.chat-view-active.chat-footer-active .chat-footer-shell>.chat-footer-heading{
  flex:0 0 auto!important;
  overflow:visible!important;
}
body.chat-view-active.chat-footer-active .chat-footer-shell>.chat-composer{
  min-height:0!important;
  max-height:100%!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.chat-view-active.chat-footer-active .chat-footer-mode .chat-selected-file-text,
body.chat-view-active.chat-footer-active .chat-footer-mode .chat-voice-preview{
  overflow:auto!important;
  overscroll-behavior:contain!important;
}

/* Os dois controles de limite pertencem ao rodapé, não à lista rolável. */
body.chat-view-active.chat-footer-active .chat-conversation-boundary-controls{
  position:relative!important;
  z-index:3!important;
  flex-shrink:0!important;
}

/* Salas: não deixar container administrativo vazio sob o card de membro comum. */
.chat-v977-room-admin:empty{display:none!important}

@media(max-width:820px){
  body.chat-view-active .chat-conversation{
    grid-template-rows:auto minmax(0,1fr) auto!important;
  }
  body.chat-view-active.chat-footer-active .chat-footer-shell>.chat-composer{
    overflow:hidden!important;
  }
}
