/* Conversa no estilo do WhatsApp, usada no chat do aluno e na tela do atendente. */

.wa-mural {
    background-color: #efeae2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='%23dfd7cb' fill-opacity='.45'%3E%3Ccircle cx='8' cy='8' r='1.6'/%3E%3Ccircle cx='38' cy='22' r='1.2'/%3E%3Ccircle cx='22' cy='44' r='1.4'/%3E%3Ccircle cx='52' cy='52' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
    padding: .8rem 4% 1rem;
    overflow-y: auto;
    overflow-x: hidden; /* nada de rolar a conversa para o lado */
    display: flex; flex-direction: column; gap: 2px;
}

/* Separador de dia ("HOJE", "07/10/2026"). */
.wa-dia { align-self: center; margin: .6rem 0; background: #fff; color: #54656f; font-size: .72rem;
          padding: .3rem .7rem; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); text-transform: uppercase; }

/* Aviso do sistema (entrou, transferiu, encerrou). */
.wa-aviso { align-self: center; max-width: 85%; margin: .45rem 0; background: #fff5c4; color: #54656f;
            font-size: .78rem; line-height: 1.35; text-align: center; padding: .4rem .75rem; border-radius: 8px;
            box-shadow: 0 1px .5px rgba(11,20,26,.13); }

/* Nota interna da equipe (o visitante nunca recebe). */
.wa-nota { align-self: center; max-width: 85%; margin: .45rem 0; background: #fff6d6; border: 1px dashed #e0b84f;
           border-radius: 10px; padding: .4rem .75rem; font-size: .85rem; }
.wa-nota-titulo { font-size: .7rem; font-weight: 600; color: #9a6b00; margin-bottom: .1rem; }
.wa-nota .wa-texto { white-space: pre-wrap; }
.wa-nota .wa-hora { display: block; text-align: right; font-size: .68rem; color: #8696a0; }

.wa-linha { display: flex; margin-top: 2px; }
.wa-linha.minha { justify-content: flex-end; }
.wa-linha.nova-sequencia { margin-top: .55rem; }

.wa-balao {
    position: relative; max-width: min(78%, 34rem);
    background: #fff; color: #111b21;
    padding: .38rem .5rem .3rem .6rem; border-radius: 8px;
    box-shadow: 0 1px .5px rgba(11,20,26,.13);
    font-size: .93rem; line-height: 1.38;
    word-wrap: break-word; overflow-wrap: anywhere;
}
.wa-linha.minha .wa-balao { background: #d9fdd3; }

/* "Rabinho" só no primeiro balão de cada sequência, como no WhatsApp. */
.wa-linha.nova-sequencia .wa-balao::before {
    content: ""; position: absolute; top: 0; width: 8px; height: 13px;
}
.wa-linha.nova-sequencia:not(.minha) .wa-balao { border-top-left-radius: 0; }
.wa-linha.nova-sequencia:not(.minha) .wa-balao::before {
    left: -8px; background: #fff; clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.wa-linha.nova-sequencia.minha .wa-balao { border-top-right-radius: 0; }
.wa-linha.nova-sequencia.minha .wa-balao::before {
    right: -8px; background: #d9fdd3; clip-path: polygon(0 0, 100% 0, 0 100%);
}

.wa-autor { font-size: .78rem; font-weight: 650; color: #04488E; margin-bottom: 1px; }
.wa-texto { white-space: pre-wrap; }
.wa-hora { float: right; margin: .35rem 0 -.2rem .6rem; font-size: .68rem; color: #667781; white-space: nowrap; position: relative; top: .25rem; }
.wa-balao::after { content: ""; display: block; clear: both; }

/* Foto dentro do balão. */
.wa-foto { display: block; margin: -.12rem -.3rem .25rem -.42rem; border-radius: 6px; overflow: hidden; background: #f0f2f5; }
.wa-foto img { display: block; max-width: min(280px, 62vw); max-height: 320px; width: auto; height: auto; object-fit: cover; cursor: zoom-in; }

/* PDF dentro do balão. */
.wa-arquivo { display: flex; align-items: center; gap: .6rem; padding: .5rem .55rem; margin: 0 -.2rem .2rem -.3rem;
              background: rgba(11,20,26,.05); border-radius: 6px; color: inherit; text-decoration: none; min-width: 210px; }
.wa-arquivo:hover { background: rgba(11,20,26,.09); color: inherit; }
.wa-arquivo .wa-arquivo-icone { width: 2.2rem; height: 2.6rem; border-radius: 4px; background: #e53935; color: #fff;
                                display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 700; flex-shrink: 0; }
.wa-arquivo .wa-arquivo-nome { font-size: .85rem; font-weight: 500; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wa-arquivo .wa-arquivo-info { font-size: .72rem; color: #667781; }

/* Áudio. */
/* O player do Safari (iPhone) tem largura mínima própria e empurrava a página para fora
   da tela: a largura é a do balão, nunca mais. */
.wa-audio { display: flex; align-items: center; gap: .5rem; width: min(250px, 62vw); max-width: 100%; padding-top: .15rem; }
.wa-audio .ti { font-size: 1.4rem; color: #04488E; flex-shrink: 0; }
.wa-audio audio { height: 36px; flex: 1; min-width: 0; width: 100%; max-width: 100%; }

/* Visualizador de foto (tela cheia, com ✕). */
.wa-visor { position: fixed; inset: 0; z-index: 2000; background: #0a0e14;
            display: flex; align-items: center; justify-content: center; padding: 3.5rem .75rem 1.5rem;
            padding-top: calc(env(safe-area-inset-top) + 3.5rem); animation: wa-visor-entra .15s ease-out; }
.wa-visor img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.wa-visor-fechar, .wa-visor-baixar { position: absolute; top: calc(env(safe-area-inset-top) + .6rem); width: 2.75rem; height: 2.75rem;
            border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 1.45rem;
            display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.wa-visor-fechar { right: .75rem; }
.wa-visor-baixar { right: 4rem; }
.wa-visor-fechar:hover, .wa-visor-baixar:hover { background: rgba(255,255,255,.28); color: #fff; }
@keyframes wa-visor-entra { from { opacity: 0; } }

/* Barra de escrever. */
.wa-compositor { display: flex; align-items: flex-end; gap: .45rem; padding: .5rem .85rem .5rem .6rem;
                 padding-right: max(.85rem, env(safe-area-inset-right)); max-width: 100%; box-sizing: border-box;
                 padding-bottom: calc(.5rem + env(safe-area-inset-bottom)); background: #f0f2f5; }
.wa-campo { flex: 1; display: flex; align-items: flex-end; background: #fff; border-radius: 22px; padding: .2rem .35rem; min-width: 0; }
.wa-campo textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; padding: .45rem .4rem;
                     font-size: .95rem; line-height: 1.35; max-height: 8.5rem; min-width: 0; font-family: inherit; }
.wa-botao-icone { border: 0; background: transparent; color: #54656f; width: 2.4rem; height: 2.4rem; border-radius: 50%;
                  display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; cursor: pointer; }
.wa-botao-icone:hover { background: rgba(11,20,26,.06); }
.wa-botao-enviar { border: 0; width: 2.9rem; height: 2.9rem; border-radius: 50%; background: #04488E; color: #fff;
                   display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; cursor: pointer; }
.wa-botao-enviar:hover { background: #033B75; }
.wa-botao-enviar:disabled { opacity: .6; cursor: default; }

/* Gravando áudio. */
.wa-gravando { flex: 1; display: flex; align-items: center; gap: .6rem; background: #fff; border-radius: 22px; padding: .55rem .9rem; color: #54656f; }
.wa-gravando .wa-ponto { width: .65rem; height: .65rem; border-radius: 50%; background: #e53935; animation: wa-pulso 1s infinite; }
.wa-gravando .wa-tempo { font-variant-numeric: tabular-nums; min-width: 2.6rem; }
@keyframes wa-pulso { 50% { opacity: .25; } }

.wa-enviando { align-self: flex-end; font-size: .75rem; color: #667781; margin: .2rem .3rem; }
