/* ============================================================
   WiWO — Deep Dive Workshop
   Sistema de Diseño
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,700&display=swap');

/* ── Sistema de temas ───────────────────────────────────────────
 * Tres ejes independientes que se combinan por cascada:
 *   1. tema     → html[data-theme="wiwo" | "neo"]   (lo elige el facilitador)
 *   2. rol      → body.facilitador (oscuro) / .participante / .asistente
 *   3. template → body.tpl-cocacola (paleta de marca del cliente)
 * Cada bloque define dos capas:
 *   (a) alias legacy (--red, --black, …) que re-tematiza todo el CSS existente
 *   (b) capa semántica (--bg, --fg, --accent, …), destino de los estilos nuevos
 * Como el tema vive en <html> y rol/template en <body>, el override por
 * descendencia siempre gana sin necesidad de !important.
 * ------------------------------------------------------------ */

/* ── Tema MGC — base clara (participante, asistente) ─────────── */
:root {
  /* (a) legacy */
  --red:     #FF1935;
  --black:   #0A0A0A;
  --white:   #FFFFFF;
  --orange:  #FF6B1A;
  --magenta: #FF1F8E;
  --blue:    #1F3DFF;
  --gray:    #F0EFEA;
  --green:   #00C9A7;
  --font-ui: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-editorial: 'Playfair Display', Georgia, serif;

  /* (b) semántica — derivada del legacy para que tpl-* propague gratis */
  --bg:            var(--white);
  --surface:       var(--white);
  --surface-2:     var(--gray);
  --surface-3:     #E4E2DA;
  --fg:            var(--black);
  --fg-2:          #3A3A3A;
  --fg-muted:      #7A7A7A;
  --line:          rgba(10,10,10,0.12);
  --line-strong:   rgba(10,10,10,0.28);
  --accent:        var(--red);
  --accent-ink:    var(--red);   /* variante legible del acento sobre el fondo del scope */
  --accent-strong: #D6122A;
  --accent-fade:   rgba(255,25,53,0.15);
  --accent-2:      var(--orange);
  --accent-3:      var(--magenta);
  --accent-4:      var(--blue);
  --ok:            var(--green);
  --warn:          var(--orange);
  --danger:        var(--red);
  --focus-ring:    var(--red);
  /* Translúcido a propósito: el mismo token se usa sobre fondo claro
     (participante) y oscuro (facilitador). Un valor opaco pintaría placas
     blancas sobre el fondo negro de la TV. */
  --accent-wash:   rgba(255,25,53,0.08);

  /* Pares fondo/texto para chips de estado (badges de fase del asistente) */
  --soft-neutral-bg: #F0F0F0;  --soft-neutral-fg: #888888;
  --soft-warn-bg:    #FFF3E0;  --soft-warn-fg:    #E65100;
  --soft-ok-bg:      #E8F5E9;  --soft-ok-fg:      #2E7D32;
  --soft-danger-bg:  #FCE4EC;  --soft-danger-fg:  #C62828;
  --soft-accent-bg:  #E3F2FD;  --soft-accent-fg:  #1565C0;

  --font-display:  var(--font-ui);
  --font-mono:     ui-monospace, SFMono-Regular, Consolas, monospace;

  --radius-sm:     8px;
  --radius-pill:   999px;
  --radius-card:   12px;
  --radius-lg:     16px;

  /* Capa de las pantallas que tapan todo (setup) */
  --z-overlay: 9000;

  /* Escala de texto y espacio. Los valores salen de contar lo que ya estaba
     escrito a mano en el CSS y en los estilos inline, quedándose con los pasos
     más usados. Se adoptan de a poco: primero acá, y en el JS solo cuando se
     toca esa función por otro motivo. Migrar de golpe las ~120 medidas sueltas
     que quedan sería un diff enorme sin ganancia visible. */
  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   20px;
  --text-xl:   28px;
  --text-2xl:  40px;
  --text-3xl:  64px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --shadow-1:      0 8px 26px rgba(10,10,10,0.08);
  --shadow-2:      0 22px 70px rgba(10,10,10,0.14);
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --motion-fast:   160ms;
  --motion-medium: 280ms;
  --motion-slow:   420ms;
  --grad-primary:  linear-gradient(103deg, var(--orange), var(--red));
}

/* ── Tema MGC — scope oscuro (facilitador / TV) ──────────────── */
html[data-theme="mgc"] body.facilitador {
  --bg:          var(--black);
  --surface:     #141414;
  --surface-2:   #1C1C1C;
  --surface-3:   #262626;
  --fg:          var(--white);
  --fg-2:        rgba(255,255,255,0.72);
  --fg-muted:    rgba(255,255,255,0.45);
  --line:        rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.26);
  --shadow-1:    0 8px 26px rgba(0,0,0,0.5);
  --shadow-2:    0 22px 70px rgba(0,0,0,0.6);
}

/* ── Tema Neo — base clara (participante, asistente) ─────────── */
html[data-theme="neo"] {
  /* (a) legacy remapeado a la paleta Neo */
  --red:     #4242FF;
  --black:   #292929;
  --white:   #FFFFFF;
  --orange:  #D88719;
  --magenta: #8D7CFF;
  --blue:    #4242FF;
  --gray:    #F3F4FA;
  --green:   #1C7A38;
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-editorial: 'Fraunces', 'Instrument Serif', Georgia, serif;

  /* (b) semántica — ground blanco. Los neutros llevan una pizca de azul del
     acento (#4242FF) en vez de gris puro: mantiene la calidez de sistema que
     antes daba el beige, sin el beige. La tinta sigue siendo #292929, que Neo
     define como su límite oscuro. */
  --bg:            #FFFFFF;
  --surface:       #FFFFFF;
  --surface-2:     #F3F4FA;
  --surface-3:     #E7E9F4;
  --fg:            #292929;
  --fg-2:          #4B4D57;
  --fg-muted:      #6B6D7A;
  --line:          rgba(41,42,58,0.13);
  --line-strong:   rgba(41,42,58,0.28);
  --accent:        #4242FF;
  --accent-ink:    #4242FF;
  --accent-strong: #2525C8;
  --accent-fade:   rgba(66,66,255,0.16);
  --accent-2:      #3BFF00;
  --accent-3:      #8D7CFF;
  --accent-4:      #8AF84F;
  --ok:            #1C7A38;
  --warn:          #9C6417;
  --danger:        #B3261E;
  --focus-ring:    #4242FF;
  --accent-wash:   rgba(66,66,255,0.08);

  /* Pares fondo/texto para chips de estado (badges de fase del asistente) */
  --soft-neutral-bg: #EFF0F7;  --soft-neutral-fg: #6B6D7A;
  --soft-warn-bg:    #FBF1E2;  --soft-warn-fg:    #8A570F;
  --soft-ok-bg:      #E6F3EA;  --soft-ok-fg:      #1C7A38;
  --soft-danger-bg:  #FBE9E7;  --soft-danger-fg:  #B3261E;
  --soft-accent-bg:  #E8E8FF;  --soft-accent-fg:  #2525C8;

  --font-display:  'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono:     'Tomorrow', ui-monospace, SFMono-Regular, Consolas, monospace;

  --radius-pill:   999px;
  --radius-card:   16px;
  --shadow-1:      0 8px 26px rgba(28,29,45,0.07);
  --shadow-2:      0 22px 70px rgba(28,29,45,0.11);
  --ease:          cubic-bezier(0.2, 0.8, 0.2, 1);
  --grad-primary:  linear-gradient(103deg, #3BFF00, #4242FF);
}

/* ── Tema Neo — scope oscuro (facilitador / TV) ──────────────── */
html[data-theme="neo"] body.facilitador {
  --black:       #191A1E;
  --bg:          #191A1E;
  --surface:     #24252B;
  --surface-2:   #2E2F37;
  --surface-3:   #393B45;
  --white:       #FFFFFF;
  --fg:          #FFFFFF;
  --fg-2:        #DCDDE6;
  --fg-muted:    #A7A9B6;
  --line:        rgba(255,255,255,0.14);
  --line-strong: rgba(255,255,255,0.30);
  --shadow-1:    0 8px 26px rgba(0,0,0,0.45);
  --shadow-2:    0 30px 90px rgba(66,66,255,0.20);
  /* El azul de marca solo alcanza 2.9:1 sobre este fondo: sirve como superficie,
     no como texto. --accent-ink es la variante legible para tipografía. */
  --accent-ink:  #8A8AFF;
  --focus-ring:  #8A8AFF;
}

/* ── Override de paleta por template (sólo facilitador) ────────
 * La clase `tpl-cocacola` la añade facilitador.js en <body> cuando
 * el template activo es Coca-Cola. Pisa el acento del tema activo,
 * sea mgc o neo. Cualquier estilo que use var(--red) / var(--black)
 * / var(--accent) se actualiza automáticamente. */
body.facilitador.tpl-cocacola {
  --red:         #FE001A;
  --black:       #000000;
  --bg:          #000000;
  --accent:      #FE001A;
  --accent-ink:  #FE001A;
  --accent-fade: rgba(254,0,26,0.15);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--text-md); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Logo ──────────────────────────────────────────────────── */
/* Cada tema trae su propio archivo de logo (ver BRANDS en theme.js). El de
   WiWO es azul y viene en un único archivo: sobre el fondo oscuro se aclara
   por filtro. El de MGC ya tiene su versión clara, así que no se filtra. */
.brand-logo {
  height: 28px;
  width: auto;
  display: block;
  user-select: none;
}
html[data-theme="neo"] body.facilitador .brand-logo { filter: brightness(0) invert(1); }
.brand-logo.par-logo {
  height: 24px;
}
/* Fallback text logo */
.brand-wordmark {
  font-family: var(--font-ui);
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: lowercase;
  font-size: var(--text-xl);
  color: var(--white);
  user-select: none;
}
.brand-wordmark span { color: var(--red); }

/* ── Tipografía mixta ──────────────────────────────────────── */
.title-hero {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: clamp(36px, 5vw, 70px);
  letter-spacing: -2px;
  line-height: 1.05;
  color: var(--white);
}
.title-hero .italic {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 700;
}
.subtitle {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 18px;
  opacity: 0.7;
}

/* ── GIF box ───────────────────────────────────────────────── */
.gif-box {
  background: var(--gray);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(180px, 25vh, 320px);
}
.gif-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Botones ───────────────────────────────────────────────── */
.btn {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--text-md);
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 36px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn-red {
  background: var(--red);
  color: var(--white);
}
.btn-red:hover { background: var(--accent-strong); }
.btn-red:disabled {
  background: var(--line-strong);
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-white {
  background: var(--white);
  color: var(--black);
}
.btn-white:hover { background: var(--gray); }
/* Funciona sobre fondo claro y oscuro: hasta ahora asumía fondo oscuro y no
   la usaba nadie. Es la definición que ya tenía el asistente. */
.btn-outline {
  background: var(--surface);
  color: var(--accent-ink);
  border: 2px solid var(--accent);
}
.btn-outline:hover:not(:disabled) { background: var(--accent-wash); }
.btn-small {
  padding: 6px 14px;
  font-size: var(--text-sm);
}
/* Medidas del panel del asistente, donde los botones van en fila y apretados. */
.btn-compact {
  padding: 14px 20px;
  font-size: 15px;
}
.btn-block { flex: 1; }
.btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Decorativos ───────────────────────────────────────────── */
.wave-decoration {
  position: absolute;
  top: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}

.color-line {
  height: 3px;
  border-radius: 2px;
  display: block;
}

/* ── Connection indicator ──────────────────────────────────── */
.ws-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
}
.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.3s;
}
.ws-dot.connected { background: var(--ok); }
.ws-dot.disconnected { background: var(--red); animation: pulse-dot 1s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Participant counter ───────────────────────────────────── */
.participant-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--white);
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse-dot 1.5s infinite;
}

/* ════════════════════════════════════════════════════════════
   FACILITADOR — Layout (TV-optimized, no sidebar)
   ════════════════════════════════════════════════════════════ */
body.facilitador {
  background: var(--bg);
  color: var(--fg);
  height: 100vh;
  overflow: hidden;
}

.fac-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 72px 1fr auto auto;
  height: 100vh;
  width: 100vw;
}

/* ── Topbar (TV: 72px tall) ──────────────────────────────── */
.fac-topbar {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 2vw, 48px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
  min-height: 72px;
}
.fac-topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(16px, 1.5vw, 28px);
}
.fac-topbar .brand-logo {
  height: 36px;
}
.session-badge {
  font-size: clamp(16px, 1.2vw, 22px);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--red);
  background: var(--accent-wash);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
}
.assistant-badge {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--fg-muted);
  background: var(--line);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}
.topbar-participants {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(14px, 1vw, 18px);
  font-weight: 700;
  color: var(--white);
}
.fac-topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1vw, 16px);
}
.topbar-icon-btn {
  background: var(--surface);
  border: 1px solid var(--surface-3);
  color: var(--fg);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: var(--text-lg);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  padding: 0;
}
.topbar-icon-btn:hover { background: var(--surface-3); }
.settings-wrap { position: relative; }
.settings-menu {
  display: none;
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 240px;
  z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  transition: background 0.12s;
}
.settings-icon { font-size: 18px; }
.settings-divider { height: 1px; background: var(--surface-3); margin: 4px 0; }
.settings-danger { color: var(--danger); }

/* ── Main panel (full width) ────────────────────────────── */
.fac-main {
  grid-column: 1;
  grid-row: 2;
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 2.5vh, 40px) clamp(32px, 3vw, 64px);
  display: flex;
  flex-direction: column;
}

/* ── Action bar (bottom controls) ────────────────────────── */
.fac-actionbar {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px clamp(24px, 3vw, 64px);
  min-height: 0;
}
.fac-actionbar:empty { display: none; }
.fac-actionbar .btn {
  min-height: 56px;
  font-size: clamp(16px, 1.2vw, 20px);
  padding: 14px 40px;
}

/* ── Progress bar (8 pills) ──────────────────────────────── */
.fac-progressbar {
  grid-column: 1;
  grid-row: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1vw, 16px);
  padding: 10px clamp(24px, 3vw, 64px);
  border-top: 1px solid var(--line);
  min-height: 0;
}
.progress-pill {
  width: clamp(36px, 3vw, 48px);
  height: clamp(36px, 3vw, 48px);
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}
.progress-pill span {
  font-size: clamp(14px, 1vw, 18px);
  font-weight: 900;
  color: var(--fg-muted);
  transition: color 0.3s;
}
.progress-pill.active {
  background: var(--red);
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(255,25,53,0.4);
}
.progress-pill.active span { color: var(--fg); }
.progress-pill.completed {
  background: var(--accent-fade);
}
.progress-pill.completed span { color: var(--fg-2); }

/* ── Lobby screen (TV-optimized) ───────────────────────────── */
.lobby-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  min-height: 0;
  gap: clamp(48px, 5vw, 80px);
  position: relative;
  overflow: hidden;
}
.lobby-left {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vh, 20px);
  flex: 0 1 auto;
  min-width: 0;
  max-width: 600px;
  justify-content: center;
}
.lobby-left .title-hero { margin-bottom: 8px; }
.lobby-right {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qr-card {
  /* Placa clara dentro del scope oscuro: invierte los tokens de texto para
     que lo que va encima siga siendo legible en cualquier tema. */
  --fg: var(--black);
  --fg-2: rgba(41,41,41,0.72);
  --fg-muted: rgba(41,41,41,0.55);
  color: var(--fg);
  background: var(--white);
  border-radius: 24px;
  padding: clamp(24px, 3vh, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.qr-card img {
  width: clamp(200px, 25vh, 320px);
  height: clamp(200px, 25vh, 320px);
}
.qr-card .session-code {
  font-size: clamp(36px, 4vw, 64px);
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--black);
}
.qr-card .qr-hint {
  font-size: clamp(13px, 1vw, 18px);
  color: var(--fg-muted);
  font-weight: 400;
}
.lobby-gif {
  width: clamp(180px, 25vh, 400px);
  height: clamp(180px, 25vh, 400px);
  margin-top: 8px;
}
.lobby-left .title-hero {
  font-size: clamp(48px, 5vw, 80px);
}

/* ── Lava lamp background ──────────────────────────────────── */
.lava-bg {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
  background: var(--bg);
}
.lava-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, var(--bg) 75%);
  z-index: 2;
}
.lobby-screen { z-index: 1; }
.lobby-left, .lobby-right { position: relative; z-index: 3; }

/* Fluid gradient blobs */
.lava-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  will-change: transform, opacity;
}
.lava-blob-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--accent) 0%, var(--accent) 30%, transparent 70%);
  top: -10%; left: -5%;
  animation: lavaFloat1 14s ease-in-out infinite;
}
.lava-blob-2 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, var(--accent-2) 0%, var(--accent-2) 30%, transparent 70%);
  top: 60%; right: -8%;
  animation: lavaFloat2 18s ease-in-out infinite;
  animation-delay: -4s;
}
.lava-blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent-3) 0%, var(--accent-3) 25%, transparent 70%);
  bottom: -12%; left: 30%;
  animation: lavaFloat3 16s ease-in-out infinite;
  animation-delay: -8s;
}
.lava-blob-4 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, var(--accent-4) 0%, var(--accent-4) 20%, transparent 70%);
  top: 30%; left: 50%;
  animation: lavaFloat4 20s ease-in-out infinite;
  animation-delay: -2s;
}
.lava-blob-5 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--accent) 0%, var(--accent-2) 40%, transparent 70%);
  top: 10%; right: 20%;
  animation: lavaFloat5 15s ease-in-out infinite;
  animation-delay: -6s;
}

/* Floating SVG shapes from logo WiWO */
.lava-shape {
  position: absolute;
  opacity: 0;
  will-change: transform, opacity;
  filter: blur(1px);
}
.lava-shape svg {
  width: 100%; height: 100%;
}
.lava-shape-1 {
  width: 120px; height: 70px;
  top: 15%; left: 8%;
  animation: shapeFloat1 22s ease-in-out infinite;
}
.lava-shape-2 {
  width: 80px; height: 80px;
  top: 70%; right: 15%;
  animation: shapeFloat2 19s ease-in-out infinite;
  animation-delay: -5s;
}
.lava-shape-3 {
  width: 100px; height: 70px;
  bottom: 20%; left: 55%;
  animation: shapeFloat3 24s ease-in-out infinite;
  animation-delay: -10s;
}
.lava-shape-4 {
  width: 60px; height: 60px;
  top: 45%; left: 25%;
  animation: shapeFloat4 17s ease-in-out infinite;
  animation-delay: -3s;
}

/* Blob animations — slow, organic, fluid */
@keyframes lavaFloat1 {
  0%   { opacity: 0.35; transform: translate(0, 0) scale(1); }
  25%  { opacity: 0.55; transform: translate(80px, 60px) scale(1.2); }
  50%  { opacity: 0.4;  transform: translate(40px, 120px) scale(0.9); }
  75%  { opacity: 0.6;  transform: translate(-30px, 50px) scale(1.15); }
  100% { opacity: 0.35; transform: translate(0, 0) scale(1); }
}
@keyframes lavaFloat2 {
  0%   { opacity: 0.3;  transform: translate(0, 0) scale(1); }
  25%  { opacity: 0.5;  transform: translate(-70px, -40px) scale(1.15); }
  50%  { opacity: 0.35; transform: translate(-120px, 30px) scale(0.85); }
  75%  { opacity: 0.5;  transform: translate(-40px, -80px) scale(1.1); }
  100% { opacity: 0.3;  transform: translate(0, 0) scale(1); }
}
@keyframes lavaFloat3 {
  0%   { opacity: 0.25; transform: translate(0, 0) scale(1); }
  30%  { opacity: 0.5;  transform: translate(60px, -70px) scale(1.3); }
  60%  { opacity: 0.35; transform: translate(-50px, -40px) scale(0.9); }
  100% { opacity: 0.25; transform: translate(0, 0) scale(1); }
}
@keyframes lavaFloat4 {
  0%   { opacity: 0.2;  transform: translate(0, 0) scale(1); }
  20%  { opacity: 0.35; transform: translate(-60px, 50px) scale(1.1); }
  50%  { opacity: 0.25; transform: translate(40px, -60px) scale(0.85); }
  80%  { opacity: 0.4;  transform: translate(80px, 20px) scale(1.2); }
  100% { opacity: 0.2;  transform: translate(0, 0) scale(1); }
}
@keyframes lavaFloat5 {
  0%   { opacity: 0.2;  transform: translate(0, 0) scale(1); }
  35%  { opacity: 0.45; transform: translate(-40px, 80px) scale(1.25); }
  65%  { opacity: 0.3;  transform: translate(50px, 40px) scale(0.9); }
  100% { opacity: 0.2;  transform: translate(0, 0) scale(1); }
}

/* Shape float animations — slower drift, fade in/out */
@keyframes shapeFloat1 {
  0%   { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.8); }
  15%  { opacity: 0.12; }
  50%  { opacity: 0.08; transform: translate(100px, 80px) rotate(15deg) scale(1); }
  85%  { opacity: 0.12; }
  100% { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.8); }
}
@keyframes shapeFloat2 {
  0%   { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.7); }
  20%  { opacity: 0.15; }
  50%  { opacity: 0.1;  transform: translate(-80px, -60px) rotate(-20deg) scale(1.1); }
  80%  { opacity: 0.15; }
  100% { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.7); }
}
@keyframes shapeFloat3 {
  0%   { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.9); }
  25%  { opacity: 0.1;  }
  50%  { opacity: 0.07; transform: translate(70px, -50px) rotate(25deg) scale(1.05); }
  75%  { opacity: 0.1;  }
  100% { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.9); }
}
@keyframes shapeFloat4 {
  0%   { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.6); }
  30%  { opacity: 0.18; }
  60%  { opacity: 0.1;  transform: translate(-50px, 70px) rotate(-10deg) scale(0.9); }
  100% { opacity: 0;    transform: translate(0, 0) rotate(0deg) scale(0.6); }
}

/* ── Intro instruction bullets ─────────────────────────────── */
.intro-instruction ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.intro-instruction ul li {
  position: relative;
  padding-left: 20px;
  font-size: 17px;
  line-height: 1.45;
}
.intro-instruction ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

/* ── Dinámica screen (facilitador, TV full-width) ──────────── */
.din-screen {
  display: grid;
  grid-template-columns: 30fr 70fr;
  gap: clamp(24px, 2.5vw, 48px);
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.din-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1.5vh, 16px);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.din-live-panel {
  position: relative;
  z-index: 1;
}

/* ── Din-screen animated background ─────────────────────────── */
@keyframes dinBlobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -60px) scale(1.15); }
  66%       { transform: translate(-30px, 30px) scale(0.9); }
}
@keyframes dinBlobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(-50px, 40px) scale(1.2); }
}
@keyframes dinBlobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(0.95); }
  40%       { transform: translate(30px, -50px) scale(1.1); }
  80%       { transform: translate(-20px, 20px) scale(1.05); }
}
@keyframes dinShapeSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes dinShapePulse {
  0%, 100% { opacity: 0.04; transform: scale(1); }
  50%       { opacity: 0.10; transform: scale(1.06); }
}
@keyframes dinDotDrift {
  0%, 100% { transform: translate(0, 0); opacity: 0.15; }
  50%       { transform: translate(var(--dx, 20px), var(--dy, -30px)); opacity: 0.04; }
}
.din-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.din-blob-1 {
  width: 500px; height: 500px;
  background: var(--red);
  opacity: 0.07;
  bottom: -160px; left: -100px;
  animation: dinBlobFloat1 20s ease-in-out infinite;
}
.din-blob-2 {
  width: 350px; height: 350px;
  background: var(--orange);
  opacity: 0.05;
  top: -120px; right: 15%;
  animation: dinBlobFloat2 25s ease-in-out infinite;
}
.din-blob-3 {
  width: 280px; height: 280px;
  background: var(--magenta);
  opacity: 0.04;
  top: 30%; right: -80px;
  animation: dinBlobFloat3 30s ease-in-out infinite;
}
.din-shape {
  position: absolute;
  color: var(--line);
  pointer-events: none;
}
.din-shape-rings {
  width: 560px; height: 560px;
  bottom: -180px; left: -120px;
  animation: dinShapeSpin 90s linear infinite;
}
.din-shape-triangle {
  width: 220px; height: 220px;
  top: 8%; right: 4%;
  animation: dinShapePulse 14s ease-in-out infinite;
}
.din-shape-dashes {
  width: 180px; height: 180px;
  top: 55%; left: 40%;
  animation: dinShapeSpin 70s linear infinite reverse;
  opacity: 0.07;
}
.din-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--fg);
  pointer-events: none;
}
.din-dot-1 { width: 6px; height: 6px; top: 22%; left: 44%; --dx: 35px; --dy: -45px; animation: dinDotDrift 15s ease-in-out infinite; }
.din-dot-2 { width: 4px; height: 4px; top: 68%; left: 28%; --dx: -25px; --dy: 22px; animation: dinDotDrift 21s ease-in-out infinite reverse; }
.din-dot-3 { width: 7px; height: 7px; top: 38%; right: 18%; --dx: 18px; --dy: 38px; animation: dinDotDrift 18s ease-in-out infinite; }

/* ── Participant roster in live panel ───────────────────────── */
.participant-roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.participant-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: clamp(10px, 1vh, 16px) clamp(14px, 1.2vw, 22px);
  border-radius: 12px;
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 600;
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
  border: 1px solid transparent;
}
.participant-chip.pending {
  background: var(--line);
  color: var(--fg-muted);
}
.participant-chip.responded {
  background: var(--soft-ok-bg);
  color: var(--fg-2);
  border-color: var(--soft-ok-bg);
}
.chip-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.participant-chip.pending .chip-status { background: var(--line-strong); }
.participant-chip.responded .chip-status {
  background: var(--ok);
  box-shadow: 0 0 7px rgba(0,200,100,0.55);
}
.chip-label { flex: 1; }
.chip-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--fg-muted);
  transition: color 0.4s ease;
}
.participant-chip.responded .chip-tag { color: var(--soft-ok-bg); }
.din-number {
  font-size: clamp(15px, 1.2vw, 20px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
}
.din-name {
  font-size: clamp(56px, 5vw, 80px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.05;
}
.din-subtitle {
  font-size: clamp(22px, 1.8vw, 32px);
  font-weight: 400;
  color: var(--orange);
  font-family: var(--font-editorial);
  font-style: italic;
}
.din-objective {
  font-size: clamp(15px, 1.2vw, 19px);
  color: var(--fg-2);
  line-height: 1.5;
  max-width: 640px;
}
.din-gif {
  width: clamp(160px, 22vh, 320px);
  height: clamp(160px, 22vh, 320px);
  margin-top: 8px;
  flex-shrink: 0;
}
.din-live-panel {
  background: var(--line);
  border-radius: 20px;
  padding: clamp(20px, 2vh, 32px);
  overflow-y: auto;
  min-height: 0;
}
.din-live-title {
  font-size: clamp(13px, 1vw, 18px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-muted);
  margin-bottom: 16px;
}
.response-count-badge {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: clamp(12px, 0.9vw, 16px);
  font-weight: 900;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
}

/* ── Response items in live panel (TV-sized) ───────────────── */
.response-item {
  background: var(--line);
  border-radius: 12px;
  padding: clamp(12px, 1.2vh, 20px) clamp(16px, 1.5vw, 28px);
  margin-bottom: 8px;
  font-size: clamp(16px, 1.2vw, 22px);
  color: var(--white);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.response-item .response-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--red);
  margin-bottom: 4px;
}

/* ── Results visualizations (TV-sized) ──────────────────────── */
.results-screen {
  padding: clamp(16px, 1.5vh, 24px) 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.results-title {
  font-size: clamp(14px, 1vw, 20px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
  margin-bottom: 8px;
}
.results-din-name {
  font-size: clamp(36px, 4vw, 64px);
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: clamp(16px, 2vh, 32px);
}

/* Word Cloud (TV: larger words) */
.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 1vw, 20px);
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 3vh, 48px) clamp(20px, 2vw, 40px);
  min-height: 0;
  flex: 1;
}
.word-cloud .word {
  display: inline-block;
  font-weight: 900;
  transition: all 0.3s ease;
  animation: fadeInWord 0.5s ease;
}
@keyframes fadeInWord {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Columns */
.columns-grid {
  display: grid;
  gap: 24px;
  padding: 20px 0;
}
.columns-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.columns-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.columns-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.column-box {
  background: var(--line);
  border-radius: 16px;
  padding: 20px;
  min-height: 200px;
}
.column-title {
  font-size: clamp(14px, 1.2vw, 24px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.column-title.red { color: var(--red); border-color: var(--red); }
.column-title.orange { color: var(--orange); border-color: var(--orange); }
.column-title.green { color: var(--green); border-color: var(--green); }
.column-title.blue { color: var(--blue); border-color: var(--blue); }

.chip {
  display: inline-block;
  background: var(--line);
  color: var(--white);
  padding: clamp(6px, 0.6vh, 10px) clamp(14px, 1.2vw, 22px);
  border-radius: var(--radius-pill);
  font-size: clamp(14px, 1.1vw, 20px);
  margin: 3px;
  animation: slideIn 0.3s ease;
}
.chip.highlight {
  background: var(--accent-fade);
  color: var(--red);
  font-weight: 700;
}

/* Bar chart */
.bar-chart { display: flex; flex-direction: column; gap: 16px; padding: 20px 0; }
.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
}
.bar-label {
  font-size: clamp(16px, 1.3vw, 24px);
  font-weight: 700;
  text-align: right;
}
.bar-pair { display: flex; flex-direction: column; gap: 4px; }
.bar-track {
  height: clamp(32px, 3.5vh, 52px);
  background: var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--white);
  min-width: 0;
}
.bar-fill.hoy { background: var(--red); }
.bar-fill.futuro { background: var(--orange); }
.bar-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}
.bar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-2);
}
.bar-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* Slider dispersión */
.tension-chart { display: flex; flex-direction: column; gap: 32px; padding: 20px 0; }
.tension-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tension-labels {
  display: flex;
  justify-content: space-between;
  font-size: clamp(14px, 1.2vw, 22px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tension-track {
  height: clamp(40px, 4vh, 56px);
  background: var(--line);
  border-radius: 10px;
  position: relative;
}
.tension-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.3s;
}
.tension-avg {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--white);
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: left 0.3s;
}
.tension-dispersion-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  display: inline-block;
  margin-left: 8px;
}
.tension-dispersion-badge.high {
  background: var(--accent-fade);
  color: var(--red);
}
.tension-dispersion-badge.medium {
  background: var(--accent-fade);
  color: var(--orange);
}
.tension-dispersion-badge.low {
  background: var(--line);
  color: var(--fg-muted);
}

/* Ranking / votes */
.ranking-list { display: flex; flex-direction: column; gap: 8px; padding: 20px 0; }
.ranking-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--line);
  border-radius: 14px;
  transition: all 0.3s;
}
.ranking-item.top-3 {
  background: var(--accent-wash);
  border: 1px solid var(--accent-fade);
}
.ranking-item.top-3:first-child {
  background: var(--accent-fade);
  font-size: clamp(18px, 1.5vw, 32px);
}
.ranking-position {
  font-size: clamp(24px, 2vw, 36px);
  font-weight: 900;
  color: var(--red);
  width: 40px;
  text-align: center;
}
.ranking-text {
  flex: 1;
  font-size: clamp(16px, 1.3vw, 24px);
  color: var(--white);
}
.ranking-votes {
  font-size: clamp(18px, 1.5vw, 28px);
  font-weight: 700;
  color: var(--red);
}

/* ── Finished screen ───────────────────────────────────────── */
.finished-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  text-align: center;
  gap: 24px;
}
.finished-screen .title-hero {
  font-size: clamp(56px, 7vw, 100px);
}
.export-buttons {
  display: flex;
  gap: 16px;
  margin-top: 20px;
}

/* ════════════════════════════════════════════════════════════
   PARTICIPANTE — Layout (mobile-first)
   ════════════════════════════════════════════════════════════ */
body.participante {
  background: var(--bg);
  color: var(--fg);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.par-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header participante ───────────────────────────────────── */
.par-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
/* Código de sesión y estado de la conexión viajan juntos a la derecha. */
.par-header-right { display: flex; align-items: center; gap: 8px; }
.par-header .brand-wordmark { color: var(--red); font-size: 24px; }
.par-header .brand-wordmark span { color: var(--black); }
.par-session {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--fg-muted);
}

/* ── Progress bar ──────────────────────────────────────────── */
.par-progress {
  display: flex;
  gap: 4px;
  padding: 12px 0;
}
.par-progress-segment {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.3s;
}
.par-progress-segment.active { background: var(--red); }
.par-progress-segment.completed { background: var(--black); }

/* ── Content area ──────────────────────────────────────────── */
.par-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
  min-height: 0;
  overflow-y: auto;
}

/* ── Dinámica header (participante) ────────────────────────── */
.par-din-header {
  margin-bottom: 24px;
}
.par-din-number {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--red);
  margin-bottom: 4px;
}
.par-din-name {
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--black);
}
.par-din-subtitle {
  font-size: var(--text-base);
  color: var(--orange);
  font-family: var(--font-editorial);
  font-style: italic;
  margin-top: 6px;
}

/* ── Form inputs ───────────────────────────────────────────── */
.par-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--fg-2);
}
.form-input,
.form-textarea {
  font-family: var(--font-ui);
  font-size: var(--text-md);
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--red);
}
.form-textarea {
  resize: none;
  min-height: 100px;
}
.form-hint {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  text-align: right;
}

/* ── Archetype cards ───────────────────────────────────────── */
.archetype-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px;
}

/* ── Sliders ───────────────────────────────────────────────── */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.slider-row { display: flex; flex-direction: column; gap: 4px; }
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--fg-muted);
}
.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  outline: none;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  cursor: pointer;
  border: 3px solid var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.slider-value {
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 900;
  color: var(--red);
}

/* ── Timer ──────────────────────────────────────────────────── */
.timer-bar {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.timer-fill {
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 1s linear;
}
.timer-text {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  color: var(--red);
  margin-bottom: 12px;
}

/* ── Submit area ───────────────────────────────────────────── */
.par-submit {
  position: sticky;
  bottom: 0;
  background: var(--white);
  padding: 12px 0;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}
.par-submit .btn { width: 100%; justify-content: center; font-size: 18px; padding: 16px; }

/* ── Wait / submitted screen ───────────────────────────────── */
.par-wait {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  padding: 40px 20px;
}
.par-wait .check-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--soft-ok-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  color: var(--green);
}
.par-wait h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
}
.par-wait p {
  font-size: var(--text-base);
  color: var(--fg-muted);
}
.par-wait .gif-box {
  width: 180px;
  height: 180px;
}

/* ── Lobby participante ────────────────────────────────────── */
.par-lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 60px 0 40px;
}
.par-lobby .gif-box {
  width: 120px !important;
  height: 120px !important;
}
.par-lobby h1 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--black);
}
.par-lobby h1 .italic {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 700;
}
.par-lobby p {
  font-size: var(--text-base);
  color: var(--fg-muted);
}

/* ── Vote cards (D08 fase 2) ───────────────────────────────── */
.vote-list { display: flex; flex-direction: column; gap: 10px; }
.vote-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.vote-card.voted {
  border-color: var(--red);
  background: var(--accent-wash);
}
.vote-card .vote-heart {
  font-size: 22px;
  transition: transform 0.2s;
}
.vote-card.voted .vote-heart { transform: scale(1.2); }
.vote-card .vote-text {
  flex: 1;
  font-size: var(--text-base);
  color: var(--black);
}

/* ── Finished participante ─────────────────────────────────── */
.par-finished {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}
.par-finished h1 {
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: -1px;
}
.par-finished p {
  font-size: var(--text-base);
  color: var(--fg-muted);
}

/* ── Animations ────────────────────────────────────────────── */
.fade-in {
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════════════════
   MICRO-ANIMACIONES — Duolingo-inspired
   ════════════════════════════════════════════════════════════ */

/* ── Pop In (bouncy entrance for chips, badges, cards) ──── */
.anim-pop {
  opacity: 0;
  transform: scale(0.3);
  animation: animPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animPopIn {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { opacity: 1; transform: scale(1.08); }
  80%  { transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Slide In Up (staggered list items, result rows) ────── */
.anim-slide-up {
  opacity: 0;
  transform: translateY(24px);
  animation: animSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animSlideUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Slide In Left (columns, panels entering) ─────────── */
.anim-slide-left {
  opacity: 0;
  transform: translateX(-30px);
  animation: animSlideLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animSlideLeft {
  to { opacity: 1; transform: translateX(0); }
}

/* ── Slide In Right ──────────────────────────────────────── */
.anim-slide-right {
  opacity: 0;
  transform: translateX(30px);
  animation: animSlideRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animSlideRight {
  to { opacity: 1; transform: translateX(0); }
}

/* ── Counter Bump (number changes, badge updates) ────── */
.anim-bump {
  animation: animBump 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes animBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ── Celebrate Pop (big moments, dominant results) ──── */
.anim-celebrate {
  opacity: 0;
  transform: scale(0);
  animation: animCelebrate 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: var(--d, 0.2s);
}
@keyframes animCelebrate {
  0%   { opacity: 0; transform: scale(0) rotate(-8deg); }
  50%  { opacity: 1; transform: scale(1.15) rotate(3deg); }
  70%  { transform: scale(0.95) rotate(-1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ── Wiggle (playful attention on hover or focus) ──── */
.anim-wiggle {
  animation: animWiggle 0.5s ease;
}
@keyframes animWiggle {
  0%, 100% { transform: rotate(0deg); }
  15%  { transform: rotate(-4deg); }
  30%  { transform: rotate(3deg); }
  45%  { transform: rotate(-2deg); }
  60%  { transform: rotate(1deg); }
  75%  { transform: rotate(-0.5deg); }
}

/* ── Glow Pulse (live indicators, active elements) ──── */
.anim-glow {
  animation: animGlow 2s ease-in-out infinite;
}
@keyframes animGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255,25,53,0.3); }
  50%      { box-shadow: 0 0 24px rgba(255,25,53,0.6), 0 0 48px rgba(255,25,53,0.15); }
}

/* ── Bar Fill (elastic width for bar charts) ───────── */
.anim-bar-fill {
  width: 0 !important;
  animation: animBarFill 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animBarFill {
  to { width: var(--w, 100%); }
}

/* ── Float Up Reveal (synthesis cards) ──────────────── */
.anim-float-reveal {
  opacity: 0;
  transform: translateY(30px);
  filter: blur(6px);
  animation: animFloatReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0.5s);
}
@keyframes animFloatReveal {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ── Scatter Dots (individual dots appearing on tension tracks) */
.anim-dot-scatter {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  animation: animDotScatter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animDotScatter {
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Flip In (archetype emoji reveals) ─────────────── */
.anim-flip {
  opacity: 0;
  transform: perspective(300px) rotateY(-90deg);
  animation: animFlip 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animFlip {
  to { opacity: 1; transform: perspective(300px) rotateY(0deg); }
}

/* ── Shimmer (loading/reveal highlight sweep) ────── */
.anim-shimmer {
  position: relative;
  overflow: hidden;
}
.anim-shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 30%,
    var(--line) 45%,
    var(--line-strong) 50%,
    var(--line) 55%,
    transparent 70%);
  animation: animShimmer 1.5s ease forwards;
  animation-delay: var(--d, 0.3s);
  transform: translateX(-100%);
  pointer-events: none;
}
@keyframes animShimmer {
  to { transform: translateX(100%); }
}

/* ── Confetti canvas ──────────────────────────────── */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ── Stagger helpers: auto-delay children ──────── */
.stagger-children > *:nth-child(1)  { --d: 0.05s; }
.stagger-children > *:nth-child(2)  { --d: 0.10s; }
.stagger-children > *:nth-child(3)  { --d: 0.15s; }
.stagger-children > *:nth-child(4)  { --d: 0.20s; }
.stagger-children > *:nth-child(5)  { --d: 0.25s; }
.stagger-children > *:nth-child(6)  { --d: 0.30s; }
.stagger-children > *:nth-child(7)  { --d: 0.35s; }
.stagger-children > *:nth-child(8)  { --d: 0.40s; }
.stagger-children > *:nth-child(9)  { --d: 0.45s; }
.stagger-children > *:nth-child(10) { --d: 0.50s; }
.stagger-children > *:nth-child(11) { --d: 0.55s; }
.stagger-children > *:nth-child(12) { --d: 0.60s; }
.stagger-children > *:nth-child(13) { --d: 0.65s; }
.stagger-children > *:nth-child(14) { --d: 0.70s; }
.stagger-children > *:nth-child(15) { --d: 0.75s; }
.stagger-children > *:nth-child(n+16) { --d: 0.80s; }

/* ── Response chip arrive animation ───────────── */
.participant-chip {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.participant-chip.just-arrived {
  animation: animPopIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.participant-chip.responded {
  animation: chipResponded 0.4s ease;
}
@keyframes chipResponded {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); background: var(--soft-ok-bg); }
  100% { transform: scale(1); }
}

/* ── Pulso timer fullscreen overlay ─────────── */
@keyframes timerOverlayIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes timerOverlayOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.05); }
}

/* ── Results title entrance ──────────────────── */
.results-title {
  animation: animSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.results-din-name {
  animation: animSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.1s;
}

/* ── Live dot bounce on increment ───────────── */
.live-dot {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.live-dot.bump {
  animation: animBump 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Synthesis card hover micro-interaction ────── */
.synthesis-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.synthesis-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255,25,53,0.12);
}

/* ── Freq chip hover ────────────────────────────── */
.freq-chip {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.freq-chip:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 12px rgba(255,25,53,0.15);
}

/* ── Column box entrance ────────────────────────── */
.anim-column {
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  animation: animColumnIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes animColumnIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Number count-up visual ────────────────────── */
.anim-number {
  display: inline-block;
  animation: animNumberPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: var(--d, 0.3s);
}
@keyframes animNumberPop {
  0%   { opacity: 0; transform: scale(0.5) translateY(8px); }
  60%  { opacity: 1; transform: scale(1.2) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Emoji bounce for archetype reveals ────────── */
.anim-emoji-bounce {
  display: inline-block;
  animation: animEmojiBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: var(--d, 0.2s);
}
@keyframes animEmojiBounce {
  0%   { opacity: 0; transform: scale(0) rotate(-15deg); }
  50%  { opacity: 1; transform: scale(1.3) rotate(5deg); }
  70%  { transform: scale(0.9) rotate(-2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* ── Scrollbar styling ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
body.participante ::-webkit-scrollbar-thumb { background: var(--line-strong); }

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-white { color: var(--white); }
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }

/* ════════════════════════════════════════════════════════════
   PARTICIPANTE — Chips de sugerencia (D02, D05, D06)
   ════════════════════════════════════════════════════════════ */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.sug-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--line);
  background: var(--white);
  color: var(--black);
  font-size: var(--text-base);
  font-weight: 500;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sug-chip:active { transform: scale(0.95); }
.sug-chip.selected {
  border-color: var(--red);
  background: var(--accent-wash);
  color: var(--red);
  font-weight: 700;
}
.sug-chip-otro {
  border-style: dashed;
  color: var(--fg-muted);
}
.sug-chip-otro.selected {
  border-style: solid;
  border-color: var(--red);
  color: var(--red);
}

/* ════════════════════════════════════════════════════════════
   PARTICIPANTE — Archetype cards (D03)
   ════════════════════════════════════════════════════════════ */
.arch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.arch-card:active { transform: scale(0.96); }
.arch-card.selected {
  border-color: var(--red);
  background: var(--accent-wash);
}
.arch-card .emoji { font-size: 26px; }
.arch-card .arch-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--black);
  line-height: 1.2;
}
.arch-card.selected .arch-name { color: var(--red); }
.arch-check {
  font-size: var(--text-sm);
  font-weight: 900;
  color: var(--red);
}
.arch-step { width: 100%; padding: 4px; }
.arch-slide-out { display: none !important; }
.arch-slide-in-hidden { display: none !important; }

/* ════════════════════════════════════════════════════════════
   PARTICIPANTE — Dials semicircle (D04 Tensiones)
   ════════════════════════════════════════════════════════════ */
.dial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dial-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dial-svg {
  width: 100%;
  max-width: 160px;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.dial-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 160px;
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dial-label-left { text-align: left; }
.dial-label-right { text-align: right; }

/* ════════════════════════════════════════════════════════════
   INTRO CAROUSEL — Multi-slide system
   ════════════════════════════════════════════════════════════ */
.intro-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.intro-track {
  display: flex;
  height: 100%;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
.intro-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Dots navigation ──────────────────────────────────────── */
.intro-dots {
  position: absolute;
  bottom: clamp(16px, 2.5vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.intro-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--line-strong);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.intro-dot.active {
  background: var(--red);
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(255, 25, 53, 0.5);
}
.intro-dot:hover:not(.active) {
  background: var(--fg-muted);
}

/* ── Confirm badge ────────────────────────────────────────── */
.intro-confirm-badge {
  position: absolute;
  top: clamp(12px, 2vh, 24px);
  right: clamp(16px, 2vw, 32px);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--fg-muted);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: clamp(13px, 1vw, 18px);
  font-weight: 700;
  color: var(--fg);
  z-index: 10;
}
.intro-confirm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse-dot 1.5s infinite;
}

/* ── Presentation slide (red bg, 2-col) ───────────────────── */
.intro-pres {
  width: 100%;
  height: 100%;
  background: var(--red);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  padding: clamp(32px, 4vh, 64px) clamp(40px, 4vw, 80px);
  align-items: center;
  position: relative;
  overflow: hidden;
}
/* En el tema neo la slide de intro deja de ser un bloque de color: el orb es
 * lo que carga la pantalla y necesita un fondo que lo deje respirar. El acento
 * queda para el eyebrow y los detalles. */
html[data-theme="neo"] body.facilitador .intro-pres {
  background: var(--surface);
}
/* Las formas decorativas de la slide se apagan y toman el lime del sistema:
 * el ámbar del tema mgc no pertenece a esta paleta. */
html[data-theme="neo"] body.facilitador .intro-pres::before,
html[data-theme="neo"] body.facilitador .intro-pres::after {
  background: var(--accent-2);
  opacity: 0.12;
}

.intro-pres::before {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -60px;
  width: 260px;
  height: 260px;
  background: var(--orange);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  pointer-events: none;
}
.intro-pres-left {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.5vh, 16px);
  z-index: 1;
}
.intro-pres-label {
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-2);
}
.intro-pres-title {
  font-family: var(--font-ui);
  font-weight: 900;
  font-size: clamp(72px, 10vh, 120px);
  color: var(--fg);
  line-height: 0.95;
  letter-spacing: -2px;
  margin: 0;
}
.intro-pres-subtitle {
  font-family: var(--font-editorial);
  font-style: italic;
  font-size: clamp(24px, 3vh, 40px);
  color: var(--fg-2);
  margin: 0;
}
.intro-pres-objective {
  font-size: clamp(14px, 1.3vw, 20px);
  color: var(--fg-2);
  line-height: 1.5;
  max-width: 600px;
  margin: 0;
}
.intro-pres-right {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.intro-pres-gif {
  width: clamp(220px, 30vw, 440px);
  height: clamp(220px, 30vw, 440px);
  object-fit: cover;
  border-radius: 24px;
}

/* ── Concept slide (black bg, centered) ───────────────────── */
.intro-concept {
  width: 100%;
  height: 100%;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(32px, 4vh, 64px) clamp(40px, 4vw, 80px);
  gap: clamp(8px, 1vh, 16px);
}

/* ── Instruction slide (black bg, mock forms) ─────────────── */
.intro-instr {
  width: 100%;
  height: 100%;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(24px, 3vh, 48px) clamp(32px, 3vw, 64px);
  gap: clamp(16px, 2vh, 28px);
}
.intro-mock-label {
  font-size: clamp(14px, 1.2vw, 20px);
  font-weight: 700;
  color: var(--fg-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: clamp(8px, 1vh, 16px);
}
/* Slider demo animation for D05 intro */
@keyframes sliderDemo {
  0%, 100% { left: 30%; }
  50% { left: 70%; }
}
.anim-slider-demo {
  animation: sliderDemo 4s ease-in-out infinite;
}
.intro-mock-input {
  background: var(--line);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  padding: clamp(12px, 1.5vh, 20px) clamp(16px, 1.5vw, 28px);
  color: var(--fg-muted);
  font-size: clamp(20px, 2.5vh, 32px);
  text-align: left;
}
.intro-mock-chip {
  display: inline-block;
  background: var(--line);
  border: 1.5px solid var(--line-strong);
  color: var(--fg-2);
  padding: clamp(6px, 0.7vh, 10px) clamp(12px, 1.2vw, 20px);
  border-radius: var(--radius-pill);
  font-size: clamp(14px, 1.3vw, 20px);
  font-weight: 500;
  white-space: nowrap;
}

/* ════════════════════════════════════════════════════════════
   RESULTS FULLSCREEN — Minimal wrapper
   ════════════════════════════════════════════════════════════ */
.results-full {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.results-header {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: clamp(12px, 1.5vw, 24px);
  padding-bottom: clamp(8px, 1vh, 14px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(8px, 1vh, 14px);
}
.results-tag {
  font-size: clamp(11px, 0.9vw, 16px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--red);
}
.results-dname {
  font-size: clamp(24px, 3vw, 48px);
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--fg);
}
.results-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Empty state ──────────────────────────────────────────── */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--fg-muted);
  font-size: clamp(16px, 1.3vw, 22px);
}
.results-empty-icon {
  font-size: clamp(48px, 6vh, 80px);
  opacity: 0.5;
}

/* ── Cierre "en construcción" (templates con wip) ──────────── */
.wip-build {
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 100%;
}
.wip-bar {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--red);
  transform-origin: left center;
  opacity: 0;
  animation: wipStack 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.4s);
}
.wip-bar:nth-child(2) { width: 78%; opacity: 0.75; }
.wip-bar:nth-child(3) { width: 52%; opacity: 0.5; }
@keyframes wipStack {
  0%        { transform: scaleX(0); opacity: 0; }
  25%, 70%  { transform: scaleX(1); opacity: 1; }
  100%      { transform: scaleX(1); opacity: 0.15; }
}
.wip-progress {
  margin-top: 22px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
}
.wip-progress span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: var(--radius-pill);
  background: var(--white);
  animation: wipSweep 1.8s ease-in-out infinite;
}
@keyframes wipSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* ============================================================
   ASISTENTE — vista de control del asistente (móvil / tablet)
   Migrada desde el <style> inline de asistente.html.
   Prefijo: ast-
   ============================================================ */

body.asistente {
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
}

.ast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
}
.ast-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ast-logo { height: 24px; }
.ast-badge {
  background: var(--soft-neutral-bg);
  color: var(--soft-neutral-fg);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}

.ast-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}
.ast-din-name {
  font-size: 24px;
  font-weight: 900;
  color: var(--fg);
  margin-bottom: 2px;
}
.ast-din-sub {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin-bottom: 12px;
}
.ast-counter {
  font-size: var(--text-sm);
  color: var(--fg-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ast-counter .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: astPulse 2s ease-in-out infinite;
}
@keyframes astPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ast-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.ast-progress-seg {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  transition: background var(--motion-medium);
}
.ast-progress-seg.active { background: var(--accent); }
.ast-progress-seg.completed { background: var(--accent); opacity: 0.4; }

.ast-phase {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ast-phase.lobby    { background: var(--soft-neutral-bg); color: var(--soft-neutral-fg); }
.ast-phase.intro    { background: var(--soft-warn-bg);    color: var(--soft-warn-fg); }
.ast-phase.dinamica { background: var(--soft-ok-bg);      color: var(--soft-ok-fg); }
.ast-phase.results  { background: var(--soft-danger-bg);  color: var(--soft-danger-fg); }
.ast-phase.finished { background: var(--soft-accent-bg);  color: var(--soft-accent-fg); }

.ast-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.ast-capture {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ast-capture-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--fg-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ast-capture-row {
  display: flex;
  gap: 8px;
}
.ast-capture-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-size: var(--text-md);
  font-family: inherit;
  background: var(--surface);
  color: var(--fg);
  outline: none;
  transition: border-color var(--motion-fast);
}
.ast-capture-input:focus { border-color: var(--focus-ring); }
.ast-capture-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--surface);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ast-capture-btn:hover { background: var(--accent-strong); }

.ast-captured-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ast-captured-chip {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: var(--text-sm);
  color: var(--fg-2);
}
.ast-waiting {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
  font-size: var(--text-md);
}

/* ── Gestión de turnos ── */
.ast-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.ast-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-ink);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.ast-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.ast-participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background var(--motion-fast);
}
.ast-participant-row.ast-turn-active {
  background: var(--accent-wash);
  border-color: var(--accent-ink);
}
.ast-participant-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}

.ast-slide-nav {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.ast-info {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: var(--text-xs);
  color: var(--fg-muted);
  line-height: 1.5;
}


/* ============================================================
   PARTICIPANTE — animaciones y componentes
   Estaban inyectados desde participante.js. Movidos tal cual: las reglas no
   se reescribieron en este paso.
   ============================================================ */
    @keyframes shake {
      0%, 100% { transform: translateX(0); }
      25% { transform: translateX(-8px); }
      75% { transform: translateX(8px); }
    }
    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

    /* D01 Mood Grid */
    .mood-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      margin-top: 12px;
    }
    .mood-chip {
      min-height: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px 4px;
      border: 2px solid var(--line-strong);
      border-radius: 10px;
      font-size: 13px;
      font-weight: 600;
      text-align: center;
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
      -webkit-user-select: none;
      background: var(--surface);
    }
    .mood-chip.selected {
      border-color: var(--red);
      background: var(--accent-fade);
      color: var(--red);
    }

    /* Suggestion Chips (D02, D05, D06) */
    .suggestion-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 4px;
    }
    .sug-chip {
      min-height: 44px;
      display: flex;
      align-items: center;
      padding: 8px 14px;
      border: 2px solid var(--line-strong);
      border-radius: 22px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.15s ease;
      user-select: none;
      -webkit-user-select: none;
      background: var(--surface);
    }
    .sug-chip.selected {
      border-color: var(--red);
      background: var(--accent-fade);
      color: var(--red);
    }
    .sug-chip-otro {
      border-style: dashed;
      color: var(--fg-muted);
    }
    .sug-chip-otro.selected {
      border-style: solid;
      color: var(--red);
    }

    /* D03 Archetype */
    .archetype-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
      margin-top: 8px;
      padding: 4px;
    }
    .arch-step {
      transition: transform 0.35s ease, opacity 0.35s ease;
      position: relative;
    }
    .arch-slide-out {
      transform: translateX(-100%);
      opacity: 0;
      position: absolute;
      top: 0; left: 0; right: 0;
      pointer-events: none;
    }
    .arch-slide-in-hidden {
      transform: translateX(100%);
      opacity: 0;
      pointer-events: none;
    }
    .arch-card {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 14px 8px;
      border: 2px solid var(--line-strong);
      border-radius: 12px;
      background: var(--surface);
      cursor: pointer;
      min-height: 80px;
      transition: transform 0.15s ease, border-color 0.15s ease;
      user-select: none;
      -webkit-user-select: none;
    }
    .arch-card .emoji {
      font-size: 28px;
      margin-bottom: 4px;
    }
    .arch-card .arch-name {
      font-size: 13px;
      font-weight: 600;
      text-align: center;
      line-height: 1.2;
    }
    .arch-card.selected {
      transform: scale(1.03);
      border-color: var(--red) !important;
      background: var(--accent-wash);
      box-shadow: 0 2px 12px var(--accent-fade);
    }
    .arch-check {
      position: absolute;
      top: 4px;
      right: 6px;
      width: 22px;
      height: 22px;
      background: var(--red);
      color: var(--surface);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 700;
    }

    /* D04 Horizontal Sliders */
    .tension-slider-grid {
      display: flex;
      flex-direction: column;
      gap: 18px;
      padding-bottom: 15px;
    }
    .tension-slider-row {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .tension-slider-labels {
      display: flex;
      justify-content: space-between;
      font-size: 13px;
      font-weight: 600;
      color: var(--fg-2);
    }
    .tension-label-left, .tension-label-right {
      max-width: 110px;
      line-height: 1.2;
    }
    .tension-item-label {
      font-size: 16px;
      font-weight: 800;
      color: var(--black);
      line-height: 1.25;
    }
    .prio-grid {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .prio-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      background: var(--surface-2);
      border-radius: 10px;
    }
    .prio-label {
      font-size: 15px;
      font-weight: 600;
      color: var(--black);
      line-height: 1.25;
    }
    .prio-select {
      flex: 0 0 auto;
      min-width: 68px;
      padding: 8px 10px;
      font-size: 16px;
      font-family: inherit;
      font-weight: 700;
      color: var(--black);
      background: var(--surface);
      border: 1.5px solid var(--line-strong);
      border-radius: 8px;
      outline: none;
    }
    .prio-select:focus { border-color: var(--red); }
    .frases-prompt {
      font-size: 17px;
      font-weight: 800;
      color: var(--black);
      line-height: 1.3;
      margin-bottom: 14px;
    }
    .tension-range {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 8px;
      background: var(--line-strong);
      border-radius: 4px;
      outline: none;
    }
    .tension-range::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      border: 3px solid var(--surface);
      box-shadow: 0 1px 4px var(--fg-muted);
    }
    .tension-range::-moz-range-thumb {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
      border: 3px solid var(--surface);
      box-shadow: 0 1px 4px var(--fg-muted);
    }

    /* D07 Autocomplete */
    .autocomplete-wrap {
      position: relative;
    }
    .autocomplete-dropdown {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--surface);
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      box-shadow: var(--shadow-1);
      z-index: 100;
      overflow: hidden;
      margin-top: 4px;
    }
    .ac-option {
      padding: 12px 14px;
      font-size: 14px;
      cursor: pointer;
      min-height: 44px;
      display: flex;
      align-items: center;
    }
    .ac-option:hover, .ac-option:active {
      background: var(--accent-wash);
    }

    /* D08 Template */
    .template-input {
      border-bottom: 2px solid var(--red) !important;
      border-radius: 0 !important;
      border-top: none !important;
      border-left: none !important;
      border-right: none !important;
      background: transparent !important;
      padding: 4px 0 !important;
    }
    .template-preview {
      border-left: 3px solid var(--red);
    }

    /* Vote cards */
    .vote-card {
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    .vote-card.voted {
      border-color: var(--red);
      background: var(--accent-wash);
    }
    .vote-card .vote-heart {
      font-size: 24px;
      transition: transform 0.2s ease;
    }
    .vote-card.voted .vote-heart {
      transform: scale(1.2);
    }

    /* Ensure touch targets */
    .form-input, .form-textarea {
      font-size: 16px !important;
    }

    /* ── Saving screen ─────────────────────────── */
    @keyframes savingFloat {
      0%, 100% { transform: translateY(0); }
      50%       { transform: translateY(-8px); }
    }
    @keyframes savingDot {
      0%, 80%, 100% { transform: translateY(0); opacity: 0.25; }
      40%           { transform: translateY(-14px); opacity: 1; }
    }
    @keyframes savingFadeIn {
      from { opacity: 0; transform: translateY(16px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .par-saving {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 20px;
      padding: 64px 24px;
      text-align: center;
      animation: savingFadeIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }
    .saving-cloud {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0;
    }
    .saving-cloud-icon {
      font-size: 52px;
      line-height: 1;
      animation: savingFloat 1.8s ease-in-out infinite;
      filter: drop-shadow(0 6px 18px var(--accent-fade));
    }
    .saving-particles {
      display: flex;
      gap: 7px;
      margin-top: 10px;
    }
    .saving-dot {
      display: inline-block;
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--red);
      animation: savingDot 1.4s ease-in-out infinite;
    }
    .saving-dot:nth-child(1) { animation-delay: 0s; }
    .saving-dot:nth-child(2) { animation-delay: 0.18s; }
    .saving-dot:nth-child(3) { animation-delay: 0.36s; }
    .saving-text {
      font-size: 17px;
      font-weight: 700;
      color: var(--black);
      letter-spacing: -0.2px;
    }
    .saving-sub {
      font-size: 13px;
      color: var(--fg-muted);
      line-height: 1.5;
      max-width: 220px;
    }

/* ════════════════════════════════════════════════════════════
   FACILITADOR — Pantalla de setup (elección de workshop)
   Overlay a pantalla completa. El scroll vive en `.fac-setup`
   y el centrado en `.fac-setup-scroll`: centrar dentro del
   propio scroller recorta la parte de arriba cuando el
   formulario es más alto que la ventana.
   ════════════════════════════════════════════════════════════ */
.fac-setup {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background:
    radial-gradient(120% 90% at 12% 0%, var(--accent-wash) 0%, transparent 55%),
    var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.fac-setup-scroll {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vh, 56px) clamp(16px, 3vw, 40px);
}
.fac-setup-card {
  width: 100%;
  max-width: 1120px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: clamp(28px, 4vh, 44px) clamp(24px, 3vw, 48px) clamp(24px, 3.5vh, 36px);
}

/* ── Cabecera ─────────────────────────────────────────────── */
.fac-setup-head {
  display: grid;
  gap: var(--space-3);
  padding-bottom: clamp(20px, 3vh, 32px);
  margin-bottom: clamp(22px, 3.2vh, 34px);
  border-bottom: 1px solid var(--line);
}
.fac-setup-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--fg);
  text-wrap: balance;
}
.fac-setup-lead {
  margin: 0;
  max-width: 58ch;
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
}

/* ── Rejilla de dos columnas ─────────────────────────────── */
.fac-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
.fac-setup-col {
  display: grid;
  gap: clamp(16px, 2.2vh, 24px);
  align-content: start;
}
.fac-setup-group {
  display: grid;
  gap: var(--space-2);
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.fac-setup-label {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.fac-setup-hint {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--fg-muted);
}
.fac-setup-count {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Campos ──────────────────────────────────────────────── */
.fac-setup-input {
  width: 100%;
  min-width: 0;
  padding: 12px 15px;
  background: var(--bg);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: inherit;
  font-size: var(--text-md);
  line-height: 1.45;
  outline: none;
  transition: border-color var(--motion-fast) var(--ease),
              box-shadow var(--motion-fast) var(--ease);
}
.fac-setup-input::placeholder { color: var(--fg-muted); }
.fac-setup-input:hover { border-color: var(--line-strong); }
.fac-setup-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
textarea.fac-setup-input { resize: vertical; min-height: 92px; }
.fac-setup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-3);
}

/* ── Tarjetas de template ────────────────────────────────── */
.fac-setup-templates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}
.fac-tpl-card {
  position: relative;
  display: grid;
  gap: 6px;
  align-content: start;
  text-align: left;
  padding: 15px 44px 15px 16px;
  background: var(--bg);
  border: 1.5px solid var(--surface-3);
  border-radius: var(--radius-card);
  color: var(--fg);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease),
              background var(--motion-fast) var(--ease),
              transform var(--motion-fast) var(--ease);
}
.fac-tpl-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.fac-tpl-card:active { transform: translateY(0); }
.fac-tpl-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.fac-tpl-card[aria-checked="true"] {
  border-color: var(--accent);
  background: var(--accent-wash);
}
.fac-tpl-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.fac-tpl-meta {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.fac-tpl-tag {
  justify-self: start;
  margin-top: 2px;
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
/* Marca de selección: círculo vacío que se llena con el acento */
.fac-tpl-card::after {
  content: '';
  position: absolute;
  top: 15px;
  right: 15px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: border-color var(--motion-fast) var(--ease),
              box-shadow var(--motion-fast) var(--ease),
              background var(--motion-fast) var(--ease);
}
.fac-tpl-card[aria-checked="true"]::after {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--surface);
}

/* ── Logo ────────────────────────────────────────────────── */
.fac-setup-logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.fac-setup-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--bg);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-size: var(--text-base);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease);
}
.fac-setup-file:hover { border-color: var(--accent); color: var(--fg); }
.fac-setup-file:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.fac-setup-logo-preview {
  height: 48px;
  width: 48px;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 4px;
}

/* ── Toggle modo asistente ───────────────────────────────── */
.fac-setup-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 15px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  cursor: pointer;
}
.fac-setup-toggle-copy { display: grid; gap: 3px; }
.fac-setup-toggle-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}
.fac-setup-switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
}
.fac-setup-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.fac-setup-switch-track {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  pointer-events: none;
  transition: background var(--motion-fast) var(--ease);
}
.fac-setup-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--motion-fast) var(--ease);
}
.fac-setup-switch input:checked + .fac-setup-switch-track { background: var(--accent); }
.fac-setup-switch input:checked + .fac-setup-switch-track::after { transform: translateX(20px); }
.fac-setup-switch input:focus-visible + .fac-setup-switch-track {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── Pie ─────────────────────────────────────────────────── */
.fac-setup-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: clamp(22px, 3.2vh, 34px);
  padding-top: clamp(18px, 2.6vh, 26px);
  border-top: 1px solid var(--line);
}
.fac-setup-foot .btn { padding: 15px 40px; }
.fac-setup-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}
.fac-setup-share a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--motion-fast) var(--ease);
}
.fac-setup-share a:hover { border-bottom-color: var(--accent-ink); }
.fac-setup-copy {
  background: none;
  border: 1px solid var(--surface-3);
  border-radius: 4px;
  padding: 3px 7px;
  color: var(--fg-muted);
  font-family: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease),
              color var(--motion-fast) var(--ease);
}
.fac-setup-copy:hover { border-color: var(--accent); color: var(--fg); }

/* Una sola columna cuando la ventana es angosta (portrait, laptop chico) */
@media (max-width: 900px) {
  .fac-setup-grid { grid-template-columns: minmax(0, 1fr); }
  .fac-setup-foot { flex-direction: column-reverse; align-items: stretch; }
  .fac-setup-foot .btn { width: 100%; }
}
/* Ventana baja (TV en landscape, notebook 768px de alto): menos aire vertical */
@media (max-height: 780px) {
  .fac-setup-card { padding-top: clamp(20px, 3vh, 28px); }
  .fac-setup-lead { display: none; }
}
