/**
 * PackVirtual iA — estilos del widget. Temas integrados («🎨 Clásicos» en el
 * panel desde la v3.0.59):
 *   Del plugin original:  timeless · chatgpt · messages
 *   Propios:  aurora · neon · boutique · grok · premium · cyberpunk
 *            glass · midnight · sunset · mint
 *            y la familia oferta (naranja, hot, verde, azul, magenta)
 * Los «✨ Temas animados» (clases michat--anim_*) viven en su propia hoja,
 * assets/widget-animados.css, que solo se carga cuando un chat los usa.
 *
 * Cada tema define su paleta con variables CSS. Si el usuario activa
 * "colores propios", el plugin añade la clase .michat--custom cuyas variables
 * (impresas inline) tienen prioridad sobre la paleta del tema.
 */

/* ============================================================== BASE ====== */

.michat {
  /* paleta por defecto (Timeless) */
  --mc-user: #2768db;
  --mc-user-text: #ffffff;
  --mc-ai: #F1F3F7;
  --mc-ai-text: #20242c;
  --mc-header: #2831dc;
  --mc-header-text: #ffffff;
  --mc-back: #fafafa;
  --mc-border: #c5c5c5;
  --mc-input-bg: #ffffff;
  --mc-input-text: #20242c;
  --mc-input-border: #c5c5c5;
  --mc-link: #2768db;
  --mc-muted: #6b7280;
  --mc-font: 'Trebuchet MS', 'Segoe UI', sans-serif;
  --mc-font-size: 15px;
  --mc-font-family: var(--mc-font);
  --mc-font-header: 16px;
  --mc-font-message: var(--mc-font-size);
  --mc-font-list: 13px;
  --mc-font-input: var(--mc-font-size);
  --mc-font-button: var(--mc-font-size);
  --mc-font-quick: 14px;
  --mc-font-compliance: 11px;
  --mc-radius: 12px;

  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  height: 520px;
  border: 1px solid var(--mc-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--mc-back);
  font-family: var(--mc-font-family, var(--mc-font));
  font-size: var(--mc-font-size);
  line-height: 1.45;
}
.michat *, .michat *::before, .michat *::after { box-sizing: border-box; }

/* ============================================================ CABECERA ==== */

.michat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mc-header);
  color: var(--mc-header-text);
  padding: 10px 14px;
  flex-shrink: 0;
}
/* v3.0.63 (2026-11-14): el dibujo del avatar llena mejor su círculo. El emoji
   pasa de 20 a 22 px (del 56 % al 61 % del círculo de 36 px, que no cambia: de
   él dependen las cuentas de la cabecera de los temas animados) y su línea
   mide lo que la letra (line-height: 1), para que quede centrado con
   cualquier fuente de emojis. WordPress pinta los emojis como
   <img class="emoji"> de 1em (con !important): los gobierna este font-size. */
.michat-header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  line-height: 1;
  overflow: hidden;
  flex-shrink: 0;
}
.michat-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* v3.0.63 (2026-11-14): sin avatar (campo vacío) la cabecera pintaba un
   círculo vacío; los mensajes ya salían sin él. */
.michat-header-avatar:empty { display: none; }
.michat-header-info { flex: 1; min-width: 0; }
.michat-header-name { font-weight: 700; display: block; line-height: 1.2; font-size: var(--mc-font-header); }
.michat-header-sub { font-size: 12px; opacity: 0.85; display: block; }
.michat-header-actions { display: flex; gap: 4px; }
.michat-header-actions button {
  border: 0; background: transparent; color: var(--mc-header-text);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 4px 6px;
  border-radius: 6px; opacity: 0.85;
}
.michat-header-actions button:hover { opacity: 1; background: rgba(255, 255, 255, 0.15); }

/* ============================================================ MENSAJES ==== */

.michat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;

  /* v3.0.29: la barra de desplazamiento de la conversación se tiñe con el
     color del tema en vez de quedarse en el gris del sistema. Los 18 temas
     definen --mc-user (su acento) y --mc-back (su fondo), así que una sola
     regla los cubre a todos, claros y oscuros. */
  --mc-scroll-thumb: var(--mc-user, #2768db);
  --mc-scroll-track: var(--mc-back, #fafafa);
  scrollbar-width: thin;
  scrollbar-color: var(--mc-scroll-thumb) var(--mc-scroll-track);
}
/* Con color-mix el acento se mezcla con el fondo del chat: la barra combina
   con el tema sin gritar, y se aviva al pasar el ratón por la conversación.
   Sin soporte, quedan los colores planos de arriba. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat-messages {
    --mc-scroll-thumb: color-mix(in srgb, var(--mc-user, #2768db) 78%, var(--mc-back, #fafafa));
    --mc-scroll-track: color-mix(in srgb, var(--mc-user, #2768db) 10%, var(--mc-back, #fafafa));
  }
  .michat-messages:hover {
    --mc-scroll-thumb: var(--mc-user, #2768db);
  }
}
/* Respaldo para WebKit antiguo (Safari anterior a 18.2), donde las dos
   propiedades estándar de arriba no existen. Los navegadores modernos
   ignoran estos pseudo-elementos al haberse declarado scrollbar-width. */
.michat-messages::-webkit-scrollbar { width: 10px; }
.michat-messages::-webkit-scrollbar-track {
  background: var(--mc-scroll-track);
  border-radius: 999px;
}
.michat-messages::-webkit-scrollbar-thumb {
  background: var(--mc-scroll-thumb);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}
.michat-msg { display: flex; gap: 8px; align-items: flex-end; }
/* v3.0.41: VIRTUALIZACIÓN NATIVA DEL HISTORIAL. En conversaciones largas el
   scroll se sentía cada vez más lento (el clásico de los chats web, igual
   que en AI Engine): el navegador seguía maquetando y manteniendo TODOS los
   mensajes aunque el 95 % estuviera fuera de pantalla. Con
   content-visibility el navegador SALTA por completo la maquetación y el
   pintado de los mensajes que no se ven y los materializa justo antes de
   que entren al viewport; contain-intrinsic-size (con la palabra clave
   auto) reserva una altura estimada la primera vez y RECUERDA la altura
   real en cuanto el mensaje se renderiza, así el tirador de la barra no
   baila. Cero JavaScript, cero cambio visual. En navegadores sin soporte
   la propiedad se ignora y todo queda como antes. */
@supports (content-visibility: auto) and (contain-intrinsic-size: auto 88px) {
  .michat-msg {
    content-visibility: auto;
    contain-intrinsic-size: auto 88px;
  }
  /* v3.0.51 (30-oct-2026): content-visibility:auto también CONTIENE EL
     PINTADO, y recortaba a ras del borde de cada mensaje las sombras y los
     brillos de las burbujas (oferta_*, glass, midnight, premium, sunset,
     mint, aurora, neon, cyberpunk) en el modo ligero, que es el de fábrica;
     al maximizar aparecían y volvían a cortarse. overflow-clip-margin
     agranda ese recorte 24 px (la sombra más larga) sin tocar el layout, el
     scroll ni la zona clicable. Regla aparte a propósito: la de arriba debe
     quedar tal cual. Donde no hay soporte (Safari) queda como antes. */
  .michat-msg {
    overflow-clip-margin: 24px;
  }
  /* Durante el gesto de maximizar/restaurar la virtualización se APAGA
     (clase michat--fs-solid, puesta por el JS nada más leer el ancla): así
     el punto de lectura se mide y se corrige sobre el layout real completo
     —idéntico al de la 3.0.33—, sin alturas estimadas moviéndose bajo sus
     pies. El coste de materializarlo todo en ese instante es el que la
     3.0.33 ya pagaba siempre; al asentar, la clase se retira, la
     virtualización vuelve y el ancla se reaplica sobre ella. */
  .michat--fs-solid .michat-msg {
    content-visibility: visible;
  }
  /* v3.0.46: historial COMPLETO elegible por chatbot — sin virtualización:
     maquetación entera y todas las animaciones vivas (el clásico 3.0.33). */
  .michat--history-full .michat-msg {
    content-visibility: visible;
  }
}
/* v3.0.41: los brillos de las fichas (dos bucles infinitos por ficha) solo
   corren cuando la fila está A LA VISTA. Fuera del viewport del panel, un
   IntersectionObserver les pone esta clase y dejan de repintar — invisible
   para el visitante: cuando las fichas se ven, brillan exactamente igual. */
.michat-chips--resting .michat-chipbtn,
.michat-chips--resting .michat-chipbtn::before,
.michat-chips--resting .michat-chipbtn::after {
  animation-play-state: paused !important;
}
.michat-msg--user { flex-direction: row-reverse; }

/* v3.0.63 (2026-11-14): AVATAR EQUILIBRADO. Pedido del dueño: «el diamante…
   está muy abajo y no está equilibrado ese tamaño». El círculo pasa de 28 a
   32 px (8/9 del de la cabecera, 36 px, y unas tres cuartas partes del alto de
   una burbuja de una línea, 42 px) y el emoji, de 16 a 20 px: del 57 % al
   62 % del círculo, la misma proporción que en la cabecera (un emoji de 16 px
   en un círculo de 28 se veía perdido). line-height: 1 lo centra con
   cualquier fuente de emojis. Un icono o una foto llenan el círculo entero
   (img al 100 %); el <img class="emoji"> de WordPress mide 1em. En el celular
   (más abajo), 28 px con el emoji a 18. La alineación con la burbuja, en el
   botón Copiar. */
.michat-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.michat-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* v3.0.63 (2026-11-14): position: relative, para el botón Copiar (abajo). */
.michat-col { max-width: 82%; display: flex; flex-direction: column; position: relative; }
.michat-msg--user .michat-col { align-items: flex-end; }

.michat-name {
  font-size: 11px;
  color: var(--mc-muted);
  margin: 0 6px 3px;
}

.michat-bubble {
  padding: 10px 14px;
  border-radius: var(--mc-radius);
  font-size: var(--mc-font-message);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.michat-msg--user .michat-bubble {
  background: var(--mc-user);
  color: var(--mc-user-text);
  border-bottom-right-radius: 4px;
}
.michat-msg--ai .michat-bubble {
  background: var(--mc-ai);
  color: var(--mc-ai-text);
  border-bottom-left-radius: 4px;
}
.michat-bubble p { margin: 0 0 8px; }
.michat-bubble p:last-child { margin-bottom: 0; }
.michat-bubble ul {
  margin: 6px 0;
  padding-left: 22px;
  /* Explícito: wp-admin resetea las listas a list-style none y en la vista
     previa del editor las viñetas desaparecían (v3.0.14). */
  list-style: disc outside;
  font-size: var(--mc-font-list);
  line-height: 1.45;
}
.michat-bubble ul li { list-style: disc outside; }
.michat-bubble li { margin: 3px 0; }
/* Blindaje: que el tema de WordPress no pinte el texto de las burbujas
   (algunos temas ponen color global a p/li/strong y lavaban los temas oscuros). */
.michat-bubble p, .michat-bubble li, .michat-bubble strong, .michat-bubble em { color: inherit; }
.michat-bubble a { color: inherit; text-decoration: underline; }
.michat-msg--ai .michat-bubble a { color: var(--mc-link); }

/* v3.0.64 (2026-11-15): ⚡ RESPUESTAS GUARDADAS — LA FRASE FINAL DESTACADA
   (SPEC-v3.0.64 §9.4). Es la última burbuja de una respuesta guardada
   cuando el dueño encendió «🎉 Frase final de marketing». Se destaca con los
   colores del TEMA: el fondo y el texto de la burbuja del chatbot (el par
   que cada tema ya deja en AA), un aro interior con su acento (--mc-user) y
   un velo de ese acento en diagonal que se desvanece (14 % en la esquina de
   arriba; el contraste AA del texto se calcula sobre ese punto en los 43
   temas: widget §4591). El aro va con box-shadow inset: no cambia el tamaño
   de la burbuja ni toca el avatar, la columna, Copiar o la fila (widget
   §4587). color-mix() solo dentro de su @supports: sin él no hay velo y
   queda el fondo de la burbuja. El «✨» es decorativo (aria-hidden, lo pone
   widget.js) y destella UNA vez al llegar (solo transform y opacity); con
   «reducir movimiento», quieto. */
.michat .michat-msg--ai .michat-bubble.michat-bubble--close {
  background-color: var(--mc-ai);
  color: var(--mc-ai-text);
  font-weight: 600;
  box-shadow: inset 0 0 0 2px var(--mc-user);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat .michat-msg--ai .michat-bubble.michat-bubble--close {
    background-image: linear-gradient(135deg, color-mix(in srgb, var(--mc-user) 14%, transparent), transparent 70%);
  }
}
.michat .michat-bubble-spark {
  display: inline-block;
  margin-right: 0.3em;
  animation: michatBubbleSpark 0.9s ease-out 1;
}
@keyframes michatBubbleSpark {
  0% { transform: scale(0.5) rotate(-20deg); opacity: 0.3; }
  60% { transform: scale(1.2) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .michat .michat-bubble-spark { animation: none; }
}
/* Colores forzados (alto contraste de Windows): sin sombras, un contorno. */
@media (forced-colors: active) {
  .michat .michat-msg--ai .michat-bubble.michat-bubble--close { outline: 2px solid CanvasText; outline-offset: -2px; }
}

/* botón copiar (en respuestas del bot)
   v3.0.63 (2026-11-14): EL AVATAR, A LA ALTURA DE SU BURBUJA. El botón iba en
   la columna, debajo de la burbuja: la alargaba (4 px de margen y de 16 a
   19 px de alto, según la fuente) y la fila alinea el avatar con su borde
   inferior (align-items: flex-end), así que el avatar del chatbot quedaba
   20 px (23 en algunos equipos) por debajo de la burbuja; el del visitante,
   sin botón, no. Ahora el botón no ocupa sitio en la columna (position:
   absolute, colgado bajo la burbuja) y su hueco lo reserva la fila con un
   relleno (la clase michat-msg--copy, que pone widget.js al añadir el
   botón): dentro del mensaje, para que content-visibility no lo recorte en
   Safari. Regla general: lo que cuelgue bajo la burbuja no puede alargar la
   columna (lo vigila la prueba widget §4587).
   Alto fijo: 4 px de margen + 18 de alto = los 22 del relleno de la fila. */
.michat-msg--copy { padding-bottom: 22px; }
.michat-copy {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 4px 6px 0;
  height: 18px;
  border: 0;
  background: transparent;
  color: var(--mc-muted);
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.michat-msg:hover .michat-copy { opacity: 1; }
.michat-copy:hover { background: rgba(0, 0, 0, 0.07); }
/* v3.0.51 (30-oct-2026): con teclado (Tab) el botón Copiar se enfocaba
   invisible (opacity 0): ahora aparece al recibir el foco. */
.michat-copy:focus-visible { opacity: 1; }
@media (hover: none) { .michat-copy { opacity: 0.8; } }

/* v3.0.51 (30-oct-2026): región viva solo para lectores de pantalla (el JS
   anuncia ahí el texto final de cada turno): fuera de la vista y del flujo. */
.michat .michat-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

/* puntos de "escribiendo..." */
.michat-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.michat-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mc-muted);
  animation: michat-blink 1.2s infinite ease-in-out;
}
.michat-typing span:nth-child(2) { animation-delay: 0.2s; }
.michat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes michat-blink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ============================================================= ENTRADA ==== */

.michat-inputrow {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}
.michat-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--mc-input-border);
  border-radius: 9px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: var(--mc-font-input);
  outline: none;
  background: var(--mc-input-bg);
  color: var(--mc-input-text);
  min-height: 46px;
  max-height: 150px; /* crece con el texto (autoGrow en JS), hasta ~1 párrafo */
  overflow-y: auto;
  line-height: 1.4;
}
.michat-input:focus { border-color: var(--mc-user); }
.michat-send, .michat-clear {
  border: 0;
  border-radius: 9px;
  padding: 0 16px;
  font-family: inherit;
  font-size: var(--mc-font-button);
  font-weight: 600;
  cursor: pointer;
  background: var(--mc-user);
  color: var(--mc-user-text);
  transition: filter 0.15s;
}
.michat-send:hover { filter: brightness(1.12); }
.michat-send:disabled { opacity: 0.55; cursor: wait; }

/* Botón borrar: papelera propia con recuadro, que "abre la tapa" al pasar. */
.michat-clear {
  background: transparent;
  color: var(--mc-muted);
  border: 1.5px solid var(--mc-input-border);
  border-radius: 10px;
  width: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}
.michat-clear svg { display: block; }
.michat-trash-lid { transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1); transform-origin: 12px 5px; }
.michat-clear:hover {
  border-color: #e25563;
  color: #e25563;
  background: rgba(226, 85, 99, 0.08);
  transform: translateY(-1px);
}
.michat-clear:hover .michat-trash-lid { transform: rotate(-14deg) translateY(-1.5px); }
.michat-clear:active { transform: scale(0.93); }

.michat-compliance {
  font-size: var(--mc-font-compliance);
  color: var(--mc-muted);
  text-align: center;
  padding: 5px 12px 8px;
  background: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

/* ===================================================== TEMA: CHATGPT ====== */

.michat--chatgpt {
  --mc-user: #19c37d;
  --mc-user-text: #062b1d;
  --mc-ai: #444654;
  --mc-ai-text: #ececf1;
  --mc-header: #202123;
  --mc-header-text: #ececf1;
  --mc-back: #343541;
  --mc-border: #20212a;
  --mc-input-bg: #40414f;
  --mc-input-text: #ececf1;
  --mc-input-border: #565869;
  --mc-link: #8ab4ff;
  --mc-muted: #c5c5d2;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 10px;
}
.michat--chatgpt .michat-inputrow,
.michat--chatgpt .michat-compliance { background: rgba(64, 65, 79, 0.6); border-top-color: #2a2b36; }
.michat--chatgpt .michat-avatar { background: rgba(255, 255, 255, 0.1); }
.michat--chatgpt .michat-copy:hover { background: rgba(255, 255, 255, 0.1); }

/* ==================================================== TEMA: MESSAGES ====== */

.michat--messages {
  --mc-user: #0a84ff;
  --mc-user-text: #ffffff;
  --mc-ai: #e9e9eb;
  --mc-ai-text: #111;
  --mc-header: #f2f2f7;
  --mc-header-text: #111;
  --mc-back: #ffffff;
  --mc-border: #e3e3e8;
  --mc-input-bg: #ffffff;
  --mc-input-text: #111;
  --mc-input-border: #d8d8dc;
  --mc-link: #0a84ff;
  --mc-muted: #8e8e93;
  --mc-font: -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mc-radius: 18px;
}
.michat--messages .michat-header { border-bottom: 1px solid #e3e3e8; }
.michat--messages .michat-header-avatar { background: #d8d8de; }
.michat--messages .michat-input { border-radius: 20px; }
.michat--messages .michat-send { border-radius: 20px; }

/* ====================================================== TEMA: AURORA ====== */

.michat--aurora {
  --mc-user: rgba(17, 12, 51, 0.55);
  --mc-user-text: #ffffff;
  --mc-ai: rgba(255, 255, 255, 0.88);
  --mc-ai-text: #221a4e;
  --mc-header: rgba(255, 255, 255, 0.14);
  --mc-header-text: #ffffff;
  --mc-back: #4326c4;
  --mc-border: rgba(255, 255, 255, 0.35);
  --mc-input-bg: rgba(255, 255, 255, 0.92);
  --mc-input-text: #221a4e;
  --mc-input-border: transparent;
  --mc-link: #4326c4;
  --mc-muted: rgba(255, 255, 255, 0.85);
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 14px;
}
.michat--aurora {
  background: linear-gradient(135deg, #5b2be0 0%, #2b6be0 55%, #18c8e8 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 36px rgba(67, 38, 196, 0.35);
}
.michat--aurora .michat-header {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}
.michat--aurora .michat-msg--user .michat-bubble {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.michat--aurora .michat-msg--ai .michat-bubble {
  box-shadow: 0 4px 14px rgba(20, 10, 60, 0.18);
}
.michat--aurora .michat-inputrow,
.michat--aurora .michat-compliance {
  background: rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.michat--aurora .michat-name { color: rgba(255, 255, 255, 0.9); }
.michat--aurora .michat-avatar { background: rgba(255, 255, 255, 0.25); }
.michat--aurora .michat-send { background: #18c8e8; color: #06303a; }
.michat--aurora .michat-clear { color: rgba(255, 255, 255, 0.9); }
.michat--aurora .michat-copy { color: rgba(255, 255, 255, 0.85); }
.michat--aurora .michat-typing span { background: rgba(67, 38, 196, 0.7); }

/* ======================================================== TEMA: NEÓN ====== */

.michat--neon {
  --mc-user: #22d3ee;
  --mc-user-text: #04222b;
  --mc-ai: #161f33;
  --mc-ai-text: #d7e4ff;
  --mc-header: #0e1526;
  --mc-header-text: #7df9ff;
  --mc-back: #0b1020;
  --mc-border: #1d2b4a;
  --mc-input-bg: #11182e;
  --mc-input-text: #d7e4ff;
  --mc-input-border: #28406e;
  --mc-link: #7df9ff;
  --mc-muted: #6f81a6;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 12px;
}
.michat--neon { box-shadow: 0 0 0 1px #1d2b4a, 0 10px 40px rgba(34, 211, 238, 0.15); }
.michat--neon .michat-header {
  border-bottom: 1px solid #1d2b4a;
  text-shadow: 0 0 10px rgba(125, 249, 255, 0.6);
}
.michat--neon .michat-msg--user .michat-bubble {
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}
.michat--neon .michat-msg--ai .michat-bubble {
  border: 1px solid #28406e;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.18);
}
.michat--neon .michat-inputrow,
.michat--neon .michat-compliance { background: #0e1526; border-top-color: #1d2b4a; }
.michat--neon .michat-input:focus { box-shadow: 0 0 8px rgba(34, 211, 238, 0.5); }
.michat--neon .michat-send { box-shadow: 0 0 10px rgba(34, 211, 238, 0.5); }
.michat--neon .michat-avatar { background: #11182e; }
.michat--neon .michat-copy:hover { background: rgba(255, 255, 255, 0.08); }

/* ==================================================== TEMA: BOUTIQUE ====== */

.michat--boutique {
  --mc-user: #b08d3e;
  --mc-user-text: #fffdf7;
  --mc-ai: #f0e9dc;
  --mc-ai-text: #33291c;
  --mc-header: #2e2620;
  --mc-header-text: #f4e8cf;
  --mc-back: #faf6ef;
  --mc-border: #d9cdb8;
  --mc-input-bg: #ffffff;
  --mc-input-text: #33291c;
  --mc-input-border: #d9cdb8;
  --mc-link: #8a6a22;
  --mc-muted: #8c7e66;
  --mc-font: Georgia, 'Times New Roman', serif;
  --mc-radius: 4px;
}
.michat--boutique { border: 1px solid #d9cdb8; }
.michat--boutique .michat-header {
  border-bottom: 2px solid #b08d3e;
  letter-spacing: 0.4px;
}
.michat--boutique .michat-header-name { font-variant: small-caps; font-size: 1.05em; }
.michat--boutique .michat-msg--user .michat-bubble {
  background: linear-gradient(160deg, #c4a050, #a37f31);
}
.michat--boutique .michat-msg--ai .michat-bubble { border: 1px solid #e2d7c3; }
.michat--boutique .michat-inputrow,
.michat--boutique .michat-compliance { background: #f4eee3; border-top-color: #e2d7c3; }
.michat--boutique .michat-avatar { background: #ece2cf; }

/* ======================================================== TEMA: GROK ====== */
/* Inspirado en Grok / X: negro puro, minimalista, pill input, acento blanco. */

.michat--grok {
  --mc-user: #ffffff;
  --mc-user-text: #0a0a0a;
  --mc-ai: #16181c;
  --mc-ai-text: #e7e9ea;
  --mc-header: #000000;
  --mc-header-text: #e7e9ea;
  --mc-back: #0a0a0a;
  --mc-border: #2f3336;
  --mc-input-bg: #000000;
  --mc-input-text: #e7e9ea;
  --mc-input-border: #2f3336;
  --mc-link: #1d9bf0;
  --mc-muted: #71767b;
  --mc-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mc-radius: 18px;
}
.michat--grok .michat-header { border-bottom: 1px solid #2f3336; }
.michat--grok .michat-header-avatar { background: #16181c; border: 1px solid #2f3336; }
.michat--grok .michat-msg--ai .michat-bubble { border: 1px solid #2f3336; }
.michat--grok .michat-inputrow,
.michat--grok .michat-compliance { background: #000; border-top-color: #2f3336; }
.michat--grok .michat-input { border-radius: 999px; padding-left: 18px; }
.michat--grok .michat-input:focus { border-color: #e7e9ea; box-shadow: 0 0 0 1px #e7e9ea; }
.michat--grok .michat-send { border-radius: 999px; background: #fff; color: #0a0a0a; }
.michat--grok .michat-clear { color: #71767b; }
.michat--grok .michat-avatar { background: #16181c; border: 1px solid #2f3336; }
.michat--grok .michat-copy:hover { background: rgba(255, 255, 255, 0.1); }

/* ====================================================== TEMA: OFERTA ====== */
/* Para VENDER: urgencia naranja, botón de compra verde, cálido y enérgico. */

.michat--oferta {
  --mc-user: #ff5722;
  --mc-user-text: #ffffff;
  --mc-ai: #ffffff;
  --mc-ai-text: #3a2a22;
  --mc-header: #ff4e2b;
  --mc-header-text: #ffffff;
  --mc-back: #fff8f2;
  --mc-border: #ffd9c2;
  --mc-input-bg: #ffffff;
  --mc-input-text: #3a2a22;
  --mc-input-border: #ffc4a3;
  --mc-link: #e64a19;
  --mc-muted: #b08368;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 14px;
}
.michat--oferta .michat-header { background: linear-gradient(110deg, #ff4e2b, #ff9606); }
.michat--oferta .michat-msg--ai .michat-bubble { border: 1px solid #ffe3d1; box-shadow: 0 2px 8px rgba(255, 87, 34, 0.07); }
.michat--oferta .michat-send {
  background: linear-gradient(120deg, #16a34a, #0d9444);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
  animation: michatBuyPulse 2.4s ease-in-out infinite;
}
@keyframes michatBuyPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35); }
  50% { box-shadow: 0 4px 22px rgba(22, 163, 74, 0.6); }
}
.michat--oferta .michat-inputrow, .michat--oferta .michat-compliance { background: #fff1e6; border-top-color: #ffe3d1; }
.michat--oferta .michat-avatar { background: #ffe3d1; }

/* ============================================= TEMA: OFERTA FUEGO ========= */
/* Lanzamientos urgentes: rojo→naranja intenso, fondo cálido con profundidad
   y botón de compra verde pulsante (rediseño v3.0.7). */

.michat--oferta_hot {
  --mc-user: #e11d48;
  --mc-user-text: #ffffff;
  --mc-ai: #ffffff;
  --mc-ai-text: #431418;
  --mc-header: #dc2626;
  --mc-header-text: #ffffff;
  --mc-back: #fff5f3;
  --mc-border: #ffd3cb;
  --mc-input-bg: #ffffff;
  --mc-input-text: #431418;
  --mc-input-border: #fca5a5;
  --mc-link: #dc2626;
  --mc-muted: #b07b76;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 16px;
}
.michat--oferta_hot {
  background: linear-gradient(180deg, #fff1ee 0%, #fff8f4 45%, #ffe9e2 100%);
  box-shadow: 0 14px 34px rgba(220, 38, 38, 0.14);
}
.michat--oferta_hot .michat-header {
  background: linear-gradient(115deg, #b91c1c 0%, #ef4444 45%, #f97316 100%);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.30);
}
.michat--oferta_hot .michat-header-avatar { background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.5); }
.michat--oferta_hot .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #f43f5e, #dc2626);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.32);
}
.michat--oferta_hot .michat-msg--ai .michat-bubble { border: 1px solid #ffe0da; box-shadow: 0 4px 12px rgba(220, 38, 38, 0.08); }
.michat--oferta_hot .michat-inputrow,
.michat--oferta_hot .michat-compliance { background: rgba(255, 255, 255, 0.75); border-top-color: #ffe0da; }
.michat--oferta_hot .michat-input:focus { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16); }
.michat--oferta_hot .michat-send {
  background: linear-gradient(120deg, #16a34a, #0d9444);
  box-shadow: 0 5px 16px rgba(22, 163, 74, 0.40);
  animation: michatBuyPulse 2.4s ease-in-out infinite;
}
.michat--oferta_hot .michat-avatar { background: #ffe0da; }
.michat--oferta_hot .michat-typing span { background: #ef4444; }

/* ============================================= TEMA: OFERTA VERDE ========= */
/* Confianza y compra directa: esmeralda→lima, fondo menta suave y CTA
   ámbar que contrasta y empuja al clic (rediseño v3.0.7). */

.michat--oferta_verde {
  --mc-user: #059669;
  --mc-user-text: #ffffff;
  --mc-ai: #ffffff;
  --mc-ai-text: #113a2b;
  --mc-header: #047857;
  --mc-header-text: #ffffff;
  --mc-back: #f0fdf6;
  --mc-border: #bbe9d3;
  --mc-input-bg: #ffffff;
  --mc-input-text: #113a2b;
  --mc-input-border: #6ee7b7;
  --mc-link: #047857;
  --mc-muted: #5f8674;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 16px;
}
.michat--oferta_verde {
  background: linear-gradient(180deg, #ecfdf3 0%, #f4fef8 50%, #e3f9ec 100%);
  box-shadow: 0 14px 34px rgba(5, 150, 105, 0.13);
}
.michat--oferta_verde .michat-header {
  background: linear-gradient(115deg, #065f46 0%, #059669 50%, #34d399 110%);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28);
}
.michat--oferta_verde .michat-header-avatar { background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.5); }
.michat--oferta_verde .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.28);
}
.michat--oferta_verde .michat-msg--ai .michat-bubble { border: 1px solid #d3f4e2; box-shadow: 0 4px 12px rgba(5, 150, 105, 0.07); }
.michat--oferta_verde .michat-inputrow,
.michat--oferta_verde .michat-compliance { background: rgba(255, 255, 255, 0.75); border-top-color: #d3f4e2; }
.michat--oferta_verde .michat-input:focus { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16); }
.michat--oferta_verde .michat-send {
  background: linear-gradient(120deg, #f59e0b, #ea580c);
  box-shadow: 0 5px 16px rgba(234, 88, 12, 0.38);
  animation: michatBuyPulseAmbar 2.4s ease-in-out infinite;
}
.michat--oferta_verde .michat-avatar { background: #d3f4e2; }
.michat--oferta_verde .michat-typing span { background: #10b981; }
@keyframes michatBuyPulseAmbar {
  0%, 100% { box-shadow: 0 5px 16px rgba(234, 88, 12, 0.38); }
  50% { box-shadow: 0 5px 24px rgba(234, 88, 12, 0.62); }
}

/* ============================================== TEMA: OFERTA AZUL ========= */
/* Promo limpia y tecnológica: azul→cian con fondo helado y CTA verde
   de compra pulsante (rediseño v3.0.7). */

.michat--oferta_azul {
  --mc-user: #2563eb;
  --mc-user-text: #ffffff;
  --mc-ai: #ffffff;
  --mc-ai-text: #122148;
  --mc-header: #1d4ed8;
  --mc-header-text: #ffffff;
  --mc-back: #f0f7ff;
  --mc-border: #c3dcfc;
  --mc-input-bg: #ffffff;
  --mc-input-text: #122148;
  --mc-input-border: #93c5fd;
  --mc-link: #1d4ed8;
  --mc-muted: #64779e;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 16px;
}
.michat--oferta_azul {
  background: linear-gradient(180deg, #edf5ff 0%, #f6faff 50%, #e4f1ff 100%);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.13);
}
.michat--oferta_azul .michat-header {
  background: linear-gradient(115deg, #1e40af 0%, #2563eb 50%, #06b6d4 115%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}
.michat--oferta_azul .michat-header-avatar { background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.5); }
.michat--oferta_azul .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.30);
}
.michat--oferta_azul .michat-msg--ai .michat-bubble { border: 1px solid #d6e8ff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.07); }
.michat--oferta_azul .michat-inputrow,
.michat--oferta_azul .michat-compliance { background: rgba(255, 255, 255, 0.75); border-top-color: #d6e8ff; }
.michat--oferta_azul .michat-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16); }
.michat--oferta_azul .michat-send {
  background: linear-gradient(120deg, #16a34a, #0d9444);
  box-shadow: 0 5px 16px rgba(22, 163, 74, 0.40);
  animation: michatBuyPulse 2.4s ease-in-out infinite;
}
.michat--oferta_azul .michat-avatar { background: #d6e8ff; }
.michat--oferta_azul .michat-typing span { background: #3b82f6; }

/* =========================================== TEMA: OFERTA MAGENTA ========= */
/* Promo vibrante para banners: magenta→rosa→naranja, fondo rosado suave y
   CTA verde de compra pulsante (rediseño v3.0.7). */

.michat--oferta_magenta {
  --mc-user: #c026d3;
  --mc-user-text: #ffffff;
  --mc-ai: #ffffff;
  --mc-ai-text: #45123a;
  --mc-header: #be185d;
  --mc-header-text: #ffffff;
  --mc-back: #fff3fa;
  --mc-border: #fbcbe6;
  --mc-input-bg: #ffffff;
  --mc-input-text: #45123a;
  --mc-input-border: #f0abd8;
  --mc-link: #be185d;
  --mc-muted: #a06a8c;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 16px;
}
.michat--oferta_magenta {
  background: linear-gradient(180deg, #ffeef8 0%, #fff7fc 50%, #ffe9f4 100%);
  box-shadow: 0 14px 34px rgba(192, 38, 211, 0.13);
}
.michat--oferta_magenta .michat-header {
  background: linear-gradient(115deg, #a21caf 0%, #db2777 55%, #f97316 120%);
  box-shadow: 0 4px 14px rgba(190, 24, 93, 0.30);
}
.michat--oferta_magenta .michat-header-avatar { background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.5); }
.michat--oferta_magenta .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #d946ef, #be185d);
  box-shadow: 0 6px 16px rgba(192, 38, 211, 0.30);
}
.michat--oferta_magenta .michat-msg--ai .michat-bubble { border: 1px solid #fbdcee; box-shadow: 0 4px 12px rgba(190, 24, 93, 0.07); }
.michat--oferta_magenta .michat-inputrow,
.michat--oferta_magenta .michat-compliance { background: rgba(255, 255, 255, 0.75); border-top-color: #fbdcee; }
.michat--oferta_magenta .michat-input:focus { border-color: #d946ef; box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.16); }
.michat--oferta_magenta .michat-send {
  background: linear-gradient(120deg, #16a34a, #0d9444);
  box-shadow: 0 5px 16px rgba(22, 163, 74, 0.40);
  animation: michatBuyPulse 2.4s ease-in-out infinite;
}
.michat--oferta_magenta .michat-avatar { background: #fbdcee; }
.michat--oferta_magenta .michat-typing span { background: #d946ef; }

/* ===================================================== TEMA: PREMIUM ====== */
/* Lujo oscuro con oro: para vender caro con elegancia. */

.michat--premium {
  --mc-user: #d4af37;
  --mc-user-text: #241a02;
  --mc-ai: #1c2030;
  --mc-ai-text: #e8e6df;
  --mc-header: #0b0d13;
  --mc-header-text: #efe3c0;
  --mc-back: #11131a;
  --mc-border: #2a2f42;
  --mc-input-bg: #0e1016;
  --mc-input-text: #e8e6df;
  --mc-input-border: #3d4256;
  --mc-link: #e6c66e;
  --mc-muted: #8f94a8;
  --mc-font: Georgia, 'Times New Roman', serif;
  --mc-radius: 14px;
}
.michat--premium .michat-header { border-bottom: 2px solid #d4af37; }
.michat--premium .michat-header-name { font-variant: small-caps; letter-spacing: 0.6px; }
.michat--premium .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #e9c75a, #b8860b);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.28);
}
.michat--premium .michat-msg--ai .michat-bubble { border: 1px solid #2e3346; }
.michat--premium .michat-send {
  background: linear-gradient(135deg, #e9c75a, #b8860b);
  color: #241a02;
}
.michat--premium .michat-inputrow, .michat--premium .michat-compliance { background: #0b0d13; border-top-color: #2a2f42; }
.michat--premium .michat-avatar { background: #1c2030; border: 1px solid #d4af37; }
.michat--premium .michat-input:focus { border-color: #d4af37; box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18); }

/* =================================================== TEMA: CYBERPUNK ====== */
/* Neón magenta + cian sobre violeta profundo, esquinas angulares y brillos. */

.michat--cyberpunk {
  --mc-user: #ff2a6d;
  --mc-user-text: #ffffff;
  --mc-ai: #150c2e;
  --mc-ai-text: #d1f7ff;
  --mc-header: #1a0533;
  --mc-header-text: #05d9e8;
  --mc-back: #0d0221;
  --mc-border: #2c1a4d;
  --mc-input-bg: #120731;
  --mc-input-text: #d1f7ff;
  --mc-input-border: #05d9e8;
  --mc-link: #fcee0a;
  --mc-muted: #7a6f9b;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 6px;
}
.michat--cyberpunk { box-shadow: 0 0 0 1px #2c1a4d, 0 12px 44px rgba(255, 42, 109, 0.18); }
.michat--cyberpunk .michat-header {
  border-bottom: 1px solid #ff2a6d;
  text-shadow: 0 0 12px rgba(5, 217, 232, 0.8);
}
.michat--cyberpunk .michat-msg--user .michat-bubble {
  box-shadow: 0 0 14px rgba(255, 42, 109, 0.5);
  border: 1px solid #ff5e94;
}
.michat--cyberpunk .michat-msg--ai .michat-bubble {
  border: 1px solid #05d9e8;
  box-shadow: 0 0 10px rgba(5, 217, 232, 0.22);
}
.michat--cyberpunk .michat-send {
  background: #05d9e8;
  color: #06141c;
  box-shadow: 0 0 12px rgba(5, 217, 232, 0.55);
}
.michat--cyberpunk .michat-inputrow, .michat--cyberpunk .michat-compliance { background: #0a031c; border-top-color: #2c1a4d; }
.michat--cyberpunk .michat-input:focus { box-shadow: 0 0 10px rgba(5, 217, 232, 0.6); }
.michat--cyberpunk .michat-avatar { background: #1a0533; border: 1px solid #ff2a6d; }
.michat--cyberpunk .michat-typing span { background: #05d9e8; }

/* ======================================================= TEMA: GLASS ====== */
/* Glassmorphism claro: auroras suaves de fondo, paneles translúcidos con
   blur y acento índigo. Estilo iOS / Windows 11. */

.michat--glass {
  --mc-user: #4f46e5;
  --mc-user-text: #ffffff;
  --mc-ai: rgba(255, 255, 255, 0.74);
  --mc-ai-text: #1e2338;
  --mc-header: rgba(255, 255, 255, 0.55);
  --mc-header-text: #1e2338;
  --mc-back: #eef1fb;
  --mc-border: rgba(255, 255, 255, 0.7);
  --mc-input-bg: rgba(255, 255, 255, 0.82);
  --mc-input-text: #1e2338;
  --mc-input-border: rgba(120, 130, 200, 0.35);
  --mc-link: #4f46e5;
  --mc-muted: #6a7290;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 16px;
}
.michat--glass {
  background:
    radial-gradient(1100px 500px at -10% -20%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(900px 480px at 110% 0%, rgba(56, 189, 248, 0.20), transparent 55%),
    radial-gradient(800px 520px at 50% 120%, rgba(236, 72, 153, 0.12), transparent 60%),
    #eef1fb;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 44px rgba(30, 35, 56, 0.16);
}
.michat--glass .michat-header {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
}
.michat--glass .michat-header-avatar { background: rgba(255, 255, 255, 0.65); }
.michat--glass .michat-msg--ai .michat-bubble {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 6px 18px rgba(30, 35, 56, 0.08);
}
.michat--glass .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.32);
}
.michat--glass .michat-inputrow,
.michat--glass .michat-compliance {
  background: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.michat--glass .michat-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18); }
.michat--glass .michat-send { background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 5px 16px rgba(79, 70, 229, 0.30); }
.michat--glass .michat-avatar { background: rgba(255, 255, 255, 0.72); }
.michat--glass .michat-typing span { background: #6366f1; }

/* ==================================================== TEMA: MIDNIGHT ====== */
/* Oscuro minimalista tipo SaaS premium (Linear/Vercel): azul noche profundo,
   acento azul eléctrico suave, bordes finos y cero neones estridentes. */

.michat--midnight {
  --mc-user: #5b7cfa;
  --mc-user-text: #ffffff;
  --mc-ai: #171c2b;
  --mc-ai-text: #dfe4f2;
  --mc-header: #0d1017;
  --mc-header-text: #eef1f8;
  --mc-back: #0f131e;
  --mc-border: #232a3d;
  --mc-input-bg: #141927;
  --mc-input-text: #dfe4f2;
  --mc-input-border: #2c3550;
  --mc-link: #8ca8ff;
  --mc-muted: #78829e;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 12px;
}
.michat--midnight { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); }
.michat--midnight .michat-header { border-bottom: 1px solid #232a3d; }
.michat--midnight .michat-header-avatar { background: #171c2b; border: 1px solid #2c3550; }
.michat--midnight .michat-msg--ai .michat-bubble { border: 1px solid #232a3d; }
.michat--midnight .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #6d8bff, #4f6ef7);
  box-shadow: 0 4px 16px rgba(91, 124, 250, 0.28);
}
.michat--midnight .michat-inputrow,
.michat--midnight .michat-compliance { background: #0d1017; border-top-color: #232a3d; }
.michat--midnight .michat-input:focus { border-color: #5b7cfa; box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.20); }
.michat--midnight .michat-send { background: linear-gradient(135deg, #6d8bff, #4f6ef7); }
.michat--midnight .michat-avatar { background: #171c2b; border: 1px solid #232a3d; }
.michat--midnight .michat-copy:hover { background: rgba(255, 255, 255, 0.08); }
.michat--midnight .michat-typing span { background: #5b7cfa; }

/* ====================================================== TEMA: SUNSET ====== */
/* Atardecer vibrante: cabecera degradada naranja → rosa → magenta sobre un
   fondo cálido. Para marcas creativas y llamativas. */

.michat--sunset {
  --mc-user: #f43f5e;
  --mc-user-text: #ffffff;
  --mc-ai: #ffffff;
  --mc-ai-text: #43273b;
  --mc-header: #ff6b35;
  --mc-header-text: #ffffff;
  --mc-back: #fff6f1;
  --mc-border: #ffd9c9;
  --mc-input-bg: #ffffff;
  --mc-input-text: #43273b;
  --mc-input-border: #fdba9f;
  --mc-link: #e11d48;
  --mc-muted: #a97b86;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 16px;
}
.michat--sunset .michat-header { background: linear-gradient(115deg, #ff6b35 0%, #f43f5e 55%, #c026d3 115%); }
.michat--sunset .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #fb7185, #e11d48);
  box-shadow: 0 5px 16px rgba(244, 63, 94, 0.30);
}
.michat--sunset .michat-msg--ai .michat-bubble { border: 1px solid #ffe4d6; box-shadow: 0 3px 10px rgba(244, 63, 94, 0.07); }
.michat--sunset .michat-inputrow,
.michat--sunset .michat-compliance { background: #fff0e8; border-top-color: #ffe4d6; }
.michat--sunset .michat-input:focus { border-color: #f43f5e; box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.16); }
.michat--sunset .michat-send { background: linear-gradient(120deg, #f43f5e, #c026d3); box-shadow: 0 4px 16px rgba(192, 38, 211, 0.30); }
.michat--sunset .michat-avatar { background: #ffe4d6; }
.michat--sunset .michat-typing span { background: #f43f5e; }

/* ======================================================== TEMA: MINT ====== */
/* Menta fresca: verdes suaves, limpio y aireado. Transmite confianza
   (ideal para salud, eco o fintech amable). */

.michat--mint {
  --mc-user: #0d9488;
  --mc-user-text: #ffffff;
  --mc-ai: #ffffff;
  --mc-ai-text: #143d38;
  --mc-header: #0f766e;
  --mc-header-text: #ecfffb;
  --mc-back: #effaf6;
  --mc-border: #c4ece2;
  --mc-input-bg: #ffffff;
  --mc-input-text: #143d38;
  --mc-input-border: #99e0d2;
  --mc-link: #0f766e;
  --mc-muted: #5f8c83;
  --mc-font: 'Segoe UI', system-ui, sans-serif;
  --mc-radius: 14px;
}
.michat--mint .michat-header { background: linear-gradient(110deg, #0f766e, #10b981); }
.michat--mint .michat-msg--user .michat-bubble {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
}
.michat--mint .michat-msg--ai .michat-bubble { border: 1px solid #d6f3ea; box-shadow: 0 3px 10px rgba(13, 148, 136, 0.06); }
.michat--mint .michat-inputrow,
.michat--mint .michat-compliance { background: #e6f7f0; border-top-color: #d6f3ea; }
.michat--mint .michat-input:focus { border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16); }
.michat--mint .michat-send { background: linear-gradient(120deg, #10b981, #0d9488); }
.michat--mint .michat-avatar { background: #d6f3ea; }
.michat--mint .michat-typing span { background: #0d9488; }

/* ============================================== ANCHO COMPLETO (fluido) === */
/* Para Elementor: el chat abarca de borde a borde de su contenedor. */
.michat--fluid { max-width: none; }

/* ================================================== PANTALLA COMPLETA ===== */
/* La geometría (left/top/width/height) la pone el JS en línea, midiendo el
   viewport real y compensando ancestros con transform (pinFullscreenRect).
   Por eso aquí NO se fuerza 100vw/100dvh: en PC 100vw incluye la barra de
   scroll y hacía que el chat sobresaliera por el costado derecho. */

.michat--fullscreen {
  position: fixed !important;
  margin: 0 !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 999999;
  overflow: hidden;
  /* Penumbra sobre la página mientras el chat está maximizado; entra y sale
     fundida con la transición de box-shadow (sin capas extra ni z-index). */
  box-shadow: 0 0 0 100vmax rgba(8, 10, 22, 0.42);
}
/* Columna de lectura en pantalla completa: los mensajes no se estiran de
   borde a borde del monitor, viven en una franja centrada.
   v3.0.28 — esa franja mide EXACTAMENTE lo que mide el chat en su tamaño
   normal (el JS calcula el valor y lo escribe en --mc-fs-column al
   maximizar). Con la columna fija de 900 px de 3.0.26 el texto se volvía a
   partir al pulsar ⛶ (medido: de 729 a 870 px de ancho) y esa columna
   sobresalía del marco 70 px por cada lado, así que durante toda la
   animación las líneas estaban cortadas en sus dos extremos y se iban
   destapando: eso era el «poquito» que se movía, y estaba en los bordes.
   Igualando la columna al ancho del chat, el texto no cambia ni un píxel
   entre los dos estados: solo el marco se agranda a su alrededor. */
.michat--fullscreen .michat-messages {
  width: min(var(--mc-fs-column, 900px), 100%);
  align-self: center;
  /* v3.0.29 — los 7,5 px hacia la derecha. Al maximizar se oculta la barra
     de desplazamiento de la página (15 px) y el chat pasa a centrarse en la
     ventana entera en vez de en el área que se veía antes, así que la
     columna se corría media barra a la derecha (medido: de 846 a 853,5).
     Este hueco a la derecha del panel centrado lo desplaza justo esa mitad
     en sentido contrario y lo deja clavado donde estaba. */
  margin-right: var(--mc-fs-gutter, 0px);
}
/* El hueco viaja con la MISMA curva y duración que el marco, así la
   compensación es exacta en cada frame y no solo al terminar. */
.michat--fs-animating .michat-messages {
  transition: margin-right .55s cubic-bezier(.32, .72, 0, 1);
}
.michat--fs-animating {
  transition:
    left .55s cubic-bezier(.32, .72, 0, 1),
    top .55s cubic-bezier(.32, .72, 0, 1),
    width .55s cubic-bezier(.32, .72, 0, 1),
    height .55s cubic-bezier(.32, .72, 0, 1),
    border-radius .55s cubic-bezier(.32, .72, 0, 1),
    box-shadow .55s ease;
  /* v3.0.33 — AQUÍ ESTABA EL PARPADEO DEL TEXTO. Antes había un
     «will-change: left, top, width, height, border-radius». Esas cinco
     propiedades son de maquetación: el navegador NO puede acelerarlas, así
     que la pista no aportaba nada… pero sí tenía un efecto secundario —
     obligaba a meter el chat en una capa aparte al empezar la animación y a
     sacarlo de ella al terminar, y en esos dos instantes cambia el modo de
     suavizado del texto. De ahí el temblorcito: duraba unos milisegundos,
     ocurría al empezar y al terminar, y solo se apreciaba en los paneles de
     texto (la cabecera y los botones son fondos lisos, ahí no se nota).
     Investigado en el sitio real pausando la transición y avanzándola
     fotograma a fotograma: el panel no se mueve —posición vertical
     57,578 px EXACTA en los diez fotogramas y horizontal estable dentro de
     1/64 de píxel—, lo que cambia 33 veces es el TAMAÑO de su caja, y cada
     cambio obliga a redibujar el texto. Sin la promoción a capa, ese
     redibujado usa siempre el mismo modo y deja de notarse. */
}
.michat-fs-placeholder {
  flex: 0 0 auto;
  pointer-events: none;
  visibility: hidden;
}

/* ============================================ BURBUJA FLOTANTE (POPUP) ==== */

.michat-popup { position: fixed; right: 22px; bottom: 22px; z-index: 99990; }
.michat-popup--left { right: auto; left: 22px; }

.michat-bubblebtn {
  width: 58px; height: 58px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  display: grid;
  place-items: center;
  /* v3.0.51 (30-oct-2026): el botón vive FUERA de .michat y las variables
     del tema nunca le llegaban (siempre azul). El JS copia aquí los colores
     de la ventana en --mc-launcher-a/-b (solo opacos) y añade la clase
     --themed; sin ellas, el degradado azul de siempre, idéntico. */
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.95) 0 12%, rgba(255, 255, 255, 0.22) 13% 28%, transparent 29%),
    linear-gradient(135deg, var(--mc-launcher-a, var(--mc-header, #2831dc)) 0%, var(--mc-launcher-b, var(--mc-user, #2768db)) 58%, var(--mc-launcher-c, #06b6d4) 100%);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.28),
    0 0 0 7px var(--mc-launcher-halo, rgba(39, 104, 219, 0.12)),
    inset 0 -7px 13px rgba(0, 0, 0, 0.16);
  transition: filter 0.18s, box-shadow 0.18s;
}
.michat-bubblebtn:hover {
  filter: brightness(1.08) saturate(1.1);
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.34),
    0 0 0 9px var(--mc-launcher-halo-hover, rgba(39, 104, 219, 0.16)),
    inset 0 -7px 13px rgba(0, 0, 0, 0.16);
}
/* Burbuja con los colores del chat: el cian fijo del final y el halo azul
   salen del acento del tema (con color-mix); sin color-mix, el final del
   degradado repite el acento y el halo queda como estaba. */
.michat-bubblebtn--themed {
  --mc-launcher-c: var(--mc-launcher-b);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat-bubblebtn--themed {
    --mc-launcher-c: color-mix(in srgb, var(--mc-launcher-b) 62%, #ffffff);
    --mc-launcher-halo: color-mix(in srgb, var(--mc-launcher-b) 12%, transparent);
    --mc-launcher-halo-hover: color-mix(in srgb, var(--mc-launcher-b) 16%, transparent);
  }
}

.michat--window {
  display: none;
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 390px;
  max-width: calc(100vw - 30px);
  height: 560px;
  max-height: calc(100vh - 60px);
  z-index: 99991;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3);
}
.michat--window.michat--open { display: flex; }
.michat-popup--left .michat--window { right: auto; left: 22px; }

.michat-close { font-size: 20px !important; }

/* =============================================================== MÓVIL ==== */

@media (max-width: 480px) {
  .michat {
    height: 86vh;
    height: min(86dvh, 760px);
    min-height: 590px;
    border-radius: 10px;
  }
  .michat--window {
    right: 8px; bottom: 8px;
    width: calc(100vw - 16px);
    height: 88vh;
    height: min(88dvh, 780px);
  }
  .michat-popup--left .michat--window { left: 8px; }
  .michat-header { padding: 8px 11px; }
  .michat-messages {
    padding: 10px 8px 8px;
    gap: 8px;
  }
  .michat-msg { gap: 5px; }
  /* v3.0.63 (2026-11-14): de 24 a 28 px y el emoji de 14 a 18 (64 % del
     círculo); la columna deja libres el avatar y su hueco (28 + 5 = 33). */
  .michat-avatar {
    width: 28px;
    height: 28px;
    font-size: 18px;
  }
  .michat-col { max-width: calc(100% - 33px); }
  .michat-bubble { padding: 9px 11px; }
  .michat-inputrow { padding: 8px; gap: 7px; }
  /* Caja de escritura más cómoda en el móvil (los 16px evitan además el
     zoom automático de iOS al tocar el campo). */
  .michat-input {
    min-height: 50px;
    font-size: max(16px, var(--mc-font-input));
  }
  .michat-send { padding: 0 14px; }
}

/* ====================================================== ✨ ANIMACIONES ===== */

/* Entrada de cada mensaje: aparece subiendo con un toque de rebote. */
.michat-msg {
  animation: michatMsgIn 0.32s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
@keyframes michatMsgIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* v3.0.63 (2026-11-14): la burbuja del streaming que RELEVA a los puntitos no
   repite la entrada. Al llegar el primer trozo, los puntitos se quitan y la
   burbuja nueva volvía a entrar desde abajo (un fotograma en blanco y el
   avatar daba un saltito justo cuando empieza la respuesta): ahora ocupa su
   sitio sin moverse (clase michat-msg--swap, de widget.js). */
.michat-msg--swap { animation: none; }

/* Animación del streaming — estilo ChatGPT: cursor de bloque parpadeante.
   v3.0.51 (30-oct-2026): el indicador cuelga del ÚLTIMO BLOQUE de la
   burbuja (párrafo, título o último ítem de la lista). Como hijo directo de
   la burbuja, cuyo contenido son bloques, caía en una línea propia debajo
   del texto: la burbuja medía una línea más (~21 px) y encogía de golpe al
   terminar. :empty cubre la burbuja aún vacía; tras un <hr> no hay cursor. */
.michat-bubble--streaming.michat-anim-caret:empty::after,
.michat-bubble--streaming.michat-anim-caret > p:last-child::after,
.michat-bubble--streaming.michat-anim-caret > h4:last-child::after,
.michat-bubble--streaming.michat-anim-caret > h5:last-child::after,
.michat-bubble--streaming.michat-anim-caret > ul:last-child > li:last-child::after,
.michat-bubble--streaming.michat-anim-caret > ol:last-child > li:last-child::after {
  content: '▍';
  display: inline-block;
  margin-left: 2px;
  animation: michatCaret 0.9s steps(1) infinite;
  opacity: 0.8;
}
@keyframes michatCaret {
  0%, 55% { opacity: 0.8; }
  56%, 100% { opacity: 0; }
}

/* Animación del streaming — estilo Grok: orbe que late con brillo.
   v3.0.51 (30-oct-2026): colgado del último bloque, igual que el cursor. */
.michat-bubble--streaming.michat-anim-pulse:empty::after,
.michat-bubble--streaming.michat-anim-pulse > p:last-child::after,
.michat-bubble--streaming.michat-anim-pulse > h4:last-child::after,
.michat-bubble--streaming.michat-anim-pulse > h5:last-child::after,
.michat-bubble--streaming.michat-anim-pulse > ul:last-child > li:last-child::after,
.michat-bubble--streaming.michat-anim-pulse > ol:last-child > li:last-child::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 5px;
  vertical-align: -1px;
  border-radius: 50%;
  background: currentColor;
  animation: michatOrb 1.05s ease-in-out infinite;
}
@keyframes michatOrb {
  0%, 100% { opacity: 0.25; transform: scale(0.75); box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 12px 1px currentColor; }
}

/* =================================== MODO COMPACTO (popup/preview/móvil) == */
/* Cuando el chat es estrecho, la caja ocupa todo el ancho y los botones
   pasan abajo, como AI Engine. La clase la pone un ResizeObserver en JS. */
.michat--compact .michat-inputrow { flex-wrap: wrap; }
.michat--compact .michat-input { flex: 1 1 100%; }
.michat--compact .michat-send { flex: 1; order: 2; padding: 11px 16px; }
.michat--compact .michat-clear { order: 3; padding: 0 14px; }
.michat--compact .michat-leadbox { margin-left: 4px; margin-right: 4px; }

/* ⚡ Respuestas rápidas — rediseño v3.0.6: UN solo borde de acento por chip
   (antes se superponían un borde cónico y un anillo animado y se veía doble).
   Los pares de colores por posición los pone el JS en --mc-chip-accent y
   --mc-chip-accent-2; al pasar el ratón el chip se rellena con su degradado. */
.michat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  justify-content: center;
  padding: 2px 4px 8px 32px;
}
.michat .michat-chipbtn {
  --mc-chip-accent: var(--mc-user);
  position: relative;
  border: 2px solid var(--mc-chip-accent);
  /* Superficie de la ficha: en temas claros es el fondo del chat; los temas
     oscuros definen --mc-chip-surface (superficie elevada) para que las
     fichas no parezcan botones negros apagados (v3.0.15). */
  background: var(--mc-chip-surface, var(--mc-back));
  color: var(--mc-chip-accent);
  border-radius: 999px;
  padding: 8px 15px;
  font: inherit;
  font-size: var(--mc-font-quick);
  font-weight: 600;
  line-height: 1.18;
  max-width: 100%;
  min-height: 38px;
  white-space: normal;
  cursor: pointer;
  opacity: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  animation: michatChipIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s, filter 0.15s;
}
.michat .michat-chipbtn:hover {
  background: linear-gradient(120deg, var(--mc-chip-accent), var(--mc-chip-accent-2, var(--mc-link)));
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.michat .michat-chipbtn:active { transform: scale(0.96); }
/* v3.0.63 (2026-11-14): LA FICHA ELEGIDA SE VE. Al pulsarla, su animación
   pasa de la entrada (michatChipIn, que la sostenía en opacity: 1) a
   michatChipSelect, que no toca la opacidad: la ficha volvía al opacity: 0 de
   su regla base y DESAPARECÍA los 0,36 s del envío, con su onda dentro (medido:
   opacidad 0 en la elegida y 1 en las demás). Además heredaba el retardo
   escalonado de la entrada (hasta 1 s en la última ficha): el salto empezaba
   tarde o nunca. Ahora se rellena con su color, salta y suelta la onda al
   instante. */
.michat .michat-chipbtn.is-selected {
  background: var(--mc-chip-accent);
  border-color: var(--mc-chip-accent);
  color: #fff;
  opacity: 1;
  animation: michatChipSelect 0.38s ease both;
  animation-delay: 0s !important; /* el retardo escalonado va en línea (widget.js) */
}
/* v3.0.63 (2026-11-14): y las demás se atenúan de verdad: el relleno de su
   animación de entrada (opacity: 1, sin transform) mandaba sobre esta regla y
   se quedaban como estaban. Sin esa animación, la regla ya se aplica. */
.michat-chips--sending .michat-chipbtn:not(.is-selected) {
  animation: none;
  opacity: 0.45;
  transform: scale(0.96);
}
/* Onda al elegir un chip (ya no se recorta: el chip no usa overflow hidden). */
.michat-chipburst {
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 2px solid var(--mc-chip-accent);
  pointer-events: none;
  animation: michatChipBurst 0.48s ease-out forwards;
}
@keyframes michatChipIn {
  from { opacity: 0; transform: translateY(10px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes michatChipSelect {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(0, 0, 0, 0.08); }
  100% { transform: scale(1.02); }
}
@keyframes michatChipBurst {
  from { opacity: 0.75; transform: scale(0.92); }
  to { opacity: 0; transform: scale(1.24); }
}

/* ── Estilo "✨ Resplandor animado" (opcional, ajuste quick_style=glow) ──
   Un ÚNICO anillo degradado en movimiento continuo reemplaza al borde plano
   (el borde base queda transparente: nunca se ven dos bordes a la vez).
   Al pasar el ratón el anillo se enciende: brilla más y acelera. */
.michat--chips-glow .michat-chipbtn {
  border-color: transparent;
  /* El relleno no debe pintar bajo el borde transparente: en temas claros se
     veía un aro blanco entre el chip y el anillo animado (bug v3.0.11). */
  background-clip: padding-box;
}
.michat--chips-glow .michat-chipbtn::before {
  content: '';
  position: absolute;
  /* Sobre el ÁREA DEL BORDE (inset negativo = grosor del borde): antes se
     dibujaba dentro del padding-box y dejaba ver ese aro claro por fuera. */
  inset: -2px;
  border-radius: inherit;
  padding: 2px; /* mismo grosor que el borde base */
  background: linear-gradient(
    90deg,
    var(--mc-chip-accent) 0%,
    var(--mc-chip-accent-2, var(--mc-link)) 25%,
    var(--mc-chip-accent) 50%,
    var(--mc-chip-accent-2, var(--mc-link)) 75%,
    var(--mc-chip-accent) 100%
  );
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.9;
  pointer-events: none;
  animation: michatChipBorderFlow 6.4s linear infinite;
}
.michat--chips-glow .michat-chipbtn:hover {
  /* En glow el chip NO se rellena: el borde se "enciende" (como el clásico). */
  background: var(--mc-chip-surface, var(--mc-back));
  background-clip: padding-box;
  border-color: transparent;
  color: var(--mc-chip-accent);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  filter: drop-shadow(0 0 7px var(--mc-chip-accent));
}
/* Al pasar el cursor SOLO se intensifica el anillo: cambiar la duración de
   la animación la reiniciaba y desincronizaba las fichas (v3.0.14). */
.michat--chips-glow .michat-chipbtn:hover::before {
  opacity: 1;
}
.michat--chips-glow .michat-chipbtn.is-selected {
  background: var(--mc-chip-accent);
  color: #fff;
  filter: none;
}
@keyframes michatChipBorderFlow {
  from { background-position: 0% 50%; }
  to { background-position: -200% 50%; }
}

/* ── Estilo "🌈 Barrido clásico" (quick_style=sweep, PREDETERMINADO) ──
   Recuperado de v2.8.6: anillo degradado fluyendo de izquierda a derecha
   más un destello que cruza el chip con su color de acento. El destello
   anima background-position (no transform), así no necesita overflow:hidden
   y la onda al elegir (chipburst) no se recorta. */
.michat--chips-sweep .michat-chipbtn {
  border-color: transparent;
  background-clip: padding-box;
}
.michat--chips-sweep .michat-chipbtn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    90deg,
    var(--mc-chip-accent) 0%,
    var(--mc-chip-accent-2, var(--mc-link)) 16.666%,
    var(--mc-chip-accent-3, currentColor) 33.333%,
    var(--mc-chip-accent) 50%,
    var(--mc-chip-accent-2, var(--mc-link)) 66.666%,
    var(--mc-chip-accent-3, currentColor) 83.333%,
    var(--mc-chip-accent) 100%
  );
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.95;
  pointer-events: none;
  animation: michatChipBorderFlow 6.4s linear infinite;
}
.michat--chips-sweep .michat-chipbtn::after {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background-image: linear-gradient(
    105deg,
    transparent 0 30%,
    var(--mc-chip-accent-2, var(--mc-link)) 45%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 62% 100%
  );
  background-size: 260% 100%;
  background-repeat: no-repeat;
  background-position-x: 100%;
  opacity: 0;
  pointer-events: none;
  animation: michatChipGlowSweep 3.2s ease-in-out infinite;
}
.michat--chips-sweep .michat-chipbtn:hover {
  background: var(--mc-chip-surface, var(--mc-back));
  background-clip: padding-box;
  border-color: transparent;
  color: var(--mc-chip-accent);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}
/* El hover solo eleva la ficha e intensifica el anillo; las animaciones de
   barrido y borde conservan su ritmo (cambiar la duración las reiniciaba y
   hacía que la ficha bajo el cursor fuera más rápida que las demás). */
.michat--chips-sweep .michat-chipbtn:hover::before {
  opacity: 1;
}
.michat--chips-sweep .michat-chipbtn.is-selected {
  background: var(--mc-chip-accent);
  color: var(--mc-user-text, #fff);
}
.michat--chips-sweep .michat-chipbtn.is-selected::after { animation: none; opacity: 0; }
@keyframes michatChipGlowSweep {
  0%, 42% { background-position-x: 100%; opacity: 0; }
  55% { opacity: 0.55; }
  100% { background-position-x: 0%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .michat--chips-sweep .michat-chipbtn::before,
  .michat--chips-sweep .michat-chipbtn::after,
  .michat--chips-glow .michat-chipbtn::before {
    animation: none;
  }
  .michat--chips-sweep .michat-chipbtn::after { opacity: 0; }
}

/* ── v3.0.64 (2026-11-15), etapa S4c (ADENDA-S4-v3.0.64 §S4.2): CUATRO ESTILOS
   NUEVOS PARA EL BORDE DE LAS FICHAS. Pedido del dueño: «busca otro tipo de
   animación de los bordes de las fichas, tipo de los bordes del chatbot que
   palpitan… porque mi público quizás se aburrió ya». 💓 Latido (pulse),
   ☄️ Cometa (comet), 🫧 Respiración (breathe) y 🌊 Ola (wave), junto a sweep,
   clean y glow, en la línea de las animaciones del borde del chat (3.0.57).
   Cada uno es «◽ Borde limpio» MÁS UN ADORNO que va SOLO en ::before y ::after
   de la ficha: la ficha conserva el color del texto, el fondo, el paso del
   ratón y la elegida de clean (el Cometa, además, cambia el borde plano por
   su aro, como glow). Así el contraste del texto es el de clean por
   construcción y los 25 temas animados (que solo retocan sweep y glow) no se
   tocan. Los adornos: sin clics (pointer-events: none); nunca encima del texto
   (aros huecos, la luz del Cometa enmascarada al área del borde y el halo de
   la Respiración como sombra EXTERIOR, que no se pinta dentro de su capa);
   crecen poco hacia fuera (como mucho un 4 % a lo ancho y un 24 % a lo alto:
   unos 5 px en una ficha de una línea; medido con una ficha de tres líneas a
   lo ancho de la fila, a 1280 y a 375 px: el panel no se desplaza de lado ni
   cambia su alto de desplazamiento); y la ficha sigue sin overflow: hidden
   (la onda al elegirla no se recorta). Los
   colores son los de cada ficha (--mc-chip-accent y --mc-chip-accent-2, que
   widget.js reparte por posición; sin ellos, los del tema) y van en la capa,
   nunca en los @keyframes, que solo mueven transform y opacity (el Cometa, el
   ángulo de su degradado, como el borde del chat). --mc-chip-i (la posición
   de la ficha; widget.js la pone solo con estos cuatro estilos) reparte los
   retardos de la Ola, la Respiración y el Cometa. Fuera de la vista se pausan
   (michat-anim-paused en la raíz y michat-chips--resting en la fila) y con
   «reducir movimiento» se quedan quietos y a la vista. Nada destella más de
   3 veces por segundo: un latido (dos aros) cada 1,6 s, una ola cada 3,2 s. */
.michat--chips-pulse .michat-chipbtn::before,
.michat--chips-pulse .michat-chipbtn::after,
.michat--chips-comet .michat-chipbtn::before,
.michat--chips-breathe .michat-chipbtn::before,
.michat--chips-wave .michat-chipbtn::before {
  content: '';
  position: absolute;
  /* La caja entera de la ficha, borde incluido (2 px), como el anillo de glow. */
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
}

/* 💓 Latido: un aro del color de la ficha sale de su borde, crece unos pocos
   píxeles y se desvanece; el segundo (::after) sale 0,24 s después: dos
   golpes y una pausa, 1,6 s por latido. Todas las fichas laten a la vez. */
.michat--chips-pulse .michat-chipbtn::before,
.michat--chips-pulse .michat-chipbtn::after {
  border: 2px solid var(--mc-chip-accent);
  opacity: 0;
  animation: michatChipBeat 1.6s ease-out infinite;
}
.michat--chips-pulse .michat-chipbtn::after {
  animation-delay: 0.24s;
}
@keyframes michatChipBeat {
  0%, 100% { opacity: 0; transform: scale(1); }
  4% { opacity: 0.85; transform: scale(1); }
  40% { opacity: 0; transform: scale(1.04, 1.24); }
}

/* ☄️ Cometa: una luz con su estela da la vuelta por el borde de cada ficha
   (la técnica del ☄️ Cometa del borde del chat: el ángulo --mc-comet-angle,
   un degradado cónico y michatComet). Su aro sustituye al borde plano, como
   en glow; cada ficha empieza en otro punto de la vuelta (retardo negativo).
   Mismas salvaguardas que en el chat: sin color-mix() el aro no se pinta y se
   queda el borde de la ficha, y sin @property el aro sale quieto. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat--chips-comet .michat-chipbtn {
    border-color: transparent;
    background-clip: padding-box;
  }
}
.michat--chips-comet .michat-chipbtn::before {
  padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  /* Sin @property (Safari < 16.4) el ángulo vale 0: el aro sale quieto. */
  --mc-comet-angle: 0deg;
  background: conic-gradient(from var(--mc-comet-angle),
    color-mix(in srgb, var(--mc-chip-accent) 45%, transparent) 0deg 225deg,
    var(--mc-chip-accent) 295deg,
    var(--mc-chip-accent-2, var(--mc-link)) 335deg,
    color-mix(in srgb, var(--mc-chip-accent-2, var(--mc-link)) 45%, #ffffff) 350deg,
    color-mix(in srgb, var(--mc-chip-accent) 45%, transparent) 360deg);
  animation: michatComet 3.2s linear infinite;
  animation-delay: calc(var(--mc-chip-i, 0) * -0.7s);
}

/* 🫧 Respiración: un halo suave del color de la ficha crece y se apaga
   despacio (4,2 s); cada ficha respira a destiempo (retardo negativo). El
   halo es la sombra exterior de una capa hueca del tamaño de la ficha: nunca
   tapa el texto, y crece con su opacidad (su difuminado se ve más lejos). Sin
   transform: una capa más grande que la ficha dejaría una raya sin halo
   entre el borde y la sombra (se vio al probarlo). */
.michat--chips-breathe .michat-chipbtn::before {
  box-shadow: 0 0 12px 3px var(--mc-chip-accent-2, var(--mc-link));
  opacity: 0.15;
  animation: michatChipBreathe 4.2s ease-in-out infinite;
  animation-delay: calc(var(--mc-chip-i, 0) * -1.3s);
}
@keyframes michatChipBreathe {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.85; }
}

/* 🌊 Ola: el borde de las fichas se enciende una tras otra, en cadena (cada
   una 0,16 s después de la anterior: con 16 fichas, la última a los 2,4 s),
   y la ola vuelve a empezar cada 3,2 s. */
.michat--chips-wave .michat-chipbtn::before {
  border: 2px solid var(--mc-chip-accent-2, var(--mc-link));
  box-shadow: 0 0 10px 1px var(--mc-chip-accent-2, var(--mc-link));
  opacity: 0;
  animation: michatChipWave 3.2s ease-in-out infinite;
  animation-delay: calc(var(--mc-chip-i, 0) * 0.16s);
}
@keyframes michatChipWave {
  0%, 26%, 100% { opacity: 0; transform: scale(1); }
  9% { opacity: 1; transform: scale(1.02, 1.1); }
}

/* Al elegir una ficha se ve como en clean: se rellena con su color, salta y
   suelta su onda (michat-chipburst), sin el adorno encima. */
.michat--chips-pulse .michat-chipbtn.is-selected::before,
.michat--chips-pulse .michat-chipbtn.is-selected::after,
.michat--chips-comet .michat-chipbtn.is-selected::before,
.michat--chips-breathe .michat-chipbtn.is-selected::before,
.michat--chips-wave .michat-chipbtn.is-selected::before {
  animation: none;
  opacity: 0;
}
/* Fuera de la vista, en pausa (no gasta batería): la raíz lleva
   michat-anim-paused (widget.js crea su observador con estos estilos). */
.michat-anim-paused.michat--chips-pulse .michat-chipbtn::before,
.michat-anim-paused.michat--chips-pulse .michat-chipbtn::after,
.michat-anim-paused.michat--chips-comet .michat-chipbtn::before,
.michat-anim-paused.michat--chips-breathe .michat-chipbtn::before,
.michat-anim-paused.michat--chips-wave .michat-chipbtn::before {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .michat--chips-pulse .michat-chipbtn::before,
  .michat--chips-pulse .michat-chipbtn::after,
  .michat--chips-comet .michat-chipbtn::before,
  .michat--chips-breathe .michat-chipbtn::before,
  .michat--chips-wave .michat-chipbtn::before {
    animation: none !important;
  }
  /* Quietos y a la vista: un aro tenue por fuera del borde (Latido), el
     halo a media luz (Respiración) y el borde a medio encender (Ola); el
     Cometa se queda con su luz parada. */
  .michat--chips-pulse .michat-chipbtn::before { opacity: 0.5; transform: scale(1.02, 1.12); }
  .michat--chips-pulse .michat-chipbtn::after { opacity: 0; }
  .michat--chips-breathe .michat-chipbtn::before { opacity: 0.5; }
  .michat--chips-wave .michat-chipbtn::before { opacity: 0.45; }
}

/* ── Fichas en temas OSCUROS (v3.0.15, revisados uno a uno) ──
   Sobre el fondo del chat las fichas parecían botones negros apagados.
   Cada tema oscuro define su superficie elevada (un paso más clara que su
   burbuja IA) y una sombra que la separa del fondo; el texto conserva el
   color de acento vivo de cada ficha. */
.michat--chatgpt   { --mc-chip-surface: #4a4d5e; }
.michat--neon      { --mc-chip-surface: #1b2742; }
.michat--grok      { --mc-chip-surface: #1d2026; }
.michat--premium   { --mc-chip-surface: #232838; }
.michat--cyberpunk { --mc-chip-surface: #1c1140; }
.michat--midnight  { --mc-chip-surface: #1d2334; }
.michat--chatgpt .michat-chipbtn,
.michat--neon .michat-chipbtn,
.michat--grok .michat-chipbtn,
.michat--premium .michat-chipbtn,
.michat--cyberpunk .michat-chipbtn,
.michat--midnight .michat-chipbtn {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* Grok usa blanco como color de usuario: como acento de ficha es ilegible
   sobre superficie oscura solo en el estado seleccionado (fondo blanco →
   el texto debe oscurecerse). */
.michat--grok .michat-chipbtn.is-selected { color: #0a0a0a; }

/* Aurora pinta un degradado vivo y su --mc-back (violeta, solo el color de
   respaldo del degradado) volvía las fichas oscuras. Superficie clara tipo
   cristal, a juego con sus burbujas (v3.0.16). */
.michat--aurora { --mc-chip-surface: rgba(255, 255, 255, 0.92); }

/* WhatsApp + captura de leads */
.michat-leadbox {
  margin: 8px 38px 10px;
  padding: 12px;
  border: 1px solid rgba(39, 104, 219, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
}
.michat-leadbox strong {
  display: block;
  color: #1d2330;
  margin: 8px 0 4px;
}
.michat-leadbox p {
  margin: 0 0 8px;
  color: #5b6270;
  font-size: 0.9em;
}
.michat-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff !important;
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: 0 5px 14px rgba(22, 163, 74, 0.25);
}
.michat-leadform {
  display: grid;
  gap: 7px;
}
.michat-leadform input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d5d9e4;
  border-radius: 9px;
  padding: 7px 10px;
  font: inherit;
  background: #fff;
}
.michat-leadform button {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  background: var(--mc-user);
  color: var(--mc-user-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.michat-leadform.is-sent input,
.michat-leadform.is-sent button { display: none; }
.michat-leadstatus {
  font-size: 0.86em;
  color: #32613f;
  min-height: 18px;
}

/* Botón enviar: micro-interacciones. */
.michat-send { transition: filter 0.15s, transform 0.12s, box-shadow 0.15s; }
.michat-send:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18); }
.michat-send:active { transform: scale(0.95); }

/* Burbuja flotante: flota suavemente y emite un anillo de pulso. */
.michat-bubblebtn {
  animation: michatFloat 3.2s ease-in-out infinite;
  position: relative;
}
.michat-bubblebtn::before {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.28), transparent 58%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  box-shadow: inset 0 1px 5px rgba(255, 255, 255, 0.42);
  pointer-events: none;
}
.michat-bubblebtn::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--mc-launcher-a, var(--mc-header, #2831dc)); /* v3.0.51 (30-oct-2026): color del chat */
  opacity: 0;
  animation: michatRing 2.6s ease-out infinite;
}
.michat-bubblebtn img {
  position: relative;
  z-index: 1;
}
@keyframes michatFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes michatRing {
  0% { transform: scale(0.9); opacity: 0.55; }
  70%, 100% { transform: scale(1.45); opacity: 0; }
}

/* Ventana del popup: se abre creciendo desde la esquina. */
.michat--window.michat--open {
  animation: michatWindowIn 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) both;
  transform-origin: bottom right;
}
.michat-popup--left .michat--window.michat--open { transform-origin: bottom left; }
@keyframes michatWindowIn {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Avatar de cabecera: saluda con un latido suave al cargar. */
.michat-header-avatar { animation: michatAvatarHello 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.2s; }
@keyframes michatAvatarHello {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.michat-leadbox {
  margin-left: 26px;
  margin-right: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.michat--compact .michat-leadbox {
  margin-left: 4px;
  margin-right: 4px;
}
.michat-wa {
  position: relative;
  overflow: hidden;
  width: min(100%, 430px);
  margin: 2px auto 4px;
  padding: 0 20px;
  background: linear-gradient(135deg, #16a34a, #22c55e, #0f9f46);
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.32);
  transform-origin: center;
  animation: michatWaPulse 2.2s ease-in-out infinite;
}
.michat-wa::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 36%, rgba(255,255,255,0.48) 47%, transparent 60% 100%);
  transform: translateX(-130%);
  animation: michatWaShine 2.6s ease-in-out infinite;
}
.michat-wa:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 24px rgba(22, 163, 74, 0.44);
}

@media (max-width: 480px) {
  .michat-chips {
    padding: 0 0 6px;
    gap: 7px;
  }
  .michat-chipbtn {
    flex: 1 1 calc(50% - 7px);
    min-width: 132px;
    padding: 8px 10px;
  }
  .michat-leadbox {
    margin: 6px 4px 8px;
    padding: 10px;
  }
  .michat-wa {
    min-height: 42px;
    padding: 0 14px;
  }
}

@supports (height: 100svh) {
  @media (max-width: 480px) {
    .michat { height: min(86svh, 760px); }
    .michat--window { height: min(88svh, 780px); }
  }
}

@keyframes michatWaPulse {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 8px 18px rgba(22, 163, 74, 0.32); }
  50% { transform: translateY(-1px) scale(1.025); box-shadow: 0 12px 28px rgba(22, 163, 74, 0.55); }
}
@keyframes michatWaShine {
  0%, 50% { transform: translateX(-130%); opacity: 0; }
  62% { opacity: 1; }
  100% { transform: translateX(130%); opacity: 0; }
}

.michat-clear:disabled {
  opacity: 0.42;
  cursor: wait;
  pointer-events: none;
  transform: none;
}

@media (min-width: 481px) {
  .michat-chips {
    align-self: center;
    max-width: 650px;
    padding-left: 0;
    padding-right: 0;
    gap: 7px 10px;
  }
  .michat-chipbtn { flex: 0 1 auto; }
}

.michat-chips--after-response {
  animation: michatQuickReplyGroup 0.85s ease both;
}
.michat-chips--after-response .michat-chipbtn {
  animation-name: michatChipReplyIn;
  animation-duration: 0.82s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes michatQuickReplyGroup {
  from { opacity: 0; transform: translateY(14px); filter: blur(2px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes michatChipReplyIn {
  0% { opacity: 0; transform: translateY(16px) scale(0.92); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .michat-chips {
    justify-content: center;
    align-self: stretch;
    max-width: none;
    padding: 0 4px 6px;
    gap: 8px;
  }
  .michat-chipbtn {
    flex: 0 1 auto;
    min-width: 0;
    padding: 8px 15px;
    min-height: 38px;
  }
}

/* v3.0.57 (1-nov-2026): NINGÚN HIJO DEL PANEL DE MENSAJES SE ENCOGE. En una
   columna flex con desplazamiento, un hijo que a su vez desplaza su contenido
   (overflow) tiene altura mínima 0: las dos filas deslizables de fichas de la
   3.0.56 se encogían hasta un hilo en el iPhone y en la vista previa del
   panel, y las fichas que vuelven tras una respuesta no se podían ver ni al
   maximizar. Ahora el panel se desplaza y cada mensaje, fila de fichas o
   aviso conserva su altura. */
.michat-messages > * { flex-shrink: 0; }

/* v3.0.57 (1-nov-2026): FICHAS EN UN CHAT ESTRECHO (móvil, burbuja flotante,
   inserciones angostas: modo compacto). Filas centradas que bajan solas, como
   en el escritorio, con las fichas un poco más compactas para que entren unas
   tres por fila: siempre se ven todas (sin desplazamiento horizontal). */
.michat--compact .michat-chips {
  justify-content: center;
  gap: 7px;
  padding: 2px 2px 8px;
}
.michat--compact .michat-chipbtn {
  flex: 0 1 auto;
  min-width: 0;
  padding: 7px 12px;
  min-height: 36px;
  font-size: calc(var(--mc-font-quick) - 0.5px);
}

/* v3.0.57 (1-nov-2026): FRASES BAJO LOS PUNTITOS mientras llega la respuesta
   («Buscando en el catálogo…», «Preparando tu respuesta…»). Se van con los
   puntitos en cuanto llega el primer trozo del streaming. */
.michat-msg--typing .michat-bubble {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  max-width: 100%;
}
/* Una sola línea (la burbuja no crece ni encoge al cambiar la frase) y el
   color del texto de la burbuja, atenuado: se lee en todos los temas
   (con --mc-muted, en Aurora salía blanco sobre blanco). */
.michat-typing-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--mc-ai-text);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat-typing-text { color: color-mix(in srgb, var(--mc-ai-text) 72%, transparent); }
}
.michat-typing-text.is-in { opacity: 1; transform: none; }

/* accesibilidad: respetar "reducir movimiento" */
@media (prefers-reduced-motion: reduce) {
  .michat-typing span { animation: none; opacity: 0.7; }
  .michat-msg, .michat-chipbtn,
  .michat-chipburst, .michat-wa, .michat-wa::after, .michat-bubblebtn, .michat-bubblebtn::after,
  .michat--window.michat--open, .michat-chips--after-response,
  .michat-header-avatar { animation: none !important; opacity: 1; }
  /* v3.0.61 (2026-11-05): las fichas parten de opacity: 0 en
     «.michat .michat-chipbtn» (0,2,0) y la regla de arriba (0,1,0) no le
     ganaba: con «reducir movimiento» (iPhone, o Windows con las animaciones
     apagadas) las fichas no se veían. Misma especificidad y después: gana. */
  .michat .michat-chipbtn { opacity: 1; }
  /* v3.0.63 (2026-11-14): el anillo de pulso del botón flotante descansa
     invisible (su estado de reposo). La lista de arriba lo dejaba en
     opacity: 1: un aro oscuro fijo alrededor del botón. */
  .michat-bubblebtn::after { opacity: 0; }
  .michat-bubble--streaming::after,
  .michat-bubble--streaming > p:last-child::after,
  .michat-bubble--streaming > h4:last-child::after,
  .michat-bubble--streaming > h5:last-child::after,
  .michat-bubble--streaming > ul:last-child > li:last-child::after,
  .michat-bubble--streaming > ol:last-child > li:last-child::after { animation: none !important; }
  /* v3.0.51 (30-oct-2026): mismos selectores que el indicador (último
     bloque) y con !important: las reglas del cursor y del orbe tienen más
     especificidad y, sin él, seguían parpadeando con «reducir movimiento». */
  .michat--chips-glow .michat-chipbtn::before { animation: none !important; }
  .michat--fs-animating,
  .michat--fs-animating .michat-messages { transition: none !important; }
}

/* ==================== v3.0.24: TÍTULOS Y LISTAS DEL MARKDOWN ==============
   Los modelos GPT-5 separan el temario con títulos (### Plantillas…) y a
   veces con listas numeradas. Antes se pintaban como texto plano; ahora se
   renderizan y se integran con el tema del chat. */
.michat .michat-bubble .michat-mdh {
  /* v3.0.25: títulos más discretos — el peso 800 los hacía "gritar" dentro
     de la burbuja aunque el tamaño apenas subía un 6%. Ahora destacan por
     jerarquía, no por volumen. */
  margin: 11px 0 4px;
  color: inherit;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: 0;
}
.michat .michat-bubble .michat-mdh:first-child { margin-top: 1px; }
.michat .michat-bubble h4.michat-mdh { font-size: 1.03em; }
.michat .michat-bubble h5.michat-mdh { font-size: 1em; opacity: .93; }
.michat .michat-bubble .michat-mdhr {
  height: 0;
  margin: 12px 0;
  border: 0;
  border-top: 1px solid currentColor;
  opacity: .18;
}
.michat .michat-bubble ol {
  margin: 6px 0 6px 2px;
  padding-left: 22px;
  list-style: decimal outside;
  /* v3.0.51 (30-oct-2026): las numeradas usan el tamaño de «Viñetas/listas»
     como las de viñetas (salían a 15 px y las viñetas a 13 px, y el ajuste
     no les afectaba). */
  font-size: var(--mc-font-list);
  line-height: 1.45;
}
.michat .michat-bubble ol li { margin: 3px 0; }

/* ============= v3.0.53 (31-oct-2026): ⏳ RECUPERANDO LA RESPUESTA ==========
   Si la conexión se corta (Safari minimizado en el iPhone, un proxy, PHP
   cortado), el widget ya no muestra «Ups…»: pone esta burbuja mientras
   consulta /turn y la cambia por la respuesta en cuanto el servidor la
   tiene. Usa los colores de la burbuja del bot de cada tema; el reloj de
   arena se da la vuelta despacio y el texto «respira». El texto parcial que
   ya había llegado por el stream se atenúa (michat-bubble--stale) hasta que
   la respuesta completa lo reemplaza. */
.michat .michat-msg--recovering .michat-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
}
.michat .michat-recover-ico {
  display: inline-block;
  flex-shrink: 0;
  line-height: 1;
  animation: michatRecoverFlip 2.4s cubic-bezier(.65, 0, .35, 1) infinite;
}
.michat .michat-recover-text {
  animation: michatRecoverBreath 2.4s ease-in-out infinite;
}
@keyframes michatRecoverFlip {
  0%, 38% { transform: rotate(0deg); }
  50%, 88% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
@keyframes michatRecoverBreath {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.michat .michat-bubble--stale {
  opacity: 0.62;
  transition: opacity 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
  .michat .michat-recover-ico,
  .michat .michat-recover-text { animation: none !important; opacity: 1; }
  .michat .michat-bubble--stale { transition: none; }
}

/* ======================================== v3.0.57 (1-nov-2026) ANIMACIONES
   De la cabecera («Animar la cabecera») y del borde de todo el chat («Animar
   el borde del chat»), cada una con su interruptor y varias para elegir. Son
   capas translúcidas sobre los colores del tema (que no se tocan): el acento
   (--mc-user), el enlace (--mc-link) y la franja (--mc-header). Fuera de la
   vista se pausan (michat-anim-paused, widget.js) y con «reducir movimiento»
   el chat se ve quieto. */
.michat {
  --mc-anim-a: var(--mc-user);
  --mc-anim-b: var(--mc-link);
  --mc-anim-c: var(--mc-header);
  --mc-anim-light: rgba(255, 255, 255, 0.42);
  --mc-anim-spark: rgba(255, 255, 255, 0.95);
}
/* Cabecera clara: las luces toman el acento del tema (el blanco no se vería)
   y el borde que fluye no usa la franja casi blanca. */
.michat--messages,
.michat--glass {
  --mc-anim-c: var(--mc-user);
  --mc-anim-light: color-mix(in srgb, var(--mc-user) 30%, transparent);
  --mc-anim-spark: color-mix(in srgb, var(--mc-user) 85%, transparent);
}
/* Aurora usa un acento casi transparente: el borde toma sus violetas. */
.michat--aurora {
  --mc-anim-a: #8b5cf6;
  --mc-anim-b: #f0abfc;
}

/* ----- Cabecera: las capas van debajo del avatar, el nombre y los botones. */
.michat-hanim .michat-header {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.michat-hanim .michat-header > * {
  position: relative;
  z-index: 1;
}
.michat-hanim .michat-header::before,
.michat-hanim .michat-header::after {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

/* ✨ Destello: una luz cruza la franja cada pocos segundos y el avatar brilla. */
.michat-hanim-brillo .michat-header::after {
  content: '';
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 38%;
  background: linear-gradient(100deg, transparent 0%, var(--mc-anim-light) 50%, transparent 100%);
  transform: translateX(-130%) skewX(-18deg);
  /* v3.0.63 (2026-11-14): con el MISMO retardo (0,8 s) que el brillo del
     avatar (michatAvatarGlint, abajo). La luz salía sin retardo y el avatar
     con 0,8 s: brillaba 0,8 s después de que la luz le pasara por encima,
     cuando ya salía por el otro lado (medido: la luz sobre el avatar a los
     3,5 s y el aro a los 4,3 s). Ahora el aro se enciende justo cuando la luz
     lo cruza (el 62 % de los dos ciclos). */
  animation: michatHeadShine 5.6s ease-in-out 0.8s infinite;
}
@keyframes michatHeadShine {
  0%, 52% { transform: translateX(-130%) skewX(-18deg); }
  82%, 100% { transform: translateX(300%) skewX(-18deg); }
}
.michat-hanim-brillo .michat-header-avatar,
.michat-hanim-chispas .michat-header-avatar {
  animation: michatAvatarHello 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.2s, michatAvatarGlint 5.6s ease-in-out 0.8s infinite;
}
@keyframes michatAvatarGlint {
  0%, 50%, 78%, 100% { box-shadow: 0 0 0 0 transparent; }
  62% { box-shadow: 0 0 0 3px var(--mc-anim-light), 0 0 10px var(--mc-anim-light); }
}

/* 🌈 Degradado vivo: bandas de luz y de los colores del tema se deslizan. */
.michat-hanim-degradado .michat-header::before {
  content: '';
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, var(--mc-anim-light) 16%, transparent 32%, color-mix(in srgb, var(--mc-anim-b) 55%, transparent) 50%, transparent 68%, var(--mc-anim-light) 84%, transparent 100%);
  background-size: 300% 100%;
  opacity: 0.85;
  animation: michatHeadFlow 9s ease-in-out infinite alternate;
}
@keyframes michatHeadFlow {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* 🌌 Aurora: luces suaves flotan detrás del nombre. */
.michat-hanim-aurora .michat-header::before {
  content: '';
  inset: -60% -20%;
  background:
    radial-gradient(38% 60% at 22% 50%, var(--mc-anim-light), transparent 70%),
    radial-gradient(34% 55% at 74% 40%, color-mix(in srgb, var(--mc-anim-b) 50%, transparent), transparent 70%),
    radial-gradient(30% 50% at 50% 82%, color-mix(in srgb, var(--mc-anim-a) 42%, transparent), transparent 70%);
  animation: michatHeadAurora 12s ease-in-out infinite alternate;
}
@keyframes michatHeadAurora {
  0% { transform: translate3d(-8%, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(6%, -6%, 0) rotate(8deg) scale(1.08); }
  100% { transform: translate3d(10%, 4%, 0) rotate(-6deg) scale(1); }
}

/* 💓 Latido: el avatar late con un halo y el nombre respira. */
.michat-hanim-pulso .michat-header-avatar {
  animation: michatAvatarHello 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both 0.2s, michatAvatarBeat 2.8s ease-in-out 0.8s infinite;
}
@keyframes michatAvatarBeat {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--mc-anim-light); }
  12% { transform: scale(1.08); }
  24% { transform: scale(1); }
  36% { transform: scale(1.05); }
  48% { transform: scale(1); }
  70%, 100% { transform: scale(1); box-shadow: 0 0 0 9px transparent; }
}
.michat-hanim-pulso .michat-header-name {
  animation: michatNameBreath 2.8s ease-in-out 0.8s infinite;
}
/* Neón y Cyberpunk ya dan brillo al nombre (text-shadow de su cabecera): la
   respiración se lo quitaría casi todo el tiempo, así que allí solo late el avatar. */
.michat--neon.michat-hanim-pulso .michat-header-name,
.michat--cyberpunk.michat-hanim-pulso .michat-header-name { animation: none; }
@keyframes michatNameBreath {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 12px var(--mc-anim-light); }
}

/* 🎇 Chispas: puntos de luz que titilan sobre la franja (dos tandas alternadas). */
.michat-hanim-chispas .michat-header::before,
.michat-hanim-chispas .michat-header::after {
  content: '';
  inset: 0;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  opacity: 0;
  animation: michatSparkle 3.2s ease-in-out infinite;
}
.michat-hanim-chispas .michat-header::before {
  background-image:
    radial-gradient(circle, var(--mc-anim-spark) 0 1.4px, transparent 2.6px),
    radial-gradient(circle, var(--mc-anim-spark) 0 1px, transparent 2.2px),
    radial-gradient(circle, var(--mc-anim-spark) 0 1.8px, transparent 3px),
    radial-gradient(circle, var(--mc-anim-spark) 0 1px, transparent 2.2px),
    radial-gradient(circle, var(--mc-anim-spark) 0 1.4px, transparent 2.6px);
  background-position: 16% 26%, 38% 74%, 61% 20%, 79% 70%, 93% 34%;
}
.michat-hanim-chispas .michat-header::after {
  background-image:
    radial-gradient(circle, var(--mc-anim-spark) 0 1px, transparent 2.2px),
    radial-gradient(circle, var(--mc-anim-spark) 0 1.6px, transparent 2.8px),
    radial-gradient(circle, var(--mc-anim-spark) 0 1px, transparent 2.2px),
    radial-gradient(circle, var(--mc-anim-spark) 0 1.4px, transparent 2.6px);
  background-position: 27% 62%, 49% 30%, 70% 58%, 86% 18%;
  animation-delay: 1.6s;
}
@keyframes michatSparkle {
  0%, 100% { opacity: 0; }
  45%, 55% { opacity: 1; }
}

/* ----- Borde de todo el chat: un anillo encima del contenido (sin clics). */
.michat-banim:not(.michat--window):not(.michat--fullscreen) { position: relative; }
/* El anillo queda dentro del chat: nunca se pinta sobre un menú fijo de la página. */
.michat-banim { isolation: isolate; }
.michat-banim::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 40;
}
.michat-banim-flujo::after,
.michat-banim-cometa::after {
  padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* 🌊 Borde que fluye: el degradado del tema recorre el borde (como las fichas). */
.michat-banim-flujo { border-color: transparent; }
.michat-banim-flujo::after {
  background: linear-gradient(90deg, var(--mc-anim-a), var(--mc-anim-b), var(--mc-anim-c), var(--mc-anim-a));
  background-size: 300% 100%;
  animation: michatBorderFlow 7s linear infinite;
}
/* Con una banda clara del mismo acento el movimiento se nota también en los
   temas de un solo color (la familia oferta: naranjas muy parecidos). */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat-banim-flujo::after {
    background-image: linear-gradient(90deg, var(--mc-anim-a), var(--mc-anim-b), color-mix(in srgb, var(--mc-anim-a) 28%, #ffffff), var(--mc-anim-c), var(--mc-anim-a));
  }
}
@keyframes michatBorderFlow {
  from { background-position: 0% 50%; }
  to { background-position: -150% 50%; }
}

/* ☄️ Cometa: una luz del color del tema da la vuelta por el borde. */
@property --mc-comet-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
/* Sin color-mix (iOS 15) el anillo no se pinta: se queda el borde del tema. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat-banim-cometa { border-color: transparent; }
}
.michat-banim-cometa::after {
  /* Sin @property (Safari < 16.4) el ángulo vale 0: el anillo sale quieto. */
  --mc-comet-angle: 0deg;
  background: conic-gradient(from var(--mc-comet-angle),
    color-mix(in srgb, var(--mc-anim-a) 22%, transparent) 0deg 250deg,
    var(--mc-anim-a) 300deg,
    var(--mc-anim-b) 335deg,
    color-mix(in srgb, var(--mc-anim-b) 40%, #ffffff) 350deg,
    color-mix(in srgb, var(--mc-anim-a) 22%, transparent) 360deg);
  animation: michatComet 4.5s linear infinite;
}
@keyframes michatComet {
  to { --mc-comet-angle: 360deg; }
}

/* 🔆 Resplandor: un halo del color del tema respira alrededor del chat. */
.michat-banim-resplandor:not(.michat--fullscreen) {
  animation: michatBorderGlow 3.6s ease-in-out infinite;
}
@keyframes michatBorderGlow {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--mc-anim-a) 35%, transparent), 0 6px 18px color-mix(in srgb, var(--mc-anim-a) 14%, transparent); }
  50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--mc-anim-a) 70%, transparent), 0 0 28px 4px color-mix(in srgb, var(--mc-anim-a) 38%, transparent); }
}
/* La burbuja flotante conserva su animación de apertura (las dos reglas
   declaran «animation» en la misma raíz y ganaría la del resplandor). */
.michat--window.michat--open.michat-banim-resplandor:not(.michat--fullscreen) {
  animation: michatWindowIn 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) both, michatBorderGlow 3.6s ease-in-out 0.3s infinite;
}
.michat-anim-paused.michat--window.michat--open.michat-banim-resplandor:not(.michat--fullscreen) {
  animation-play-state: running, paused !important;
}
/* v3.0.57, revisión: sin color-mix (iOS 15 a 16.1) cada sombra del halo es
   inválida y la animación dejaba el chat SIN su sombra propia (la de la
   ventana flotante o la del tema): ahí no se anima y queda la del tema. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .michat-banim-resplandor:not(.michat--fullscreen) { animation: none; }
  .michat--window.michat--open.michat-banim-resplandor:not(.michat--fullscreen) {
    animation: michatWindowIn 0.3s cubic-bezier(0.34, 1.3, 0.64, 1) both;
  }
  .michat-remote-canvas .michat-banim-resplandor:not(.michat--fullscreen)::after { animation: none; }
}
/* En el chat remoto (iframe de borde a borde) el halo exterior caería fuera
   de la vista: allí el resplandor se dibuja hacia dentro. */
.michat-remote-canvas .michat-banim-resplandor:not(.michat--fullscreen) { animation: none; }
.michat-remote-canvas .michat-banim-resplandor:not(.michat--fullscreen)::after {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--mc-anim-a) 70%, transparent), inset 0 0 18px 2px color-mix(in srgb, var(--mc-anim-a) 30%, transparent);
  opacity: 0.35;
  animation: michatBorderBeat 3.6s ease-in-out infinite;
}

/* 💗 Latido del borde: el borde se enciende y se apaga despacio. */
.michat-banim-latido::after {
  border: 2px solid var(--mc-anim-a);
  opacity: 0.25;
  animation: michatBorderBeat 2.6s ease-in-out infinite;
}
@keyframes michatBorderBeat {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* Fuera de la vista, en pausa (no gasta batería). */
.michat-anim-paused .michat-header::before,
.michat-anim-paused .michat-header::after,
.michat-anim-paused .michat-header-avatar,
.michat-anim-paused .michat-header-name,
.michat-anim-paused.michat-banim::after,
.michat-anim-paused.michat-banim-resplandor {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .michat-hanim .michat-header::before,
  .michat-hanim .michat-header::after { animation: none !important; content: none !important; }
  .michat-hanim .michat-header-avatar,
  .michat-hanim .michat-header-name,
  .michat-banim::after,
  .michat-banim-resplandor { animation: none !important; }
  .michat-banim-latido::after { opacity: 0.6; }
}

/* ======================= v3.0.59 (2026-11-02): ENVIAR DE LA FAMILIA OFERTA
   El Enviar de los cinco temas Oferta (michatBuyPulse y michatBuyPulseAmbar)
   latía sin fin: ahora se pausa con el chat fuera de la vista (la misma clase
   michat-anim-paused que pone widget.js; su observador también vigila los
   temas michat--oferta*) y se queda quieto con «reducir movimiento», con su
   sombra de siempre. */
.michat-anim-paused .michat-send {
  animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
  .michat .michat-send { animation: none !important; }
}

/* =================== v3.0.66 (2026-11-21), etapa M3: 🔥 LA CINTA DE OFERTA
   SPEC-v3.0.66 §9 (decisión 11). La de un asistente de 📣 Marketing con una
   oferta vigente (widget.js la pinta solo entonces): una franja hija de .michat
   bajo la cabecera y antes de los mensajes, que no se encoge (flex-shrink: 0:
   con la conversación llena se encogen los mensajes, nunca ella ni la caja de
   escribir). Sus colores son el par de la burbuja del chatbot, el que la 3.0.65
   eligió para las tarjetas de los adjuntos por su contraste en los 43 temas
   (--mc-ai-text sobre --mc-ai, compuesto sobre --mc-back: un --mc-ai
   translúcido no deja ver lo de detrás; nunca --mc-muted, que falla en 16).
   «Comprar» lleva el par INVERTIDO (el mismo contraste); «Copiar» y «✕», el
   aspecto del botón de la voz (transparentes, con su borde en currentColor) y
   todos, su anillo de foco y 24 × 24 px como mínimo. A 320 px se parte en dos
   líneas: el texto arriba y los botones juntos debajo. Sin animaciones ni
   transiciones; en colores forzados, los bordes en ButtonText y el foco en
   Highlight. Ninguna regla toca la cabecera, los mensajes ni la caja de
   escribir. widget §4599 lo calcula en los 43 temas. */
.michat .michat-offer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  padding: 6px 8px 6px 12px;
  border-bottom: 1px solid var(--mc-border);
  background: linear-gradient(var(--mc-ai), var(--mc-ai)), var(--mc-back);
  color: var(--mc-ai-text);
  font-size: var(--mc-font-list, 13px);
  line-height: 1.3;
}
.michat .michat-offer-text {
  flex: 1 1 14em;
  min-width: 0;
  margin: 0;
  color: var(--mc-ai-text);
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
.michat .michat-offer-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
}
.michat .michat-offer-code {
  min-width: 0;
  color: var(--mc-ai-text);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.michat .michat-offer-copy,
.michat .michat-offer-close,
.michat .michat-offer-buy {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.michat .michat-offer-copy,
.michat .michat-offer-close {
  background: transparent;
  color: var(--mc-ai-text);
}
.michat .michat-offer-close {
  padding: 2px 6px;
}
.michat .michat-offer-buy,
.michat .michat-offer-buy:hover,
.michat .michat-offer-buy:visited {
  background: var(--mc-ai-text);
  color: var(--mc-ai);
}
.michat .michat-offer-copy:focus-visible,
.michat .michat-offer-close:focus-visible,
.michat .michat-offer-buy:focus-visible {
  outline: 2px solid var(--mc-ai-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--mc-ai);
}
@media (forced-colors: active) {
  .michat .michat-offer { border-bottom-color: CanvasText; }
  .michat .michat-offer-copy,
  .michat .michat-offer-close,
  .michat .michat-offer-buy { border-color: ButtonText; }
  .michat .michat-offer-copy:focus-visible,
  .michat .michat-offer-close:focus-visible,
  .michat .michat-offer-buy:focus-visible { outline-color: Highlight; }
}

/* =================== v3.0.65 (2026-11-16), etapa E5: 🔊 LA VOZ DE LA FRASE FINAL
   SPEC-v3.0.65 §9.9 y §9.10. Con «📣 Modo marketing» y «Leer la frase final en
   voz alta (con karaoke)» encendidos, la frase final suena con su voz de IA y
   cada palabra se ilumina mientras suena: widget.js envuelve cada palabra en un
   .michat-kw y solo cambia la clase .michat-kw--on. El resalte NO cambia
   tamaños (sin relleno, márgenes ni bordes: el texto no se mueve al pasar de
   palabra) y su fondo es el acento del tema al 24 % sobre el fondo de la
   burbuja: el texto de la frase (--mc-ai-text) encima queda en AA en los 43
   temas (peor caso medido, 5,64:1; widget §4598 lo calcula). color-mix() solo
   dentro de su @supports: sin él, un subrayado de 3 px en el acento. Un fundido
   de 120 ms, quitado con «reducir movimiento»; en colores forzados, Highlight y
   HighlightText. El control («🔊 Escuchar» / «⏹ Detener» y la leyenda «Voz
   generada por IA») es una fila DENTRO de la burbuja, con el texto de la frase
   (contraste de la frase final, widget §4591) y un botón de 24 × 24 px o más
   con el anillo de foco del tema. Ningún selector nombra la frase final
   (.michat-bubble--close: widget §4591), ninguno toca el avatar, la columna,
   «📋 Copiar» ni la fila (widget §4587 y temas-avatares §0988) y no hay
   animaciones (widget §4589). Los adornos ::before de los temas animados ya
   llevan pointer-events: none: no tapan el botón. */
.michat .michat-kw {
  transition: background-color 0.12s ease;
}
.michat .michat-kw--on {
  color: var(--mc-ai-text);
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  text-decoration: underline;
  text-decoration-color: var(--mc-user);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat .michat-kw--on {
    background-color: color-mix(in srgb, var(--mc-user) 24%, var(--mc-ai));
    text-decoration: none;
  }
}
.michat .michat-voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
}
.michat .michat-voice-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin: 0;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: var(--mc-ai-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.michat .michat-voice-btn:focus-visible {
  outline: 2px solid var(--mc-ai-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--mc-ai);
}
.michat .michat-voice-ai {
  color: var(--mc-ai-text);
  font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .michat .michat-kw { transition: none; }
}
@media (forced-colors: active) {
  .michat .michat-kw--on { background-color: Highlight; color: HighlightText; forced-color-adjust: none; }
}

/* =================== v3.0.65 (2026-11-16), etapa E3: 📣 LOS ADJUNTOS EN EL CHAT
   SPEC-v3.0.65 §9.2-§9.10. Con «📣 Modo marketing» encendido, una respuesta
   guardada trae también las fotos, los vídeos, los documentos y los enlaces de
   su ficha (bloques «gallery» y «files»). Cada bloque es una burbuja más del
   chatbot (su fondo, su borde, su radio y los adornos del tema), sin «📋
   Copiar». Los colores salen del tema: el texto de las tarjetas y «No
   disponible», en --mc-ai-text sobre --mc-ai (nunca --mc-muted, que en 16 de
   los 43 temas queda por debajo de 4,5:1); los velos de «+N», de «▶» y de la
   duración son fijos (negro al 55-60 %: el blanco encima queda a 4,74:1 o más
   aunque la foto sea blanca). color-mix() solo dentro de su @supports. Ninguna
   regla toca el avatar, la columna, «📋 Copiar» ni la fila (widget §4587 y
   temas-avatares §0988) y no hay ningún bucle sin fin. widget §4596 lo calcula
   en los 43 temas. */
.michat .michat-msg--ai .michat-bubble.michat-bubble--media {
  width: 320px;
  max-width: 100%;
  padding: 3px;
}
.michat .michat-msg--ai .michat-bubble.michat-bubble--files {
  width: 320px;
  max-width: 100%;
  padding: 2px 12px;
}
/* El adorno de los temas animados (::before) no tapa los toques de una foto. */
.michat .michat-msg--ai .michat-bubble.michat-bubble--media::before,
.michat .michat-msg--ai .michat-bubble.michat-bubble--files::before { pointer-events: none; }

/* La cuadrícula (§9.2): 1 · 2 · 3 · 4 · «+N», con 3 px de separación y las
   esquinas de fuera con el radio de la burbuja menos su relleno. */
.michat .michat-media-grid {
  --mc-media-r: max(2px, calc(var(--mc-radius) - 3px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.michat .michat-media-grid--one { grid-template-columns: 1fr; }
.michat .michat-media-grid--three,
.michat .michat-media-grid--four,
.michat .michat-media-grid--more {
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1 / 1;
}
.michat .michat-media-item {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.michat .michat-media-grid--one > .michat-media-item { aspect-ratio: 4 / 3; }
.michat .michat-media-grid--two > .michat-media-item { aspect-ratio: 1 / 1; }
.michat .michat-media-grid--three > .michat-media-item:first-child { grid-row: 1 / span 2; }
.michat .michat-media-cell {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: rgba(127, 127, 127, 0.18);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.michat .michat-media-grid--one .michat-media-cell { border-radius: var(--mc-media-r); }
.michat .michat-media-grid--two > .michat-media-item:first-child > .michat-media-cell,
.michat .michat-media-grid--three > .michat-media-item:first-child > .michat-media-cell { border-radius: var(--mc-media-r) 0 0 var(--mc-media-r); }
.michat .michat-media-grid--two > .michat-media-item:last-child > .michat-media-cell { border-radius: 0 var(--mc-media-r) var(--mc-media-r) 0; }
.michat .michat-media-grid--three > .michat-media-item:nth-child(2) > .michat-media-cell,
.michat .michat-media-grid--four > .michat-media-item:nth-child(2) > .michat-media-cell,
.michat .michat-media-grid--more > .michat-media-item:nth-child(2) > .michat-media-cell { border-radius: 0 var(--mc-media-r) 0 0; }
.michat .michat-media-grid--three > .michat-media-item:nth-child(3) > .michat-media-cell,
.michat .michat-media-grid--four > .michat-media-item:nth-child(4) > .michat-media-cell,
.michat .michat-media-grid--more > .michat-media-item:nth-child(4) > .michat-media-cell { border-radius: 0 0 var(--mc-media-r) 0; }
.michat .michat-media-grid--four > .michat-media-item:first-child > .michat-media-cell,
.michat .michat-media-grid--more > .michat-media-item:first-child > .michat-media-cell { border-radius: var(--mc-media-r) 0 0 0; }
.michat .michat-media-grid--four > .michat-media-item:nth-child(3) > .michat-media-cell,
.michat .michat-media-grid--more > .michat-media-item:nth-child(3) > .michat-media-cell { border-radius: 0 0 0 var(--mc-media-r); }
.michat .michat-media-cell--dark { background: #111318; }
/* La miniatura: llena su casilla y entra con un fundido de 200 ms al cargar
   (widget.js le pone «is-in»); con «reducir movimiento», sin fundido. «Sin
   descarga» es una disuasión (§2.4): ni el menú de mantener pulsado del iPhone
   ni seleccionarla ni arrastrarla (el clic derecho lo cancela widget.js). */
.michat .michat-media-thumb {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.michat .michat-media-thumb.is-in { opacity: 1; }
.michat .michat-media-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}
.michat .michat-media-pill {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  pointer-events: none;
}
.michat .michat-media-more {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
/* §9.7: una foto que no carga ya no es un botón: «No disponible», con el fondo
   y el texto de la burbuja; si fallan todas, una sola línea. */
.michat .michat-media-cell--gone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  cursor: default;
  background: var(--mc-ai);
  color: var(--mc-ai-text);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.4);
  font-size: 12px;
  line-height: 1.3;
}
.michat .michat-media-video--gone { aspect-ratio: 16 / 9; }
.michat .michat-media-gone-icon { display: block; flex: 0 0 auto; }
.michat .michat-media-gone-all {
  margin: 0;
  padding: 7px 11px;
  color: var(--mc-ai-text);
  font-size: 14px;
}

/* §9.3: un vídeo solo, en el sitio: su portada con «▶» (56 px) y «⛶» (36 px)
   arriba a la derecha; los controles nativos aparecen al pulsar «▶». */
.michat .michat-media-video {
  position: relative;
  overflow: hidden;
  border-radius: max(2px, calc(var(--mc-radius) - 3px));
  background: #000000;
  aspect-ratio: 16 / 9;
}
.michat .michat-media-player {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: contain;
  background: #000000;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.michat .michat-media-play,
.michat .michat-media-expand {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.michat .michat-media-play {
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  font-size: 22px;
}
.michat .michat-media-expand {
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
}
.michat .michat-media-video .michat-media-pill { bottom: 8px; }
.michat .michat-media-play[hidden],
.michat .michat-media-pill[hidden] { display: none; }

/* §9.5: las tarjetas de los documentos y los enlaces, una bajo otra, con una
   línea de 1 px entre ellas (decorativa). Todo su texto, en --mc-ai-text
   (también el tipo y el peso, a 12 px): gana a las reglas de los enlaces de la
   burbuja (el color --mc-link y el subrayado). */
.michat .michat-files {
  margin: 0;
  padding: 0;
  list-style: none;
}
.michat .michat-files-item {
  margin: 0;
  padding: 0;
  list-style: none;
}
.michat .michat-files-item + .michat-files-item { border-top: 1px solid rgba(127, 127, 127, 0.25); }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .michat .michat-files-item + .michat-files-item { border-top-color: color-mix(in srgb, var(--mc-ai-text) 18%, transparent); }
}
.michat .michat-msg--ai .michat-bubble .michat-files-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 0;
  border-radius: 6px;
  color: var(--mc-ai-text);
  text-decoration: none;
}
.michat .michat-msg--ai .michat-bubble .michat-files-card:hover .michat-files-title { text-decoration: underline; }
.michat .michat-files-icon {
  display: block;
  flex: 0 0 auto;
  width: 32px;
  height: 40px;
}
.michat .michat-files-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.michat .michat-files-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--mc-ai-text);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
.michat .michat-files-meta {
  color: var(--mc-ai-text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
.michat .michat-files-go {
  flex: 0 0 auto;
  color: var(--mc-ai-text);
  font-size: 16px;
  line-height: 1;
}
/* Lo de los paréntesis («(se abre en una pestaña nueva)», «(se descarga)»):
   oculto a la vista y se lee. */
.michat .michat-files-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* El anillo de foco de las casillas, del vídeo y de las tarjetas: el texto
   del chatbot sobre su fondo (≥ 7,93:1 en los 43 temas). */
.michat .michat-media-cell:focus-visible,
.michat .michat-media-play:focus-visible,
.michat .michat-media-expand:focus-visible,
.michat .michat-media-player:focus-visible,
.michat .michat-msg--ai .michat-bubble .michat-files-card:focus-visible {
  outline: 2px solid var(--mc-ai-text);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--mc-ai);
}

@media (prefers-reduced-motion: reduce) {
  .michat .michat-media-thumb { opacity: 1; transition: none; }
}
/* Colores forzados (alto contraste de Windows): un contorno en cada casilla,
   los velos con los colores del sistema y los iconos, a su cuenta. */
@media (forced-colors: active) {
  .michat .michat-media-cell { outline: 1px solid CanvasText; }
  .michat .michat-media-badge,
  .michat .michat-media-pill,
  .michat .michat-media-more,
  .michat .michat-media-play,
  .michat .michat-media-expand { background: Canvas; color: CanvasText; }
  .michat .michat-files-icon,
  .michat .michat-media-gone-icon { forced-color-adjust: auto; }
}

/* ======================== v3.0.65 (2026-11-16), etapa E3: EL VISOR (§9.4) ===
   Fuera de .michat, colgado de <body> (ninguna variable del tema llega aquí):
   paleta fija y oscura (fondo #0b0d12 al 96 %, texto #ffffff y lo secundario
   en #cbd5e1; con cualquier página debajo, más de 13:1), sus estilos de base y
   sus botones con reglas propias, para verse igual en el sitio, en la página
   remota y en la vista previa del panel. Por encima del chat maximizado
   (999999) y de la ventana de la burbuja (99991). widget §4597 lo vigila. */
.michat-viewer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: rgba(11, 13, 18, 0.96);
  color: #ffffff;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: contain;
}
.michat-viewer,
.michat-viewer *,
.michat-viewer *::before,
.michat-viewer *::after { box-sizing: border-box; }
.michat-viewer [hidden] { display: none !important; }
.michat-viewer-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 10px 6px 16px;
  transition: opacity 0.2s ease;
}
.michat-viewer-count {
  flex: 0 0 auto;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.michat-viewer-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.michat-viewer-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.michat-viewer-btn,
.michat-viewer-nav {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.michat-viewer-btn {
  flex: 0 0 auto;
  padding: 0 14px;
  border-radius: 999px;
}
.michat-viewer-btn:hover,
.michat-viewer-nav:hover { background: rgba(255, 255, 255, 0.2); }
.michat-viewer-stage {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 68px;
  overflow: hidden;
  touch-action: none;
}
.michat-viewer-media {
  display: block;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.michat-viewer-img {
  width: auto;
  height: auto;
}
.michat-viewer-video {
  width: 100%;
  height: 100%;
  background: #000000;
}
.michat-viewer--real .michat-viewer-stage {
  display: block;
  padding: 0;
  overflow: auto;
  touch-action: auto;
}
.michat-viewer--real .michat-viewer-img {
  max-width: none;
  max-height: none;
  margin: 0 auto;
}
.michat-viewer-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border-radius: 50%;
  font-size: 28px;
}
.michat-viewer-prev { left: 12px; }
.michat-viewer-next { right: 12px; }
.michat-viewer-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.michat-viewer-caption {
  flex: 0 0 auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  padding: 8px 16px 14px;
  color: #cbd5e1;
  text-align: center;
  overflow-wrap: break-word;
  overflow-wrap: anywhere;
}
.michat-viewer-gone {
  margin: 0;
  color: #cbd5e1;
  font-size: 16px;
  text-align: center;
}
.michat-viewer :focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}
/* En el móvil, las flechas abajo (al alcance del pulgar) y la barra de
   arriba, que se oculta a los 3 s y vuelve al tocar. */
@media (max-width: 600px) {
  .michat-viewer-stage { padding: 4px; }
  .michat-viewer-nav {
    top: auto;
    bottom: 12px;
    margin-top: 0;
  }
  .michat-viewer-prev { left: 16px; }
  .michat-viewer-next { right: 16px; }
  .michat-viewer-caption { padding-bottom: 68px; }
  .michat-viewer-closetext { display: none; }
  .michat-viewer-btn { padding: 0 12px; }
}
.michat-viewer--idle .michat-viewer-bar {
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .michat-viewer-bar { transition: none; }
}
@media (forced-colors: active) {
  .michat-viewer { forced-color-adjust: auto; }
  .michat-viewer-btn,
  .michat-viewer-nav { border: 1px solid ButtonText; }
}
