/* =====================================================================
   La ventana del análisis de Turing (#turing-ventana), en /medios/turing. 13 nov 2026, pedido de Daniel:
   «Regresa al MODAL que tenía Turing, siempre sí está mejor pero que tenga un mejor diseño de animación».
   Arriba, la noche azul de Turing con luces que se mueven y un anillo de avance alrededor del logo; abajo, los cuatro
   pasos siempre a la vista, unidos por una línea que se llena al avanzar. El paso que trabaja se abre; el que termina
   se pliega y deja lo que encontró. js/turing-ventana.js · parciales/turing-ventana.php.
   Colores: los azules y turquesas de Turing, un toque lavanda y neutros (nada de vino ni de colores de partidos).
   ===================================================================== */
.tv {
  --tv-noche: var(--tu-noche, #071430);
  --tv-noche-2: var(--tu-noche-2, #0a1b3f);
  --tv-azul: var(--tu-azul, #1d4ed8);
  --tv-vivo: var(--tu-vivo, #2563eb);
  --tv-listo: #0d9488;
  --tv-listo-o: #0f766e;
  --tv-listo-c: #e3f6f3;
  --tv-tinta: var(--mr-tinta, #0f1a30);
  --tv-piedra: var(--mr-piedra, #56617a);
  --tv-linea: var(--mr-linea, #dbe3ef);
  --tv-papel: #f3f6fb;
  --tv-curva: cubic-bezier(.16, 1, .3, 1);
  padding: 0; border: 0; background: transparent; color: var(--tv-tinta);
  width: min(62rem, calc(100vw - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); overflow: visible;
}
/* Alto fijo: la ventana no brinca cuando un paso se abre o se pliega; lo de adentro se desplaza. */
.tv[open] { display: flex; height: min(52rem, calc(100dvh - 2rem)); }
.tv[open] > .tv-caja { flex: 1 1 auto; }
.tv:focus, .tv:focus-visible { outline: none; }
.tv::backdrop { background: rgba(4, 10, 28, .66); -webkit-backdrop-filter: blur(6px) saturate(1.15); backdrop-filter: blur(6px) saturate(1.15); }
.tv[open]::backdrop { animation: tv-velo .45s ease both; }
html.tv-abierta { overflow: hidden; }
.tv-caja {
  position: relative; display: flex; flex-direction: column; max-height: calc(100dvh - 2rem); overflow: hidden;
  border-radius: 26px; background: var(--tv-papel);
  box-shadow: 0 40px 90px -30px rgba(2, 8, 30, .75), 0 0 0 1px rgba(143, 211, 255, .18);
}
.tv[open] .tv-caja { animation: tv-entra .6s var(--tv-curva) both; }
/* Al llegar a la página con el análisis en curso (?encargo=…) entra más rápido: la persona ya estaba esperando. */
.tv[data-auto][open] .tv-caja { animation-duration: .32s; }
.tv[data-auto][open]::backdrop { animation-duration: .2s; }
.tv.tv-saliendo .tv-caja { animation: tv-sale .32s ease forwards; }
@keyframes tv-velo { from { opacity: 0; } to { opacity: 1; } }
@keyframes tv-entra { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes tv-sale { to { opacity: 0; transform: translateY(-10px) scale(.985); } }

/* ---------- Encabezado: la noche de Turing ---------- */
.tv-cab {
  position: relative; isolation: isolate; overflow: hidden; flex: none; color: #fff;
  padding: 1.35rem 1.6rem 0;
  background: linear-gradient(140deg, var(--tv-noche) 0%, var(--tv-noche-2) 60%, #0b1233 100%);
}
/* Puntos finos, como una red, que se desvanecen hacia abajo. */
.tv-cab::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(207, 239, 255, .22) 1px, transparent 1.4px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.tv-luces { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.tv-luces span { position: absolute; width: 22rem; height: 22rem; border-radius: 50%; filter: blur(60px); opacity: .45; transition: opacity 1s ease; }
.tv-luces span:nth-child(1) { left: -6rem; top: -10rem; background: #2563eb; animation: tv-luz-a 16s ease-in-out infinite alternate; }
.tv-luces span:nth-child(2) { right: -7rem; top: -6rem; background: #06b6d4; animation: tv-luz-b 19s ease-in-out infinite alternate; }
.tv-luces span:nth-child(3) { left: 38%; bottom: -14rem; background: #7c6cf0; opacity: .3; animation: tv-luz-c 22s ease-in-out infinite alternate; }
.tv.tv-trabajando .tv-luces span { opacity: .8; }
.tv.tv-trabajando .tv-luces span:nth-child(3) { opacity: .5; }
.tv.tv-terminado .tv-luces span:nth-child(1) { background: #0d9488; }
@keyframes tv-luz-a { to { transform: translate(9rem, 5rem) scale(1.15); } }
@keyframes tv-luz-b { to { transform: translate(-8rem, 6rem) scale(.9); } }
@keyframes tv-luz-c { to { transform: translate(-10rem, -4rem) scale(1.2); } }

.tv-cab-fila { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.35rem; align-items: center; }

/* El logo dentro de su anillo de avance */
.tv-orbe { position: relative; width: 128px; height: 128px; flex: none; display: grid; place-items: center; }
.tv-anillo { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.tv-anillo circle { fill: none; stroke-width: 6; }
.tv-anillo-fondo { stroke: rgba(255, 255, 255, .12); }
.tv-anillo-avance { stroke: url(#tv-anillo-color); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset .45s ease-out, stroke .4s; filter: drop-shadow(0 0 6px rgba(56, 189, 248, .7)); }
.tv.tv-detenido .tv-anillo-avance { stroke: #f2b544; filter: none; }
.tv.tv-terminado .tv-anillo-avance { filter: drop-shadow(0 0 10px rgba(94, 234, 212, .95)); }
/* Una chispa que da vueltas mientras trabaja */
.tv-cometa { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.tv-cometa i { position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin: -2px 0 0 -5px; border-radius: 50%;
  background: #e0fbff; box-shadow: 0 0 10px 3px rgba(94, 234, 212, .9), 0 0 22px 6px rgba(56, 189, 248, .55); }
.tv.tv-trabajando .tv-cometa { opacity: 1; animation: tv-gira 2.6s linear infinite; }
@keyframes tv-gira { to { transform: rotate(360deg); } }
.tv-logo { position: absolute; display: grid; place-items: center; inset: 0; transition: opacity .5s ease, transform .5s var(--tv-curva); }
.tv-logo picture, .tv-logo img { display: block; width: 76px !important; height: 76px !important; vertical-align: top !important; filter: drop-shadow(0 8px 20px rgba(37, 99, 235, .55)); }
.tv-logo-quieto { opacity: 0; transform: scale(.85); }
.tv.tv-terminado .tv-logo-trabaja, .tv.tv-detenido .tv-logo-trabaja { opacity: 0; transform: scale(.85); }
.tv.tv-terminado .tv-logo-quieto, .tv.tv-detenido .tv-logo-quieto { opacity: 1; transform: none; }
/* Al terminar, dos ondas salen del anillo */
.tv-onda { position: absolute; inset: 8px; border-radius: 50%; border: 2px solid rgba(94, 234, 212, .85); opacity: 0; pointer-events: none; }
.tv.tv-terminado .tv-onda { animation: tv-onda 1.5s ease-out both; }
.tv.tv-terminado .tv-onda + .tv-onda { animation-delay: .35s; }
@keyframes tv-onda { 0% { opacity: .9; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.75); } }

.tv-cab-texto { min-width: 0; }
.tv-estado { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .35rem; padding: .2rem .7rem; border-radius: 999px;
  background: rgba(143, 211, 255, .14); border: 1px solid rgba(143, 211, 255, .32); font-size: .78rem; font-weight: 700; letter-spacing: .03em; color: #cfefff; }
.tv-estado-punto { width: .55rem; height: .55rem; border-radius: 50%; background: #5eead4; }
.tv.tv-trabajando .tv-estado-punto { animation: tv-latido 1.4s ease-out infinite; }
.tv.tv-terminado .tv-estado-punto { background: #5eead4; box-shadow: 0 0 0 3px rgba(94, 234, 212, .25); }
.tv.tv-detenido .tv-estado-punto, .tv.tv-preguntando .tv-estado-punto { background: #f2b544; }
@keyframes tv-latido { 0% { box-shadow: 0 0 0 0 rgba(94, 234, 212, .7); } 100% { box-shadow: 0 0 0 .55rem rgba(94, 234, 212, 0); } }
.tv-cab h2 { margin: 0 0 .55rem; color: #fff; font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2.05rem); line-height: 1.1; letter-spacing: -.01em; }
.tv-entrada { display: flex; gap: .6rem; align-items: flex-start; margin: 0; padding: .5rem .75rem; border-radius: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); }
.tv-entrada[hidden] { display: none; }
.tv-entrada > i { margin-top: .2rem; color: #8fd3ff; }
.tv-entrada span { min-width: 0; }
.tv-entrada strong { display: block; color: #fff; font-size: .95rem; }
.tv-entrada small { display: block; color: #b9c8ea; font-size: .78rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tv-desde { margin: .5rem 0 0; font-size: .83rem; color: #cfefff; }
.tv-desde i { margin-right: .3rem; color: #8fd3ff; }

.tv-cifra { text-align: right; align-self: center; }
.tv-cifra p { margin: 0; }
.tv-pct { font-size: 2.9rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #ffffff, #cfefff 55%, #a5f3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tv-pct small { font-size: 1.2rem; font-weight: 700; margin-left: .1rem; }
.tv-cuenta { margin-top: .35rem !important; color: #cfdcf7; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.tv-reloj { color: #9fb2da; font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tv-barra { position: relative; height: 5px; margin: 1.15rem -1.6rem 0; background: rgba(255, 255, 255, .1); overflow: hidden; }
.tv-barra > span { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .4s ease-out;
  background: linear-gradient(90deg, #14b8a6, #22d3ee 40%, #818cf8 70%, #22d3ee); background-size: 200% 100%; }
.tv.tv-trabajando .tv-barra > span { animation: tv-brillo 1.8s linear infinite; }
.tv.tv-terminado .tv-barra > span { background: linear-gradient(90deg, #14b8a6, #5eead4); }
.tv.tv-detenido .tv-barra > span { background: linear-gradient(90deg, #e59e2a, #f2b544); }
@keyframes tv-brillo { from { background-position: 200% 0; } to { background-position: 0 0; } }

/* ---------- Cuerpo ---------- */
.tv-cuerpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth;
  display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: 1.25rem; align-items: start; padding: 1.3rem 1.6rem 1.5rem; }
.tv-principal { min-width: 0; }

/* Los pasos, unidos por una línea que se llena */
.tv-pasos { list-style: none; margin: 0; padding: 0; }
.tv-paso { position: relative; display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: .85rem; padding-bottom: .8rem; }
.tv[open] .tv-paso { animation: tv-paso-entra .55s var(--tv-curva) both; animation-delay: calc(.18s + var(--i, 0) * .08s); }
@keyframes tv-paso-entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tv-paso::before, .tv-paso::after { content: ""; position: absolute; left: 1.375rem; top: 2.95rem; bottom: .2rem; width: 3px; margin-left: -1.5px; border-radius: 3px; }
.tv-paso::before { background: var(--tv-linea); }
.tv-paso::after { background: linear-gradient(180deg, var(--tv-listo), #22d3ee); transform: scaleY(0); transform-origin: top; transition: transform .8s var(--tv-curva); }
.tv-paso:last-child::before, .tv-paso:last-child::after { display: none; }
.tv-paso[data-estado="hecho"]::after { transform: scaleY(1); }
.tv-paso[data-estado="omitido"]::after { transform: scaleY(1); background: repeating-linear-gradient(180deg, #b8c3d4 0 5px, transparent 5px 10px); }

.tv-marca { position: relative; z-index: 1; }
.tv-marca-icono { position: relative; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 14px; font-size: 1.05rem;
  background: #fff; border: 2px solid var(--mr-linea-2, #c8d3e4); color: var(--mr-piedra-2, #8a96ab);
  transition: background .35s, border-color .35s, color .35s, transform .35s var(--tv-curva), box-shadow .35s; }
.tv-marca-icono > i { position: absolute; transition: opacity .3s, transform .45s var(--tv-curva); }
.tv-i-listo, .tv-i-omitido, .tv-i-error { opacity: 0; transform: scale(.4) rotate(-45deg); }
/* Un halo que gira alrededor del paso que trabaja */
.tv-marca-icono::before { content: ""; position: absolute; inset: -6px; border-radius: 18px; opacity: 0; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 55%, #22d3ee 75%, #818cf8 90%, transparent 100%);
  padding: 3px; transition: opacity .3s;
  -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; }
.tv-paso[data-estado="activo"] .tv-marca-icono, .tv-paso[data-estado="pregunta"] .tv-marca-icono {
  background: linear-gradient(140deg, var(--tv-vivo), var(--tv-azul)); border-color: transparent; color: #fff; transform: scale(1.06);
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, .8); }
.tv-paso[data-estado="activo"] .tv-marca-icono::before { opacity: 1; animation: tv-gira 1.6s linear infinite; }
.tv-paso[data-estado="hecho"] .tv-marca-icono { background: var(--tv-listo); border-color: var(--tv-listo); color: #fff; animation: tv-pop .5s var(--tv-curva); }
.tv-paso[data-estado="omitido"] .tv-marca-icono { background: #f1f4f8; border-style: dashed; color: #98a4b6; }
.tv-paso[data-estado="error"] .tv-marca-icono { background: #fff6e5; border-color: #d98a1c; color: #a35a06; }
.tv-paso[data-estado="hecho"] .tv-i-paso, .tv-paso[data-estado="omitido"] .tv-i-paso, .tv-paso[data-estado="error"] .tv-i-paso { opacity: 0; transform: scale(.4) rotate(45deg); }
.tv-paso[data-estado="hecho"] .tv-i-listo, .tv-paso[data-estado="omitido"] .tv-i-omitido, .tv-paso[data-estado="error"] .tv-i-error { opacity: 1; transform: none; }
@keyframes tv-pop { 0% { transform: scale(.8); } 55% { transform: scale(1.16); } 100% { transform: scale(1); } }

.tv-tarjeta { position: relative; overflow: hidden; min-width: 0; padding: .75rem 1rem .8rem; border-radius: 16px; background: #fff; border: 1px solid var(--tv-linea);
  box-shadow: 0 1px 2px rgba(7, 20, 48, .05); transition: border-color .35s, box-shadow .35s, background .35s, opacity .35s; }
.tv-paso[data-estado="espera"] .tv-tarjeta { background: rgba(255, 255, 255, .55); }
.tv-paso[data-estado="espera"] .tv-paso-cab h3, .tv-paso[data-estado="espera"] .tv-que { opacity: .62; }
.tv-paso[data-estado="activo"] .tv-tarjeta, .tv-paso[data-estado="pregunta"] .tv-tarjeta {
  border-color: rgba(37, 99, 235, .55); background: linear-gradient(135deg, #eef4ff, #f7fbff 60%, #eefcfd);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, .35), 0 18px 36px -22px rgba(29, 78, 216, .65); }
/* Una luz recorre la tarjeta del paso que trabaja */
.tv-tarjeta::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(56, 189, 248, .16) 45%, rgba(129, 140, 248, .14) 55%, transparent 70%);
  background-size: 250% 100%; }
.tv.tv-trabajando .tv-paso[data-estado="activo"] .tv-tarjeta::after { opacity: 1; animation: tv-barrido 2.4s ease-in-out infinite; }
@keyframes tv-barrido { from { background-position: 130% 0; } to { background-position: -30% 0; } }
.tv-paso[data-estado="hecho"] .tv-tarjeta { border-color: #bfe6df; }
.tv-paso[data-estado="omitido"] .tv-tarjeta { background: #f8f9fc; border-style: dashed; }
.tv-paso[data-estado="error"] .tv-tarjeta { border-color: #e2a54c; background: #fffbf2; box-shadow: 0 0 0 1px #e2a54c; }

.tv-paso-cab { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; }
.tv-paso-cab h3 { margin: 0; flex: 1 1 auto; font-size: 1.02rem; line-height: 1.25; color: var(--tv-tinta); transition: opacity .35s; }
.tv-paso-n { color: var(--mr-piedra-2, #8a96ab); font-weight: 700; }
.tv-chip { flex: none; padding: .12rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 750; letter-spacing: .02em; background: #eef1f6; color: var(--tv-piedra); transition: background .3s, color .3s; }
.tv-paso[data-estado="activo"] .tv-chip, .tv-paso[data-estado="pregunta"] .tv-chip { background: var(--tv-azul); color: #fff; }
.tv-paso[data-estado="hecho"] .tv-chip { background: var(--tv-listo-c); color: var(--tv-listo-o); }
.tv-paso[data-estado="error"] .tv-chip { background: #fdecc8; color: #8a4a05; }
.tv-tiempo { flex: none; font-size: .76rem; color: var(--tv-piedra); font-variant-numeric: tabular-nums; }
.tv-tiempo:empty { display: none; }

/* Lo que se pliega: la descripción y la lista de tareas se cierran cuando el paso termina. */
.tv-pliegue { position: relative; z-index: 1; display: grid; grid-template-rows: 1fr; transition: grid-template-rows .55s var(--tv-curva), opacity .4s; }
.tv-pliegue > div { min-height: 0; overflow: hidden; }
.tv-paso[data-estado="hecho"] .tv-pliegue, .tv-paso[data-estado="omitido"] .tv-pliegue { grid-template-rows: 0fr; opacity: 0; }
.tv-que { margin: .3rem 0 0; font-size: .86rem; line-height: 1.45; color: var(--tv-piedra); }

.tv-hizo, .tv-hallazgos { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; }
.tv-hizo:not(:empty) { margin-top: .55rem; padding-top: .5rem; border-top: 1px dashed var(--tv-linea); }
.tv-hallazgos:not(:empty) { margin-top: .5rem; }
.tv-linea { display: flex; gap: .55rem; align-items: baseline; padding: .12rem 0; font-size: .87rem; line-height: 1.4; color: var(--tv-tinta); }
.tv-linea > i { flex: none; width: 1rem; text-align: center; font-size: .78rem; }
.tv-linea.hecha { color: var(--tv-piedra); }
.tv-linea.hecha > i { color: var(--tv-listo); }
.tv-linea.haciendo { color: var(--tv-azul); font-weight: 650; }
.tv-linea.resultado { padding: .45rem .65rem; border-radius: 10px; background: var(--tv-listo-c); color: #134e48; font-weight: 600; }
.tv-linea.resultado > i { color: var(--tv-listo); }
.tv-linea.resultado + .tv-linea { margin-top: .3rem; }
.tv-linea.omitida { color: var(--tv-piedra); font-style: italic; }
.tv-linea.resultado.omitida { background: #f1f3f8; color: var(--tv-piedra); font-weight: 500; }
.tv-linea.nota { padding: .45rem .65rem; border-radius: 10px; background: #fff7e8; color: #6f4407; }
.tv-linea.nota > i { color: #b06a0a; }
.tv-linea.nueva { animation: tv-linea .45s var(--tv-curva) both; }
.tv-linea.resultado.nueva { animation: tv-linea .45s var(--tv-curva) both, tv-destello 1.4s ease-out .1s; }
@keyframes tv-linea { from { opacity: 0; transform: translateX(-8px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes tv-destello { 0% { box-shadow: 0 0 0 0 rgba(13, 148, 136, .45); } 100% { box-shadow: 0 0 0 .5rem rgba(13, 148, 136, 0); } }

/* La pregunta del año, dentro del paso 2 */
.tv-pregunta { position: relative; z-index: 1; margin-top: .75rem; padding: .9rem 1rem; border-radius: 14px; background: #fff; border: 2px solid var(--tv-vivo);
  box-shadow: 0 14px 30px -18px rgba(29, 78, 216, .55); animation: tv-linea .45s var(--tv-curva) both; }
.tv-pregunta[hidden] { display: none; }
.tv-pregunta-titulo { margin: 0 0 .3rem; font-weight: 750; color: var(--tv-tinta); font-size: 1rem; }
.tv-pregunta-titulo i { color: var(--tv-azul); margin-right: .25rem; }
.tv-pregunta-texto { margin: 0 0 .7rem; font-size: .87rem; color: var(--tv-piedra); line-height: 1.45; }
.tv-pregunta-campo { display: flex; gap: .5rem; flex-wrap: wrap; }
.tv-pregunta-campo input { flex: 1 1 9rem; max-width: 12rem; }
.tv-pregunta-error { margin: .45rem 0 0; color: #a35a06; font-size: .85rem; font-weight: 600; }
.tv-pregunta-atajos { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }

/* Avisos: sin red, error y final */
.tv-aviso { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1rem; padding: .8rem 1rem; border-radius: 14px; background: #fff7e8; border: 1px solid #f0cf94; color: #6f4407; }
.tv-aviso[hidden] { display: none; }
.tv-aviso p { margin: 0; font-size: .9rem; }
.tv-aviso i { margin-top: .2rem; }

.tv-final { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: center; margin-bottom: 1rem; padding: .95rem 1.1rem; border-radius: 18px;
  background: linear-gradient(135deg, #e6f8f5, #eef9ff); border: 1px solid #b7e4dc; animation: tv-final .6s var(--tv-curva) both; }
.tv-final[hidden] { display: none; }
.tv-final-icono { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 50%; background: var(--tv-listo); color: #fff; font-size: 1.2rem;
  box-shadow: 0 0 0 6px rgba(13, 148, 136, .14); animation: tv-pop .6s var(--tv-curva) .15s both; }
.tv-final-titulo { margin: 0; font-weight: 800; font-size: 1.05rem; color: #0f3f3a; }
.tv-final p { margin: 0; font-size: .9rem; color: #285a55; }
.tv-final .btn { white-space: nowrap; }
@keyframes tv-final { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
/* 15 nov 2026 (Daniel: «se cierra el modal y pasa un rato y ya carga»): al terminar la ventana NO se desvanece; se queda
   a la vista con esta barra que avanza hasta que el navegador cambia de página. */
.tv-final-barra { grid-column: 1 / -1; height: 5px; margin: .15rem 0 0; border-radius: 99px; overflow: hidden; background: rgba(13, 148, 136, .18); }
.tv-final-barra::after { content: ""; display: block; height: 100%; width: 40%; border-radius: inherit; background: linear-gradient(90deg, #0d9488, #22d3ee, #38bdf8);
  animation: tv-busca 1.15s ease-in-out infinite; }
.tv:not(.tv-abriendo) .tv-final-barra::after { animation-duration: 1.7s; opacity: .75; }
.tv.tv-abriendo-lento .tv-final .btn { box-shadow: 0 0 0 4px rgba(37, 99, 235, .22); }
@keyframes tv-busca { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* Al hacer clic en «Analizar»: la ventana ya está abierta (esperando lo que responde el servidor). */
.tv.tv-preparando .tv-barra > span { width: 6%; }

.tv-error { margin-top: .3rem; padding: 1rem 1.1rem; border-radius: 16px; background: #fffaf0; border: 1px solid #ecc27f; }
.tv-error[hidden] { display: none; }
.tv-error:focus { outline: 3px solid rgba(217, 138, 28, .35); outline-offset: 2px; }
.tv-error-titulo { margin: 0 0 .35rem; color: #6f4407; }
.tv-error-titulo i { color: #b06a0a; margin-right: .25rem; }
.tv-error p { font-size: .9rem; }
.tv-error-botones { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0 0; }
.tv-error.sacude { animation: tv-sacude .5s ease both; }
@keyframes tv-sacude { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* Columna de al lado */
.tv-lado { display: grid; gap: .9rem; position: sticky; top: 0; }
.tv-ias { padding: .85rem .95rem; border-radius: 16px; background: #fff; border: 1px solid var(--tv-linea); transition: border-color .4s, box-shadow .4s; }
.tv-ias.con-ia { border-color: #c7d3fb; box-shadow: 0 12px 26px -20px rgba(37, 99, 235, .6); }
.tv-lado-titulo { margin: 0 0 .55rem; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--tv-piedra); }
.tv-ias .ia-logos { justify-content: flex-start; }
.tv-ias .ia-logo .ia-logo-img { transition: filter .5s, opacity .5s, transform .5s var(--tv-curva); }
.tv-ias .ia-logo.en-espera .ia-logo-img { filter: grayscale(1); opacity: .45; }
.tv-ias .ia-logo.usada .ia-logo-img { transform: scale(1.08); }
.tv-ias.pensando .ia-logo .ia-logo-img { animation: ia-pensar 1.5s ease-in-out infinite; }
.tv-ias.pensando .ia-logo:nth-child(2) .ia-logo-img { animation-delay: .25s; }
.tv-ias.pensando .ia-logo:nth-child(3) .ia-logo-img { animation-delay: .5s; }
.tv-ias-nota { margin: .55rem 0 0; font-size: .82rem; color: var(--tv-piedra); line-height: 1.4; }
.tv-ias-nota strong { color: var(--tv-tinta); }
.tv-consejos { list-style: none; margin: 0; padding: 0 .2rem; display: grid; gap: .6rem; font-size: .8rem; line-height: 1.4; color: var(--tv-piedra); }
.tv-consejos li { display: flex; gap: .55rem; }
.tv-consejos i { flex: none; margin-top: .2rem; color: var(--tv-azul); width: .95rem; text-align: center; }
.tv-consejos strong { color: var(--tv-tinta); }

/* ---------- Tamaños ---------- */
@media (max-width: 860px) {
  .tv-cuerpo { grid-template-columns: minmax(0, 1fr); }
  .tv-lado { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 640px) {
  .tv { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .tv-caja { height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .tv[open] .tv-caja { animation-name: tv-entra-movil; }
  @keyframes tv-entra-movil { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }
  .tv-cab { padding: 1rem 1rem 0; }
  .tv-cab-fila { grid-template-columns: auto minmax(0, 1fr); gap: .9rem; }
  .tv-orbe { width: 88px; height: 88px; }
  .tv-logo picture, .tv-logo img { width: 52px !important; height: 52px !important; }
  .tv-cab h2 { font-size: 1.3rem; margin-bottom: .4rem; }
  .tv-estado { font-size: .72rem; }
  .tv-entrada { padding: .4rem .6rem; }
  .tv-entrada small { display: none; }
  .tv-cifra { grid-column: 1 / -1; display: flex; align-items: baseline; gap: .8rem; text-align: left; }
  .tv-pct { font-size: 2rem; }
  .tv-cuenta { margin: 0 !important; }
  .tv-reloj { margin-left: auto !important; }
  .tv-barra { margin: .8rem -1rem 0; }
  .tv-cuerpo { padding: 1rem .9rem 1.4rem; }
  .tv-paso { grid-template-columns: 2.4rem minmax(0, 1fr); gap: .65rem; }
  .tv-paso::before, .tv-paso::after { left: 1.2rem; top: 2.6rem; }
  .tv-marca-icono { width: 2.4rem; height: 2.4rem; border-radius: 12px; font-size: .95rem; }
  .tv-tarjeta { padding: .7rem .8rem; }
  .tv-lado { grid-template-columns: minmax(0, 1fr); }
  .tv-final { grid-template-columns: auto minmax(0, 1fr); }
  .tv-final .btn { grid-column: 1 / -1; }
}

/* Sin animaciones para quien las pide así */
@media (prefers-reduced-motion: reduce) {
  .tv *, .tv *::before, .tv *::after, .tv::backdrop, .tv[open] .tv-caja { animation: none !important; transition: none !important; }
  .tv-cuerpo { scroll-behavior: auto; }
}
