/* Story 18.6 (Bot de apoyo), Fase 4: el widget (templates/components/support_bot.html.twig, public/tml/support-bot.js).
   Estilos propios con el prefijo tml-bot-: sirven igual en los layouts nuevos (tml.css) y en los viejos (Bootstrap).
   - Esquina inferior derecha; sube con el aviso de abajo que este visible (instalar la app, notificaciones o huella:
     --bottom-notice-offset, de public/js/bottom-notices.js).
   - z-index 1030: por debajo del fondo de los modales de Bootstrap (1040), del menu del celular (1100) y del aviso de
     cookies. Con un recorrido guiado abierto (html.tml-guide-on, tml.css) baja a 999, bajo el escudo de la guia
     (1000-1003), para no tapar su tarjeta (#816); abierto (.tml-bot-open, 7000) queda encima de todo.
   - El Triple Apoyo (contact/triple_apoyo_chat.css) sigue en right: 90px; no se toca.
   - 18/10: con el boton "Ayuda" la burbuja de Triple Apoyo se oculta y su chat se abre desde el menu (ver abajo).

   Capas de lo que flota abajo (#922-#931). Al tocar una, revisar las demas. "Sube" = suma --bottom-notice-offset.
   | Elemento                               | Lado      | z-index (red social F7)       | Sube | Con recorrido abierto  |
   | Avisos de abajo (bottom-notices.js)    | ancho     | 2000                          | -    | ocultos                |
   | "Guia rapida" (quick-guide.css)        | izquierda | 1055                          | si   | -                      |
   | Ayuda (.tml-bot, este archivo)         | derecha   | 1030 (6500); abierto 7000     | si   | 999, bajo el escudo    |
   | "Retomar el Carrusel" (carousel_resume)| izquierda | 1030                          | si   | oculto                 |
   | "Tu guia" (guide-button.css)           | izquierda | 1020, ventana 1035 (6500/6510)| si   | oculto                 |
   | Recorrido: escudo/anillo/tarjeta/aviso | centro    | 1000-1003 (tml.css)           | aviso| -                      |
   | "Ver recorrido" (.tml-guide-fab)       | izquierda | 900                           | si   | oculto                 |
   En la red social, con las pestanas al pie (tml-app.css), Ayuda y "Tu guia" suben 80px por encima de ellas.
   Reserva al final de la pagina para Ayuda (abajo, #315/#485): 108px (96px hasta 600px) + lo que sube; en el body, o
   dentro de .tml-footer si la pagina tiene pie (#930); en las tarjetas de acceso, en .tml-auth-main (#929). */
.tml-bot {
  --tml-bot-primary: #1E40AF;
  --tml-bot-deep: #172554;
  --tml-bot-soft: #EEF3FF;
  --tml-bot-growth: #10B981;
  --tml-bot-ink: #0F172A;
  --tml-bot-muted: #475569;
  --tml-bot-line: #E2E8F0;
  --tml-bot-bg: #F7F9FC;
  --tml-bot-danger: #B42318;
  --tml-bot-bottom: calc(20px + var(--bottom-notice-offset, 0px));
  /* El diametro de la esfera del boton "Ayuda" (2026-11-04): el menu y el panel se abren encima de ella */
  --tml-bot-size: 76px;
  position: fixed;
  right: 20px;
  bottom: var(--tml-bot-bottom);
  z-index: 1030;
  font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--tml-bot-ink);
  text-align: left;
}
.tml-bot *, .tml-bot *::before, .tml-bot *::after { box-sizing: border-box; }
.tml-bot[hidden], .tml-bot [hidden] { display: none !important; }
.tml-bot p { margin: 0; }
.tml-bot button { font-family: inherit; }

/* El boton "Ayuda" (18/10, Nelson, artefacto "Botón único de ayuda"; reemplaza las 2 burbujas de la Story 9.12).
   2026-11-04 (Cecy y Luis, docs/bmad/ux-designs/boton-asistente-ia-final.html): una esfera con un robot y un anillo verde
   que late, con la etiqueta "Ayuda" pegada a su izquierda; el mismo diseño en todos los anchos (antes, desde 768px, el
   texto iba dentro del boton). Abierto (menu, bot o equipo), la esfera muestra una X, sin latido ni parpadeo, y la
   etiqueta dice "Cerrar". La posicion y las capas las sigue dando .tml-bot (no las del mockup: fixed y z-index 9999). */
.tml-bot-bubble { position: relative; z-index: 1; display: inline-flex; flex-direction: row-reverse; align-items: center; padding: 0; border: 0; background: none; color: #FFFFFF; cursor: pointer; font-family: inherit; }
.tml-bot-bubble:focus { outline: none; }
.tml-bot-bubble:focus-visible { outline: 3px solid var(--tml-bot-growth); outline-offset: 6px; border-radius: 999px; }
.tml-bot .tml-ia-orb { position: relative; z-index: 1; flex: none; width: var(--tml-bot-size); height: var(--tml-bot-size); border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #2D56D6 0%, var(--tml-bot-primary) 35%, var(--tml-bot-deep) 85%); box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 6px rgba(16, 185, 129, .55), 0 10px 28px rgba(23, 37, 84, .45), 0 0 26px rgba(16, 185, 129, .35); transition: transform .2s; }
.tml-bot .tml-ia-orb > svg { grid-area: 1 / 1; }
.tml-bot .tml-ia-robot { width: 80%; height: 80%; overflow: visible; filter: drop-shadow(0 0 2.5px rgba(147, 197, 253, .75)); }
.tml-bot .tml-ia-orb::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--tml-bot-growth); pointer-events: none; animation: tml-ia-pulse 2s ease-out infinite; }
.tml-bot .tml-ia-eyes { transform-box: fill-box; transform-origin: center; animation: tml-ia-blink 4s infinite; }
.tml-bot-bubble:hover .tml-ia-orb { transform: scale(1.05); }
.tml-bot-tag { white-space: nowrap; margin-right: -20px; padding: 7px 28px 7px 16px; border-radius: 999px 0 0 999px; background: #D1FAE5; color: #047857; border: 2px solid var(--tml-bot-growth); font-size: 15px; font-weight: 700; box-shadow: 0 6px 16px rgba(23, 37, 84, .15); animation: tml-ia-glow 2s ease-in-out infinite; }
.tml-bot-icon-close, .tml-bot-tag-close { display: none; }
.tml-bot-any-open .tml-ia-robot, .tml-bot-any-open .tml-bot-tag-help { display: none; }
.tml-bot-any-open .tml-bot-icon-close { display: block; width: 30px; height: 30px; }
.tml-bot-any-open .tml-bot-tag-close { display: inline; }
.tml-bot-any-open .tml-ia-orb::after { display: none; }
.tml-bot-any-open .tml-bot-tag { animation: none; }
/* Los mensajes sin leer del equipo: en la esquina de arriba a la derecha de la esfera */
.tml-bot-unseen { position: absolute; z-index: 2; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; border: 2px solid #FFFFFF; background: var(--tml-bot-danger); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.tml-bot-any-open .tml-bot-unseen { display: none; }
@keyframes tml-ia-pulse { 0% { transform: scale(1); opacity: .85; } 70%, 100% { transform: scale(1.4); opacity: 0; } }
@keyframes tml-ia-glow { 0%, 100% { box-shadow: 0 6px 16px rgba(23, 37, 84, .15); } 50% { box-shadow: 0 6px 16px rgba(23, 37, 84, .15), 0 0 14px rgba(16, 185, 129, .7); } }
@keyframes tml-ia-blink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.1); } }
@media (max-width: 600px) {
  .tml-bot { --tml-bot-size: 64px; }
}

/* Story 18.11: el mensaje de bienvenida (solo en las paginas publicas). Encima de la esfera, como el menu, con una flecha
   que baja hasta su centro: no tapa el boton "Ayuda" ni el "Ver recorrido" de la izquierda (.tml-guide-fab, abajo). Sube
   con el aviso de abajo porque va dentro de .tml-bot. Con el menu, el bot o el equipo abiertos, o un recorrido en curso,
   no se ve. */
.tml-bot-welcome { position: absolute; z-index: 1; right: 0; bottom: calc(var(--tml-bot-size) + 18px); width: 280px; max-width: calc(100vw - 32px); display: flex; align-items: flex-start; gap: 4px; padding: 12px 4px 12px 16px; background: #FFFFFF; border: 1px solid var(--tml-bot-line); border-left: 4px solid var(--tml-bot-growth); border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); animation: tml-bot-welcome-in .35s ease-out; }
.tml-bot-welcome::after { content: ""; position: absolute; right: calc(var(--tml-bot-size) / 2 - 8px); bottom: -9px; width: 16px; height: 16px; background: #FFFFFF; border-right: 1px solid var(--tml-bot-line); border-bottom: 1px solid var(--tml-bot-line); transform: rotate(45deg); }
.tml-bot .tml-bot-welcome-text { flex: 1 1 auto; min-width: 0; padding-top: 2px; font-size: 15px; color: var(--tml-bot-ink); }
.tml-bot-welcome-close { flex: none; width: 44px; height: 44px; margin: -10px 0 -10px; padding: 0; border: none; border-radius: 10px; background: transparent; color: var(--tml-bot-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tml-bot-welcome-close:hover { background: var(--tml-bot-bg); color: var(--tml-bot-ink); }
.tml-bot-welcome-close:focus-visible { outline: 3px solid var(--tml-bot-growth); outline-offset: 0; }
.tml-bot-any-open .tml-bot-welcome, html.tml-guide-on .tml-bot-welcome { display: none; }
@keyframes tml-bot-welcome-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tml-bot-welcome { animation: none; }
}

/* El menu "¿Con quién quieres hablar?" (solo con el chat de Triple Apoyo en la pagina). En el celular oscurece la pagina
   detras; en escritorio no. */
.tml-bot-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); }
.tml-bot-menu { position: absolute; z-index: 1; right: 0; bottom: calc(var(--tml-bot-size) + 16px); width: 310px; max-width: calc(100vw - 32px); padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #FFFFFF; border: 1px solid var(--tml-bot-line); border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); }
.tml-bot .tml-bot-menu-title { margin: 0 4px 2px; font-size: 15px; font-weight: 700; color: var(--tml-bot-deep); }
.tml-bot-option { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 12px; border: 1px solid var(--tml-bot-line); border-radius: 14px; background: #FFFFFF; color: var(--tml-bot-ink); text-align: left; font-family: inherit; cursor: pointer; }
.tml-bot-option:hover, .tml-bot-option:focus-visible { outline: none; border-color: var(--tml-bot-primary); box-shadow: 0 0 0 3px rgba(30, 64, 175, .15); }
.tml-bot-option-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--tml-bot-soft); color: var(--tml-bot-deep); display: inline-flex; align-items: center; justify-content: center; }
.tml-bot-option-team .tml-bot-option-icon { background: #F1EDFB; color: #5435B0; }
.tml-bot-option-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tml-bot-option-name { font-size: 15px; font-weight: 600; }
.tml-bot-option-desc { font-size: 13px; color: var(--tml-bot-muted); }
.tml-bot-option-unseen { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--tml-bot-danger); color: #FFFFFF; font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (min-width: 768px) {
  .tml-bot-scrim { display: none !important; }
  .tml-bot-menu { width: 340px; }
}

/* Con el boton "Ayuda" la burbuja morada de Triple Apoyo no se ve: su chat se abre desde "Tu equipo" (support-bot.js) */
body.tml-help-unified #contactChat .chat-btn, body.tml-help-unified #contactChat #global-unseen { display: none !important; }

/* 09/11 (Panel 3/3, PanelEspera / PCPanelEspera de Luis): .tml-bot-fab, el boton "Ayuda" flotante del Panel. Pildora verde
   clara (#D1FAE5, borde #047857, texto #065F46) de 52px con un auricular y la palabra "Ayuda" (abierto: X y "Cerrar"), a
   16px de la esquina. El menu: "Chat con tu equipo" (avatares del equipo) y "Asistente con IA" (destello en un circulo
   azul marino), filas de 52px. Sin la esfera, el latido ni el titulo visible del menu. */
.tml-bot-fab { --tml-bot-size: 52px; right: 16px; --tml-bot-bottom: calc(16px + var(--bottom-notice-offset, 0px)); }
.tml-bot-fab .tml-bot-bubble { flex-direction: row; gap: 8px; min-height: 52px; padding: 0 20px 0 14px; border-radius: 26px; border: 2px solid #047857; background: #D1FAE5; color: #065F46; font-size: 15px; font-weight: 600; box-shadow: 0 8px 20px rgba(15, 23, 42, .25); }
.tml-bot-fab .tml-bot-bubble:hover { background: #A7F3D0; }
.tml-bot-fab .tml-bot-bubble:focus-visible { outline-color: #047857; outline-offset: 3px; border-radius: 26px; }
.tml-bot-fab .tml-bot-fab-icon, .tml-bot-fab .tml-bot-icon-close { flex: none; }
.tml-bot-fab.tml-bot-any-open .tml-bot-fab-icon { display: none; }
.tml-bot-fab.tml-bot-any-open .tml-bot-icon-close { display: inline; }
.tml-bot-fab .tml-bot-unseen { top: -8px; right: -6px; }
.tml-bot-fab .tml-bot-menu { min-width: 250px; width: 300px; padding: 8px; gap: 4px; border-radius: 16px; box-shadow: 0 12px 30px rgba(15, 23, 42, .22); }
.tml-bot-fab .tml-bot-option { min-height: 52px; padding: 8px 12px; gap: 10px; border: 0; border-radius: 12px; color: #172554; }
.tml-bot-fab .tml-bot-option:hover, .tml-bot-fab .tml-bot-option:focus-visible { background: #EFF6FF; box-shadow: 0 0 0 2px var(--tml-bot-primary); }
.tml-bot-fab .tml-bot-option-ia .tml-bot-option-icon { width: 36px; height: 36px; border-radius: 50%; background: #172554; color: #FFFFFF; }
.tml-bot-fab .tml-bot-option-desc { color: #475569; }
.tml-bot-stack { flex: none; display: flex; }
.tml-bot-stack img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #047857; background: #1E40AF; object-fit: cover; margin-left: -8px; }
.tml-bot-stack img:first-child { margin-left: 0; }

/* El final de la pagina deja libre el lugar del boton: nada queda debajo de el (#315). #485: en todos los contextos
   donde esta el boton, tambien en el sitio publico (antes solo en el panel y el Carrusel). La red social (Framework7,
   #framework7-root) tiene su propio alto y no lo necesita. Suma lo que sube el boton con el aviso de abajo visible
   (--bottom-notice-offset). 2026-11-04: la esfera mide 76px (64px hasta 600px) mas 32px, como antes 56 + 32 = 88px;
   aqui no llega --tml-bot-size, que es de .tml-bot.
   #930: con el pie de las paginas publicas (.tml-footer), la reserva va dentro del pie y no en el body: en el body
   quedaba debajo del pie oscuro como una banda blanca. Es un bloque al final del pie (::after), que suma la misma
   altura sin depender del padding del pie, que cambia por ancho en tml.css. */
body:not(:has(#framework7-root)):not(:has(.tml-footer)):has(.tml-bot) { padding-bottom: calc(108px + var(--bottom-notice-offset, 0px)); }
body:not(:has(#framework7-root)):has(.tml-bot) .tml-footer::after { content: ""; display: block; height: calc(108px + var(--bottom-notice-offset, 0px)); }
@media (max-width: 600px) {
  body:not(:has(#framework7-root)):not(:has(.tml-footer)):has(.tml-bot) { padding-bottom: calc(96px + var(--bottom-notice-offset, 0px)); }
  body:not(:has(#framework7-root)):has(.tml-bot) .tml-footer::after { height: calc(96px + var(--bottom-notice-offset, 0px)); }
}
/* Nelson (16/11): en celulares y tablets no flota el globo "Ayuda" (ni su saludo). Se abre desde el menu lateral y el
   pie (data-support-bot-help, components/device_options.html.twig) o desde "Ayuda" de la barra de arriba donde la hay;
   el panel y el menu son los mismos. Sin el globo, la pagina ya no reserva su lugar al final. Tablet = hasta 1024px o
   cualquier pantalla tactil sin mouse (un iPad apaisado mide 1180px). Mismo criterio en pwa-install.js y push-subscribe.js */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .tml-bot .tml-bot-bubble, .tml-bot .tml-bot-welcome { display: none !important; }
  body:not(:has(#framework7-root)):not(:has(.tml-footer)):has(.tml-bot) { padding-bottom: var(--bottom-notice-offset, 0px); }
  body:not(:has(#framework7-root)):has(.tml-bot) .tml-footer::after { height: var(--bottom-notice-offset, 0px); }
}
/* #929: en las pantallas de acceso (tml/auth.html.twig) con 2 columnas, la tarjeta ocupa toda la altura y su esquina de
   abajo a la derecha ("Recuperar membresia") quedaba bajo el boton sin poder bajar mas. La tarjeta se centra en el lugar
   que deja libre el boton (hasta 180px a la derecha, sin achicarse de 520px) y abajo queda su reserva. */
@media (min-width: 961px) {
  body:has(.tml-bot) .tml-auth-main { padding-right: clamp(24px, calc(100% - 544px), 180px); padding-bottom: calc(108px + var(--bottom-notice-offset, 0px)); }
}

/* El panel */
.tml-bot-panel { position: absolute; right: 0; bottom: calc(var(--tml-bot-size) + 16px); width: 380px; max-width: calc(100vw - 32px); max-height: calc(100vh - var(--tml-bot-size) - 56px - var(--bottom-notice-offset, 0px)); display: flex; flex-direction: column; background: #FFFFFF; border: 1px solid var(--tml-bot-line); border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); overflow: hidden; }
.tml-bot-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 18px; background: var(--tml-bot-deep); color: #FFFFFF; }
.tml-bot .tml-bot-title { font-size: 17px; font-weight: 700; color: #FFFFFF; }
.tml-bot .tml-bot-sub { font-size: 13px; color: rgba(255, 255, 255, .8); }
.tml-bot-close { flex: none; width: 40px; height: 40px; padding: 0; border: none; border-radius: 10px; background: transparent; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tml-bot-close:hover { background: rgba(255, 255, 255, .15); }
.tml-bot-close:focus-visible { outline: 3px solid var(--tml-bot-growth); outline-offset: 0; }

.tml-bot-notice { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tml-bot .tml-bot-notice-title { font-weight: 700; color: var(--tml-bot-deep); }
.tml-bot-notice p { color: var(--tml-bot-muted); }

.tml-bot-body { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; overflow-y: auto; background: var(--tml-bot-bg); }
.tml-bot-log { display: flex; flex-direction: column; gap: 8px; padding: 14px; min-height: 160px; }
.tml-bot-msg { display: flex; }
.tml-bot-msg-text { padding: 9px 13px; border-radius: 14px; max-width: 85%; white-space: pre-line; overflow-wrap: anywhere; }
.tml-bot-msg-bot .tml-bot-msg-text { background: var(--tml-bot-soft); color: var(--tml-bot-ink); border-top-left-radius: 4px; }
.tml-bot-msg-user { justify-content: flex-end; }
.tml-bot-msg-user .tml-bot-msg-text { background: var(--tml-bot-primary); color: #FFFFFF; border-top-right-radius: 4px; }
.tml-bot-msg-wait .tml-bot-msg-text { color: var(--tml-bot-muted); font-style: italic; }
.tml-bot-faqs { display: flex; flex-wrap: wrap; gap: 6px; }
.tml-bot .tml-bot-faqs-title { width: 100%; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tml-bot-muted); }
.tml-bot-chip { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--tml-bot-primary); background: #FFFFFF; color: var(--tml-bot-primary); font-size: 14px; text-align: left; cursor: pointer; }
.tml-bot-chip:hover, .tml-bot-chip:focus-visible { background: var(--tml-bot-soft); outline: none; box-shadow: 0 0 0 3px rgba(30, 64, 175, .18); }
.tml-bot-chip-leave { border-color: #047857; color: #047857; }

/* El mensaje a soporte */
.tml-bot-form { margin: 0 14px 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #FFFFFF; border: 1px solid var(--tml-bot-line); border-radius: 14px; }
.tml-bot .tml-bot-form-title { font-weight: 700; color: var(--tml-bot-deep); }
.tml-bot .tml-bot-form-note { font-size: 13px; color: var(--tml-bot-muted); }
.tml-bot-guest { display: flex; flex-direction: column; gap: 10px; }
.tml-bot-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; font-weight: 600; color: var(--tml-bot-ink); }
.tml-bot-field input, .tml-bot-field textarea { width: 100%; min-height: 42px; margin: 0; padding: 8px 12px; border: 1px solid var(--tml-bot-line); border-radius: 10px; background: #FFFFFF; color: var(--tml-bot-ink); font-size: 16px; font-weight: 400; line-height: 1.4; font-family: inherit; }
.tml-bot-field textarea { resize: vertical; min-height: 72px; }
.tml-bot-field input:focus, .tml-bot-field textarea:focus { outline: none; border-color: var(--tml-bot-primary); box-shadow: 0 0 0 3px rgba(30, 64, 175, .15); }
.tml-bot [aria-invalid="true"] { border: 2px solid var(--tml-bot-danger); }
.tml-bot-consent { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; font-weight: 400; color: var(--tml-bot-muted); }
.tml-bot-consent input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; }
.tml-bot-consent input[aria-invalid="true"] { outline: 2px solid var(--tml-bot-danger); outline-offset: 2px; }
.tml-bot-consent a { color: var(--tml-bot-primary); text-decoration: underline; }
.tml-bot .tml-bot-form-error { font-size: 13px; color: var(--tml-bot-danger); }
.tml-bot-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.tml-bot-btn { min-height: 44px; padding: 0 18px; border: none; border-radius: 10px; background: var(--tml-bot-primary); color: #FFFFFF; font-size: 15px; font-weight: 600; cursor: pointer; }
.tml-bot-btn:hover { background: var(--tml-bot-deep); }
.tml-bot-btn:focus-visible { outline: 3px solid var(--tml-bot-growth); outline-offset: 2px; }
.tml-bot-btn[disabled], .tml-bot-send[disabled] { opacity: .6; cursor: progress; }

/* La pregunta */
.tml-bot-ask { position: sticky; bottom: 0; display: flex; gap: 8px; margin: auto 0 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: #FFFFFF; border-top: 1px solid var(--tml-bot-line); }
.tml-bot-ask input { flex: 1 1 auto; min-width: 0; min-height: 44px; margin: 0; padding: 0 12px; border: 1px solid var(--tml-bot-line); border-radius: 10px; background: #FFFFFF; color: var(--tml-bot-ink); font-size: 16px; font-family: inherit; }
.tml-bot-ask input:focus { outline: none; border-color: var(--tml-bot-primary); box-shadow: 0 0 0 3px rgba(30, 64, 175, .15); }
.tml-bot-send { flex: none; width: 44px; height: 44px; padding: 0; border: none; border-radius: 10px; background: var(--tml-bot-primary); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tml-bot-send:hover { background: var(--tml-bot-deep); }
.tml-bot-send:focus-visible { outline: 3px solid var(--tml-bot-growth); outline-offset: 2px; }

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

/* Celular: el panel nunca pasa del ancho de la pantalla (sin scroll horizontal) */
@media (max-width: 640px) {
  .tml-bot-panel { width: calc(100vw - 32px); max-height: calc(100vh - var(--tml-bot-size) - 46px - var(--bottom-notice-offset, 0px)); max-height: calc(100dvh - var(--tml-bot-size) - 46px - var(--bottom-notice-offset, 0px)); }
}
/* Sin movimiento: la esfera queda quieta (sin latido, parpadeo, brillo ni crecer al pasar el raton) */
@media (prefers-reduced-motion: reduce) {
  .tml-bot-bubble *, .tml-bot-bubble *::after { animation: none !important; transition: none !important; }
  .tml-bot-bubble:hover .tml-ia-orb { transform: none; }
}

/* 18/10 (Nelson): con el chat del bot abierto, el widget queda por encima de todo (la Guia rapida, las vistas de la red
   social, el panel "Mas") y el fondo oscuro tapa la pagina, en el celular y en escritorio: no se toca lo de atras y al
   tocarlo se cierra el chat. La X del boton y el panel quedan encima del fondo. */
.tml-bot.tml-bot-open, body:has(#framework7-root) .tml-bot.tml-bot-open { z-index: 7000; }
.tml-bot.tml-bot-open .tml-bot-scrim { display: block !important; }
.tml-bot-panel { z-index: 1; }
.tml-bot.tml-bot-open .tml-bot-scrim { background: rgba(15, 23, 42, .5); }

/* 19/10 (Nelson, celular): con varias preguntas se desplazaba todo el cuerpo del panel y la caja de preguntar, "sticky",
   quedaba a mitad de los mensajes; ademas support-bot.js baja la lista (log.scrollTop) y la que se desplazaba era el cuerpo,
   asi que nunca llegaba al ultimo mensaje. Ahora solo se desplaza la lista de mensajes; el formulario para hablar con una
   persona (si esta abierto) y la caja de preguntar quedan fijos abajo, como en cualquier chat. */
.tml-bot-body { overflow: hidden; }
.tml-bot-log { flex: 1 1 auto; min-height: 96px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.tml-bot-form { flex: none; max-height: 55%; overflow-y: auto; }
.tml-bot-ask { position: static; flex: none; margin-top: 0; }
/* 19/10 (Nelson): una pregunta ya respondida no se repite (support-bot.js). La pregunta frecuente ya hecha lleva ✓ y un tono
   mas suave; al tocarla, el chat sube a su respuesta y la resalta un momento. */
.tml-bot-chip.is-asked { background: var(--tml-bot-bg); color: var(--tml-bot-muted); border-color: var(--tml-bot-line); }
.tml-bot-chip.is-asked::before { content: "✓ "; color: var(--tml-bot-growth); font-weight: 700; }
.tml-bot-msg-flash .tml-bot-msg-text { animation: tml-bot-flash 1.6s ease-out; }
@keyframes tml-bot-flash { 0%, 35% { box-shadow: 0 0 0 3px rgba(16, 185, 129, .55); background: #ECFDF5; } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@media (prefers-reduced-motion: reduce) { .tml-bot-msg-flash .tml-bot-msg-text { animation: none; box-shadow: 0 0 0 3px rgba(16, 185, 129, .55); } }
