/* Motor de recreaciones de video de TOS — estilos del lienzo.
   @source: DECISION del dueño (2026-09-23): mientras no existan grabaciones reales, el sitio monta
   recreaciones animadas rotuladas "Recreación · datos de ejemplo", con el texto y los colores reales
   del producto. Colores del panel = app/web/panel.css; marca = assets/marca/MARCA.md (Verde Mercado).
   El lienzo tiene tamaño base fijo (9:16 = 360×640, 16:9 = 960×540) y se escala entero: la tipografía
   es idéntica en una tarjeta pequeña, en pantalla completa o al exportar un frame a 1080×1920.
   Pesos: la interfaz recreada (WhatsApp, panel) usa 400/500 como el producto real; los subtítulos y
   la tarjeta de marca son gráfica de video (como el logo) y pueden usar 700. */

:root {
  /* WhatsApp — la pantalla del canal, no es paleta de marca */
  --wa-bg: #0b141a; --wa-in: #1f2c34; --wa-out: #005c4b; --wa-head: #1f2c34; --wa-tx2: #8fa6b4;
  /* Panel real (app/web/panel.css) */
  --p-bg: #0f1420; --p-s1: #171d2b; --p-s2: #1e2536; --p-bd: #2a3346;
  --p-tx: #e7ecf5; --p-tx2: #93a0b7; --p-mut: #6b7688;
  --p-accent: #4f8cff; --p-success: #22c55e; --p-warning: #f59e0b; --p-danger: #ef4444;
  /* Marca Verde Mercado */
  --negro: #141414; --verde: #0FA152; --accion: #0A7A40;
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--fuente); -webkit-font-smoothing: antialiased; }

/* --- Marco escalado --- */
.tv-marco { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; }
.tv-marco.v916 { width: 360px; height: 640px; }
.tv-marco.v169 { width: 960px; height: 540px; }
.tv-lienzo { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--wa-bg); color: #fff; }

/* --- Línea de tiempo: capas (fundido) y elementos (entran al aparecer) --- */
.tv-capa { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s linear .45s; }
.tv-capa.on { opacity: 1; visibility: visible; transition: opacity .45s ease; }
.tv-el:not(.on) { display: none !important; }
.tv-el.on { animation: tv-entrar .38s ease both; }
@keyframes tv-entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Modo quieto (exportar frames): el instante t exacto, sin transiciones a medio camino. */
.quieto *, .quieto *::before, .quieto *::after { transition: none !important; animation: none !important; }

/* --- Rótulo obligatorio, discreto ---
   @source: Sistema_Produccion_Videos_TOS_V2.md §7.7 | decisión del dueño del 2026-11-04: el rótulo sigue
   en cada recreación, pero sin el sello verde que competía con el video: gris neutro translúcido, más
   pequeño y sin borde. El fondo al 50 % deja el texto blanco legible tanto sobre el panel claro como
   sobre la cabecera verde del chat. */
.tv-rec {
  position: absolute; top: 8px; right: 8px; z-index: 60; pointer-events: none;
  font-size: 8px; font-weight: 400; letter-spacing: .02em; color: rgba(255, 255, 255, .9);
  background: rgba(17, 24, 39, .5); border-radius: 4px; padding: 2px 6px;
}
.v169 .tv-rec { top: 6px; right: 10px; font-size: 9px; }
/* En vertical el rótulo cae donde el panel pone el nombre de la tienda: se oculta ese nombre, que es
   decorativo, para que el rótulo no se monte sobre texto (2026-11-04). */
.v916 .tv-p-head .ti { visibility: hidden; }

/* --- Subtítulos quemados --- */
.tv-texto {
  position: absolute; left: 0; right: 0; bottom: 42px; z-index: 50; text-align: center;
  padding: 0 20px; pointer-events: none; opacity: 0; transform: translateY(6px);
  transition: opacity .35s ease, transform .35s ease;
}
.tv-texto.arriba { bottom: auto; top: 96px; }
.tv-texto.on { opacity: 1; transform: none; }
.tv-texto span {
  background: rgba(6, 10, 14, .8); box-shadow: 0 0 0 7px rgba(6, 10, 14, .8); border-radius: 2px;
  color: #fff; font-weight: 700; font-size: 17px; line-height: 1.55;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.tv-texto.acento span { color: #86efb8; }
.v169 .tv-texto { bottom: 30px; }
.v169 .tv-texto span { font-size: 20px; }

/* --- Capa: noche (reloj + notificación) --- */
.tv-noche {
  background: radial-gradient(120% 90% at 50% 22%, #10201a 0%, #060a08 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #e0efe7;
}
.tv-noche .reloj { font-weight: 700; font-size: 58px; letter-spacing: .02em; text-shadow: 0 2px 20px rgba(15, 161, 82, .4); line-height: 1; }
.tv-noche .ampm { display: block; text-align: center; font-size: 14px; font-weight: 500; letter-spacing: .35em; color: #8fb3a1; margin-top: 8px; }
.tv-notif {
  width: 82%; background: rgba(18, 28, 24, .94); border: 1px solid #24463a; border-radius: 16px;
  padding: 11px 13px; display: flex; gap: 10px; align-items: center;
}
.tv-notif .ic { width: 30px; height: 30px; border-radius: 8px; background: #25d366; flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; color: #04231a; }
.tv-notif .tx { font-size: 12px; line-height: 1.3; color: #dcefe4; }
.tv-notif .tx b { display: block; color: #fff; font-weight: 500; font-size: 12.5px; }

/* --- Capa / bloque: chat de WhatsApp --- */
.tv-chat { display: flex; flex-direction: column; background: var(--wa-bg); height: 100%; }
.tv-wa-top { background: var(--wa-head); padding: 12px 12px 10px; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.tv-wa-top .av { width: 34px; height: 34px; border-radius: 50%; background: #324a3f; display: grid; place-items: center; font-weight: 500; color: #cfe9db; font-size: 14px; flex: 0 0 auto; }
.tv-wa-top .nm { font-size: 14px; font-weight: 500; color: #fff; line-height: 1.15; }
.tv-wa-top .nm small { display: block; font-size: 11px; font-weight: 400; color: var(--wa-tx2); }
.tv-hilo {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px;
  padding: 10px 10px 108px; overflow: hidden;
  background:
    linear-gradient(rgba(11, 20, 26, .94), rgba(11, 20, 26, .94)),
    repeating-linear-gradient(0deg, #0f1a22 0 2px, transparent 2px 22px),
    repeating-linear-gradient(90deg, #0f1a22 0 2px, transparent 2px 22px);
}
.tv-chat.sin-margen .tv-hilo { padding-bottom: 12px; }
.tv-b { max-width: 82%; padding: 7px 10px 6px; border-radius: 10px; font-size: 13.5px; line-height: 1.36; overflow-wrap: anywhere; flex: 0 0 auto; }
.tv-b.cli { align-self: flex-end; background: var(--wa-out); border-top-right-radius: 3px; color: #e9fff7; }
.tv-b.bot, .tv-b.ase { align-self: flex-start; background: var(--wa-in); border-top-left-radius: 3px; color: #e7eef3; }
.tv-b .hr { float: right; font-size: 10px; color: rgba(255, 255, 255, .5); margin: 7px 0 0 10px; }
.tv-b .tag {
  display: block; width: max-content; max-width: 100%; font-size: 10px; font-weight: 500; margin-bottom: 4px;
  color: #6ee7a8; background: rgba(15, 161, 82, .18); border: 1px solid rgba(60, 200, 130, .32); border-radius: 5px; padding: 1px 6px;
}
.tv-b.ase .tag { color: #9cc0ff; background: rgba(79, 140, 255, .16); border-color: rgba(79, 140, 255, .35); }
.tv-escribiendo { align-self: flex-start; background: var(--wa-in); border-radius: 10px; border-top-left-radius: 3px; padding: 10px 13px; display: flex; gap: 4px; flex: 0 0 auto; }
.tv-escribiendo i { width: 6px; height: 6px; border-radius: 50%; background: #7f97a6; animation: tv-parpadeo 1.2s infinite; }
.tv-escribiendo i:nth-child(2) { animation-delay: .2s; }
.tv-escribiendo i:nth-child(3) { animation-delay: .4s; }
@keyframes tv-parpadeo { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.tv-sistema { align-self: center; font-size: 10.5px; color: #c5d3dc; background: #182229; border-radius: 7px; padding: 3px 9px; flex: 0 0 auto; }
.tv-rotulo { align-self: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #04231a; background: #6ee7a8; border-radius: 999px; padding: 3px 12px; flex: 0 0 auto; }
.tv-comprobante { align-self: flex-end; width: 66%; background: var(--wa-out); border-radius: 10px; border-top-right-radius: 3px; padding: 5px; flex: 0 0 auto; }
.tv-comprobante .doc { background: #f4f6f8; color: #1d2733; border-radius: 7px; padding: 9px 10px; font-size: 11px; line-height: 1.45; }
.tv-comprobante .doc .bn { font-weight: 500; color: #5b2a86; font-size: 12px; }
.tv-comprobante .doc .ok { color: #178a4c; font-weight: 500; }
.tv-comprobante .doc .mt { font-size: 17px; font-weight: 500; color: #111; margin: 2px 0; }
.tv-comprobante .pie { font-size: 10px; color: rgba(255, 255, 255, .6); text-align: right; padding: 3px 4px 0; }
.tv-producto { align-self: flex-start; width: 78%; background: var(--wa-in); border-radius: 10px; border-top-left-radius: 3px; overflow: hidden; flex: 0 0 auto; }
.tv-producto .ph { height: 74px; background: linear-gradient(135deg, #22332b, #2f4a3c); display: flex; align-items: center; justify-content: center; gap: 8px; color: #a6cdb8; font-size: 11px; }
.tv-producto .ph svg { flex: 0 0 auto; }
.tv-producto .cb { padding: 8px 10px; }
.tv-producto .cb b { font-size: 13px; font-weight: 500; color: #fff; display: block; }
.tv-producto .pr { font-weight: 500; color: #6ee7a8; font-size: 15px; margin-top: 2px; }
.tv-producto .st { font-size: 11px; color: var(--wa-tx2); margin-top: 1px; }

/* --- Capa: panel (tema oscuro real del producto) --- */
.tv-panel { background: var(--p-bg); color: var(--p-tx); display: flex; flex-direction: column; font-size: 13px; }
.tv-navegador { flex: 0 0 auto; height: 28px; background: #1b1f27; display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.tv-navegador i { width: 9px; height: 9px; border-radius: 50%; background: #3a4150; }
.tv-navegador .url { margin-left: 10px; flex: 0 1 380px; background: #0f1319; color: #9aa5b8; font-size: 11px; border-radius: 6px; padding: 3px 10px; }
.tv-p-head { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--p-s1); border-bottom: .5px solid var(--p-bd); }
.tv-p-head .lg { font-weight: 500; letter-spacing: .3px; font-size: 14px; }
.tv-p-head .lg span { color: var(--p-accent); }
.tv-p-head nav { display: flex; gap: 2px; }
.tv-p-head nav a { color: var(--p-tx2); padding: 5px 9px; border-radius: 7px; font-size: 12px; font-weight: 500; }
.tv-p-head nav a.activo { color: var(--p-tx); background: var(--p-s2); }
.tv-p-head nav a .fl { font-size: 9px; opacity: .7; }
.tv-p-head .sp { flex: 1; }
.tv-p-head .ti { color: var(--p-tx2); font-size: 12px; }
.v916 .tv-p-head { padding: 12px 14px; }
.v916 .tv-p-head .pe { font-size: 13px; font-weight: 500; color: var(--p-tx); }
.tv-p-body { flex: 1 1 auto; min-height: 0; padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.v169 .tv-p-body { padding: 16px 20px; gap: 12px; }
.v916 .tv-p-body { padding-bottom: 104px; }

/* Bloques del panel */
.tv-titulo { font-size: 15px; font-weight: 500; color: var(--p-tx); }
.tv-titulo small { display: block; font-size: 12px; font-weight: 400; color: var(--p-tx2); margin-top: 2px; }
.v169 .tv-titulo { font-size: 17px; }
.tv-texto-b { font-size: 12.5px; color: var(--p-tx2); line-height: 1.5; }
.tv-etq { align-self: flex-start; font-size: 11px; font-weight: 500; border-radius: 999px; padding: 3px 10px; background: var(--r-bg); color: var(--r-tx); border: 1px solid var(--r-bd); }
.tv-tarjeta { background: var(--p-s2); border: .5px solid var(--p-bd); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.tv-tarjeta.calor { border-left: 3px solid var(--r-tx); }
.tv-tarjeta .cab { display: flex; align-items: center; gap: 8px; }
.tv-tarjeta .nm { font-size: 13.5px; font-weight: 500; }
.tv-tarjeta .mt { font-size: 11.5px; color: var(--p-tx2); }
.tv-insignia { margin-left: auto; font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--r-bg); color: var(--r-tx); }
.tv-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; margin: 0; }
.tv-kv dt { color: var(--p-mut); }
.tv-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.tv-aviso { font-size: 12px; border-radius: 9px; padding: 8px 10px; background: var(--r-bg); color: var(--r-tx); border: 1px solid var(--r-bd); line-height: 1.4; }
.tv-aviso b { font-weight: 500; }
.tv-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-btn {
  position: relative; font-size: 12.5px; font-weight: 500; border-radius: 8px; padding: 8px 13px;
  background: var(--p-s2); color: var(--p-tx); border: .5px solid var(--p-bd); transition: transform .12s ease, filter .12s ease;
}
.tv-btn.primario { background: var(--p-accent); border-color: var(--p-accent); color: #fff; }
.tv-btn.exito { background: var(--p-success); border-color: var(--p-success); color: #04210f; }
.tv-btn.peligro { background: rgba(239, 68, 68, .15); border-color: rgba(239, 68, 68, .45); color: #fca5a5; }
.tv-btn.ancho { display: block; width: 100%; text-align: center; padding: 10px; font-size: 13.5px; }
.tv-btn.presionado { transform: scale(.95); filter: brightness(.88); }
.tv-cursor { position: absolute; right: 8px; bottom: -10px; font-size: 22px; line-height: 1; opacity: 0; transform: translate(10px, 12px); transition: opacity .3s ease, transform .5s ease; pointer-events: none; z-index: 5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.tv-cursor.on { opacity: 1; transform: none; }
.tv-foco { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px rgba(255, 255, 255, .14); border-radius: 10px; }

.tv-lista { display: flex; flex-direction: column; gap: 8px; }
.tv-lista .tv-tarjeta { padding: 10px 11px; gap: 3px; transition: opacity .35s ease; }
.tv-lista.enfoque .tv-tarjeta:not(.tv-foco) { opacity: .32; }
.tv-orden { position: absolute; left: -8px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; border-radius: 50%; background: var(--verde); color: #04210f; font-size: 10.5px; font-weight: 700; display: none; place-items: center; }
.tv-lista.ordenada .tv-orden { display: grid; }

.tv-cols { display: grid; gap: 10px; flex: 0 1 auto; min-height: 0; align-items: start; }
.tv-col { background: var(--p-s1); border: .5px solid var(--p-bd); border-radius: 11px; padding: 9px; display: flex; flex-direction: column; gap: 7px; min-width: 0; overflow: hidden; }
.tv-col .ct { font-size: 11px; font-weight: 500; color: var(--p-tx2); display: flex; justify-content: space-between; }
.tv-col .tv-tarjeta { padding: 8px 9px; gap: 2px; }
.tv-col .tv-tarjeta .nm { font-size: 12px; }
.tv-col .tv-tarjeta .mt { font-size: 10.5px; }

.tv-tabla { width: 100%; border-collapse: collapse; font-size: 12px; }
.tv-tabla th { text-align: left; color: var(--p-mut); font-weight: 500; font-size: 11px; padding: 6px 8px; border-bottom: .5px solid var(--p-bd); }
.tv-tabla td { padding: 8px; border-bottom: .5px solid var(--p-bd); vertical-align: middle; }
.tv-tabla tr.tv-foco td { background: rgba(255, 255, 255, .05); }
.tv-tabla tr.tv-foco { outline: none; box-shadow: none; }
.tv-tag { font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--r-bg); color: var(--r-tx); white-space: nowrap; }

.tv-filas { display: flex; flex-direction: column; }
.tv-fila { display: flex; align-items: center; gap: 11px; padding: 9px 2px; border-bottom: .5px solid var(--p-bd); position: relative; }
.tv-fila .th { width: 42px; height: 42px; border-radius: 9px; background: var(--p-s2); display: grid; place-items: center; font-size: 19px; flex: 0 0 auto; }
.tv-fila.alerta .th { background: rgba(245, 158, 11, .15); }
.tv-fila .cu { flex: 1; min-width: 0; }
.tv-fila .cu b { display: block; font-size: 13px; font-weight: 500; }
.tv-fila .cu span { font-size: 11.5px; color: var(--p-tx2); }
.tv-fila.alerta .cu span { color: var(--p-warning); }

.tv-embudo { display: flex; flex-direction: column; gap: 9px; }
.tv-barra { display: grid; grid-template-columns: 96px 1fr 44px; gap: 8px; align-items: center; font-size: 12px; }
.v169 .tv-barra { grid-template-columns: 130px 1fr 50px; }
.tv-barra .pista { height: 18px; background: var(--p-s1); border-radius: 4px; overflow: hidden; }
.tv-barra .relleno { display: block; height: 100%; width: 0; background: var(--p-accent); border-radius: 4px; transition: width 1.1s ease; }
.tv-barra.cierre .relleno { background: var(--p-success); }
.tv-barra .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--p-tx); }
.tv-barra.fuga { outline: 1px dashed rgba(239, 68, 68, .7); outline-offset: 3px; border-radius: 4px; }

.tv-stats { display: grid; gap: 8px; }
.tv-stat { background: var(--p-s2); border: .5px solid var(--p-bd); border-radius: 10px; padding: 10px; }
.tv-stat .v { font-size: 20px; font-weight: 500; color: var(--r-tx, var(--p-tx)); font-variant-numeric: tabular-nums; }
.tv-stat .e { font-size: 11px; color: var(--p-tx2); }

.tv-form { display: flex; flex-direction: column; gap: 9px; }
.tv-campo label { display: block; font-size: 11.5px; color: var(--p-tx2); margin-bottom: 4px; }
.tv-campo .in { background: var(--p-s1); border: .5px solid var(--p-bd); border-radius: 8px; padding: 8px 10px; font-size: 13px; min-height: 34px; color: var(--p-tx); }
.tv-campo .in.escribiendo::after { content: "|"; color: var(--p-accent); margin-left: 1px; }

.tv-pasos { display: flex; flex-direction: column; gap: 7px; }
.tv-paso { display: flex; align-items: center; gap: 10px; background: var(--p-s2); border: .5px solid var(--p-bd); border-radius: 10px; padding: 9px 11px; font-size: 13px; }
.tv-paso .ck { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--p-mut); display: grid; place-items: center; font-size: 12px; color: transparent; flex: 0 0 auto; }
.tv-paso.hecho .ck { background: var(--p-success); border-color: var(--p-success); color: #04210f; }
.tv-paso.hecho { color: var(--p-tx2); }
.tv-paso.actual { border-color: var(--p-accent); }

.tv-opciones { display: grid; gap: 8px; }
.tv-opcion { background: var(--p-s2); border: 1px solid var(--p-bd); border-radius: 10px; padding: 9px 11px; }
.tv-opcion b { display: block; font-size: 13px; font-weight: 500; }
.tv-opcion span { font-size: 11.5px; color: var(--p-tx2); line-height: 1.4; display: block; margin-top: 2px; }
.tv-opcion.sel { border-color: var(--p-accent); background: rgba(79, 140, 255, .1); }
.tv-opcion.sel b::after { content: "  ✓"; color: var(--p-accent); }

.tv-inter { display: flex; flex-direction: column; gap: 8px; }
.tv-sw { display: flex; align-items: center; gap: 10px; font-size: 12.5px; background: var(--p-s2); border: .5px solid var(--p-bd); border-radius: 10px; padding: 9px 11px; }
.tv-sw .tx { flex: 1; }
.tv-sw .tx small { display: block; color: var(--p-tx2); font-size: 11px; }
.tv-sw .pl { width: 34px; height: 20px; border-radius: 999px; background: #3a4356; position: relative; transition: background .25s ease; flex: 0 0 auto; }
.tv-sw .pl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .25s ease; }
.tv-sw.activo .pl { background: var(--p-success); }
.tv-sw.activo .pl::after { left: 17px; }

.tv-subir { border: 1.5px dashed var(--p-bd); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; }
.tv-subir .ic { font-size: 26px; }
.tv-subir .ar { font-size: 12.5px; }
.tv-subir .pr { width: 100%; height: 6px; background: var(--p-s1); border-radius: 999px; overflow: hidden; }
.tv-subir .pr i { display: block; height: 100%; width: 0; background: var(--p-accent); }

.tv-grupo { display: flex; gap: 12px; min-height: 0; align-items: flex-start; }
.tv-grupo.col { flex-direction: column; align-items: stretch; }
.tv-grupo > * { min-width: 0; }
.tv-bloque-chat { border-radius: 12px; overflow: hidden; border: .5px solid var(--p-bd); }
.tv-bloque-chat .tv-hilo { padding-bottom: 12px; }

/* Roles de color (patrón tinte del panel) */
.r-exito   { --r-bg: rgba(34, 197, 94, .15);  --r-tx: #22c55e; --r-bd: rgba(34, 197, 94, .4); }
.r-alerta  { --r-bg: rgba(245, 158, 11, .15); --r-tx: #f59e0b; --r-bd: rgba(245, 158, 11, .4); }
.r-peligro { --r-bg: rgba(239, 68, 68, .15);  --r-tx: #f87171; --r-bd: rgba(239, 68, 68, .45); }
.r-info    { --r-bg: rgba(79, 140, 255, .16); --r-tx: #6ea1ff; --r-bd: rgba(79, 140, 255, .4); }
.r-neutro  { --r-bg: rgba(107, 118, 136, .18); --r-tx: #9aa5b8; --r-bd: rgba(107, 118, 136, .4); }
/* Mapa de calor: 4 activos + 2 cerrados (Documento_Estilo_Panel §1). Ganado = verde fluorescente con
   insignia sólida (texto oscuro), para no confundirse con el verde de Alta; Perdido = gris. */
.n-alta     { --r-bg: rgba(34, 197, 94, .15);  --r-tx: #22c55e; --r-bd: rgba(34, 197, 94, .4); }
.n-media    { --r-bg: rgba(245, 158, 11, .15); --r-tx: #f59e0b; --r-bd: rgba(245, 158, 11, .4); }
.n-baja     { --r-bg: rgba(79, 140, 255, .16); --r-tx: #4f8cff; --r-bd: rgba(79, 140, 255, .4); }
.n-riesgo   { --r-bg: rgba(239, 68, 68, .15);  --r-tx: #ef4444; --r-bd: rgba(239, 68, 68, .45); }
.n-ganado   { --r-bg: #39ff14; --r-tx: #39ff14; --r-bd: rgba(57, 255, 20, .5); }
.n-ganado .tv-insignia { color: #0f1420; }
.n-perdido  { --r-bg: rgba(107, 118, 136, .18); --r-tx: #6b7688; --r-bd: rgba(107, 118, 136, .4); }

/* --- Capa: titular (texto grande sobre fondo de marca) --- */
.tv-titular { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 36px 30px 90px; background: var(--negro); }
.tv-titular.claro { background: #F6F7FB; color: var(--negro); }
.tv-titular.verde { background: radial-gradient(120% 100% at 30% 20%, #0f7d44 0%, #064d2a 80%); }
.tv-titular .l-grande { font-weight: 700; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
.tv-titular .l-normal { font-size: 17px; line-height: 1.45; color: #d6dde6; }
.tv-titular.claro .l-normal { color: #5B6472; }
.tv-titular .l-etiqueta { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6ee7a8; }
.tv-titular.claro .l-etiqueta { color: var(--accion); }
.tv-titular .l-pequeno { font-size: 13px; color: #9aa5b8; }
.v169 .tv-titular { padding: 50px 80px; }
.v169 .tv-titular .l-grande { font-size: 40px; }
.v169 .tv-titular .l-normal { font-size: 20px; }

/* --- Capa: tarjeta de marca (cierre) --- */
.tv-marca { background: radial-gradient(120% 100% at 50% 35%, #1c1c1c 0%, #0a0a0a 80%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px; text-align: center; padding: 28px; }
.tv-marca .mono { width: 70px; height: 70px; border-radius: 22%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: 23px; letter-spacing: .5px; color: var(--negro); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.tv-marca .logo { font-weight: 800; font-size: 29px; color: #fff; }
.tv-marca .logo b { color: var(--verde); font-weight: 800; }
.tv-marca .lema { color: #c5cdd6; font-size: 14px; max-width: 25ch; line-height: 1.4; }
.tv-marca .cta { margin-top: 4px; display: inline-flex; align-items: center; gap: 8px; background: var(--accion); color: #fff; font-weight: 700; font-size: 15px; padding: 11px 20px; border-radius: 999px; box-shadow: 0 8px 24px rgba(10, 122, 64, .4); }

/* --- Capa: tarjeta de noticia (pista D · actualidad) --- */
.tv-noticia { position: absolute; inset: 0; background: #141414; overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.tv-noticia .motivo { position: absolute; inset: 0; width: 100%; height: 100%; }
.tv-noticia .scrim { position: absolute; left: 0; right: 0; top: 36%; bottom: 0; background: linear-gradient(to bottom, rgba(20,20,20,0) 0%, rgba(20,20,20,.86) 35%, #141414 100%); }
.tv-noticia .cab { position: absolute; top: 20px; left: 20px; color: #fff; font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.tv-noticia .cab b { color: var(--verde); }
.tv-noticia .cab .mono { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--verde); background: #141414; font-size: 13px; font-weight: 800; }
.tv-noticia .chip { position: absolute; left: 20px; display: inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.tv-noticia .chip.kick { top: 62px; background: var(--verde); color: #141414; letter-spacing: .5px; }
.tv-noticia .chip.fecha { top: 98px; background: #1e1e1e; color: var(--verde); }
.tv-noticia .titular { position: absolute; left: 20px; right: 20px; bottom: 168px; color: #fff; font-weight: 800; font-size: 33px; line-height: 1.08; letter-spacing: -.5px; }
.tv-noticia .linea { position: absolute; left: 20px; right: 20px; bottom: 150px; height: 1px; background: #2a2a2a; }
.tv-noticia .tienda { position: absolute; left: 20px; right: 20px; bottom: 96px; color: #9aa3b0; font-weight: 600; font-size: 12.5px; line-height: 1.4; }
.tv-noticia .tienda b { color: #c5cdd6; }
.tv-noticia .fuente { position: absolute; left: 20px; bottom: 74px; color: #6b7280; font-size: 11px; }
.tv-noticia .cta { position: absolute; left: 20px; bottom: 24px; background: var(--accion); color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(10,122,64,.4); }

/* --- Capa: pantalla dividida (cliente arriba / dueño abajo) --- */
.tv-dividido { display: flex; flex-direction: column; background: #05080a; gap: 2px; }
.tv-mitad { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; }
.tv-mitad > .tv-chat, .tv-mitad > .tv-panel { position: absolute; inset: 0; }
.tv-mitad .tv-hilo { padding-bottom: 32px; }
.tv-mitad .tv-p-body { padding-bottom: 10px; }
.tv-mitad .rot { position: absolute; left: 8px; bottom: 8px; z-index: 4; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(0, 0, 0, .7); color: #fff; padding: 3px 8px; border-radius: 6px; }

/* --- Controles del reproductor --- */
.tv-ctl {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; align-items: center; gap: 10px;
  padding: 18px 12px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .75));
  opacity: 0; transition: opacity .25s ease; font-family: var(--fuente);
}
.tv-ctl.visible, .tv-ctl:focus-within { opacity: 1; }
.tv-ctl button {
  width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accion); color: #fff;
  font-size: 15px; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto;
}
.tv-ctl button:focus-visible, .tv-barra-t:focus-visible { outline: 3px solid #86efb8; outline-offset: 2px; }
.tv-barra-t { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .25); cursor: pointer; position: relative; }
.tv-barra-t i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: #22c274; }
.tv-ctl .tm { color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.tv-fin {
  position: fixed; inset: 0; z-index: 90; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(0, 0, 0, .55); font-family: var(--fuente);
}
.tv-fin.visible { display: flex; }
.tv-fin button, .tv-fin a {
  font: inherit; font-size: 15px; font-weight: 500; border-radius: 999px; padding: 11px 20px; cursor: pointer; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .4); color: #fff; min-height: 44px;
}
.tv-fin a { background: var(--accion); border-color: var(--accion); }
.tv-error { color: #c5cdd6; font: 14px/1.5 var(--fuente); display: grid; place-items: center; height: 100%; text-align: center; padding: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Panel sin cabecera y con una sola tarjeta centrada (inicio de sesión, diálogos). */
.tv-p-body.centrado { justify-content: center; align-items: center; }
.tv-p-body.centrado > * { width: 100%; max-width: 380px; }
/* Leyenda de pasos para videos de soporte (16:9): número + texto. */
.v169 .tv-p-body { font-size: 13.5px; }
/* El rótulo "Recreación" vive arriba a la derecha: la cabecera del chat que está debajo le deja lugar. */
.tv-lienzo > .tv-chat .tv-wa-top, .tv-dividido > .tv-mitad:first-child .tv-wa-top { padding-right: 150px; }
