/* Fisio Coach: chat con el asistente virtual. Usa las variables de style.css (claro y oscuro). */
#p-coach .oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.coach-aviso { margin: 4px 0 16px; }
.coach-aviso strong { font-weight: 500; display: block; margin-bottom: 4px; }
.coach-consentir { margin-bottom: 16px; }
.coach-vacio { text-align: center; margin: 24px 0; }

.coach-mensajes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.coach-msg { max-width: 86%; padding: 10px 14px; border-radius: var(--radio); border: 1px solid var(--linea); background: var(--superficie); }
.coach-msg p { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.coach-msg small { display: block; margin-top: 4px; font-size: 11px; color: var(--suave); }
.coach-msg.coach { align-self: flex-start; border-bottom-left-radius: 6px; }
.coach-msg.yo { align-self: flex-end; background: var(--texto); color: var(--fondo); border-color: var(--texto); border-bottom-right-radius: 6px; }
.coach-msg.yo small { color: inherit; opacity: .7; }
.coach-msg.alarma { border-color: var(--mal); border-left-width: 3px; }

/* "Escribiendo…": tres puntos que laten */
.coach-msg.escribiendo { display: flex; gap: 5px; padding: 14px 16px; }
.coach-msg.escribiendo span { width: 7px; height: 7px; border-radius: 50%; background: var(--suave); animation: coach-late 1.2s infinite ease-in-out; }
.coach-msg.escribiendo span:nth-child(2) { animation-delay: .2s; }
.coach-msg.escribiendo span:nth-child(3) { animation-delay: .4s; }
@keyframes coach-late { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .coach-msg.escribiendo span { animation: none; opacity: .6; } }

.coach-estado { min-height: 1.2em; margin: 10px 0 0; }
.coach-estado.error, #coach-contador.error { color: var(--mal); }

.coach-form { position: sticky; bottom: 0; margin-top: 12px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--fondo); }
.coach-form textarea { width: 100%; min-height: 56px; max-height: 40vh; font: 400 16px/1.45 var(--sans); color: var(--texto); background: var(--superficie);
  border: 1px solid var(--linea); border-radius: 14px; padding: 12px 14px; resize: vertical; box-sizing: border-box; }
.coach-form textarea:focus { outline: 2px solid var(--acento); outline-offset: 1px; }
.coach-acciones { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.coach-acciones .principal { width: auto; margin: 0; padding: 10px 24px; }
.coach-acciones .principal:disabled { opacity: .5; cursor: wait; }
.enlace-coach { display: block; margin: 8px auto 0; background: none; border: 0; padding: 6px; color: var(--suave); font-size: 13px; text-decoration: underline; }
