/* Chat do agente de atendimento VetNova (área autenticada). */
.chat-shell { max-width: 860px; margin: 0 auto; padding-block: 24px 48px; }
.chat-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.chat-heading h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 6px; }
.chat-heading p { color: var(--color-text-muted); margin: 0; max-width: 52ch; }
.chat-panel { display: flex; flex-direction: column; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--glass-bg); box-shadow: var(--shadow-md); overflow: hidden; }
.chat-log { list-style: none; margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 320px; max-height: min(58vh, 560px); }
.chat-msg { max-width: 82%; border-radius: var(--radius-md); padding: 12px 16px; line-height: 1.6; overflow-wrap: anywhere; }
.chat-msg p { margin: 0; white-space: pre-wrap; }
.chat-msg[data-role="usuario"] .chat-text { white-space: pre-wrap; }
.chat-msg .chat-text > *:first-child { margin-top: 0; }
.chat-msg .chat-text > p + p, .chat-msg .chat-text > ul { margin-top: 8px; }
.chat-msg .chat-text ul { padding-left: 20px; }
.chat-msg .chat-text li + li { margin-top: 2px; }
.chat-msg time { display: block; margin-top: 6px; font-size: .75rem; opacity: .7; }
.chat-msg[data-role="usuario"] { align-self: flex-end; background: linear-gradient(135deg, rgba(97, 238, 229, .16), rgba(97, 238, 229, .07)); border: 1px solid rgba(97, 238, 229, .35); }
.chat-msg[data-role="assistente"] { align-self: flex-start; background: var(--color-surface); border: 1px solid var(--color-border); }
.chat-empty { color: var(--color-text-muted); text-align: center; padding: 48px 20px; font-size: .9375rem; line-height: 1.7; }
.chat-typing { align-self: flex-start; display: inline-flex; gap: 6px; padding: 14px 18px; }
.chat-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); opacity: .35; animation: chat-dot 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-form { display: flex; gap: 12px; align-items: flex-end; padding: 16px; border-top: 1px solid var(--color-border); background: var(--color-bg-alt); }
.chat-form textarea { flex: 1; min-width: 0; min-height: 52px; max-height: 160px; resize: vertical; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-bg); color: var(--color-text); font: inherit; padding: 12px 14px; color-scheme: dark; }
.chat-form textarea:focus { border-color: var(--color-primary); outline: none; }
.chat-form .btn { flex-shrink: 0; }
.chat-note { margin: 16px 4px 0; font-size: .8125rem; line-height: 1.7; color: var(--color-text-muted); }
.chat-note a { color: var(--color-primary); }
@media (max-width: 640px) {
  .chat-log { padding: 14px; min-height: 280px; }
  .chat-msg { max-width: 92%; }
  .chat-form { flex-direction: column; align-items: stretch; }
  .chat-form .btn { width: 100%; }
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
