/* ═════════════════════════════════════════════════════════════
   TRAUMACENTRO — COMPONENTES DE TRIAJE RÁPIDO & ASISTENTE VIRTUAL
   ═════════════════════════════════════════════════════════════ */

/* ─── 1. SECCIÓN DE TRIAJE INTERACTIVO RÁPIDO ─── */
.triage-section {
  padding: 3.5rem 0 2rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  position: relative;
  z-index: 20;
}

.triage-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

.triage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: #e0f4fc;
  color: #0077c8;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 50px;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(0, 119, 200, 0.2);
}

.triage-title {
  font-size: 2.1rem;
  color: #003b71;
  margin-bottom: 0.75rem;
  font-weight: 800;
  line-height: 1.25;
}

.triage-subtitle {
  font-size: 1.05rem;
  color: #64748B;
  line-height: 1.6;
}

.triage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.triage-card {
  background: #ffffff;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.triage-card:hover {
  transform: translateY(-5px);
  border-color: #003b71;
  box-shadow: 0 16px 32px rgba(0, 59, 113, 0.12);
}

.triage-card.active {
  border-color: #0077c8;
  background: #fff8f8;
  box-shadow: 0 14px 28px rgba(0, 119, 200, 0.2);
}

.triage-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.15rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2F6 100%);
  color: #003b71;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(15, 52, 96, 0.08);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 4px 10px rgba(0, 0, 0, 0.02);
}

.triage-card__icon svg {
  width: 32px;
  height: 32px;
  display: block;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.triage-card:hover .triage-card__icon {
  background: linear-gradient(135deg, #003b71 0%, #002850 100%);
  color: #ffffff;
  border-color: #003b71;
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 52, 96, 0.25);
}

.triage-card:hover .triage-card__icon svg {
  transform: scale(1.06);
}

.triage-card.active .triage-card__icon {
  background: linear-gradient(135deg, #0077c8 0%, #9B112B 100%);
  color: #ffffff;
  border-color: #0077c8;
  box-shadow: 0 10px 24px rgba(196, 30, 58, 0.35);
}

.triage-card[data-triage="urgencia"] .triage-card__icon {
  background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%);
  color: #0077c8;
  border-color: rgba(196, 30, 58, 0.2);
}

.triage-card[data-triage="urgencia"]:hover .triage-card__icon,
.triage-card[data-triage="urgencia"].active .triage-card__icon {
  background: linear-gradient(135deg, #0077c8 0%, #9B112B 100%);
  color: #ffffff;
  border-color: #0077c8;
  box-shadow: 0 10px 24px rgba(196, 30, 58, 0.4);
}

.triage-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #003b71;
  margin-bottom: 0.35rem;
}

.triage-card__desc {
  font-size: 0.85rem;
  color: #64748B;
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.triage-card__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #003b71;
  background: #EBF3FA;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.triage-card.active .triage-card__badge {
  color: #0077c8;
  background: rgba(196, 30, 58, 0.1);
}

/* Panel de resolución de triaje */
.triage-result {
  background: #003b71;
  color: #ffffff;
  border-radius: 18px;
  padding: 1.75rem 2rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 1.5rem;
  box-shadow: 0 20px 40px rgba(15, 52, 96, 0.25);
  animation: fadeInSlideUp 0.4s ease forwards;
}

.triage-result--show {
  display: flex;
}

.triage-result__info h4 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.triage-result__info p {
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
  margin: 0;
}

.triage-result__actions {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.triage-btn-primary {
  background: #0077c8;
  color: #ffffff !important;
  font-weight: 700;
  padding: 0.85rem 1.6rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.triage-btn-primary:hover {
  background: #a51830;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(196, 30, 58, 0.4);
}

.triage-btn-wa {
  background: #25D366;
  color: #ffffff !important;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.triage-btn-wa:hover {
  background: #1ebc59;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

@keyframes fadeInSlideUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .triage-result {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
  .triage-result__actions {
    flex-direction: column;
    width: 100%;
  }
  .triage-btn-primary, .triage-btn-wa {
    justify-content: center;
    width: 100%;
  }
}

/* ─── 2. ASISTENTE VIRTUAL INTELIGENTE (TRAUMABOT PRO) ─── */
.trauma-bot-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Teaser / Burbuja flotante de bienvenida */
.trauma-bot-teaser {
  position: absolute;
  bottom: 75px;
  right: 0;
  background: #ffffff;
  border-radius: 18px;
  padding: 0.75rem 1rem 0.75rem 0.85rem;
  box-shadow: 0 12px 32px -4px rgba(10, 37, 64, 0.18), 0 0 0 1px rgba(10, 37, 64, 0.06);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 270px;
  cursor: pointer;
  animation: teaserBounce 0.5s cubic-bezier(0.16, 1, 0.3, 1), teaserFloat 3.5s ease-in-out infinite 0.5s;
  transition: all 0.25s ease;
  z-index: 9998;
}

.trauma-bot-teaser:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -4px rgba(0, 119, 200, 0.25);
  border-color: #0077c8;
}

@keyframes teaserBounce {
  0% { opacity: 0; transform: translateY(15px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes teaserFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.trauma-bot-teaser__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a2540 0%, #0077c8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 119, 200, 0.3);
}

.trauma-bot-teaser__avatar svg {
  width: 20px;
  height: 20px;
}

.trauma-bot-teaser__body {
  flex: 1;
}

.trauma-bot-teaser__body strong {
  display: block;
  font-size: 0.82rem;
  color: #0a2540;
  font-weight: 700;
  line-height: 1.25;
}

.trauma-bot-teaser__body span {
  display: block;
  font-size: 0.74rem;
  color: #64748b;
  margin-top: 2px;
}

.trauma-bot-teaser__close {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.trauma-bot-teaser__close:hover {
  background: #f1f5f9;
  color: #0a2540;
}

/* Botón Disparador Flotante (Launcher) */
.trauma-bot-trigger {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a2540 0%, #003b71 50%, #0077c8 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 119, 200, 0.38), 0 4px 10px rgba(10, 37, 64, 0.2);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  backdrop-filter: blur(8px);
}

.trauma-bot-trigger:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 36px rgba(0, 119, 200, 0.55), 0 6px 14px rgba(10, 37, 64, 0.3);
}

.trauma-bot-trigger:active {
  transform: translateY(-1px) scale(0.98);
}

.trauma-bot-trigger__icon {
  width: 30px;
  height: 30px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}

.trauma-bot-trigger:hover .trauma-bot-trigger__icon {
  transform: scale(1.1);
}

.trauma-bot-trigger__badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #10b981;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.6);
  animation: botPulse 2s infinite;
  padding: 0;
}

@keyframes botPulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ─── VENTANA DEL CHATBOT PRO ─── */
.trauma-bot-panel {
  position: absolute;
  bottom: 78px;
  right: 0;
  width: 395px;
  max-width: calc(100vw - 32px);
  height: 585px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 25px 70px -10px rgba(10, 37, 64, 0.28), 0 0 0 1px rgba(10, 37, 64, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(22px) scale(0.94);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10000;
}

.trauma-bot-panel--open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Cabecera Pro del Chat */
.trauma-bot-header {
  background: linear-gradient(135deg, #0a2540 0%, #003b71 60%, #005a9c 100%);
  color: #ffffff;
  padding: 0.95rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 2px solid #0077c8;
  position: relative;
  box-shadow: 0 4px 14px rgba(10, 37, 64, 0.15);
}

.trauma-bot-header__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.trauma-bot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.trauma-bot-avatar svg {
  width: 22px;
  height: 22px;
}

.trauma-bot-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trauma-bot-info h4 {
  font-size: 0.98rem;
  margin: 0;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.trauma-bot-badge {
  display: none;
}

.trauma-bot-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: #a7f3d0;
  font-weight: 600;
  margin-top: 2px;
  white-space: nowrap;
}

.trauma-bot-status__dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

/* Acciones en la cabecera */
.trauma-bot-header__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.trauma-bot-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.trauma-bot-header-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #38bdf8;
  transform: translateY(-1px);
}

.trauma-bot-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
}

.trauma-bot-close:hover {
  background: rgba(239, 68, 68, 0.8);
  border-color: rgba(239, 68, 68, 0.8);
  transform: rotate(90deg);
}

/* ─── ÁREA DE MENSAJES (STREAM) ─── */
.trauma-bot-messages {
  flex: 1;
  padding: 1.25rem 1.15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  background: #f8fafc;
  scroll-behavior: smooth;
}

/* Fecha divisoria */
.chat-date-badge {
  align-self: center;
  background: #edf2f7;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.35rem;
}

/* Mensajes individuales */
.bot-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  font-size: 0.89rem;
  line-height: 1.48;
  animation: msgPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgPop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bot-msg--bot {
  align-self: flex-start;
}

.bot-msg--user {
  align-self: flex-end;
}

.bot-msg__bubble {
  padding: 0.85rem 1.05rem;
  border-radius: 18px;
  position: relative;
  word-break: break-word;
}

.bot-msg--bot .bot-msg__bubble {
  background: #ffffff;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 12px rgba(10, 37, 64, 0.05);
  border: 1px solid #e2e8f0;
}

.bot-msg--user .bot-msg__bubble {
  background: linear-gradient(135deg, #0077c8 0%, #0284c7 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 119, 200, 0.25);
}

.bot-msg__bubble strong {
  color: #003b71;
  font-weight: 700;
}

.bot-msg--user .bot-msg__bubble strong {
  color: #ffffff;
}

.bot-msg__time {
  font-size: 0.66rem;
  color: #94a3b8;
  margin-top: 0.3rem;
  align-self: flex-start;
  padding-left: 0.25rem;
}

.bot-msg--user .bot-msg__time {
  align-self: flex-end;
  padding-right: 0.25rem;
}

/* Indicador de "Escribiendo..." con 3 puntos */
.bot-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 3px 12px rgba(10, 37, 64, 0.05);
  margin-bottom: 0.2rem;
}

.bot-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0077c8;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.bot-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.bot-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.bot-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* ─── CHIPS Y BOTONES RÁPIDOS DENTRO DEL CHAT ─── */
.bot-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.bot-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0a2540;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.42rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 6px rgba(10, 37, 64, 0.03);
  font-family: inherit;
}

.bot-chip:hover {
  background: #0077c8;
  color: #ffffff;
  border-color: #0077c8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.25);
}

.bot-chip--urgent {
  border-color: #10b981;
  color: #047857;
  background: #ecfdf5;
}

.bot-chip--urgent:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.bot-chip--cta {
  background: #f0f9ff;
  border-color: #38bdf8;
  color: #0284c7;
}

.bot-chip--cta:hover {
  background: #0284c7;
  color: #ffffff;
}

/* ─── FOOTER / INPUT DEL BOT ─── */
.trauma-bot-footer {
  padding: 0.75rem 1rem 0.65rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.trauma-bot-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 25px;
  padding: 0.25rem 0.35rem 0.25rem 0.95rem;
  transition: all 0.2s ease;
}

.trauma-bot-input-row:focus-within {
  background: #ffffff;
  border-color: #0077c8;
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}

.trauma-bot-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  color: #0f172a;
}

.trauma-bot-input::placeholder {
  color: #94a3b8;
}

.trauma-bot-send {
  background: linear-gradient(135deg, #0077c8 0%, #005a9c 100%);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 119, 200, 0.3);
}

.trauma-bot-send:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0077c8 100%);
  transform: scale(1.08);
  box-shadow: 0 5px 14px rgba(0, 119, 200, 0.45);
}

.trauma-bot-disclaimer {
  font-size: 0.67rem;
  color: #94a3b8;
  text-align: center;
  margin: 0;
  line-height: 1.25;
}

/* ─── BACKDROP OVERLAY PARA EL ASISTENTE EN MÓVILES ─── */
.trauma-bot-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.trauma-bot-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsividad para móviles y pantallas táctiles */
@media (max-width: 640px) {
  .trauma-bot-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: 85vh !important;
    height: 85dvh !important;
    max-height: 85dvh !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -12px 40px rgba(10, 37, 64, 0.4) !important;
    margin: 0 !important;
    transform: translateY(105%) !important;
    transform-origin: bottom center !important;
    z-index: 10001 !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease !important;
  }

  .trauma-bot-panel.trauma-bot-panel--open {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
  }

  .trauma-bot-container {
    position: fixed !important;
    bottom: 18px !important;
    right: 18px !important;
    z-index: 9999 !important;
  }

  /* Ocultar trigger cuando el bot está abierto en móvil para despejar el campo de texto */
  body.trauma-bot--open .trauma-bot-trigger {
    transform: scale(0.6);
    opacity: 0;
    pointer-events: none;
  }

  .trauma-bot-teaser {
    right: 0 !important;
    bottom: 74px !important;
    max-width: calc(100vw - 36px) !important;
    width: calc(100vw - 36px) !important;
  }

  .trauma-bot-header {
    padding: 0.95rem 1.15rem !important;
    border-radius: 24px 24px 0 0 !important;
  }

  .trauma-bot-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
  }

  .trauma-bot-avatar svg {
    width: 22px !important;
    height: 22px !important;
  }

  .trauma-bot-info h4 {
    font-size: 0.98rem !important;
  }

  .trauma-bot-header-btn {
    width: 34px !important;
    height: 34px !important;
  }

  .trauma-bot-close {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.5rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
  }

  .trauma-bot-messages {
    padding: 1rem 0.9rem !important;
    gap: 0.85rem !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .trauma-bot-footer {
    padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px)) !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
  }

  .trauma-bot-input {
    font-size: 0.92rem !important;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .trauma-bot-panel {
    width: 380px !important;
    max-width: calc(100vw - 40px) !important;
    right: 0 !important;
    max-height: calc(100vh - 110px) !important;
  }
}

/* ─── 3. MODAL LEGAL (HABEAS DATA / PRIVACIDAD) ─── */
.tc-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(6, 16, 30, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.tc-modal--open {
  opacity: 1;
  pointer-events: auto;
}

.tc-modal__dialog {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tc-modal--open .tc-modal__dialog {
  transform: translateY(0) scale(1);
}

.tc-modal__header {
  padding: 1.5rem 2rem;
  background: #003b71;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tc-modal__title {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0;
}

.tc-modal__close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.tc-modal__close:hover {
  opacity: 1;
}

.tc-modal__body {
  padding: 2rem;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
}

.tc-modal__body h4 {
  color: #003b71;
  margin: 1.25rem 0 0.5rem;
  font-size: 1.1rem;
}

.tc-modal__footer {
  padding: 1rem 2rem;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  text-align: right;
}

.tc-modal__btn {
  background: #003b71;
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.tc-modal__btn:hover {
  background: #0077c8;
}
