/* GattoMusic 2.0 - Build 9.74
   Layout defensivo de Chat/Salas: sem truncamentos, sobreposições ou controles
   fora da área rolável. As abas são estruturais e não dependem de reinjeção. */

/* Sidebar: abas sempre ocupam uma linha própria e não encolhem. */
.chat-v974-sidebar-tabs{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:6px!important;flex:0 0 auto!important}
.chat-v974-sidebar-tabs .chat-v972-tab{min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.2!important;padding:8px 6px!important}

/* O painel de Sala possui apenas cabeçalho fixo + uma área rolável. */
.chat-room-sidepanel-v972{
  grid-template-rows:auto minmax(0,1fr)!important;
  align-content:stretch!important;
  overflow:hidden!important;
}
.chat-room-side-scroll-v972{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-auto-rows:max-content!important;
  align-content:start!important;
  gap:10px!important;
  min-width:0!important;
  min-height:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  padding:2px 4px 8px 0!important;
}
.chat-room-side-scroll-v972>*{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;position:relative!important;inset:auto!important;transform:none!important}
.chat-room-side-call-v972{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-auto-rows:max-content!important;align-content:start!important;gap:9px!important;min-width:0!important;overflow:visible!important}

/* Vídeo/card nunca invade controles seguintes. */
.chat-room-sidepanel-v972 .chat-room-grid-v969{min-width:0!important;min-height:0!important;overflow:visible!important;align-items:stretch!important}
.chat-room-sidepanel-v972 .chat-room-participant-v969{min-width:0!important;max-width:100%!important;isolation:isolate!important}
.chat-room-sidepanel-v972 .chat-room-participant-footer-v969{max-width:calc(100% - 14px)!important;box-sizing:border-box!important}
.chat-room-sidepanel-v972 .chat-room-participant-footer-v969 strong{min-width:0!important;flex:1 1 auto!important}

/* Dispositivos, ações e identificação não podem se sobrepor. */
.chat-room-sidepanel-v972 .chat-room-devices-v969,
.chat-room-sidepanel-v972 .chat-room-profile-v972,
.chat-room-sidepanel-v972 .chat-room-messages-v972{position:relative!important;z-index:auto!important;clear:both!important;overflow:hidden!important;min-width:0!important}
.chat-room-sidepanel-v972 .chat-room-devices-v969[open]{overflow:visible!important}
.chat-room-sidepanel-v972 .chat-room-device-grid-v969{grid-template-columns:repeat(auto-fit,minmax(min(170px,100%),1fr))!important;grid-auto-rows:minmax(68px,auto)!important;align-items:stretch!important}
.chat-room-sidepanel-v972 .chat-room-device-field-v969,
.chat-room-sidepanel-v972 .chat-room-device-grid-v969>.button{height:auto!important;min-height:68px!important;min-width:0!important;max-width:100%!important}
.chat-room-sidepanel-v972 .chat-room-device-field-v969 select{min-width:0!important;max-width:100%!important;text-overflow:ellipsis!important}

.chat-room-sidepanel-v972 .chat-room-actions-v969{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr))!important;
  gap:8px!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  min-width:0!important;
}
.chat-room-sidepanel-v972 .chat-room-actions-v969 .button,
.chat-room-sidepanel-v972 .chat-room-profile-actions-v972 .button{
  width:100%!important;min-width:0!important;max-width:100%!important;min-height:44px!important;height:auto!important;
  white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere!important;word-break:normal!important;
  line-height:1.25!important;text-align:center!important;padding:9px 10px!important;box-sizing:border-box!important;
}

.chat-room-profile-v972>summary,.chat-room-devices-v969>summary{white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.3!important}
.chat-room-profile-grid-v972{grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:max-content!important;align-items:start!important;overflow:visible!important;padding:8px!important}
.chat-room-profile-field-v972{min-width:0!important;overflow:visible!important}
.chat-room-profile-field-v972>span{white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.25!important}
.chat-room-profile-field-v972 input,.chat-room-profile-field-v972 textarea{position:static!important;display:block!important;min-width:0!important;max-width:100%!important;margin:0!important;transform:none!important;line-height:1.35!important}
.chat-room-profile-actions-v972{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(min(170px,100%),1fr))!important;gap:8px!important;min-width:0!important}

/* Mensagens e compositor da Sala ficam sempre dentro da rolagem. */
.chat-room-messages-v972{grid-template-rows:auto minmax(150px,260px) auto!important}
.chat-room-message-composer-v972{min-width:0!important;align-items:stretch!important}
.chat-room-message-composer-v972 textarea{min-width:0!important;width:100%!important;box-sizing:border-box!important}
.chat-room-message-composer-v972 .button{white-space:normal!important;min-width:82px!important}
.chat-room-privacy-v969{white-space:normal!important;overflow-wrap:anywhere!important;padding-bottom:4px!important}

/* Chat principal: somente conteúdo rolável rola; compositor e ações não ficam cortados. */
body.chat-view-active .chat-workspace-panel{min-height:0!important;max-height:calc(100dvh - 8px)!important}
body.chat-view-active .chat-shell{min-height:0!important;overflow:hidden!important}
body.chat-view-active .chat-sidebar{min-width:0!important;overflow-y:auto!important}
body.chat-view-active .chat-conversation{min-width:0!important;min-height:0!important;overflow:hidden!important}
body.chat-view-active .chat-composer{max-height:min(48dvh,360px)!important;overflow-y:auto!important;overflow-x:hidden!important}
body.chat-view-active .chat-composer-actions{display:flex!important;flex-wrap:wrap!important;gap:7px!important}
body.chat-view-active .chat-composer-actions .button{min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}
body.chat-view-active .chat-fixed-actions{min-width:0!important;flex-wrap:wrap!important}
body.chat-view-active .chat-fixed-actions .button{min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}

@media(max-width:820px){
  .chat-room-profile-grid-v972{grid-template-columns:minmax(0,1fr)!important}
  .chat-room-sidepanel-v972 .chat-room-actions-v969{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .chat-room-sidepanel-v972 .chat-room-device-grid-v969{grid-template-columns:minmax(0,1fr)!important}
}
@media(max-width:520px){
  .chat-room-sidepanel-v972 .chat-room-actions-v969{grid-template-columns:minmax(0,1fr)!important}
  .chat-room-profile-actions-v972{grid-template-columns:minmax(0,1fr)!important}
  .chat-room-message-composer-v972{grid-template-columns:minmax(0,1fr)!important}
  .chat-room-message-composer-v972 .button{width:100%!important}
}
