/* ── el teleprompter: siempre texto claro sobre negro, en los dos temas ──── */
.tp, .tpc{ --tp-fondo:#000; --tp-texto:#f5f5f2; --tp-tenue:#8f8d86; --tp-linea:#2a2a28; --tp-boton:#1a1a19; --tp-acento:#6d8dff; }

.tp{ position:fixed; inset:0; background:var(--tp-fondo); color:var(--tp-texto); overflow:hidden; outline:none; user-select:none; -webkit-user-select:none }
.tp-escenario{ position:absolute; inset:0; overflow:hidden; cursor:pointer; touch-action:none }
.tp-pista{ position:absolute; left:0; right:0; top:30vh; will-change:transform; line-height:1.38; font-weight:600 }
.tp-texto{ max-width:min(92vw, 1100px); margin:0 auto; padding:0 4vw 70vh }
.tp-titulo{ font-size:max(14px, .32em); color:var(--tp-tenue); font-weight:600; margin-bottom:.6em }
.tp-parte{ margin-bottom:.9em }
.tp-etiqueta{ font-size:max(12px, .24em); letter-spacing:.12em; text-transform:uppercase; color:var(--tp-acento); margin-bottom:.15em }
.tp-parte p{ margin:0; white-space:pre-wrap }
.tp-fin{ font-size:max(14px, .32em); color:var(--tp-tenue); margin-top:1.5em }
.tp-vacio{ font-size:28px; color:var(--tp-tenue) }
/* La línea de lectura: donde van los ojos. */
.tp-guia{ position:absolute; left:0; right:0; top:30vh; height:0; border-top:2px solid color-mix(in srgb, var(--tp-acento) 45%, transparent); pointer-events:none }

.tp-barra{ position:absolute; left:0; right:0; top:0; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; padding:10px 14px;
  background:linear-gradient(var(--tp-fondo) 60%, transparent); transition:opacity .25s; z-index:2 }
.tp-grupo{ display:flex; align-items:center; gap:8px; flex-wrap:wrap }
.tp-rotulo{ font-size:13px; color:var(--tp-tenue); max-width:40vw; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.tp-par{ display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--tp-tenue) }
.tp-par b{ color:var(--tp-texto); min-width:26px; text-align:center; font-variant-numeric:tabular-nums }
.tp-btn{ display:inline-flex; align-items:center; justify-content:center; height:34px; padding:0 12px; border-radius:8px; border:1px solid var(--tp-linea); background:var(--tp-boton); color:var(--tp-texto); font:600 13px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; cursor:pointer; text-decoration:none }
.tp-btn:hover{ border-color:var(--tp-tenue) }
.tp-btn.activo{ border-color:var(--tp-acento); color:var(--tp-acento) }
.tp-chico{ width:34px; padding:0 }
.tp-play{ min-width:96px; background:var(--tp-texto); color:var(--tp-fondo); border-color:var(--tp-texto) }
.tp-play.activo{ background:var(--tp-acento); border-color:var(--tp-acento); color:var(--tp-fondo) }
.tp-conexion{ font-size:12px; color:var(--tp-tenue) }
.tp-conexion.ok{ color:#5fd38d }
.tp-pie{ position:absolute; left:0; right:0; bottom:0; padding:10px 14px 14px; background:linear-gradient(transparent, var(--tp-fondo) 50%); transition:opacity .25s; z-index:2 }
.tp-avance{ height:3px; background:var(--tp-linea); border-radius:3px; overflow:hidden; margin-bottom:10px }
.tp-avance i{ display:block; height:100%; background:var(--tp-acento) }
.tp-puntos{ display:flex; justify-content:center; gap:8px; flex-wrap:wrap }
.tp-punto{ width:10px; height:10px; border-radius:50%; border:0; background:var(--tp-linea); cursor:pointer; padding:0 }
.tp-punto.actual{ background:var(--tp-acento) }
/* Mientras se lee, la barra se esconde; vuelve al mover el ratón o tocar. */
.tp.tp-quieta .tp-barra, .tp.tp-quieta .tp-pie{ opacity:0; pointer-events:none }

/* ── el control, para el celular ───────────────────────────────────────── */
.tpc{ min-height:100vh; background:var(--tp-fondo); color:var(--tp-texto); padding:16px; display:flex; flex-direction:column; gap:12px; font:15px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif }
.tpc-cab{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px }
.tpc-sub{ font-size:13px; color:var(--tp-tenue) }
.tpc-estado{ font-size:13px; color:var(--tp-tenue); padding:8px 10px; border:1px solid var(--tp-linea); border-radius:10px }
.tpc-estado.ok{ color:#5fd38d; border-color:color-mix(in srgb, #5fd38d 40%, transparent) }
.tpc-play{ height:88px; border-radius:16px; border:0; background:var(--tp-texto); color:var(--tp-fondo); font-size:28px; font-weight:700; cursor:pointer }
.tpc-play.activo{ background:var(--tp-acento) }
.tpc-avance{ height:4px; background:var(--tp-linea); border-radius:4px; overflow:hidden }
.tpc-avance i{ display:block; height:100%; background:var(--tp-acento) }
.tpc-fila{ display:flex; gap:10px; flex-wrap:wrap }
.tpc-fila > .tpc-btn{ flex:1 1 0 }
.tpc-btn{ display:inline-flex; align-items:center; justify-content:center; min-height:52px; padding:0 14px; border-radius:12px; border:1px solid var(--tp-linea); background:var(--tp-boton); color:var(--tp-texto); font-size:16px; font-weight:600; cursor:pointer; text-decoration:none }
.tpc-btn.activo{ border-color:var(--tp-acento); color:var(--tp-acento) }
.tpc-chico{ width:52px; padding:0; font-size:22px }
.tpc-par{ display:flex; align-items:center; gap:10px; width:100%; justify-content:space-between; color:var(--tp-tenue); font-size:14px }
.tpc-par b{ color:var(--tp-texto); font-size:20px; min-width:40px; text-align:center; font-variant-numeric:tabular-nums }
.tpc-rot{ margin-top:6px; font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--tp-tenue) }
.tpc-lista{ display:flex; flex-direction:column; gap:8px; padding-bottom:24px }
.tpc-guion{ display:flex; align-items:center; gap:10px; text-align:left; min-height:52px; padding:8px 12px; border-radius:12px; border:1px solid var(--tp-linea); background:var(--tp-boton); color:var(--tp-texto); font-size:15px; cursor:pointer }
.tpc-guion.actual{ border-color:var(--tp-acento) }
.tpc-num{ width:26px; height:26px; flex:none; border-radius:50%; display:grid; place-items:center; background:var(--tp-linea); font-size:13px; font-weight:700 }
.tpc-guion.actual .tpc-num{ background:var(--tp-acento); color:var(--tp-fondo) }
.tpc-hecho{ margin-left:auto; font-size:12px; color:var(--tp-tenue) }
@media (max-width:700px){ .tp-rotulo{ max-width:60vw } .tp-par{ font-size:0 } .tp-par b, .tp-par .tp-btn{ font-size:13px } }

/* ── editar un guion desde el teleprompter ─────────────────────────────── */
.tp-editor{ --tp-fondo:#000; --tp-texto:#f5f5f2; --tp-tenue:#8f8d86; --tp-linea:#2a2a28; --tp-boton:#1a1a19; --tp-acento:#6d8dff;
  position:fixed; inset:0; z-index:90; overflow:auto; background:var(--tp-fondo); color:var(--tp-texto);
  padding:16px; display:flex; flex-direction:column; gap:12px; font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif }
.tp-ed-pantalla{ padding:24px max(16px, calc((100vw - 900px) / 2)) }
.tp-ed-cab{ display:flex; align-items:center; justify-content:space-between; gap:12px; position:sticky; top:-16px; padding:8px 0; background:#000 }
.tp-ed-acciones{ display:flex; gap:8px }
.tp-ed-eco{ color:#ff8a7a; font-size:14px; min-height:0 }
.tp-ed-campo{ display:flex; flex-direction:column; gap:6px }
.tp-ed-campo span{ font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--tp-acento) }
.tp-editor input, .tp-editor textarea{ width:100%; padding:10px 12px; border-radius:10px; border:1px solid var(--tp-linea); background:var(--tp-boton); color:var(--tp-texto); font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; resize:vertical }
.tp-editor input:focus, .tp-editor textarea:focus{ outline:2px solid var(--tp-acento); outline-offset:1px; border-color:transparent }
.tpc-editar{ width:100% }

/* ── el QR del control, encima de la pantalla ──────────────────────────── */
/* Sale al abrir la pantalla si no hay ningún control conectado, y con el botón
   «Control en el celular». Se escanea con la cámara del celular. */
.tp-capa-qr{ position:absolute; inset:0; z-index:5; display:grid; place-items:center; padding:20px;
  background:rgba(0,0,0,.78); backdrop-filter:blur(2px) }
.tp-capa-qr[hidden]{ display:none }
.tp-qr-caja{ display:flex; flex-direction:column; align-items:center; gap:12px; max-width:420px; width:100%; padding:24px 22px 20px;
  border-radius:18px; background:var(--tp-boton); border:1px solid var(--tp-linea); text-align:center;
  font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; color:var(--tp-texto) }
.tp-qr-caja b{ font-size:19px }
.tp-qr-caja p{ margin:0; color:var(--tp-tenue); font-size:14px }
.tp-qr-caja .qr{ border-radius:12px; margin:4px 0 }
.tp-qr-url{ max-width:100%; font:12.5px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; color:var(--tp-tenue);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; user-select:all; -webkit-user-select:all }
.tp-qr-acciones{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; margin-top:4px }

/* ── cuando el enlace dejó de valer ────────────────────────────────────── */
.tp-fin-pantalla{ position:fixed; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  padding:24px; text-align:center; background:#000; color:#f5f5f2;
  font:16px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif }
.tp-fin-pantalla b{ font-size:22px; max-width:520px }
.tp-fin-pantalla p{ margin:0; color:#8f8d86; max-width:460px }
.tp-fin-pantalla .tp-btn{ --tp-fondo:#000; --tp-texto:#f5f5f2; --tp-linea:#2a2a28; --tp-boton:#1a1a19; --tp-acento:#6d8dff; margin-top:6px }
