/* Fluvi 3 · la llamada (js/llamada.js). Hoja propia: solo la piden las páginas con llamada (Conversa con Fluvi y el curso de
   inglés), así no pesa en el resto del sitio. Pantalla completa oscura, sobria: el único color vivo es el orbe. */
html.llamada-abierta, html.llamada-abierta body { overflow: hidden; }
.llamada {
  --ll-fondo: #0D0B1A; --ll-texto: #F5F3FA; --ll-tenue: rgba(245, 243, 250, .66); --ll-linea: rgba(255, 255, 255, .10);
  --ll-boton: rgba(255, 255, 255, .08); --ll-boton-h: rgba(255, 255, 255, .15); --ll-rojo: #E5484D; --ll-agua: #2FC3E6;
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; overflow: hidden;
  padding: max(14px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  background: var(--ll-fondo); color: var(--ll-texto);
  font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.4; text-align: center;
  -webkit-tap-highlight-color: transparent; animation: ll-entrar .3s ease-out;
}
.llamada [hidden] { display: none !important; }
.llamada p { margin: 0; }
.llamada svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.llamada svg.relleno { fill: currentColor; stroke: none; }
.llamada :focus-visible { outline: 2px solid var(--ll-agua); outline-offset: 3px; }
@keyframes ll-entrar { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

.llamada-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 640px; margin: 0 auto; text-align: left; }
.llamada-quien b { display: block; font-family: Manrope, Inter, sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.llamada-quien small { display: block; margin-top: 2px; color: var(--ll-tenue); font-size: 13px; }
.llamada-reloj { padding: 6px 12px; border-radius: 999px; background: var(--ll-boton); color: var(--ll-tenue); font-size: 14px; font-variant-numeric: tabular-nums; }
.llamada-reloj.pronto { color: #FFC2B3; }
.llamada-reloj:empty { visibility: hidden; }

.llamada-pildoras { position: absolute; z-index: 2; left: 16px; right: 16px; top: calc(max(14px, env(safe-area-inset-top)) + 54px); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.llamada-pildora {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 520px; padding: 10px 14px;
  border: 1px solid var(--ll-linea); border-radius: 16px; background: rgba(24, 26, 48, .9); color: var(--ll-texto);
  font: inherit; font-size: 14px; line-height: 1.35; text-align: left; box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: ll-pildora .26s ease-out;
}
button.llamada-pildora { cursor: pointer; }
.llamada-pildora .ll-marca { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.llamada-pildora .ll-marca svg { width: 15px; height: 15px; stroke-width: 2.4; }
.llamada-pildora b { font-weight: 600; }
.llamada-pildora small { display: block; margin-top: 3px; color: var(--ll-tenue); font-size: 12.5px; }
.llamada-pildora.es-bien .ll-marca { background: rgba(52, 211, 153, .16); color: #7BEBC0; }
.llamada-pildora.es-casi .ll-marca { background: rgba(255, 90, 54, .18); color: #FFA28C; }
.llamada-pildora.es-ingles .ll-marca { background: rgba(47, 195, 230, .18); color: #94E4F6; }
.llamada-pildora.es-aviso .ll-marca { background: rgba(255, 255, 255, .12); color: var(--ll-texto); }
.llamada-pildora.sale { animation: ll-salir .25s ease-in forwards; }
@keyframes ll-pildora { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ll-salir { to { opacity: 0; transform: translateY(-6px); } }

.llamada-centro { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.llamada-orbe { display: block; flex: 0 1 auto; min-height: 88px; width: min(70vw, 44vh, 320px); height: min(70vw, 44vh, 320px); }   /* en pantallas bajas se encoge el alto: el orbe se dibuja con el lado menor */
.llamada-estado { min-height: 1.4em; color: var(--ll-tenue); font-size: 15px; }
.llamada-subs { display: grid; gap: 6px; width: 100%; max-width: 560px; }
.llamada-sub-fluvi { font-size: 19px; font-weight: 500; line-height: 1.4; cursor: pointer; }
.llamada-sub-es { color: var(--ll-tenue); font-size: 14px; }
.llamada-sub-yo { color: rgba(245, 243, 250, .78); font-size: 15px; font-style: italic; }

.llamada-pie { flex: none; width: 100%; max-width: 560px; margin: 0 auto; }
.llamada-ideas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-bottom: 12px; }
.llamada-ideas-tit { display: inline-flex; align-items: center; gap: 6px; color: var(--ll-tenue); font-size: 13px; }
.llamada-ideas-tit svg { width: 16px; height: 16px; }
.llamada-idea { padding: 8px 14px; border: 1px solid var(--ll-linea); border-radius: 999px; background: var(--ll-boton); color: var(--ll-texto); font: inherit; font-size: 14px; cursor: pointer; }
.llamada-idea:hover { background: var(--ll-boton-h); }
.llamada-escribir { display: flex; gap: 8px; margin-bottom: 12px; }
.llamada-escribir input { flex: 1; min-width: 0; padding: 12px 16px; border: 1px solid var(--ll-linea); border-radius: 999px; background: rgba(255, 255, 255, .06); color: var(--ll-texto); font: inherit; font-size: 16px; }
.llamada-escribir input::placeholder { color: var(--ll-tenue); }
.llamada-escribir .llamada-btn { width: 48px; height: 48px; }
.llamada-opciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 16px; }
.llamada-chip { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border: 1px solid var(--ll-linea); border-radius: 999px; background: transparent; color: var(--ll-tenue); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
@media (max-width: 380px) { .llamada-chip { padding: 6px 9px; font-size: 12.5px; } .llamada-chip svg { width: 14px; height: 14px; } }
.llamada-chip svg { width: 16px; height: 16px; }
.llamada-chip[aria-pressed="true"] { border-color: transparent; background: var(--ll-boton-h); color: var(--ll-texto); }
.llamada-controles { display: flex; align-items: center; justify-content: center; gap: 28px; }
.llamada-btn { display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--ll-boton); color: var(--ll-texto); cursor: pointer; transition: background .2s, transform .15s; }
.llamada-btn:hover, .llamada-btn[aria-pressed="true"] { background: var(--ll-boton-h); }
.llamada-colgar, .llamada-colgar:hover { background: var(--ll-rojo); }
.llamada-colgar svg { width: 28px; height: 28px; }
.llamada-mic { position: relative; display: grid; place-items: center; width: 78px; height: 78px; padding: 0; border: 0; border-radius: 50%; background: #FFFFFF; color: var(--ll-fondo); cursor: pointer; transition: transform .15s, background .2s; }
.llamada-mic svg { width: 30px; height: 30px; }
.llamada-mic::after { content: ''; position: absolute; inset: -7px; border: 2px solid transparent; border-radius: 50%; pointer-events: none; }
.llamada-mic.escucha::after { border-color: rgba(47, 195, 230, .9); animation: ll-aro 1.4s ease-out infinite; }
.llamada-mic.habla { background: rgba(255, 255, 255, .86); }
/* Voz en vivo: el micrófono en silencio (una raya cruza el ícono) */
.llamada-mic.mudo { background: rgba(255, 255, 255, .16); color: var(--ll-texto); }
.llamada-mic.mudo::before { content: ''; position: absolute; width: 36px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }
.llamada-mic.mudo.escucha::after { animation: none; border-color: transparent; }
.llamada-btn:active, .llamada-mic:active { transform: scale(.94); }
@keyframes ll-aro { from { transform: scale(1); opacity: 1; } to { transform: scale(1.28); opacity: 0; } }

.llamada-resumen { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 560px; margin: 0 auto; padding: 4px 0 8px; }
.llamada-resumen .llamada-orbe { flex: none; width: 112px; height: 112px; }
.llamada-resumen h2 { margin: 0; color: var(--ll-texto); font-family: Manrope, Inter, sans-serif; font-size: 26px; letter-spacing: -.02em; }
.llamada-adios { color: var(--ll-tenue); font-size: 15px; }
.llamada-cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.llamada-cifras div { padding: 12px 6px; border: 1px solid var(--ll-linea); border-radius: 14px; background: rgba(255, 255, 255, .05); }
.llamada-cifras b { display: block; font-family: Manrope, Inter, sans-serif; font-size: 24px; font-variant-numeric: tabular-nums; }
.llamada-cifras span { color: var(--ll-tenue); font-size: 12.5px; }
.llamada-avance { color: #94E4F6; font-size: 14px; }
.llamada-titulo { align-self: flex-start; margin-top: 6px !important; color: var(--ll-tenue); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.llamada-frases { display: grid; gap: 8px; width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.llamada-frases li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--ll-linea); border-radius: 14px; background: rgba(255, 255, 255, .05); }
.llamada-frases small { display: block; color: var(--ll-tenue); font-size: 13px; }
.llamada-frases b { display: block; margin: 2px 0; font-size: 16px; font-weight: 600; }
.llamada-frases .ll-natural { margin-top: 4px; color: #94E4F6; }
.llamada-oir { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--ll-boton-h); color: var(--ll-texto); cursor: pointer; }
.llamada-oir svg { width: 16px; height: 16px; }
.llamada-nota { color: var(--ll-tenue); font-size: 13px; }
.llamada-nota a { color: var(--ll-texto); }
.llamada .llamada-valor { max-width: 36ch; margin: 0 auto 12px; text-align: center; line-height: 1.5; }
.llamada-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 4px 0 10px; }
.llamada-primario { display: inline-block; padding: 13px 24px; border: 0; border-radius: 999px; background: #FFFFFF; color: var(--ll-fondo); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.llamada-secundario { padding: 12px 22px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; background: transparent; color: var(--ll-texto); font: inherit; cursor: pointer; }

@media (min-width: 720px) { .llamada-controles { gap: 36px; } .llamada-sub-fluvi { font-size: 21px; } }
@media (max-height: 640px) { .llamada-orbe { width: min(56vw, 34vh); height: min(56vw, 34vh); } .llamada-opciones { margin-bottom: 10px; } .llamada-centro { gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .llamada, .llamada-pildora, .llamada-pildora.sale { animation: none; } .llamada-mic.escucha::after { animation: none; } }
/* Fluvi en la página «Conversa con Fluvi» (fuera de la llamada): el mismo orbe, en pequeño */
.llamada-orbe-mini { display: block; width: 104px; height: 104px; }
/* Fluvi a la mano: el botón flotante del curso de inglés (charla.js). Se esconde en lecciones, exámenes y en la llamada. */
.fluvi-flotante {
  position: fixed; z-index: 900; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border: 0; border-radius: 999px;
  background: #0D0B1A; color: #F5F3FA; font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 10px 30px rgba(13, 11, 26, .35); transition: transform .15s; animation: ll-entrar .35s ease-out;
}
.fluvi-flotante:hover { transform: translateY(-2px); }
.fluvi-flotante:focus-visible { outline: 2px solid #2FC3E6; outline-offset: 3px; }
.fluvi-flotante[hidden], body.aula2-activa .fluvi-flotante, html.llamada-abierta .fluvi-flotante { display: none; }
.fluvi-flotante-orbe { flex: none; display: block; width: 46px; height: 46px; }
.fluvi-flotante-txt b { display: block; font-family: Manrope, Inter, sans-serif; font-size: 15px; font-weight: 700; line-height: 1.2; }
.fluvi-flotante-txt small { display: block; margin-top: 1px; color: rgba(245, 243, 250, .72); font-size: 12px; }
.fluvi-flotante.nuevo { box-shadow: 0 0 0 3px rgba(47, 195, 230, .45), 0 10px 30px rgba(13, 11, 26, .35); }
@media (max-width: 480px) { .fluvi-flotante { padding-right: 14px; } .fluvi-flotante:not(.nuevo) .fluvi-flotante-txt small { display: none; } }
@media (prefers-reduced-motion: reduce) { .fluvi-flotante { animation: none; transition: none; } }
