/* Etzon Cloud — interfaz de control. Oscuro profundo, vidrio y aurora azul que cambia con el estado del stream. */
:root {
  --bg: #04060d;
  --bg-2: #080c1a;
  --ink: #f3f6ff;
  --ink-2: rgba(222, 230, 255, 0.7);
  --ink-3: rgba(196, 208, 255, 0.45);
  --ink-4: rgba(196, 208, 255, 0.28);
  --line: rgba(150, 175, 255, 0.11);
  --line-2: rgba(150, 175, 255, 0.2);
  --glass: rgba(16, 23, 48, 0.55);
  --glass-2: rgba(26, 36, 74, 0.6);
  --glass-hi: rgba(255, 255, 255, 0.045);
  --blue: #2f6bff;
  --blue-2: #5b8cff;
  --cyan: #2ad4ff;
  --live: #ff2e58;
  --warn: #ffb547;
  --ok: #33e6a0;
  --aurora-a: #1d4dff;
  --aurora-b: #22c6ff;
  --aurora-c: #3b2bff;
  --r-xl: 30px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --display: 'Unbounded', 'SF Pro Display', system-ui, sans-serif;
  --ui: 'Onest', 'SF Pro Text', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

body.phase-live { --aurora-a: #1f4bff; --aurora-b: #ff2e78; --aurora-c: #2a2bff; }
body.phase-brb { --aurora-a: #ff8a1f; --aurora-b: #2f6bff; --aurora-c: #ff4d2e; }
body.phase-intro,
body.phase-outro,
body.phase-starting,
body.phase-ending { --aurora-a: #3d5bff; --aurora-b: #9b6bff; --aurora-c: #22c6ff; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--blue-2); text-decoration: none; }
svg { display: block; }
::selection { background: rgba(47, 107, 255, 0.5); }

/* ---------- Cielo (fondo) ---------- */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% 120%, #0a1230 0%, var(--bg) 60%); }
.sky-glow { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; transition: background 1.6s var(--ease), opacity 1.6s var(--ease); will-change: transform; }
.g1 { width: 620px; height: 620px; left: -220px; top: -260px; background: radial-gradient(circle at 60% 60%, var(--aurora-a), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.g2 { width: 520px; height: 520px; right: -240px; top: 30vh; background: radial-gradient(circle at 40% 40%, var(--aurora-b), transparent 65%); opacity: 0.32; animation: drift2 32s ease-in-out infinite alternate; }
.g3 { width: 700px; height: 420px; left: 10%; bottom: -300px; background: radial-gradient(circle, var(--aurora-c), transparent 65%); opacity: 0.35; animation: drift1 38s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(90px, 70px, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-80px, -60px, 0) scale(1.12); } }
.grain {
  position: absolute; inset: -50%; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) { .sky-glow { animation: none; } }

#app { position: relative; z-index: 1; }

/* ---------- Estructura ---------- */
.shell { max-width: 1240px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 112px); }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.wordmark { display: flex; align-items: center; gap: 10px; white-space: nowrap; min-width: 0; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: 0.02em; }
.wordmark .mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, #2f6bff, #1b2fd8 60%, #0d1660); box-shadow: 0 6px 24px -6px rgba(47, 107, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.wordmark small { display: block; font-family: var(--ui); font-weight: 500; font-size: 10.5px; letter-spacing: 0.24em; color: var(--ink-3); margin-top: 1px; }
.topbar .grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--ink-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); white-space: nowrap; }
.chip.warn { color: var(--warn); border-color: rgba(255, 181, 71, 0.35); }
.chip.sim { color: var(--cyan); border-color: rgba(42, 212, 255, 0.3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.live { background: var(--live); box-shadow: 0 0 10px var(--live); animation: pulse 1.6s ease-in-out infinite; }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); animation: pulse 1s ease-in-out infinite; }
.dot.off { background: rgba(196, 208, 255, 0.25); }
@keyframes pulse { 50% { opacity: 0.35; } }

.view-title { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -0.01em; margin: 6px 0 4px; }
.view-sub { color: var(--ink-3); margin: 0 0 20px; font-size: 14px; }

.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (min-width: 980px) {
  .shell { padding-left: 116px; padding-bottom: 48px; }
  .live-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

/* ---------- Vidrio ---------- */
.card { position: relative; background: linear-gradient(180deg, var(--glass-2), var(--glass)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); box-shadow: inset 0 1px 0 var(--glass-hi), 0 20px 50px -30px rgba(0, 0, 0, 0.8); }
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.005em; }
.card-head .grow { flex: 1; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em; }

/* ---------- Escenario (vista previa) ---------- */
.stage { padding: 10px; border-radius: var(--r-xl); }
.stage::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(91, 140, 255, 0.55), transparent 35%, transparent 65%, rgba(42, 212, 255, 0.35)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; transition: background 0.8s; }
.phase-live .stage::before { background: linear-gradient(140deg, rgba(255, 46, 88, 0.75), transparent 40%, transparent 60%, rgba(47, 107, 255, 0.6)); }
.phase-brb .stage::before { background: linear-gradient(140deg, rgba(255, 181, 71, 0.8), transparent 40%, transparent 60%, rgba(255, 120, 60, 0.4)); }
.screen { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden; background: #02040a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04); }
.screen img, .screen svg.schem { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen .hud { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.screen .hud .grow { flex: 1; }
.badge { display: inline-flex; align-items: center; gap: 7px; height: 28px; white-space: nowrap; flex: none; padding: 0 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(4, 6, 13, 0.62); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.08); }
.badge.live { background: var(--live); border-color: transparent; box-shadow: 0 6px 22px -6px var(--live); }
.badge.brb { background: rgba(255, 181, 71, 0.95); color: #1d1200; border-color: transparent; }
.badge.mute { background: rgba(255, 46, 88, 0.18); color: #ff8aa2; border-color: rgba(255, 46, 88, 0.35); }
.badge .time { font-family: var(--mono); font-weight: 500; letter-spacing: 0; text-transform: none; }
@media (max-width: 420px) { .screen .hud { left: 9px; right: 9px; top: 9px; gap: 6px; } .badge { height: 25px; padding: 0 9px; font-size: 10.5px; gap: 5px; } .screen .foot { left: 9px; bottom: 9px; } }
.screen .foot { position: absolute; left: 12px; bottom: 12px; right: 12px; display: flex; justify-content: space-between; align-items: end; pointer-events: none; }
.screen .scene-name { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.85); background: rgba(4, 6, 13, 0.55); padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* Pipeline INTRO → CÁMARA → RESPALDO → OUTRO */
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 4px 4px; position: relative; }
.pipeline::before { content: ''; position: absolute; left: 12%; right: 12%; top: 17px; height: 2px; background: linear-gradient(90deg, var(--line-2), var(--line-2)); border-radius: 2px; }
.pipe { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.pipe .node { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #0b1124; border: 1px solid var(--line-2); color: var(--ink-3); transition: all 0.5s var(--ease); position: relative; z-index: 1; }
.pipe .lbl { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); transition: color 0.4s; }
.pipe .sub { font-size: 11px; color: var(--ink-4); margin-top: -4px; min-height: 15px; }
.pipe.done .node { color: var(--blue-2); border-color: rgba(91, 140, 255, 0.45); }
.pipe.armed .node { color: var(--ok); border-color: rgba(51, 230, 160, 0.4); }
.pipe.armed .sub { color: rgba(51, 230, 160, 0.8); }
.pipe.on .node { background: linear-gradient(145deg, var(--blue-2), var(--blue)); color: #fff; border-color: transparent; box-shadow: 0 0 0 6px rgba(47, 107, 255, 0.16), 0 8px 26px -4px rgba(47, 107, 255, 0.9); }
.pipe.on .lbl { color: var(--ink); }
.pipe.on.red .node { background: linear-gradient(145deg, #ff5a7a, var(--live)); box-shadow: 0 0 0 6px rgba(255, 46, 88, 0.16), 0 8px 26px -4px rgba(255, 46, 88, 0.9); }
.pipe.on.amber .node { background: linear-gradient(145deg, #ffd27a, var(--warn)); color: #241500; box-shadow: 0 0 0 6px rgba(255, 181, 71, 0.18), 0 8px 26px -4px rgba(255, 181, 71, 0.9); animation: throb 1.4s ease-in-out infinite; }
.pipe.on .sub { color: var(--ink-2); }
@keyframes throb { 50% { box-shadow: 0 0 0 11px rgba(255, 181, 71, 0.06), 0 8px 26px -4px rgba(255, 181, 71, 0.9); } }

/* ---------- Botones ---------- */
.cta { position: relative; width: 100%; height: 60px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 16.5px; letter-spacing: 0.005em; transition: transform 0.25s var(--ease), box-shadow 0.3s, opacity 0.3s; overflow: hidden; user-select: none; -webkit-user-select: none; }
.cta:active { transform: scale(0.975); }
.cta.go { color: #fff; background: linear-gradient(180deg, #4b84ff 0%, #2f6bff 45%, #1f4fe6 100%); box-shadow: 0 16px 40px -14px rgba(47, 107, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.2); }
.cta.go::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%); transform: translateX(-120%); animation: sheen 3.8s ease-in-out infinite 1s; }
@keyframes sheen { 30%, 100% { transform: translateX(120%); } }
.cta.end { color: #070b18; background: linear-gradient(180deg, #ffffff, #e3e8f5); box-shadow: 0 16px 40px -18px rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.08); }
.cta.wait { color: var(--ink-2); background: var(--glass-2); border: 1px solid var(--line-2); cursor: progress; }
.cta.wait::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(91, 140, 255, 0.25), transparent); animation: sheen 1.6s linear infinite; transform: translateX(-120%); }
.cta[disabled] { opacity: 0.55; pointer-events: none; }
.cta-sub { text-align: center; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; transition: background 0.2s, transform 0.2s var(--ease); white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn:hover { background: rgba(40, 54, 108, 0.65); }
.btn.primary { background: linear-gradient(180deg, #4b84ff, #2f6bff); border-color: transparent; color: #fff; box-shadow: 0 10px 26px -12px rgba(47, 107, 255, 0.9); }
.btn.white { background: #fff; color: #070b18; border-color: transparent; }
.btn.danger { color: #ff8aa2; border-color: rgba(255, 46, 88, 0.3); background: rgba(255, 46, 88, 0.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 42px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn.block { width: 100%; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Controles rápidos ---------- */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { position: relative; text-align: left; padding: 15px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--glass-2), var(--glass)); border: 1px solid var(--line); min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; transition: transform 0.25s var(--ease), border-color 0.3s, background 0.3s; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); overflow: hidden; }
.tile:active { transform: scale(0.97); }
.tile .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(91, 140, 255, 0.14); color: var(--blue-2); }
.tile .t { font-weight: 600; font-size: 14.5px; }
.tile .s { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.tile.active { border-color: rgba(255, 46, 88, 0.45); background: linear-gradient(180deg, rgba(255, 46, 88, 0.2), rgba(255, 46, 88, 0.06)); }
.tile.active .ico { background: var(--live); color: #fff; }
.tile.active.amber { border-color: rgba(255, 181, 71, 0.5); background: linear-gradient(180deg, rgba(255, 181, 71, 0.2), rgba(255, 181, 71, 0.05)); }
.tile.active.amber .ico { background: var(--warn); color: #241500; }
.tile.active.blue { border-color: rgba(91, 140, 255, 0.5); background: linear-gradient(180deg, rgba(47, 107, 255, 0.24), rgba(47, 107, 255, 0.06)); }
.tile.active.blue .ico { background: var(--blue); color: #fff; }
.tile .eq { position: absolute; right: 14px; top: 18px; display: flex; gap: 3px; align-items: end; height: 16px; }
.tile .eq i { width: 3px; background: var(--blue-2); border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.tile .eq i:nth-child(2) { animation-delay: 0.2s; } .tile .eq i:nth-child(3) { animation-delay: 0.45s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* ---------- Carril de escenas ---------- */
.rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.scene-card { flex: none; width: 148px; scroll-snap-align: start; text-align: left; padding: 8px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); transition: border-color 0.3s, transform 0.25s var(--ease), box-shadow 0.3s; }
.scene-card:active { transform: scale(0.97); }
.scene-card .thumb { aspect-ratio: 16 / 9; border-radius: 11px; overflow: hidden; background: #050915; }
.scene-card .thumb svg { width: 100%; height: 100%; }
.scene-card .nm { font-size: 13px; font-weight: 600; margin: 8px 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-card .ly { font-size: 11px; color: var(--ink-3); margin: 0 4px 2px; }
.scene-card.active { border-color: rgba(91, 140, 255, 0.7); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18), 0 14px 30px -16px rgba(47, 107, 255, 0.9); }
.scene-card.active .nm::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-2); margin-right: 6px; vertical-align: 2px; box-shadow: 0 0 8px var(--blue-2); }

/* ---------- Señal ---------- */
.sig { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.sig:first-of-type { border-top: 0; padding-top: 2px; }
.sig .nm { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sig .val { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-align: right; }
.sig .meta { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--ink-3); }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: rgba(150, 175, 255, 0.09); overflow: hidden; border: 1px solid rgba(150, 175, 255, 0.06); }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #19d6ff, #3a7bff 55%, #5b5bff); box-shadow: 0 0 14px rgba(42, 212, 255, 0.55); transition: width 0.6s var(--ease); }
.bar.low i { background: linear-gradient(90deg, #ffcf6b, #ff9a2e); box-shadow: 0 0 14px rgba(255, 181, 71, 0.5); }
.bar.dead i { width: 0 !important; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; background: rgba(91, 140, 255, 0.14); color: var(--blue-2); }
.tag.ok { background: rgba(51, 230, 160, 0.12); color: var(--ok); }
.tag.warn { background: rgba(255, 181, 71, 0.14); color: var(--warn); }
.tag.red { background: rgba(255, 46, 88, 0.14); color: #ff7d97; }
.tag.dim { background: rgba(150, 175, 255, 0.08); color: var(--ink-3); }

.dests { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 12px; border-radius: var(--r-md); background: rgba(8, 12, 28, 0.5); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.stat span { font-size: 11.5px; color: var(--ink-3); }

.feed { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow: auto; }
.ev { display: grid; grid-template-columns: 46px 10px 1fr; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 13px; color: var(--ink-2); }
.ev time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); }
.ev .dot { transform: translateY(-1px); }

/* ---------- Listas / formularios ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; height: 48px; padding: 0 15px; border-radius: 14px; background: rgba(5, 8, 20, 0.65); border: 1px solid var(--line-2); outline: none; transition: border-color 0.2s, box-shadow 0.2s; font-size: 15px; }
textarea.input { height: auto; min-height: 92px; padding: 13px 15px; resize: vertical; }
.input:focus { border-color: rgba(91, 140, 255, 0.75); box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.18); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.copy { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: rgba(5, 8, 20, 0.65); border: 1px solid var(--line-2); }
.copy code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; line-height: 1.5; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(150, 175, 255, 0.16); transition: background 0.25s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.3s var(--ease); }
.switch input:checked + i { background: linear-gradient(90deg, var(--blue), var(--blue-2)); }
.switch input:checked + i::after { transform: translateX(20px); }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(5, 8, 20, 0.6); border: 1px solid var(--line); }
.seg button { flex: 1; height: 36px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: all 0.25s var(--ease); }
.seg button.on { background: linear-gradient(180deg, #4b84ff, #2f6bff); color: #fff; box-shadow: 0 6px 18px -8px rgba(47, 107, 255, 0.9); }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--blue) var(--p, 50%), rgba(150, 175, 255, 0.15) var(--p, 50%)); outline: none; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(47, 107, 255, 0.25); }
input[type='range']::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 0; }

.empty { text-align: center; padding: 26px 12px; color: var(--ink-3); font-size: 14px; }
.empty .big { font-size: 30px; margin-bottom: 6px; }

/* Fuentes */
.src-head { display: flex; align-items: center; gap: 12px; }
.src-ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgba(91, 140, 255, 0.12); color: var(--blue-2); flex: none; position: relative; }
.src-ico .dot { position: absolute; right: -2px; top: -2px; width: 11px; height: 11px; border: 2px solid #0b1124; }
.proto-tabs { margin: 14px 0 12px; }
.qr { width: 132px; height: 132px; border-radius: 16px; background: rgba(5, 8, 20, 0.65); border: 1px solid var(--line-2); padding: 10px; flex: none; }
.qr img { width: 100%; height: 100%; }
.guide { margin: 12px 0 0; padding: 0 0 0 20px; color: var(--ink-2); font-size: 13.5px; }
.guide li { margin: 5px 0; }
.guide b { color: var(--ink); }

/* Medios */
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role { padding: 14px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--glass-2), var(--glass)); border: 1px solid var(--line); text-align: left; display: flex; flex-direction: column; gap: 10px; min-height: 128px; }
.role .rt { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.role .rt .n { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.role .thumbs { display: flex; gap: 6px; }
.role .thumbs > div { width: 46px; aspect-ratio: 16 / 10; border-radius: 8px; background: #0a1022 center / cover; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-4); }
.role .hint { font-size: 12px; color: var(--ink-3); }
.drop { border: 1.5px dashed rgba(91, 140, 255, 0.4); border-radius: var(--r-lg); padding: 24px 16px; text-align: center; background: rgba(47, 107, 255, 0.05); transition: background 0.2s, border-color 0.2s; }
.drop.over { background: rgba(47, 107, 255, 0.14); border-color: var(--blue-2); }
.drop .big { width: 54px; height: 54px; border-radius: 18px; margin: 0 auto 10px; display: grid; place-items: center; background: linear-gradient(145deg, var(--blue-2), var(--blue)); color: #fff; box-shadow: 0 12px 30px -12px rgba(47, 107, 255, 0.95); }
.lib { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .lib { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .lib { grid-template-columns: repeat(4, 1fr); } }
.file { text-align: left; border-radius: 16px; overflow: hidden; background: var(--glass); border: 1px solid var(--line); transition: transform 0.2s var(--ease); }
.file:active { transform: scale(0.98); }
.file .th { aspect-ratio: 16 / 9; background: #070c1c center / cover; position: relative; display: grid; place-items: center; color: var(--ink-4); }
.file .th .dur { position: absolute; right: 6px; bottom: 6px; font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; }
.file .th .roles-on { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; }
.file .meta { padding: 9px 10px 10px; }
.file .meta .nm { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .meta .sz { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.progress { height: 6px; border-radius: 99px; background: rgba(150, 175, 255, 0.12); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue)); transition: width 0.3s; }

/* Escenas */
.scene-row { display: grid; grid-template-columns: 132px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.scene-row:first-child { border-top: 0; }
.scene-row .thumb { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #050915; border: 1px solid var(--line); }
.scene-row .thumb svg { width: 100%; height: 100%; }
.scene-row .nm { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.scene-row .ly { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.layouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.layout-opt { padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 8, 20, 0.5); text-align: center; font-size: 11.5px; color: var(--ink-3); font-weight: 600; transition: all 0.2s; }
.layout-opt svg { width: 100%; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; margin-bottom: 6px; }
.layout-opt.on { border-color: var(--blue-2); color: var(--ink); background: rgba(47, 107, 255, 0.12); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(5, 8, 20, 0.5); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all 0.2s; }
.pill.on { background: linear-gradient(180deg, #4b84ff, #2f6bff); border-color: transparent; color: #fff; }

/* ---------- Navegación ---------- */
.tabbar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 12px); display: flex; gap: 2px; padding: 6px; border-radius: 26px; background: rgba(10, 15, 34, 0.72); border: 1px solid var(--line-2); backdrop-filter: blur(28px) saturate(160%); -webkit-backdrop-filter: blur(28px) saturate(160%); box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05); width: min(calc(100% - 24px), 440px); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; border-radius: 20px; color: var(--ink-3); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; transition: color 0.25s, background 0.25s; position: relative; }
.tab.on { color: var(--ink); background: rgba(91, 140, 255, 0.16); }
.tab.on svg { color: var(--blue-2); }
.tab .pip { position: absolute; top: 6px; right: calc(50% - 16px); width: 7px; height: 7px; border-radius: 50%; }
@media (min-width: 980px) {
  .tabbar { left: 20px; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; width: 84px; padding: 8px; border-radius: 28px; }
  .tab { padding: 12px 0 10px; }
}

/* ---------- Hojas (modales) ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(2, 3, 8, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.25s var(--ease); }
.sheet { position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow: auto; padding: 10px 18px calc(var(--safe-b) + 22px); border-radius: 30px 30px 0 0; background: linear-gradient(180deg, #121a38, #0a0f22); border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -30px 80px -20px rgba(0, 0, 0, 0.8); animation: up 0.42s var(--ease); }
.sheet .handle { width: 42px; height: 5px; border-radius: 9px; background: rgba(196, 208, 255, 0.25); margin: 2px auto 16px; }
.sheet h2 { font-family: var(--display); font-weight: 600; font-size: 21px; margin: 0 0 4px; letter-spacing: -0.01em; }
.sheet .lead { color: var(--ink-3); margin: 0 0 18px; font-size: 14px; }
@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; bottom: 50%; width: 560px; transform: translate(-50%, 50%); border-radius: 30px; border-bottom: 1px solid var(--line-2); padding-bottom: 24px; animation: pop 0.35s var(--ease); }
  .sheet .handle { display: none; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 54%) scale(0.97); } }

/* ---------- Avisos ---------- */
#toasts { position: fixed; z-index: 80; top: calc(var(--safe-t) + 12px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(calc(100% - 24px), 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: rgba(16, 23, 50, 0.92); border: 1px solid var(--line-2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.9); font-size: 14px; font-weight: 500; animation: drop 0.4s var(--ease); }
.toast.err { border-color: rgba(255, 46, 88, 0.45); }
.toast.ok .dot { background: var(--ok); }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } }
.conn-lost { position: sticky; top: calc(var(--safe-t) + 6px); z-index: 20; display: flex; gap: 10px; align-items: center; padding: 11px 14px; margin-bottom: 14px; border-radius: 16px; background: rgba(255, 181, 71, 0.13); border: 1px solid rgba(255, 181, 71, 0.4); color: #ffd590; font-size: 13px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(var(--safe-t) + 30px) 24px calc(var(--safe-b) + 34px); max-width: 460px; margin: 0 auto; }
.login .hero-mark { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(145deg, #3b78ff, #1b2fd8 60%, #0d1660); box-shadow: 0 16px 50px -10px rgba(47, 107, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.4); margin-bottom: 26px; }
.login h1 { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 14px; }
.login h1 em { font-style: normal; background: linear-gradient(90deg, #6aa0ff, #2ad4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login p { color: var(--ink-2); margin: 0 0 30px; font-size: 16px; }
.login .dots { display: flex; gap: 6px; margin-bottom: 26px; }
.login .dots i { width: 6px; height: 6px; border-radius: 9px; background: var(--ink-4); }
.login .dots i:first-child { width: 34px; background: var(--blue); }
.feat { display: flex; flex-direction: column; gap: 10px; margin: 0 0 30px; padding: 0; list-style: none; }
.feat li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.feat li svg { color: var(--ok); flex: none; }

/* ---------- Entradas animadas ---------- */
.rise { animation: rise 0.6s var(--ease) both; }
.rise.d1 { animation-delay: 0.05s; } .rise.d2 { animation-delay: 0.1s; } .rise.d3 { animation-delay: 0.15s; } .rise.d4 { animation-delay: 0.2s; } .rise.d5 { animation-delay: 0.25s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.hide-sm { display: none; }
@media (min-width: 720px) { .hide-sm { display: initial; } }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgba(150, 175, 255, 0.12); }
