/* Cigananaestrada — CELULAR
   Escopo exclusivo: 0–767px. Não colocar regras de tablet/notebook/desktop aqui. */
@media (max-width: 767px){
  :root{
    --cna-device-gutter:12px;
    --cna-device-content:100%;
    --cna-device-card-radius:18px;
    --cna-device-control-height:46px;
  }

  html,body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
    touch-action:pan-y;
  }

  html body .cna-container{width:calc(100% - 24px);max-width:none;margin-inline:auto}
  html body .cna-card{max-width:100%;border-radius:var(--cna-device-card-radius)}
  html body .cna-btn{min-height:var(--cna-device-control-height)}
  html body img,html body video,html body audio{max-width:100%}
  html body input,html body select,html body textarea,html body button{max-width:100%}
  html body .video-atendimento-grade{grid-template-columns:minmax(0,1fr)}
  html body .video-atendimento-grade video{min-height:190px;width:100%}
  html body .rodape-projeto{width:calc(100% - 24px);flex-direction:column;justify-content:center;text-align:center;gap:5px}
  html body .rodape-projeto span:last-child{text-align:center}

  body[data-sala-v3="cliente"] .sv3-chat-shell,
  body[data-sala-v3="consultor"] .sv3-chat-shell{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:visible!important;
    touch-action:pan-y!important;
  }

  body[data-sala-v3="cliente"] .sv3-messages,
  body[data-sala-v3="consultor"] .sv3-messages{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    height:52dvh!important;
    min-height:320px!important;
    max-height:560px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:auto!important;
    touch-action:pan-y!important;
    scroll-behavior:auto!important;
    scrollbar-gutter:stable!important;
  }

  /* Áudio no mobile: cliente e atendente com o mesmo tamanho compacto.
     Linha 1 = nome + duração; linha 2 = tipo de mensagem + horário; linha 3 = player. */
  body[data-sala-v3] .sv3-messages .msg-audio,
  body[data-sala-v3] .sv3-messages .mensagem-audio{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-auto-rows:auto!important;
    column-gap:8px!important;
    row-gap:2px!important;
    width:min(330px,84vw)!important;
    max-width:84%!important;
    min-width:0!important;
    padding:8px 9px!important;
  }

  body[data-sala-v3] .sv3-messages .msg-audio>br{display:none!important}

  body[data-sala-v3] .sv3-messages .msg-audio>strong,
  body[data-sala-v3] .sv3-messages .mensagem-audio>.autor{
    grid-column:1!important;
    grid-row:1!important;
    align-self:center!important;
    margin:0!important;
    min-width:0!important;
    font-size:10px!important;
    line-height:1.15!important;
  }

  body[data-sala-v3] .sv3-messages .msg-audio>.audio-mensagem-duracao,
  body[data-sala-v3] .sv3-messages .mensagem-audio>.audio-mensagem-duracao{
    grid-column:2!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:end!important;
    margin:0!important;
    font-size:9px!important;
    line-height:1!important;
    opacity:.78!important;
    white-space:nowrap!important;
  }

  body[data-sala-v3] .sv3-messages .msg-audio>.texto-mensagem,
  body[data-sala-v3] .sv3-messages .mensagem-audio>.texto-mensagem{
    grid-column:1!important;
    grid-row:2!important;
    margin:0!important;
    font-size:11px!important;
    line-height:1.2!important;
  }

  body[data-sala-v3] .sv3-messages .msg-audio>.horario,
  body[data-sala-v3] .sv3-messages .mensagem-audio>.horario{
    grid-column:2!important;
    grid-row:2!important;
    align-self:center!important;
    justify-self:end!important;
    margin:0!important;
    font-size:9px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }

  body[data-sala-v3] .sv3-messages .msg-audio>.audio-player-permanente,
  body[data-sala-v3] .sv3-messages .mensagem-audio>.audio-player-permanente{
    grid-column:1 / -1!important;
    grid-row:3!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:4px 0 0!important;
    padding:6px 7px!important;
  }

  body[data-sala-v3] .sv3-messages .msg,
  body[data-sala-v3] .sv3-messages .mensagem,
  body[data-sala-v3] .sv3-messages .msg-audio,
  body[data-sala-v3] .sv3-messages .mensagem-audio,
  body[data-sala-v3] .sv3-messages .audio-player-permanente,
  body[data-sala-v3] .sv3-messages .texto-mensagem,
  body[data-sala-v3] .sv3-messages .autor,
  body[data-sala-v3] .sv3-messages .horario{
    touch-action:pan-y!important;
  }

  body[data-sala-v3] .audio-player-toggle,
  body[data-sala-v3] .audio-player-velocidade{
    touch-action:manipulation!important;
  }
  body[data-sala-v3] .audio-player-progresso{
    touch-action:auto!important;
  }

  body[data-sala-v3] .sv3-composer,
  body[data-sala-v3] .atividade-remota-status{
    flex:0 0 auto!important;
  }

  body[data-sala-v3] .chat-ir-fundo{
    position:sticky!important;
    bottom:70px!important;
    z-index:5!important;
  }
}
