/* Encuestas en vivo — misma paleta salvia y tipografía Poppins del MHDS. */

:root {
  --sage: #5c7268; --sage-dark: #48584f; --sage-light: #8ba192;
  --sage-pale: #eef1ec; --sage-mist: #f4f6f3;
  --bright: #7ed957; --deep: #2f605c;
  --paper: #fafaf7; --ink: #2c3733; --ink-soft: #55625c; --line: #e2e5e0;
  --warm: #c2571a; --cool: #2f7497; --bad: #c8443c;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(44, 55, 51, .08);
  --shadow-lg: 0 12px 40px rgba(44, 55, 51, .22);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: Poppins, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-weight: 300; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
b, strong { font-weight: 600; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 500; font-size: .93rem; text-decoration: none; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(44, 55, 51, .16); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--sage); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--sage-dark); }
.btn-light { background: #fff; color: var(--sage-dark); }
.btn-ghost { background: #fff; color: var(--sage-dark); border-color: var(--line); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .75); }
.btn-chico { padding: 7px 14px; font-size: .84rem; }
.btn svg { width: 17px; height: 17px; flex: none; }

.icono {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft);
}
.icono:hover:not(:disabled) { background: var(--sage-pale); color: var(--sage-dark); }
.icono:disabled { opacity: .3; cursor: default; }
.icono svg { width: 18px; height: 18px; }
.icono.peligro:hover { background: #fbebe9; color: var(--bad); }

input[type=text], textarea, select {
  width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 13px; font-weight: 400; transition: border-color .15s, box-shadow .15s;
}
input[type=text]:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--sage-light); box-shadow: 0 0 0 3px rgba(139, 161, 146, .25);
}
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }

/* =====================================================================
   PANEL
   ===================================================================== */
.hero {
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-dark) 100%);
  color: #fff; padding: 46px 0 72px;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 18px; }
.kicker { margin: 0 0 10px; text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 500; opacity: .85; }
.hero h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.2; font-weight: 700; }
.hero p.sub { margin: 12px 0 0; opacity: .92; }
/* Título y bajada a todo el ancho; los botones en una fila debajo. */
.hero-fila { display: flex; flex-direction: column; align-items: stretch; gap: 22px; }

.main { margin-top: -40px; padding-bottom: 80px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 14px;
}

.lista-item { display: flex; align-items: center; gap: 16px; }
.lista-item h2 { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--sage-dark); }
.lista-item p { margin: 2px 0 0; font-size: .84rem; color: var(--ink-soft); }
.lista-item .cuerpo { flex: 1; min-width: 0; }
.lista-item .acciones { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.lista-item { display: block; }
.fila-item { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.candado {
  display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft); transition: background .15s, color .15s, border-color .15s;
}
.candado svg { width: 18px; height: 18px; }
.candado:hover { border-color: var(--sage-light); color: var(--sage-dark); }
.cerrada .candado { background: var(--bad); border-color: var(--bad); color: #fff; }
.cerrada .candado:hover { background: #a9362f; border-color: #a9362f; color: #fff; }
.txt-cerrada { color: var(--bad); font-weight: 600; }
.resumen { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th { text-align: left; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding: 0 10px 8px; }
.tabla td { padding: 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tabla td.n { color: var(--sage-light); font-weight: 600; width: 1%; }
.tabla td.tipo { color: var(--ink-soft); white-space: nowrap; font-size: .84rem; }
.tabla .num-col { text-align: right; white-space: nowrap; }
.tabla td.num-col b { font-size: 1.05rem; color: var(--sage-dark); }
.tabla td.num-col small { display: block; color: var(--ink-soft); font-size: .76rem; }
.resumen-vacio { margin: 0; color: var(--ink-soft); font-size: .9rem; }

.hero-lado { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.enlaces-claros { display: flex; gap: 6px 16px; flex-wrap: wrap; }

/* Papelera junto al candado */
.papelera:hover { background: #fbebe9; border-color: var(--bad); color: var(--bad); }

/* Invitación a seguir en Instagram (celular) */
.seguime {
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100%, 320px);
}
.seguime p { margin: 0; font-weight: 500; color: var(--ink); max-width: none; }
.seguime .seguime-nota { font-weight: 400; font-size: .86rem; color: var(--ink-soft); line-height: 1.5; max-width: 28ch; }

/* Mismo lenguaje que los botones de redes de lucianodona.com.ar: vidrio oscuro, borde claro fino,
   flota apenas, un anillo verde que late y un destello verde que lo recorre. */
.btn-seguime {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 22px 10px 18px; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 500; font-size: .98rem; letter-spacing: .02em;
  background: rgba(29, 42, 40, .86);
  border: 1px solid rgba(255, 255, 255, .38);
  -webkit-backdrop-filter: blur(10px) saturate(1.5); backdrop-filter: blur(10px) saturate(1.5);
  box-shadow: 0 8px 22px rgba(5, 12, 10, .25);
  -webkit-tap-highlight-color: transparent;

  transition: background .25s, box-shadow .25s;
}
.btn-seguime svg { width: 19px; height: 19px; flex: none; }
/* destello verde que cruza el botón */
.btn-seguime::after {
  content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(126, 217, 87, .55), transparent);
  transform: skewX(-18deg);
  animation: seguime-destello 3.6s ease-in-out 1.2s infinite;
}
/* anillo verde que late */
.seguime-anillo { position: relative; display: inline-flex; border-radius: 999px; animation: seguime-flota 6.5s ease-in-out 1s infinite; }
.seguime-anillo::before {
  content: ''; position: absolute; inset: -1px; border-radius: 999px; pointer-events: none;
  border: 1.5px solid rgba(126, 217, 87, .85); opacity: 0;
  animation: seguime-ping 4.8s ease-out 1.6s infinite;
}
.btn-seguime:hover, .btn-seguime:active {
  background: rgba(47, 96, 92, .92);
  box-shadow: 0 0 0 4px rgba(126, 217, 87, .25), 0 10px 26px rgba(5, 12, 10, .3);
}
@keyframes seguime-flota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes seguime-destello { 0% { left: -60%; } 45%, 100% { left: 130%; } }
@keyframes seguime-ping { 0% { opacity: .9; transform: scale(1); } 22%, 100% { opacity: 0; transform: scale(1.18, 1.5); } }

/* Opción múltiple: las filas se reordenan con movimiento */
.barra { transition: transform .7s cubic-bezier(.2, .8, .2, 1); will-change: transform; }
.enlace-claro { text-decoration: none; background: none; border: 0; padding: 2px 4px; color: #fff; opacity: .75; font-size: .82rem; font-weight: 500; }
.enlace-claro:hover { opacity: 1; text-decoration: underline; }
.ingreso { max-width: 420px; display: flex; flex-direction: column; gap: 4px; }
.ingreso input { padding: 12px 14px; font-size: 1.05rem; }
.ingreso .btn { align-self: flex-start; margin-top: 6px; }
.error-ingreso { margin: 6px 0 0; min-height: 1.3em; color: var(--bad); font-size: .88rem; font-weight: 500; }
input[type=password] {
  width: 100%; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
input[type=password]:focus { outline: none; border-color: var(--sage-light); box-shadow: 0 0 0 3px rgba(139, 161, 146, .25); }

.vacio { text-align: center; color: var(--ink-soft); padding: 36px 20px; }

/* Editor */
.volver { color: #fff; opacity: .85; text-decoration: none; font-size: .86rem; font-weight: 500; display: inline-block; margin-bottom: 14px; }
.volver:hover { opacity: 1; }
input.titulo-input {
  width: 100%; background: transparent; border: 0; border-bottom: 2px solid rgba(255, 255, 255, .35);
  color: #fff; font-size: clamp(1.4rem, 3.6vw, 2rem); font-weight: 700; padding: 4px 0 8px; border-radius: 0;
}
input.titulo-input::placeholder { color: rgba(255, 255, 255, .55); }
input.titulo-input:focus { outline: none; border-color: transparent; border-bottom-color: #fff; box-shadow: none; }
.hero .acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; align-items: center; }
.guardado { font-size: .8rem; opacity: .8; margin-left: 4px; }

.preg-cab { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.num {
  flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--sage-pale);
  color: var(--sage); display: grid; place-items: center; font-size: .8rem; font-weight: 600;
}
.tipo-nombre { font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--sage-dark); flex: 1; }
.preg-texto { font-size: 1.08rem; font-weight: 500; resize: none; overflow: hidden; min-height: 46px; }
.detalle { margin-top: 14px; }
.etiqueta { display: block; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 7px; }
.opcion { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.opcion .letra { flex: none; width: 22px; text-align: center; font-weight: 600; color: var(--sage-light); font-size: .9rem; }
.enlace { background: none; border: 0; padding: 4px 0; color: var(--sage); font-weight: 500; font-size: .88rem; }
.enlace:hover { color: var(--sage-dark); text-decoration: underline; }
.fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fila select { width: auto; }

.imagen-zona {
  display: grid; place-items: center; text-align: center; gap: 4px; padding: 26px 16px;
  border: 1.5px dashed var(--sage-light); border-radius: 12px; background: var(--sage-mist);
  color: var(--ink-soft); font-size: .9rem; cursor: pointer;
}
.imagen-zona:hover { background: var(--sage-pale); }
.imagen-zona b { color: var(--sage-dark); }
.imagen-previa { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.imagen-previa img { max-height: 150px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

.agregar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; }
.agregar > span { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-soft); width: 100%; }
.tipo-btn {
  flex: 1 1 200px; display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px;
  transition: border-color .15s, background .15s;
}
.tipo-btn:hover { border-color: var(--sage-light); background: var(--sage-mist); }
.tipo-btn svg { width: 26px; height: 26px; color: var(--sage); flex: none; }
.tipo-btn b { display: block; font-size: .93rem; color: var(--sage-dark); }
.tipo-btn small { color: var(--ink-soft); font-size: .78rem; line-height: 1.3; display: block; }

.pie { margin-top: 34px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* =====================================================================
   PRESENTADOR
   ===================================================================== */
body.presentar { height: 100vh; overflow: hidden; display: grid; grid-template-columns: clamp(250px, 23vw, 400px) 1fr; }

.lado {
  background: linear-gradient(165deg, var(--sage) 0%, var(--sage-dark) 100%); color: #fff;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(20px, 3vh, 40px) clamp(18px, 2vw, 34px); gap: clamp(12px, 2.2vh, 24px);
}
.lado .kicker { margin: 0; align-self: stretch; text-align: left; letter-spacing: .14em; line-height: 1.5; }
.lado .medio { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(12px, 2.2vh, 22px); width: 100%; }
.qr {
  width: 100%; max-width: 44vh; aspect-ratio: 1; background: #fff; border: 0; border-radius: 16px;
  padding: 7%; box-shadow: var(--shadow-lg); display: block;
}
.qr img { width: 100%; height: 100%; display: block; }
.lado .paso { margin: 0; font-size: clamp(.95rem, 1.5vw, 1.35rem); font-weight: 500; line-height: 1.3; }
.lado .url {
  margin: 0; font-size: clamp(.8rem, 1.15vw, 1.1rem); font-weight: 500; word-break: break-all;
  background: rgba(255, 255, 255, .14); border-radius: 10px; padding: 7px 12px;
}
.conteo { display: flex; flex-direction: column; line-height: 1.1; }
.conteo b { font-size: clamp(2.2rem, 5.5vh, 4rem); font-weight: 700; }
.conteo span { font-size: clamp(.78rem, 1.05vw, 1rem); opacity: .88; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; }

/* QR a pantalla completa, para que escaneen desde el fondo del aula */
body.qr-grande .lado { position: fixed; inset: 0; z-index: 20; justify-content: center; }
body.qr-grande .lado .kicker, body.qr-grande .conteo { display: none; }
body.qr-grande .qr { max-width: 62vh; }
body.qr-grande .lado .paso { font-size: clamp(1.4rem, 3vw, 2.6rem); }
body.qr-grande .lado .url { font-size: clamp(1.2rem, 2.6vw, 2.2rem); }

/* Portada con QR grande y transición tipo diapositiva */
.portada {
  position: fixed; inset: 0; z-index: 30; color: #fff;
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-dark) 100%);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5vw;
  padding: 6vh 13vw 6vh 6vw;
  transition: transform .75s cubic-bezier(.65, 0, .35, 1);
}
body.presentar > .lado, body.presentar > .escena { transition: transform .75s cubic-bezier(.65, 0, .35, 1); }
body.mostrando .portada { transform: translateX(-100%); }
body.presentar:not(.mostrando) > .lado, body.presentar:not(.mostrando) > .escena { transform: translateX(100vw); }

.portada .kicker { letter-spacing: .14em; }
.p-paso { margin: 0; font-size: clamp(.8rem, 1.1vw, 1.05rem); text-transform: uppercase; letter-spacing: .16em; font-weight: 600; opacity: .7; }
.portada h1 { margin: .35em 0 .7em; font-size: clamp(2rem, 4.4vw, 4.6rem); line-height: 1.1; font-weight: 700; text-wrap: balance; }
.p-ayuda { margin: 0; font-size: clamp(1rem, 1.6vw, 1.55rem); opacity: .95; line-height: 1.5; }
#p-url { display: inline-block; margin-top: .55em; background: rgba(255, 255, 255, .14); border-radius: 10px; padding: .2em .7em; font-weight: 500; }
.p-conteo { margin: 4vh 0 0; display: flex; flex-direction: column; line-height: 1.1; }
.p-conteo b { font-size: clamp(2.2rem, 5vh, 3.8rem); font-weight: 700; }
.p-conteo span { font-size: clamp(.78rem, 1.05vw, 1rem); opacity: .85; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; }
.portada-qr { height: min(80vh, 44vw); aspect-ratio: 1; background: #fff; border-radius: 26px; padding: 3.4vh; box-shadow: var(--shadow-lg); }
.portada-qr img { width: 100%; height: 100%; display: block; }

.salir-portada {
  position: absolute; top: 2.4vh; left: 2vw; display: inline-flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-size: .86rem; font-weight: 500; opacity: .55;
  padding: 7px 12px; border-radius: 10px; transition: opacity .2s, background .2s;
}
.salir-portada:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.salir-portada svg { width: 16px; height: 16px; }
.portada-texto { padding-top: 4vh; }
.controles a.texto { text-decoration: none; }
.controles .divisor { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }

/* Diapositiva final */
.final {
  position: fixed; inset: 0; z-index: 40; background: var(--paper);
  display: flex; flex-direction: column; padding: 3.5vh 3.5vw 1.6vh;
  transform: translateX(100%); transition: transform .75s cubic-bezier(.65, 0, .35, 1);
}
body.en-final .final { transform: none; }
.final-cab { text-align: center; }
.final-cab .kicker { color: var(--sage-light); margin-bottom: .6vh; }
.final-cab h1 {
  margin: 0 auto; font-size: clamp(2rem, 7.5vh, 5.6rem); line-height: 1.05; font-weight: 700; color: var(--sage-dark);
  display: inline-block; padding-bottom: 1.4vh; position: relative;
}
.final-cab h1::after {
  content: ""; position: absolute; left: 15%; right: 15%; bottom: 0; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), var(--sage-light) 60%, var(--bright));
}
.final-grid { flex: 1; min-height: 0; display: grid; gap: 2vh 1.4vw; margin-top: 3vh; }
.tarjeta {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.6vh 1.1vw 1.2vh; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden;
}
.tarjeta-cab { display: flex; gap: .7vw; align-items: baseline; }
.tarjeta-cab .num { width: auto; height: auto; padding: .15em .5em; font-size: clamp(.7rem, 1.4vh, .95rem); }
.tarjeta h3 {
  margin: 0; flex: 1; font-size: clamp(.85rem, 2vh, 1.4rem); line-height: 1.25; font-weight: 600; color: var(--sage-dark);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tarjeta .meta { flex: none; font-size: clamp(.68rem, 1.3vh, .9rem); color: var(--ink-soft); white-space: nowrap; }
.tarjeta .zona { flex: 1; min-height: 0; position: relative; margin-top: 1vh; }
.tarjeta .zona .viz-nota { font-size: clamp(.8rem, 1.6vh, 1.1rem); }
.final .nube span { cursor: default; transition: none; }
.final .nube span:hover { text-decoration: none; opacity: 1; }
.mini-barras { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 1.1vh; }
.mb { display: grid; grid-template-columns: minmax(0, 34%) 1fr 3.4em; align-items: center; gap: .7vw; font-size: clamp(.72rem, 1.7vh, 1.15rem); }
.mb .nombre { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mb .pista { height: clamp(10px, 2.6vh, 30px); background: var(--sage-pale); border-radius: 6px; overflow: hidden; }
.mb .relleno { height: 100%; background: var(--sage); border-radius: 6px; }
.mb.lider .relleno { background: var(--deep); }
.mb .valor { font-weight: 700; color: var(--sage-dark); font-variant-numeric: tabular-nums; }
.final-pie { display: flex; justify-content: space-between; align-items: center; padding-top: 1.2vh; font-size: .8rem; color: var(--ink-soft); opacity: .55; transition: opacity .2s; }
.final-pie:hover { opacity: 1; }
.final-pie a { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; font-weight: 500; }
.final-pie svg { width: 16px; height: 16px; }

.siguiente {
  position: absolute; right: 2.4vw; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: none; border: 0; padding: 8px; color: #fff;
  font-size: clamp(.78rem, 1vw, 1rem); font-weight: 500; text-transform: uppercase; letter-spacing: .1em;
}
.siguiente i {
  width: clamp(56px, 5vw, 80px); aspect-ratio: 1; border-radius: 50%; background: #fff; color: var(--sage-dark);
  display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform .2s ease;
}
.siguiente i svg { width: 46%; height: 46%; }
.siguiente span { max-width: 7.5em; text-align: center; line-height: 1.3; opacity: .92; }
.siguiente:hover i { transform: translateX(6px); }
.siguiente:hover span { opacity: 1; }

.escena { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: clamp(22px, 4.2vh, 54px) clamp(26px, 4vw, 70px) 0; }
.escena .paso-n { margin: 0 0 .5vh; font-size: clamp(.74rem, 1vw, .95rem); text-transform: uppercase; letter-spacing: .16em; font-weight: 600; color: var(--sage-light); }
.escena h1 {
  margin: 0; font-size: clamp(1.5rem, 3.5vw, 3.5rem); line-height: 1.16; font-weight: 700; color: var(--sage-dark);
  padding-bottom: clamp(10px, 1.8vh, 20px); position: relative; text-wrap: balance;
}
.escena h1::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), var(--sage-light) 60%, var(--bright));
}
.viz { flex: 1; min-height: 0; position: relative; margin-top: clamp(12px, 2.4vh, 28px); }
.viz-nota {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--sage-light); font-size: clamp(1rem, 1.8vw, 1.6rem); font-weight: 400;
}

/* Nube */
.nube { position: absolute; inset: 0; overflow: hidden; }
.nube span {
  position: absolute; left: 0; top: 0; white-space: nowrap; line-height: 1.12; font-weight: 600; cursor: pointer;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), font-size .7s cubic-bezier(.2, .8, .2, 1), opacity .45s ease;
}
.nube span.nueva { opacity: 0; }
.nube span:hover { text-decoration: line-through; text-decoration-thickness: .06em; opacity: .55; }

/* Barras */
.barras { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 2.4vh, 26px); }
.barra { display: grid; grid-template-columns: minmax(110px, 30%) 1fr clamp(92px, 9vw, 150px); align-items: center; gap: clamp(12px, 1.6vw, 26px); }
.barra .nombre { font-size: clamp(1rem, 1.9vw, 2rem); font-weight: 500; line-height: 1.2; text-align: right; overflow-wrap: anywhere; }
.barra .pista { height: clamp(26px, 6vh, 58px); background: var(--sage-pale); border-radius: 10px; overflow: hidden; }
.barra .relleno { height: 100%; width: 0; background: var(--sage); border-radius: 10px; transition: width .7s cubic-bezier(.2, .8, .2, 1), background .4s; }
.barra.lider .relleno { background: var(--deep); }
.barra .valor { font-size: clamp(1.1rem, 2.2vw, 2.3rem); font-weight: 700; color: var(--sage-dark); line-height: 1; font-variant-numeric: tabular-nums; }
.barra .valor small { display: block; margin-top: 4px; font-size: .46em; font-weight: 400; color: var(--ink-soft); }

/* Imagen con mapa de calor */
.lienzo-caja { position: absolute; inset: 0; display: grid; place-items: center; }
.lienzo { position: relative; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.lienzo img, .lienzo canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Barra de controles */
.controles { display: flex; align-items: center; gap: 4px; padding: 10px 0 12px; opacity: .5; transition: opacity .2s; }
.controles:hover, .controles:focus-within { opacity: 1; }
.controles .sep { flex: 1; }
.controles .pos { font-size: .84rem; font-weight: 500; color: var(--ink-soft); min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.controles .texto {
  background: none; border: 0; border-radius: 10px; padding: 8px 12px; font-size: .84rem; font-weight: 500; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 7px;
}
.controles .texto:hover { background: var(--sage-pale); color: var(--sage-dark); }
.controles .texto svg { width: 16px; height: 16px; }
.controles .texto.activo { color: var(--warm); }
.aviso-cerrada {
  align-self: flex-start; margin-top: 10px; background: #fdeee4; color: var(--warm); border-radius: 999px;
  padding: 4px 14px; font-size: clamp(.76rem, 1vw, .95rem); font-weight: 500;
}

@media (max-width: 760px) {
  body.presentar { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100vh; overflow: auto; }
  .lado { flex-direction: row; text-align: left; }
  .lado .kicker { display: none; }
  .lado .medio { flex-direction: row; justify-content: flex-start; }
  .qr { width: 96px; flex: none; }
  .viz { min-height: 56vh; }
  body.presentar { overflow-x: hidden; }
  .portada { grid-template-columns: 1fr; padding: 24px 20px 120px; overflow-y: auto; align-content: start; gap: 22px; }
  .portada-qr { height: auto; width: min(72vw, 42vh); justify-self: center; }
  .siguiente { top: auto; bottom: 20px; right: 20px; transform: none; flex-direction: row-reverse; }
  .controles { flex-wrap: wrap; }
  .controles .sep { flex-basis: 100%; height: 0; }
  .lado .url { word-break: normal; overflow-wrap: anywhere; }
}

/* =====================================================================
   PARTICIPANTE (celular)
   ===================================================================== */
body.responder { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.barra-sup {
  background: linear-gradient(160deg, var(--sage) 0%, var(--sage-dark) 100%); color: #fff;
  padding: 14px 20px; font-size: .78rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  display: flex; justify-content: space-between; gap: 12px;
}
.barra-sup span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-sup span:last-child { opacity: .8; flex: none; }
.hoja { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 28px 20px 32px; display: flex; flex-direction: column; }
.hoja h1 { margin: 0 0 24px; font-size: clamp(1.45rem, 6.4vw, 2rem); line-height: 1.22; font-weight: 700; color: var(--sage-dark); text-wrap: balance; }
.hoja .ayuda { margin: 12px 2px 0; font-size: .88rem; color: var(--ink-soft); }
.hoja .error { margin: 12px 2px 0; font-size: .9rem; color: var(--bad); font-weight: 500; min-height: 1.4em; }
.campo-grande { font-size: 1.2rem !important; padding: 16px 18px !important; border-radius: 14px !important; }
.btn-enviar { width: 100%; padding: 16px; font-size: 1.05rem; font-weight: 600; margin-top: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { background: var(--sage-pale); color: var(--sage-dark); border-radius: 999px; padding: 6px 14px; font-weight: 500; font-size: .95rem; }

.elegir { display: flex; flex-direction: column; gap: 10px; }
.elegir button {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 16px 18px;
  font-size: 1.08rem; font-weight: 500; transition: border-color .15s, background .15s;
}
.elegir button::before {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--sage-light); background: #fff;
  transition: border-width .15s, border-color .15s;
}
.elegir button.sel { border-color: var(--sage); background: var(--sage-mist); }
.elegir button.sel::before { border-width: 7px; border-color: var(--sage); }

.tocar { position: relative; align-self: center; width: 100%; max-width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; touch-action: manipulation; cursor: crosshair; line-height: 0; }
.tocar img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.marca {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  background: rgba(194, 87, 26, .3); border: 3px solid var(--warm); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); pointer-events: none;
}
.marca::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--warm); }

.estado { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding-bottom: 8vh; }
.estado .circulo { width: 76px; height: 76px; border-radius: 50%; background: var(--sage-pale); color: var(--sage); display: grid; place-items: center; margin-bottom: 14px; }
.estado .circulo svg { width: 36px; height: 36px; }
.estado.ok .circulo { background: var(--sage); color: #fff; animation: aparecer .45s cubic-bezier(.2, 1.4, .4, 1); }
.estado h2 { margin: 0; font-size: 1.4rem; font-weight: 700; color: var(--sage-dark); }
.estado p { margin: 0; color: var(--ink-soft); max-width: 30ch; }
.estado .chips { justify-content: center; }
@keyframes aparecer { from { transform: scale(.4); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* =====================================================================
   VENTANA DE RESULTADOS
   ===================================================================== */
body.con-modal { overflow: hidden; }
.modal {
  position: fixed; inset: 0; z-index: 100; background: rgba(44, 55, 51, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 3vh 16px; animation: modal-fondo .2s ease;
}
.modal-caja {
  width: min(880px, 100%); max-height: 94vh; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; animation: modal-caja .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes modal-fondo { from { opacity: 0; } }
@keyframes modal-caja { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-cargando { padding: 60px 24px; text-align: center; color: var(--ink-soft); }
.modal-cab {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  padding: 20px 22px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.modal-titulo { min-width: 0; flex: 1 1 300px; }
.modal-titulo .kicker { color: var(--sage-light); margin: 0 0 4px; }
.modal-titulo h2 { margin: 0; font-size: 1.35rem; line-height: 1.25; font-weight: 700; color: var(--sage-dark); }
.modal-meta { margin: 4px 0 0; font-size: .82rem; color: var(--ink-soft); }
.modal-acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.modal-cuerpo { overflow-y: auto; padding: 18px 22px 26px; display: flex; flex-direction: column; gap: 14px; }

.res-preg { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; }
.res-cab { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.res-cab h3 { margin: 2px 0 0; font-size: 1.02rem; font-weight: 600; color: var(--sage-dark); line-height: 1.3; }
.res-meta { margin: 2px 0 0; font-size: .8rem; color: var(--ink-soft); }
.res-vacio { margin: 0; color: var(--ink-soft); font-style: italic; font-size: .9rem; }
.res-nota { margin: 8px 0 0; font-size: .78rem; color: var(--ink-soft); }

.res-palabras { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.res-chip {
  display: inline-flex; align-items: baseline; gap: 6px; background: var(--sage-pale); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; font-weight: 600; line-height: 1.3;
}
.res-chip small { font-size: .72rem; font-weight: 600; color: var(--sage); }

.res-barras { display: flex; flex-direction: column; gap: 9px; }
.res-barra { display: grid; grid-template-columns: minmax(0, 32%) 1fr auto; gap: 12px; align-items: center; font-size: .92rem; }
.res-barra .nombre { font-weight: 500; overflow-wrap: anywhere; }
.res-barra .pista { height: 14px; background: var(--sage-pale); border-radius: 6px; overflow: hidden; }
.res-barra .relleno { display: block; height: 100%; background: var(--sage); border-radius: 6px; }
.res-barra.lider .relleno { background: var(--deep); }
.res-barra .valor { white-space: nowrap; color: var(--ink-soft); font-size: .84rem; min-width: 7.5em; text-align: right; }
.res-barra .valor b { color: var(--sage-dark); font-size: .95rem; margin-right: 2px; }

.res-calor-lugar { display: grid; place-items: center; min-height: 140px; color: var(--ink-soft); font-size: .88rem; background: var(--sage-mist); border-radius: 10px; }
canvas.res-calor { display: block; width: 100%; max-height: 460px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

@media (max-width: 600px) {
  .modal { padding: 0; }
  .modal-caja { max-height: 100vh; height: 100%; border-radius: 0; }
  .res-barra { grid-template-columns: 1fr auto; }
  .res-barra .pista { grid-column: 1 / -1; grid-row: 2; }
}
