:root {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: #edf5ef;
  background: #0D0F12;
  font-synthesis: none;
  text-rendering: optimizeLegibility;

  --bg-deep: #0D0F12;
  --bg-surface: #16191E;
  --bg-elevated: #1F232B;
  --bg-input: #12151A;
  --line: rgba(255, 255, 255, 0.07);
  --line-green: rgba(16, 185, 129, 0.22);
  --muted: #94A3B8;
  --panel: #16191E;
  --green: #10B981;
  --green-dark: #059669;
  --green-soft: #6EE7B7;
  --danger: #ef4444;
  --header-h: 52px;
  --footer-h: 64px;
  --scenes-w: 220px;
  --rail-w: 58px;
  --drawer-w: 440px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-deep);
  color: #edf5ef;
}

button,
input,
select {
  font: inherit;
}

/* Scrollbar sutil solo para contenedores con scroll interno */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(34, 197, 94, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 197, 94, 0.42);
}

/* =====================================================================
   SHELL PRINCIPAL FIJO 100dvh / 100vh · IZQUIERDA (ESCENAS) + CENTRO (16:9) + DERECHA (PANELES)
   ===================================================================== */
.app-shell {
  display: grid;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-deep);
  grid-template-rows: var(--header-h) minmax(0, 1fr) var(--footer-h);
  grid-template-columns: var(--scenes-w) minmax(0, 1fr) auto;
  grid-template-areas:
    "header header header"
    "left center right"
    "footer footer footer";
}

/* =====================================================================
   ZONA 1: BARRA SUPERIOR FIJA LIMPIA (HEADER · 52px)
   ===================================================================== */
.topbar.studio-header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: var(--header-h);
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
  z-index: 20;
  min-width: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #16a34a;
  font-size: 17px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-copy strong {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #f0fdf4;
}

.brand-copy span {
  font-size: 8.5px;
  letter-spacing: 0.22em;
  color: var(--green-soft);
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
  flex-shrink: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumbs strong {
  color: #edf5ef;
  font-weight: 600;
}

.crumb-separator {
  color: #3f5747;
}

.draft-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(34, 197, 94, 0.24);
  border-radius: 999px;
  background: rgba(13, 23, 17, 0.9);
  color: #a7f3c0;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.connection-dot,
.live-status i,
.draft-badge i {
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #08100b;
  color: #a6b9ac;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.live-status i {
  background: #64746b;
  box-shadow: none;
}

.live-timer {
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #f87171;
  margin-left: 2px;
}

/* Botón principal de transmisión: texto nítido único, sin text-shadow ni pseudo-elementos */
.btn-stream {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid #22c55e;
  border-radius: 999px;
  background: #16a34a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-stream:hover {
  background: #15803d;
  border-color: #4ade80;
}

.btn-stream:disabled {
  opacity: 0.72;
  cursor: wait;
}

.stream-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbf7d0;
  flex-shrink: 0;
}

.btn-stream.is-connecting {
  background: #b45309;
  border-color: #f59e0b;
  color: #ffffff;
}

.btn-stream.is-connecting .stream-dot {
  background: #fef3c7;
  animation: live-pulse 0.8s infinite ease-in-out;
}

.btn-stream.is-live {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

.btn-stream.is-live:hover {
  background: #b91c1c;
}

.btn-stream.is-live .stream-dot {
  background: #ffffff;
  animation: live-pulse 1s infinite ease-in-out;
}

/* Botón de engranaje Configuración de Transmisión RTMP junto a Iniciar transmisión */
.btn-header-gear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #111f16;
  color: #d4e8da;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-header-gear:hover {
  background: #183021;
  border-color: #22c55e;
  color: #ffffff;
}

.btn-header-gear.is-active {
  background: rgba(22, 163, 74, 0.28);
  border-color: #22c55e;
  color: #86efac;
}

.eyebrow {
  color: #779280;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* =====================================================================
   ZONA 3: CENTRO (LIENZO 16:9 SIN SCROLL + PLANTILLAS) Y VISTAS
   ===================================================================== */
.main-area.center-workspace {
  grid-area: center;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-deep);
  position: relative;
}

.view {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
}

.view[hidden] {
  display: none !important;
}

/* Vista Principal de Escenario (Estilo Restream Studio · 0 scroll) */
#view-escenas {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px 16px 10px;
  gap: 10px;
}

.stage-center-frame {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scene-canvas-wrapper {
  position: relative;
  width: min(100%, calc((100dvh - var(--header-h) - var(--footer-h) - 82px) * 16 / 9));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  background: #050a07;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.55);
}

.scene-composite-canvas {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
}

.scene-webviews-layer,
.scene-slots-overlay,
.scene-transform-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.scene-webviews-layer {
  z-index: 2;
}

.scene-transform-layer {
  z-index: 3;
  user-select: none;
  display: none !important;
  pointer-events: none !important;
}

#scene-camera-box,
.scene-camera-box,
.cam-resize-handle {
  display: none !important;
  pointer-events: none !important;
}

.scene-slots-overlay {
  z-index: 10;
}

.slot-webview-box {
  position: absolute;
  overflow: hidden;
  background: #050b07;
  pointer-events: auto;
  box-sizing: border-box;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.slot-webview-box webview {
  width: 100%;
  height: 100%;
  border: 0;
  display: inline-flex;
  background: #050b07;
}

/* Celdas de ventana: SIEMPRE limpias sin texto permanente; botones visibles SOLO al :hover */
.stage-slot-cell {
  position: absolute;
  box-sizing: border-box;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.stage-slot-cell.is-empty {
  pointer-events: auto;
  background: transparent;
  border: 1px dashed rgba(34, 197, 94, 0.22);
}

.stage-slot-cell.is-empty .slot-empty-picker {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.stage-slot-cell.is-empty:hover {
  background: rgba(24, 28, 35, 0.46);
  border-color: #525761;
}

.stage-slot-cell.is-empty:hover .slot-empty-picker {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.slot-empty-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  width: 100%;
  max-width: 96%;
  text-align: center;
}

.slot-empty-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86efac;
  background: rgba(7, 13, 9, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  padding: 2px 9px;
}

.slot-options-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.slot-opt-btn {
  background: rgba(13, 23, 17, 0.94);
  color: #edf5ef;
  border: 1px solid rgba(34, 197, 94, 0.38);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
  white-space: nowrap;
}

.slot-opt-btn:hover {
  background: #16a34a;
  border-color: #22c55e;
  color: #041208;
  transform: translateY(-1px);
}

.slot-hover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  background: linear-gradient(
    180deg,
    rgba(5, 11, 7, 0.8) 0%,
    rgba(5, 11, 7, 0.04) 36%,
    rgba(5, 11, 7, 0.04) 64%,
    rgba(5, 11, 7, 0.84) 100%
  );
}

.stage-slot-cell:hover .slot-hover-overlay,
.stage-slot-cell.is-hovered .slot-hover-overlay,
.stage-slot-cell.is-toolbar-pinned .slot-hover-overlay,
.stage-slot-cell.is-control-focused .slot-hover-overlay {
  opacity: 1;
}

.slot-hover-top,
.slot-hover-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.slot-hover-bottom {
  justify-content: center;
  gap: 4px;
}

.slot-source-pill {
  font-size: 10px;
  font-weight: 600;
  color: #edf5ef;
  background: rgba(7, 13, 9, 0.88);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  padding: 2px 7px;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.slot-mini-btn {
  background: rgba(13, 23, 17, 0.94);
  color: #e6f4ea;
  border: 1px solid rgba(34, 197, 94, 0.36);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.slot-mini-btn:hover {
  background: #16a34a;
  border-color: #22c55e;
  color: #041208;
}

.slot-mini-btn.is-muted {
  background: rgba(127, 29, 29, 0.92);
  border-color: #f87171;
  color: #fecaca;
}

.slot-mini-btn.is-danger:hover {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

.slot-end-behavior-select {
  background: rgba(9, 20, 14, 0.96);
  color: #d8f5de;
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  max-width: 148px;
  outline: none;
}

.slot-end-behavior-select:hover,
.slot-end-behavior-select:focus {
  border-color: #22c55e;
  background: #122c1d;
}

.slot-end-behavior-select option {
  background: #08110c;
  color: #edf5ef;
}

.slot-webview-trigger {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  pointer-events: auto;
  background: rgba(7, 13, 9, 0.88);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.stage-slot-cell.is-hovered .slot-webview-trigger,
.stage-slot-cell.is-toolbar-pinned .slot-webview-trigger {
  opacity: 0;
  pointer-events: none;
}

/* Fila compacta centrada de 4 plantillas justo debajo del canvas */
.stage-template-strip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
}

.layout-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-layout-opt {
  background: #0a140e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #9cb5a3;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.btn-layout-opt:hover {
  background: #13281b;
  border-color: rgba(34, 197, 94, 0.4);
  color: #edf5ef;
}

.btn-layout-opt.active {
  background: rgba(22, 163, 74, 0.24);
  border-color: var(--green);
  color: #bbf7d0;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}

/* Modo recorte estilo OBS (Alt / AltGr): desbloquear los 4 bordes sobre #scene-canvas */
.scene-canvas-wrapper.is-obs-crop-key .scene-slots-overlay,
.scene-canvas-wrapper.is-obs-crop-key .slot-hover-overlay,
.scene-canvas-wrapper.is-obs-crop-key .slot-hover-top,
.scene-canvas-wrapper.is-obs-crop-key .slot-hover-bottom {
  pointer-events: none !important;
  opacity: 0 !important;
}

.btn-reset-crop {
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
  background: rgba(22, 163, 74, 0.14);
}

.btn-reset-crop:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.28);
  border-color: #22c55e;
  color: #dcfce7;
}

.btn-reset-crop:disabled {
  opacity: 0.45;
  cursor: default;
  background: #0a140e;
  border-color: rgba(255, 255, 255, 0.08);
  color: #7c9584;
}

.btn-reset-crop.has-crop {
  background: rgba(34, 197, 94, 0.24);
  border-color: #22c55e;
  color: #dcfce7;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.24);
}

.slot-mini-btn.is-crop-reset {
  background: rgba(22, 163, 74, 0.32);
  border-color: rgba(74, 222, 128, 0.7);
  color: #dcfce7;
}

.slot-mini-btn.is-crop-reset:hover {
  background: #16a34a;
  color: #041208;
}

/* =====================================================================
   ZONA 3B: BARRA INFERIOR FIJA (FOOTER RESTREAM + PARTICIPANTES)
   ===================================================================== */
.studio-footer {
  grid-area: footer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--footer-h);
  padding: 0 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
  z-index: 20;
  overflow: hidden;
}

.footer-dock-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: nowrap;
}

.dock-mic-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: #08110c;
  border: 1px solid var(--line);
}

.dock-mic-gain {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dock-mic-gain input[type="range"] {
  width: 68px;
  height: 4px;
  accent-color: var(--green);
  cursor: pointer;
}

.dock-mic-gain span {
  font-size: 9.5px;
  font-family: Consolas, monospace;
  color: #86efac;
  min-width: 30px;
  text-align: right;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111f16;
  color: #dcebe0;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.dock-btn.dock-btn-compact {
  height: 30px;
  padding: 0 9px;
  font-size: 10.5px;
}

.dock-btn:hover:not(:disabled) {
  background: #183021;
  border-color: rgba(34, 197, 94, 0.55);
  color: #ffffff;
}

.dock-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.dock-btn.is-active {
  background: rgba(22, 163, 74, 0.24);
  border-color: var(--green);
  color: #bbf7d0;
}

.dock-btn.dock-btn-circle {
  width: 34px;
  padding: 0;
  font-size: 14px;
}

.dock-guest-link-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guest-generated-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.22);
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* Cuadrito flotante sobre la barra inferior al copiar enlace de invitado */
.guest-link-popover {
  position: fixed;
  bottom: calc(var(--footer-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(440px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 12px;
  background: #0d1711;
  border: 1px solid rgba(34, 197, 94, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65);
  display: none;
  flex-direction: column;
  gap: 8px;
}

.guest-link-popover.is-open {
  display: flex;
}

.guest-link-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guest-link-popover-head span {
  font-size: 11.5px;
  font-weight: 700;
  color: #86efac;
}

.dock-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 2px;
  flex-shrink: 0;
}

/* Medidor de nivel compacto integrado junto al micrófono */
.stage-vu-floating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vu-track {
  width: 48px;
  height: 6px;
  background: #040906;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #16291d;
}

.vu-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e 0%, #eab308 75%, #ef4444 100%);
  transition: width 0.05s ease-out;
}

.vu-db {
  font-size: 9.5px;
  font-family: Consolas, monospace;
  color: #86efac;
  min-width: 24px;
  text-align: right;
}

/* Tarjetas en vivo de participantes a la derecha del footer */
.footer-participants {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.participant-card {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #08110c;
  border: 1px solid var(--line);
  min-width: 155px;
  max-width: 220px;
}

.participant-card.participant-card-guest {
  min-width: 235px;
  max-width: 300px;
}

.participant-card.is-host {
  border-color: rgba(34, 197, 94, 0.32);
}

.participant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(22, 163, 74, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-size: 15px;
  flex-shrink: 0;
}

.participant-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.participant-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.participant-info strong {
  font-size: 11px;
  color: #edf5ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-info small {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant-vol-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.participant-vol-row input[type="range"] {
  width: 56px;
  height: 4px;
  accent-color: var(--green);
  cursor: pointer;
}

.btn-kick-inline {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(239, 68, 68, 0.65);
  background: rgba(185, 28, 28, 0.32);
  color: #fecaca;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn-kick-inline:hover:not(:disabled) {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

.btn-kick-inline:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.participant-vol-row span {
  font-size: 9px;
  font-family: Consolas, monospace;
  color: #86efac;
  min-width: 26px;
}

/* =====================================================================
   ZONA 4: BARRA LATERAL DERECHA PLEGABLE (DRAWER + RAIL DE ICONOS)
   ===================================================================== */
.right-tools-area {
  grid-area: right;
  display: flex;
  flex-direction: row;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
  z-index: 40;
}

.right-drawer {
  position: relative;
  z-index: 42;
  width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-surface);
  border-left: 0 solid var(--line);
  transition: width 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.right-drawer.is-open {
  width: min(var(--drawer-w), 44vw);
  border-left-width: 1px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.drawer-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: #edf5ef;
}

.drawer-close-btn {
  width: 28px;
  height: 28px;
  margin-right: 12px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #101e15;
  color: #d6e9dc;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.drawer-close-btn:hover {
  border-color: var(--green);
  background: #173322;
  color: #ffffff;
}

.drawer-scroll-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 13px 15px 18px;
  width: min(var(--drawer-w), 44vw);
}

.drawer-panel {
  display: none;
  flex-direction: column;
  gap: 11px;
}

.drawer-panel.is-active {
  display: flex;
}

.right-icon-rail {
  width: var(--rail-w);
  flex-shrink: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  background: #09110c;
  border-left: 1px solid var(--line);
  overflow-y: auto;
}

.rail-divider {
  width: 28px;
  height: 1px;
  background: var(--line);
  margin: 4px 0;
  flex-shrink: 0;
}

.rail-icon-btn {
  width: 44px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.rail-icon-btn span:first-child {
  font-size: 15px;
  line-height: 1;
}

.rail-icon-btn span:last-child {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.rail-icon-btn:hover {
  background: rgba(34, 197, 94, 0.1);
  color: #edf5ef;
}

.rail-icon-btn.is-active {
  background: rgba(22, 163, 74, 0.24);
  border-color: var(--green);
  color: #86efac;
}

.drawer-placeholder-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 22px 14px;
  background: #08110c;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.drawer-placeholder-card h3 {
  margin: 0;
  font-size: 14px;
  color: #edf5ef;
}

.drawer-placeholder-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

/* =====================================================================
   COMPONENTES COMPARTIDOS (PANELES, FORMULARIOS, AUDIO, AJUSTES, MODAL)
   ===================================================================== */
.welcome-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.wave {
  color: #86efac;
  font-size: 16px;
}

.subheading {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-surface);
  color: #a5b8ab;
  font-size: 10.5px;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.95fr);
  gap: 14px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.95fr);
  gap: 14px;
  margin-top: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin: 3px 0 0;
  font-size: 13.5px;
  font-weight: 620;
}

.stage-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 10px;
  background: radial-gradient(ellipse at 65% 10%, #1c442c 0, #102519 42%, #070d09 82%);
}

.stage-grid {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image: linear-gradient(#d8f4dc12 1px, transparent 1px),
    linear-gradient(90deg, #d8f4dc12 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.stage-orb {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  pointer-events: none;
}
.orb-one {
  top: -110px;
  right: 12%;
  background: rgba(34, 197, 94, 0.18);
}
.orb-two {
  bottom: -140px;
  left: 8%;
  width: 220px;
  height: 220px;
  background: rgba(22, 163, 74, 0.15);
}

.stage-cat {
  position: absolute;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.14);
  font-size: 46px;
  z-index: 1;
  pointer-events: none;
}

.stage-caption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: grid;
  gap: 3px;
  z-index: 3;
}

.stage-label {
  color: #86efac;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.stage-caption strong {
  font-size: 13px;
  font-weight: 600;
}

.preview-corner {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(7, 13, 9, 0.85);
  color: #b7c9bc;
  font-size: 8.5px;
  z-index: 3;
}

.preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
}

.scene-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scene-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  font-size: 14px;
}

.scene-name div {
  display: grid;
  gap: 2px;
}

.scene-name strong {
  font-size: 11px;
}

.scene-name small {
  color: var(--muted);
  font-size: 9.5px;
}

.local-tag {
  color: #7c9484;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.studio-camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

#stage-composite-canvas {
  object-fit: contain;
  background: #050b07;
}

#stage-composite-canvas.is-active {
  opacity: 1;
  display: block !important;
}

.camera-no-signal-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 13, 9, 0.9);
  backdrop-filter: blur(8px);
  padding: 16px;
  text-align: center;
}

.no-signal-content {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.no-signal-content strong {
  font-size: 13px;
  color: #fca5a5;
}

.no-signal-content p {
  font-size: 10.5px;
  color: var(--muted);
  margin: 0;
}

.no-signal-actions {
  display: flex;
  gap: 8px;
}

.quick-card {
  display: flex;
  flex-direction: column;
}

.quick-actions {
  display: grid;
  gap: 8px;
}

.quick-action {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #08110c;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.quick-action:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: #102016;
}

.action-icon,
.module-icon,
.placeholder-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 700;
}

.action-icon {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.purple { color: #c3a7ff; background: #8b64db22; }
.orange { color: #f2bb79; background: #d9833222; }
.pink { color: #f29bc1; background: #d45c9822; }
.blue { color: #93c7f3; background: #458bc222; }
.green { color: #86efac; background: rgba(34, 197, 94, 0.16); }
.gold { color: #f1c473; background: #cf9b3822; }

.quick-action > span:nth-child(2) {
  display: grid;
  gap: 2px;
}
.quick-action strong {
  font-size: 11px;
}
.quick-action small {
  color: var(--muted);
  font-size: 9.5px;
}
.quick-action b {
  color: #6b8072;
  font-size: 18px;
  font-weight: 400;
}

.coming-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: auto;
  padding-top: 12px;
  color: #93ab9b;
}

.coming-note span {
  color: var(--green);
}
.coming-note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.module-list {
  display: grid;
}

.module-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-top: 1px solid var(--line);
}

.module-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.module-row > div {
  display: grid;
  gap: 2px;
}
.module-row strong {
  font-size: 11px;
}
.module-row small {
  color: var(--muted);
  font-size: 9.5px;
}
.module-state {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.note-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 12px;
  background: radial-gradient(ellipse at 92% 10%, rgba(34, 197, 94, 0.16), transparent 45%),
    linear-gradient(145deg, #12271a, #0a160f);
}

.note-card h2 {
  margin: 6px 0 6px;
  font-size: 17px;
  line-height: 1.15;
}

.note-card p {
  max-width: 240px;
  margin-bottom: 12px;
  color: #9cb5a3;
  font-size: 10.5px;
  line-height: 1.45;
}

.note-signature {
  color: #82a08b;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.note-signature span {
  color: var(--green);
}

.section-placeholder {
  display: grid;
  justify-items: center;
  align-content: center;
  height: 100%;
  text-align: center;
}

.placeholder-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  border-radius: 16px;
  font-size: 24px;
}

.coming-soon {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* Formularios, Audio y RTMP */
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: #b4cab9;
}

.form-control {
  background: var(--bg-input);
  border: 1px solid #1d3525;
  color: #edf5ef;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password-wrapper .form-control {
  padding-right: 36px;
}

.btn-input-action {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: #7c9684;
  cursor: pointer;
  padding: 5px;
  font-size: 14px;
}

.btn-input-action:hover {
  color: #d1fae5;
}

.form-hint {
  font-size: 10px;
  color: #708878;
}

.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* Botones verdes principales: texto único limpio sin text-shadow ni efecto doble */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #16a34a;
  border: 1px solid #22c55e;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary:hover {
  background: #15803d;
  border-color: #4ade80;
}

.btn-mini {
  background: #13251a;
  border: 1px solid #244731;
  color: #c2dfc9;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn-mini:hover:not(:disabled) {
  background: #1b3a26;
  border-color: var(--green);
  color: #ffffff;
}

.btn-mini:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.save-feedback {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

/* Telemetría y Consola FFmpeg */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-input);
  border: 1px solid #1a2d21;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  color: #779080;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #86efac;
  font-family: Consolas, monospace;
}

.terminal-container {
  display: flex;
  flex-direction: column;
  height: 230px;
  background: #050a07;
  border: 1px solid #192b1f;
  border-radius: 8px;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: #0c1710;
  border-bottom: 1px solid #192b1f;
  font-size: 9px;
  font-weight: 700;
  color: #779080;
  letter-spacing: 0.1em;
}

.terminal-output {
  flex: 1;
  margin: 0;
  padding: 10px 12px;
  overflow-y: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  line-height: 1.45;
  color: #86efac;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Audio */
.vu-meter-master {
  background: var(--bg-input);
  border: 1px solid #1a2d21;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.vu-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #b4cab9;
}

.vu-labels strong {
  font-family: Consolas, monospace;
  color: #86efac;
}

.vu-meter-bar-track {
  height: 14px;
  background: #040906;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #16261b;
}

.vu-meter-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 60%, #eab308 82%, #ef4444 100%);
  transition: width 0.05s ease-out;
}

.vu-meter-scale {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #63766a;
  font-family: Consolas, monospace;
}

.range-slider {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex: 0 0 36px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #16281c;
  transition: 0.2s;
  border-radius: 20px;
  border: 1px solid #264732;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #16a34a;
  border-color: #22c55e;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

.noise-gate-group.is-disabled,
#system-volume-group.is-muted {
  opacity: 0.45;
  pointer-events: none;
}

.noise-gate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.noise-gate-val {
  font-size: 10.5px;
  font-family: Consolas, monospace;
  color: #86efac;
}

.compressor-desc,
.system-audio-hint {
  color: var(--muted);
  display: block;
  font-size: 10px;
  line-height: 1.4;
}

.system-audio-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #08110c;
  border: 1px solid #1b3123;
  border-radius: 10px;
  padding: 12px;
}

.system-audio-btn.is-active {
  background: #16a34a;
  border-color: #22c55e;
  color: #041208;
}

.audio-summary-box {
  background: var(--bg-input);
  border: 1px solid #1b2e21;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.summary-item span {
  color: #779080;
  font-size: 10px;
}
.summary-item strong {
  color: #edf5ef;
  font-size: 11px;
}

/* Drawer Tools: Fondos, Recorte, Multimedia, Invitado */
.bg-type-selector,
.cam-mode-selector {
  display: flex;
  gap: 4px;
  background: #070e0a;
  border: 1px solid #182a1f;
  padding: 3px;
  border-radius: 8px;
}

.btn-bg-tab,
.btn-cam-mode {
  flex: 1;
  background: transparent;
  border: none;
  color: #849d8c;
  padding: 7px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.btn-bg-tab:hover,
.btn-cam-mode:hover {
  color: #edf5ef;
  background: rgba(255, 255, 255, 0.04);
}

.btn-bg-tab.active,
.btn-cam-mode.active {
  background: rgba(22, 163, 74, 0.28);
  color: #bbf7d0;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.virtual-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #08110c;
  border: 1px solid #1a2d21;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  text-align: center;
  color: #a5b9ab;
  transition: all 0.14s ease;
}

.preset-card:hover {
  border-color: #22c55e;
}

.preset-card.active {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.18);
  color: #dcfce7;
}

.preset-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
}

.thumb-neon { background: radial-gradient(circle at 70% 30%, #22c55e 0%, #14532d 55%, #070d09 100%); }
.thumb-cyberpunk { background: linear-gradient(135deg, #7928ca 0%, #ff0080 50%, #00dfd8 100%); }
.thumb-cozy { background: linear-gradient(145deg, #d97706 0%, #78350f 50%, #1c1917 100%); }
.thumb-broadcast { background: linear-gradient(180deg, #1e3a5f 0%, #0d1b2a 60%, #050a10 100%); }

.preset-card span {
  font-size: 10px;
  font-weight: 600;
}

.file-preview-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #08110c;
  border: 1px solid #1e3526;
  border-radius: 8px;
  padding: 8px;
}

.file-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
}

.file-meta strong {
  display: block;
  font-size: 11px;
  color: #edf5ef;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta small {
  font-size: 9.5px;
  color: var(--green);
}

.cam-mode-info-card {
  background: #08110c;
  border: 1px solid #1a2f22;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-bg-thumb {
  width: 30px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(34, 197, 94, 0.55);
  background: #050a07;
  flex-shrink: 0;
}

.camera-shape-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.scene-media-card {
  padding: 12px;
  background: #08110c;
  border: 1px solid #1a2d21;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scene-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scene-media-header h3 {
  margin: 2px 0 0;
  font-size: 12px;
  color: #edf5ef;
}

.scene-media-pick-btn {
  background: rgba(22, 163, 74, 0.22);
  border-color: rgba(34, 197, 94, 0.5);
  color: #bbf7d0;
}

.scene-media-pick-btn:hover {
  background: #16a34a;
  border-color: #22c55e;
  color: #041208;
}

.scene-media-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.scene-media-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-media-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #0c1711;
  border: 1px solid #1d3324;
  border-radius: 7px;
  flex-wrap: wrap;
}

.scene-media-badge {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(22, 163, 74, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
  font-size: 9px;
  font-weight: 700;
}

.scene-media-meta {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
}

.scene-media-meta strong {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-media-meta small {
  font-size: 9.5px;
  color: #86efac;
}

.scene-media-actions {
  display: flex;
  gap: 5px;
}

.scene-media-remove-btn {
  border-color: #4a2323;
  color: #fca5a5;
}

.scene-media-remove-btn:hover {
  background: #991b1b;
  border-color: #ef4444;
  color: #ffffff;
}

.guest-status-badge {
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #223b2b;
  background: #0c1a12;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.guest-status-badge.is-waiting {
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.guest-status-badge.is-connected {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(22, 163, 74, 0.24);
  color: #bbf7d0;
}

.guest-link-input {
  padding: 7px 9px;
  font-size: 10.5px;
  font-family: Consolas, monospace;
  color: #86efac;
}

.scene-canvas-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 13, 9, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 5;
}

.local-media-hidden-el {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Modal selector real de fuentes por slot */
.slot-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 9, 6, 0.84);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.slot-picker-backdrop.is-open {
  display: flex;
}

.slot-picker-dialog {
  width: 100%;
  max-width: 760px;
  max-height: 82vh;
  background: var(--bg-surface);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.slot-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #08110c;
}

.slot-picker-header h3 {
  margin: 0;
  font-size: 14px;
  color: #edf5ef;
}

.slot-picker-subtitle {
  font-size: 11px;
  color: #86efac;
  display: block;
  margin-top: 2px;
}

.slot-picker-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.desktop-picker-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #86efac;
  margin: 4px 0 10px;
}

.desktop-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.desktop-source-card {
  background: #08110c;
  border: 1px solid #1e3827;
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  color: #edf5ef;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.14s ease, transform 0.12s ease, background 0.14s ease;
}

.desktop-source-card:hover {
  border-color: var(--green);
  background: #102418;
  transform: translateY(-2px);
}

.desktop-source-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: #040906;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.desktop-source-name {
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.desktop-source-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-source-icon {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  flex-shrink: 0;
}

.camera-source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.camera-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  background: #08110c;
  border: 1px solid #1e3827;
  border-radius: 10px;
  padding: 11px 14px;
  color: #edf5ef;
  cursor: pointer;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
}

.camera-source-item:hover {
  border-color: var(--green);
  background: #102418;
}

.camera-source-item small {
  font-size: 10.5px;
  color: #86efac;
  font-weight: 500;
}

.web-source-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.web-source-input-row {
  display: flex;
  gap: 8px;
}

.web-source-input-row input {
  flex: 1;
  background: #070d09;
  color: #edf5ef;
  border: 1px solid #244a32;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
}

.web-source-input-row input:focus {
  outline: none;
  border-color: var(--green);
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.92); }
}

@media (max-width: 1120px) {
  :root {
    --drawer-w: 310px;
  }
  .participant-card {
    min-width: 145px;
  }
  .dock-btn {
    padding: 0 9px;
    font-size: 10.5px;
  }
}

@media (max-width: 900px) {
  .studio-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }
  .footer-participants {
    display: none;
  }
}


/* =====================================================================
   IZQUIERDA: PANEL DE ESCENAS INDEPENDIENTES (+ AGREGAR ESCENA + 4 PRECARGADAS)
   ===================================================================== */
.left-scenes-panel {
  grid-area: left;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #09120d;
  border-right: 1px solid var(--line);
  z-index: 12;
}

.left-scenes-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 10px 10px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.left-scenes-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.scenes-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.38);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
}

.btn-add-scene {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #22c55e;
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.14s ease, transform 0.12s ease;
}

.btn-add-scene:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-add-scene span {
  font-size: 14px;
  line-height: 1;
}

.scenes-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 9px 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scene-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  border-radius: 10px;
  background: #0c1711;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dcebe0;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.scene-card:hover {
  border-color: rgba(34, 197, 94, 0.48);
  background: #102016;
}

.scene-card.is-active {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.16);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.38), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.scene-mini-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: radial-gradient(circle at 60% 35%, #1d4d30 0%, #0b1c12 65%, #060d09 100%);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.scene-mini-preview.tpl-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.scene-mini-preview.tpl-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 82% 18%;
  gap: 0;
  padding: 0;
  align-items: stretch;
}

.scene-mini-preview.tpl-2 .scene-mini-slot {
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  align-self: stretch;
}

.scene-mini-preview.tpl-2 .scene-mini-tv-double {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border-top: 1.5px solid #22c55e;
  overflow: hidden;
}

.scene-mini-preview.tpl-2 .scene-mini-tv-double .tv-band-main {
  flex: 1.7;
  background: linear-gradient(90deg, #04140b 0%, #092c18 100%);
}

.scene-mini-preview.tpl-2 .scene-mini-tv-double .tv-band-ticker {
  flex: 1;
  background: linear-gradient(90deg, #15803d 0%, #22c55e 100%);
}

.scene-mini-preview.tpl-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.scene-mini-preview.tpl-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.scene-mini-slot {
  border-radius: 4px;
  background: rgba(7, 15, 10, 0.72);
  border: 1px dashed rgba(134, 239, 172, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #86efac;
  min-height: 14px;
}

.scene-mini-slot.is-filled {
  border-style: solid;
  border-color: rgba(74, 222, 128, 0.65);
  background: rgba(22, 163, 74, 0.25);
}

.scene-mini-preview.tpl-3 .scene-mini-slot:nth-child(3) {
  grid-column: 1 / -1;
  width: 52%;
  justify-self: center;
}

.scene-mini-live-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.92);
  color: #031107;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scene-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.scene-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.scene-card-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #edf5ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-card-sub {
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.scene-mini-badge {
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #a7f3c0;
}

.scene-card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(7, 13, 9, 0.82);
  color: #cbd5cf;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity 0.14s ease, transform 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.scene-card:hover .scene-card-delete,
.scene-card:focus-within .scene-card-delete {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.scene-card-delete:hover:not(:disabled) {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

.scene-card-delete:disabled {
  display: none;
}

/* =====================================================================
   CENTRO: BARRA DE CONTROLES DEBAJO DEL LIENZO (MIC, CÁMARA, ESPEJO, GRILLA)
   ===================================================================== */
.stage-controls-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  max-width: 100%;
}

.stage-controls-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.stage-controls-sep {
  width: 1px;
  height: 24px;
  background: var(--line);
  flex-shrink: 0;
}

/* =====================================================================
   CONTEO REGRESIVO PRIVADO EN MI PANTALLA (10 al 1) PARA PASE A ESCENA 2
   ===================================================================== */
.live-countdown-hud {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(4, 10, 7, 0.42) 0%, rgba(4, 10, 7, 0.14) 70%);
}

.live-countdown-hud[hidden] {
  display: none !important;
}

.live-countdown-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 240px;
  padding: 16px 26px 14px;
  border-radius: 16px;
  background: rgba(7, 15, 10, 0.88);
  border: 2px solid rgba(34, 197, 94, 0.85);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.7), 0 0 28px rgba(34, 197, 94, 0.28);
  backdrop-filter: blur(8px);
  text-align: center;
}

.live-countdown-hud.is-urgent .live-countdown-card {
  border-color: rgba(239, 68, 68, 0.92);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.75), 0 0 34px rgba(239, 68, 68, 0.42);
}

.live-countdown-hud.is-warning .live-countdown-card {
  border-color: rgba(245, 158, 11, 0.9);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.72), 0 0 30px rgba(245, 158, 11, 0.32);
}

.live-countdown-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fca5a5;
  background: rgba(185, 28, 28, 0.32);
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  padding: 2px 9px;
}

.live-countdown-label {
  font-size: 12px;
  color: #d7e9dc;
}

.live-countdown-label strong {
  color: #86efac;
}

.live-countdown-number {
  font-family: Consolas, "Segoe UI", monospace;
  font-size: 68px;
  font-weight: 900;
  line-height: 1;
  color: #4ade80;
  text-shadow: 0 4px 20px rgba(34, 197, 94, 0.55);
  margin: 2px 0;
  transition: transform 0.14s ease;
}

.live-countdown-hud.is-warning .live-countdown-number {
  color: #fbbf24;
  text-shadow: 0 4px 20px rgba(245, 158, 11, 0.55);
}

.live-countdown-hud.is-urgent .live-countdown-number {
  color: #f87171;
  text-shadow: 0 4px 24px rgba(239, 68, 68, 0.65);
}

.live-countdown-number.is-tick {
  transform: scale(1.16);
}

.live-countdown-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 2px;
}

.live-countdown-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #86efac);
  transition: width 0.12s linear;
}

.live-countdown-hud.is-warning .live-countdown-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #fde047);
}

.live-countdown-hud.is-urgent .live-countdown-bar-fill {
  background: linear-gradient(90deg, #dc2626, #f87171);
}

.live-countdown-cancel {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e2f0e6;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.live-countdown-cancel:hover {
  background: rgba(220, 38, 38, 0.45);
  border-color: #f87171;
  color: #ffffff;
}

/* =====================================================================
   DERECHA: CABECERA DEL DRAWER Y PANELES AMPLIOS (GRÁFICOS, MÚSICA, TEXTOS, CHAT)
   ===================================================================== */
.drawer-header-titles {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.drawer-scene-scope {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-scope-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 11px;
  color: #b7d7c0;
}

.scene-scope-banner strong {
  color: #86efac;
  font-size: 11.5px;
}

/* GRÁFICOS: Subtabs + Secciones Logo / Overlay / Fondo (compacto) */
.graphics-subtabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #070e0a;
  border: 1px solid #182a1f;
  padding: 3px;
  border-radius: 8px;
}

.btn-graphics-subtab,
.btn-music-tab,
.btn-chat-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #849d8c;
  padding: 6px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.btn-graphics-subtab:hover,
.btn-music-tab:hover,
.btn-chat-tab:hover {
  color: #edf5ef;
  background: rgba(255, 255, 255, 0.05);
}

.btn-graphics-subtab.active,
.btn-music-tab.active,
.btn-chat-tab.active {
  background: rgba(22, 163, 74, 0.28);
  color: #bbf7d0;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.graphics-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 9px;
  background: #08110c;
  border: 1px solid #1a2d21;
}

.graphics-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.graphics-section-head h3 {
  margin: 1px 0 0;
  font-size: 12px;
  color: #edf5ef;
}

.graphics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.graphic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 4px;
  border-radius: 7px;
  background: #0c1711;
  border: 1px solid #1d3324;
  color: #b7cfbe;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.14s ease, background-color 0.14s ease, transform 0.12s ease;
}

.graphic-card:hover {
  border-color: rgba(34, 197, 94, 0.65);
  background: #112418;
  transform: translateY(-1px);
}

.graphic-card.is-active {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.2);
  color: #dcfce7;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.graphic-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 46px;
  border-radius: 4px;
  background-color: #060e09;
  background-image: linear-gradient(45deg, #0d1c13 25%, transparent 25%),
    linear-gradient(-45deg, #0d1c13 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #0d1c13 75%),
    linear-gradient(-45deg, transparent 75%, #0d1c13 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.graphic-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.graphic-thumb.is-cover img {
  object-fit: cover;
}

.graphic-none-icon {
  font-size: 14px;
  color: #6b8575;
}

.graphic-card span {
  display: block;
  width: 100%;
  padding: 0 2px;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botón discreto "×" para borrar fondos personalizados */
.graphic-card-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(7, 13, 9, 0.78);
  color: rgba(237, 245, 239, 0.85);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.graphic-card:hover .graphic-card-delete-btn {
  opacity: 0.95;
}

.graphic-card-delete-btn:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.92);
  border-color: rgba(248, 113, 113, 0.9);
  color: #ffffff;
}

/* Caja interactiva del Logo sobre el lienzo (arrastre libre + redimensionado proporcional en esquina inferior derecha) */
.scene-logo-transform-box {
  position: absolute;
  z-index: 21;
  box-sizing: border-box;
  border: 1.5px dashed transparent;
  border-radius: 6px;
  background: transparent;
  cursor: move;
  user-select: none;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.scene-logo-transform-box[hidden],
.scene-logo-transform-box:not(.is-active),
.scene-canvas-wrapper.is-sponsor-takeover .scene-logo-transform-box {
  display: none !important;
  pointer-events: none !important;
}

.scene-logo-transform-box:hover,
.scene-logo-transform-box.is-dragging,
.scene-logo-transform-box.is-resizing {
  border-color: rgba(74, 222, 128, 0.88);
  background: rgba(34, 197, 94, 0.06);
}

.scene-logo-transform-box .logo-resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid #07130c;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.12s ease;
}

.scene-logo-transform-box:hover .logo-resize-handle,
.scene-logo-transform-box.is-dragging .logo-resize-handle,
.scene-logo-transform-box.is-resizing .logo-resize-handle {
  opacity: 1;
}

.scene-logo-transform-box .logo-resize-handle:hover {
  transform: scale(1.18);
}

/* Crucecita rápida en esquina del Logo sobre el lienzo (oculta en reposo, visible solo en hover) */
.scene-logo-transform-box .scene-logo-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 4;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #525761;
  background: rgba(18, 21, 27, 0.88);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  transition: opacity 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.scene-logo-transform-box:hover .scene-logo-remove-btn {
  opacity: 0.95;
  pointer-events: auto;
}

.scene-logo-transform-box.is-dragging .scene-logo-remove-btn,
.scene-logo-transform-box.is-resizing .scene-logo-remove-btn {
  opacity: 0;
  pointer-events: none;
}

.scene-logo-transform-box .scene-logo-remove-btn:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.92);
  border-color: rgba(248, 113, 113, 0.9);
  color: #ffffff;
}

/* Crucecita rápida en esquina del Overlay sobre el lienzo (oculta en reposo, visible solo en hover) */
.scene-overlay-remove-zone {
  position: absolute;
  top: 6px;
  right: 6px;
  left: auto;
  z-index: 22;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  user-select: none;
}

.scene-overlay-remove-zone.is-corner-left {
  right: auto;
  left: 6px;
  justify-content: flex-start;
}

.scene-overlay-remove-zone[hidden],
.scene-overlay-remove-zone:not(.is-active),
.scene-canvas-wrapper.is-sponsor-takeover .scene-overlay-remove-zone {
  display: none !important;
  pointer-events: none !important;
}

.scene-overlay-remove-btn {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #525761;
  background: rgba(18, 21, 27, 0.88);
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  transition: opacity 0.14s ease, background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.scene-overlay-remove-zone:hover .scene-overlay-remove-btn,
.scene-overlay-remove-zone.is-overlay-hovered .scene-overlay-remove-btn {
  opacity: 0.95;
  pointer-events: auto;
}

.scene-overlay-remove-btn:hover {
  opacity: 1;
  background: rgba(220, 38, 38, 0.92);
  border-color: rgba(248, 113, 113, 0.9);
  color: #ffffff;
}

.cam-beauty-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px 11px;
  border-radius: 9px;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.06) 0%, rgba(28, 32, 39, 0.84) 36%, rgba(16, 19, 25, 0.94) 100%);
  border: 1.5px solid #3c4048;
  border-top-color: #525761;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.35);
}

.cam-beauty-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cam-beauty-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #cbd5e1;
}

.cam-beauty-reset-btn {
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid #525761;
  background: rgba(38, 42, 50, 0.78);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.cam-beauty-reset-btn:hover {
  background: rgba(66, 72, 84, 0.9);
  border-color: #6b7280;
  color: #f8fafc;
}

.cam-beauty-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cam-beauty-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
}

.cam-beauty-val {
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
  min-width: 32px;
  text-align: right;
}

.cam-beauty-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #525761 0%, #3c4048 100%);
  border: 1px solid #494e58;
  outline: none;
  cursor: pointer;
}

.cam-beauty-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 1.5px solid #3c4048;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.cam-beauty-slider::-webkit-slider-thumb:hover {
  background: #ffffff;
  transform: scale(1.1);
}

.cam-beauty-hint {
  font-size: 9.5px;
  color: #94a3b8;
  line-height: 1.3;
}

.cam-beauty-control-teeth {
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid rgba(82, 87, 97, 0.55);
}

.cam-beauty-substatus {
  font-size: 9px;
  color: #9aa3b2;
  line-height: 1.25;
}

/* MÚSICA: Reproductor Maestro + Personalizada MP3/WAV + Incorporada */
.music-player-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(155deg, #0d1f14 0%, #08110c 100%);
  border: 1px solid rgba(34, 197, 94, 0.32);
}

.music-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.music-now-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.music-now-info strong {
  font-size: 12.5px;
  color: #edf5ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-now-info small {
  font-size: 10px;
  color: #86efac;
}

.music-player-btns {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.music-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.music-track-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.music-empty-state {
  padding: 16px 12px;
  border-radius: 9px;
  background: #08110c;
  border: 1px dashed rgba(34, 197, 94, 0.25);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  line-height: 1.45;
}

.music-track-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #08110c;
  border: 1px solid #1b3123;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.music-track-row:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: #0e1e15;
}

.music-track-row.is-playing {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.16);
}

.music-track-play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(22, 163, 74, 0.18);
  color: #bbf7d0;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.music-track-row.is-playing .music-track-play {
  background: #16a34a;
  color: #ffffff;
}

.music-track-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.music-track-info strong {
  font-size: 11.5px;
  color: #edf5ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-track-info small {
  font-size: 9.5px;
  color: var(--muted);
}

/* TEXTOS Y BANNERS */
.banner-editor-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px;
  border-radius: 10px;
  background: #08110c;
  border: 1px solid #1a2d21;
}

.banner-editor-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.saved-banners-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.banner-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #08110c;
  border: 1px solid #1b3123;
}

.banner-item-card.is-live {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.16);
}

.banner-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.banner-item-copy strong {
  font-size: 11.5px;
  color: #edf5ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-item-copy small {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-item-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

/* CHAT EN VIVO */
.chat-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.chat-pinned-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(22, 163, 74, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.55);
}

.chat-pinned-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.chat-pinned-info strong {
  font-size: 11px;
  color: #edf5ef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 220px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 8px;
  border-radius: 10px;
  background: #070e0a;
  border: 1px solid #182b1f;
}

.chat-msg-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #0c1711;
  border: 1px solid #1a2f22;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.chat-msg-card:hover {
  border-color: rgba(74, 222, 128, 0.6);
  background: #112319;
}

.chat-msg-card.is-pinned {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.22);
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35);
}

.chat-msg-live-pill {
  padding: 1px 6px;
  border-radius: 999px;
  background: #16a34a;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chat-feed-hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.chat-feed-hint {
  font-size: 10px;
  color: #86efac;
  opacity: 0.85;
}

.multichat-style-controls {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.multichat-style-row-2 {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 6px;
}

.multichat-style-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.multichat-style-field label {
  font-size: 10px;
  font-weight: 700;
  color: #9ec0aa;
}

.multichat-style-field select.form-control {
  font-size: 11px;
  padding: 5px 7px;
}

.chat-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-msg-author-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-platform-badge {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.chat-platform-badge.plat-youtube { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.chat-platform-badge.plat-twitch { background: rgba(168, 85, 247, 0.25); color: #d8b4fe; }
.chat-platform-badge.plat-kick { background: rgba(34, 197, 94, 0.25); color: #86efac; }
.chat-platform-badge.plat-studio { background: rgba(56, 189, 248, 0.22); color: #bae6fd; }

.chat-msg-author {
  font-size: 11px;
  font-weight: 700;
  color: #edf5ef;
}

.chat-msg-time {
  font-size: 9.5px;
  color: #6b8575;
}

.chat-msg-text {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #d7e7dc;
  word-break: break-word;
}

.chat-msg-foot {
  display: flex;
  justify-content: flex-end;
}

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border-radius: 10px;
  background: #08110c;
  border: 1px solid #1a2d21;
}

.chat-composer-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.chat-platform-select {
  width: 106px;
  flex-shrink: 0;
}

.chat-web-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-webview-container {
  height: 46vh;
  min-height: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1b3123;
  background: #060d09;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-webview-container webview {
  width: 100%;
  height: 100%;
  border: 0;
}

/* MODAL: + AGREGAR ESCENA */
.add-scene-dialog {
  max-width: 560px;
}

.add-scene-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scene-template-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.template-pick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  background: #08110c;
  border: 1px solid #1e3526;
  color: #c2dcc9;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.template-pick-card:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: #0f2116;
}

.template-pick-card.active {
  border-color: var(--green);
  background: rgba(22, 163, 74, 0.2);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.template-pick-card strong {
  font-size: 12px;
}

.template-pick-card small {
  font-size: 10px;
  color: var(--muted);
}

.tpl-mini-grid {
  width: 100%;
  max-width: 132px;
  aspect-ratio: 16 / 9;
  padding: 6px;
  border-radius: 6px;
  background: #050b07;
  border: 1px solid rgba(34, 197, 94, 0.25);
  display: grid;
  gap: 4px;
}

.tpl-mini-grid span {
  border-radius: 3px;
  background: rgba(34, 197, 94, 0.3);
  border: 1px solid rgba(74, 222, 128, 0.6);
}

.tpl-mini-grid.tpl-1 {
  grid-template-columns: 1fr;
}

.tpl-mini-grid.tpl-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 82% 18%;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.tpl-mini-grid.tpl-2 > span {
  border-radius: 0;
}

.tpl-mini-grid.tpl-2 .tpl-2-zocalo {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #082415 0% 62%, #16a34a 62% 100%);
  border-top: 1.5px solid #4ade80;
}

.tpl-mini-grid.tpl-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.tpl-mini-grid.tpl-3 .tpl-3-bottom {
  grid-column: 1 / -1;
  width: 52%;
  justify-self: center;
}

.tpl-mini-grid.tpl-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.add-scene-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

@media (max-width: 1200px) {
  :root {
    --scenes-w: 192px;
    --drawer-w: 380px;
  }
  .graphics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* =====================================================================
   SELECTOR DE ROL INVITADO / CO-HOST Y CHAT PRIVADO INTERNO EN BARRA INFERIOR
   ===================================================================== */
.dock-role-select {
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: #0d1d14;
  color: #dcfce7;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.dock-role-select:hover,
.dock-role-select:focus {
  border-color: var(--green);
  background: #142c1e;
}

.dock-role-select option {
  background: #08110c;
  color: #edf5ef;
}

.guest-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.guest-role-pill.is-cohost {
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(192, 132, 252, 0.65);
  color: #e9d5ff;
}

.dock-btn-private-chat {
  position: relative;
  border-color: rgba(192, 132, 252, 0.42);
  background: rgba(88, 28, 135, 0.24);
  color: #e9d5ff;
}

.dock-btn-private-chat:hover:not(:disabled) {
  border-color: #c084fc;
  background: rgba(126, 34, 206, 0.38);
  color: #ffffff;
}

.dock-btn-private-chat.is-active {
  border-color: #c084fc;
  background: rgba(126, 34, 206, 0.46);
  color: #ffffff;
}

.private-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
}

.participant-card.is-host {
  cursor: pointer;
}

.participant-card.is-host:hover {
  border-color: var(--green);
  background: #0d1d14;
}

.connection-dot.is-off {
  background: #64746b;
  box-shadow: none;
}

.private-chat-popover {
  position: fixed;
  bottom: calc(var(--footer-h) + 10px);
  left: max(16px, calc(var(--scenes-w) + 14px));
  z-index: 65;
  width: min(390px, calc(100vw - 32px));
  border-radius: 13px;
  background: #0d1419;
  border: 1px solid rgba(192, 132, 252, 0.55);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72), 0 0 22px rgba(168, 85, 247, 0.16);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.private-chat-popover.is-open {
  display: flex;
}

.private-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 13px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.45) 0%, rgba(15, 23, 42, 0.92) 100%);
  border-bottom: 1px solid rgba(192, 132, 252, 0.25);
}

.private-chat-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.private-chat-title-wrap strong {
  font-size: 12px;
  color: #f3e8ff;
}

.private-chat-title-wrap small {
  font-size: 9.5px;
  color: #d8b4fe;
}

.private-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: 230px;
  overflow-y: auto;
  padding: 10px 11px;
  background: #080d11;
}

.private-chat-empty {
  margin: auto;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.45;
  color: #94a3b8;
  padding: 12px;
}

.private-msg-bubble {
  max-width: 86%;
  padding: 7px 10px;
  border-radius: 9px;
  background: #141f2a;
  border: 1px solid rgba(192, 132, 252, 0.22);
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.private-msg-bubble.is-mine {
  align-self: flex-end;
  background: rgba(126, 34, 206, 0.28);
  border-color: rgba(192, 132, 252, 0.5);
}

.private-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  color: #c4b5fd;
  font-weight: 700;
}

.private-msg-text {
  font-size: 11.5px;
  line-height: 1.4;
  color: #f8fafc;
  word-break: break-word;
}

.private-chat-form {
  display: flex;
  gap: 6px;
  padding: 9px 10px;
  background: #0b1116;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}


/* =====================================================================
   CÁPSULA FLOTANTE CENTRADA DE CONTROLES DE VIDEO (TRANSPARENTE + BLUR)
   ===================================================================== */
.scene-video-transport-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: calc(100% - 28px);
  max-width: 340px;
  box-sizing: border-box;
  z-index: 2;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 7px;
  border-radius: 12px;
  background: rgba(15, 18, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.stage-slot-cell.has-video-transport > .scene-video-transport-bar,
.scene-canvas-wrapper.has-active-video > .scene-video-transport-bar.is-canvas-fallback {
  display: flex;
}

/* Aparece al mover el mouse sobre el video y se oculta en 1s al sacarlo (.is-capsule-visible) */
.scene-video-transport-bar.is-capsule-visible,
.scene-canvas-wrapper.is-video-scrubbing .scene-video-transport-bar {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: none;
}

.scene-video-transport-bar.is-capsule-visible .video-capsule-interactive,
.scene-video-transport-bar.is-capsule-visible .video-transport-seek,
.scene-video-transport-bar.is-capsule-visible .video-transport-play-btn,
.scene-canvas-wrapper.is-video-scrubbing .scene-video-transport-bar .video-capsule-interactive,
.scene-canvas-wrapper.is-video-scrubbing .scene-video-transport-bar .video-transport-seek,
.scene-canvas-wrapper.is-video-scrubbing .scene-video-transport-bar .video-transport-play-btn {
  pointer-events: auto;
}

.scene-canvas-wrapper.is-obs-crop-key .scene-video-transport-bar {
  opacity: 0 !important;
  pointer-events: none !important;
}

.stage-slot-cell.has-video-transport .slot-hover-overlay {
  padding-bottom: 72px;
}

.video-capsule-timeline-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.video-capsule-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.video-transport-play-btn,
.video-capsule-icon-btn {
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.video-transport-play-btn:hover,
.video-capsule-icon-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: #ffffff;
  color: #ffffff;
  transform: scale(1.06);
}

.video-capsule-icon-btn.is-active {
  background: rgba(255, 255, 255, 0.28);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
}

.video-capsule-icon-btn.is-muted {
  opacity: 0.65;
}

.video-transport-seek {
  --seek-pct: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  flex: 1;
  min-width: 60px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #ffffff var(--seek-pct),
    rgba(255, 255, 255, 0.28) var(--seek-pct),
    rgba(255, 255, 255, 0.28) 100%
  );
  outline: none;
  cursor: pointer;
}

.video-transport-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(15, 18, 24, 0.8);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 0.12s ease;
}

.video-transport-seek::-webkit-slider-thumb:hover,
.video-transport-seek:active::-webkit-slider-thumb {
  transform: scale(1.22);
}

.video-transport-time {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.video-capsule-vol-cluster {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 72px;
  max-width: 110px;
}

.video-capsule-vol-slider {
  --vol-pct: 100%;
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 44px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    #ffffff var(--vol-pct),
    rgba(255, 255, 255, 0.28) var(--vol-pct),
    rgba(255, 255, 255, 0.28) 100%
  );
  outline: none;
  cursor: pointer;
}

.video-capsule-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(15, 18, 24, 0.85);
  cursor: pointer;
}


/* =====================================================================
   DRAG & DROP PARA REORDENAR TARJETAS DE ESCENAS EN LA BARRA IZQUIERDA
   ===================================================================== */
.scene-card[draggable="true"] {
  cursor: grab;
  user-select: none;
}

.scene-card[draggable="true"]:active {
  cursor: grabbing;
}

.scene-card.is-dragging {
  opacity: 0.42;
  border-style: dashed;
  border-color: rgba(74, 222, 128, 0.7);
  transform: scale(0.98);
}

.scene-card.drop-before::before,
.scene-card.drop-after::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 3px;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.95);
  z-index: 8;
  pointer-events: none;
}

.scene-card.drop-before::before {
  top: -6px;
}

.scene-card.drop-after::after {
  bottom: -6px;
}

.scene-drag-grip {
  font-size: 11px;
  line-height: 1;
  color: #5b7866;
  letter-spacing: -1px;
  padding: 2px 3px;
  flex-shrink: 0;
  transition: color 0.14s ease;
}

.scene-card:hover .scene-drag-grip {
  color: #86efac;
}

/* Botón discreto de zócalo (lower third) al pasar el mouse sobre una cámara en el lienzo */
.slot-mini-btn.is-lower-third-btn {
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  gap: 3px;
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(8, 16, 12, 0.82);
  color: #dcfce7;
}

.slot-mini-btn.is-lower-third-btn:hover {
  background: rgba(22, 163, 74, 0.32);
  border-color: rgba(74, 222, 128, 0.72);
  color: #ffffff;
}

.slot-mini-btn.is-lower-third-btn.is-on {
  background: rgba(22, 163, 74, 0.38);
  border-color: rgba(74, 222, 128, 0.9);
  color: #bbf7d0;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.35);
}

/* Panel flotante pequeño de configuración de zócalo por cámara (fuera de #scene-canvas) */
.camera-lt-popover {
  position: fixed;
  top: 90px;
  left: 50%;
  width: 318px;
  max-width: calc(100vw - 24px);
  display: none;
  flex-direction: column;
  background: rgba(10, 19, 14, 0.97);
  border: 1px solid rgba(74, 222, 128, 0.42);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(12px);
  z-index: 80;
  overflow: hidden;
  color: #eef6ef;
}

.camera-lt-popover.is-open {
  display: flex;
}

.camera-lt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(74, 222, 128, 0.16);
  background: rgba(16, 30, 22, 0.9);
}

.camera-lt-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.camera-lt-title-wrap strong {
  font-size: 12.5px;
  color: #f0fdf4;
  line-height: 1.2;
}

.camera-lt-title-wrap small {
  font-size: 11px;
  color: #86efac;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.camera-lt-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 11px 12px 12px;
}

.camera-lt-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.18);
  cursor: pointer;
  user-select: none;
}

.camera-lt-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: #e2f5e6;
}

.camera-lt-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
}

.camera-lt-status-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.camera-lt-status-pill.is-live {
  background: rgba(34, 197, 94, 0.24);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.55);
}

.camera-lt-checkbox {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.camera-lt-switch-track {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #27372e;
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: background 0.16s ease, border-color 0.16s ease;
  flex-shrink: 0;
}

.camera-lt-switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: transform 0.16s ease, background 0.16s ease;
}

.camera-lt-checkbox:checked + .camera-lt-switch-track {
  background: #16a34a;
  border-color: #4ade80;
}

.camera-lt-checkbox:checked + .camera-lt-switch-track::after {
  transform: translateX(15px);
  background: #ffffff;
}

.camera-lt-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(74, 222, 128, 0.14);
}

.camera-lt-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #86efac;
}

.camera-lt-input {
  padding: 6px 9px !important;
  font-size: 12.5px !important;
  min-height: 30px;
}

.camera-lt-style-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.camera-lt-color-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #b5cbb9;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  padding: 3px 6px 3px 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.camera-lt-color-field input[type="color"] {
  width: 24px;
  height: 22px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.camera-lt-color-field.is-compact {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

.camera-lt-font-field {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: #b5cbb9;
}

.camera-lt-select {
  flex: 1;
  min-width: 0;
  padding: 4px 7px !important;
  font-size: 11.5px !important;
  height: 28px;
}

.camera-lt-bg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.camera-lt-bg-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #d5e8d9;
}

/* Botón Ajustes del estudio (Cámara + Audio) con ícono de engranaje SVG en la barra inferior */
.dock-btn.dock-btn-compact.dock-btn-studio-settings {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #111f16;
  color: #dcebe0;
}

.dock-btn.dock-btn-compact.dock-btn-studio-settings:hover:not(:disabled) {
  background: #183021;
  border-color: rgba(34, 197, 94, 0.55);
  color: #ffffff;
}

.dock-btn.dock-btn-compact.dock-btn-studio-settings.is-active {
  background: rgba(22, 163, 74, 0.24);
  border-color: var(--green);
  color: #bbf7d0;
}

.dock-gear-svg {
  display: block;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.dock-btn-studio-settings:hover .dock-gear-svg,
.dock-btn-studio-settings.is-active .dock-gear-svg {
  transform: rotate(35deg);
}

/* Pestañas y sección Configuración de Cámara dentro del panel Ajustes */
.studio-settings-subtabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(8, 16, 12, 0.85);
  border: 1px solid rgba(74, 222, 128, 0.16);
}

.btn-studio-settings-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #9ec4aa;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-studio-settings-tab:hover {
  color: #ecfdf5;
  background: rgba(74, 222, 128, 0.1);
}

.btn-studio-settings-tab.active {
  background: rgba(22, 163, 74, 0.28);
  border-color: rgba(74, 222, 128, 0.55);
  color: #f0fdf4;
}

.studio-settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(11, 22, 16, 0.72);
  border: 1px solid rgba(74, 222, 128, 0.15);
  margin-bottom: 12px;
}

.studio-settings-section[hidden] {
  display: none !important;
}

.studio-camera-settings-card {
  border-color: rgba(74, 222, 128, 0.28);
  background: linear-gradient(180deg, rgba(16, 33, 24, 0.86), rgba(10, 20, 14, 0.82));
}

.studio-settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.studio-settings-section-head h3 {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #f0fdf4;
}

.studio-cam-status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
}

.studio-cam-status-pill.is-live {
  background: rgba(22, 163, 74, 0.22);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.5);
}

/* Selector desplegable visual de Tipografía (Font) con vista previa real en cada opción */
.studio-font-picker {
  position: relative;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.studio-font-picker-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.studio-font-picker-trigger {
  width: 100%;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0a140e;
  color: #edf7ef;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.camera-lt-font-field .studio-font-picker-trigger {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 12.5px;
}

.studio-font-picker-trigger:hover,
.studio-font-picker.is-open .studio-font-picker-trigger {
  border-color: rgba(74, 222, 128, 0.65);
  background: #0f1f16;
}

.studio-font-picker-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.studio-font-picker-caret {
  font-size: 10px;
  color: #86efac;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.studio-font-picker.is-open .studio-font-picker-caret {
  transform: rotate(180deg);
}

.studio-font-picker-menu {
  position: fixed;
  z-index: 140;
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: 268px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 10px;
  background: rgba(8, 16, 12, 0.98);
  border: 1px solid rgba(74, 222, 128, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
}

.studio-font-picker-menu.is-open {
  display: flex;
}

.studio-font-option {
  width: 100%;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #e6f4ea;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.studio-font-option:hover {
  background: rgba(34, 197, 94, 0.18);
  color: #ffffff;
}

.studio-font-option.is-selected {
  background: rgba(22, 163, 74, 0.28);
  border-color: rgba(74, 222, 128, 0.65);
  color: #bbf7d0;
}

.studio-font-option-check {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  color: #4ade80;
  flex-shrink: 0;
}

/* =========================================================================
   ESCENA CON INVITADOS: MINI PREVIEW + BARRA DE GESTIÓN DE COLUMNA DE INVITADOS
   ========================================================================= */
.scene-mini-preview.tpl-guests {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  padding: 2px;
}

.scene-mini-guests-stage {
  height: 87%;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 0 2px;
}

.scene-mini-preview.tpl-guests .scene-mini-guest-stack {
  width: 24%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 2px;
  border: 1px dashed rgba(74, 222, 128, 0.24);
  border-radius: 3px;
  padding: 1px;
}

.scene-mini-preview.tpl-guests .scene-mini-guest-stack .scene-mini-slot {
  height: 31%;
  width: 100%;
  flex-shrink: 0;
  font-size: 7px;
}

.scene-mini-guests-main {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  padding: 0 3px;
}

.scene-mini-guests-top {
  height: 36%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
}

.scene-mini-guests-top .scene-mini-slot {
  width: 44%;
  height: 100%;
}

.scene-mini-guests-main .scene-mini-slot.is-guest-media {
  height: 58%;
  width: 94%;
  margin: 0 auto;
}

.scene-mini-tv-triple {
  height: 11%;
  min-height: 7px;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 2px;
  overflow: hidden;
}

.scene-mini-tv-triple .tv-band-blue {
  flex: 1;
  background: #2563eb;
}

.scene-mini-tv-triple .tv-band-white {
  flex: 1;
  background: #f8fafc;
}

.scene-mini-tv-triple .tv-band-dark {
  flex: 1;
  background: #0b1120;
}

.tpl-mini-grid.tpl-guests {
  display: grid;
  grid-template-columns: 24% 8% 31% 31% 6%;
  grid-template-rows: 34% 53% 11%;
  gap: 2px;
}

.tpl-mini-grid.tpl-guests .tpl-g-col {
  grid-column: 1;
  grid-row: 1 / span 2;
  border-style: dashed;
  opacity: 0.8;
}

.tpl-mini-grid.tpl-guests .tpl-g-cam1 {
  grid-column: 3;
  grid-row: 1;
}

.tpl-mini-grid.tpl-guests .tpl-g-cam2 {
  grid-column: 4;
  grid-row: 1;
}

.tpl-mini-grid.tpl-guests .tpl-g-media {
  grid-column: 3 / span 2;
  grid-row: 2;
}

.stage-slot-cell.is-guest-col-slot video,
.stage-slot-cell.is-guest-col-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tarjeta editora en vivo del Zócalo de TV Triple (Escena con invitados) */
.tv-zocalo-editor-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  margin-top: 10px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(14, 28, 48, 0.72), rgba(9, 17, 13, 0.88));
  border: 1px solid rgba(59, 130, 246, 0.42);
}

.tv-zocalo-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tv-zocalo-editor-head h4 {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #eff6ff;
}

.tv-zocalo-mini-preview {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 10px;
  line-height: 1.3;
}

.tv-zocalo-mini-preview .tv-prev-blue {
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  color: #ffffff;
  font-weight: 700;
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-zocalo-mini-preview .tv-prev-white {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-zocalo-mini-preview .tv-prev-dark {
  background: #090e1a;
  color: #93c5fd;
  font-weight: 600;
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-zocalo-field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #d5e8d9;
  margin-bottom: 4px;
}

.tv-zocalo-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.tv-zocalo-swatch.is-blue {
  background: #2563eb;
}

.tv-zocalo-swatch.is-white {
  background: #f8fafc;
}

.tv-zocalo-swatch.is-dark {
  background: #0b1120;
}

.guests-stage-tv-btn {
  background: rgba(37, 99, 235, 0.24) !important;
  border-color: rgba(96, 165, 250, 0.6) !important;
  color: #dbeafe !important;
  font-weight: 700 !important;
}

.guests-stage-tv-btn:hover {
  background: rgba(37, 99, 235, 0.42) !important;
  color: #ffffff !important;
}

.guests-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 12px;
  margin-top: 6px;
  border-radius: 10px;
  background: rgba(10, 20, 14, 0.9);
  border: 1px solid rgba(74, 222, 128, 0.24);
}

.guests-stage-bar[hidden] {
  display: none !important;
}

.guests-stage-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.guests-stage-badge {
  font-size: 11px;
  color: #b7d7c0;
  font-weight: 600;
}

.guests-stage-badge strong {
  color: #86efac;
}

.guests-stage-add-btn {
  background: rgba(22, 163, 74, 0.24) !important;
  border-color: rgba(74, 222, 128, 0.6) !important;
  color: #dcfce7 !important;
  font-weight: 700 !important;
}

.guests-stage-add-btn:hover:not(:disabled) {
  background: rgba(22, 163, 74, 0.4) !important;
  color: #ffffff !important;
}

.guests-stage-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.guests-stage-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.guests-stage-empty-hint {
  font-size: 11px;
  color: #7d9d86;
  font-style: italic;
}

.guest-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 3px 9px;
  border-radius: 999px;
  background: rgba(16, 33, 23, 0.95);
  border: 1px solid rgba(74, 222, 128, 0.34);
  font-size: 11px;
  color: #e6f6ea;
}

.guest-stage-chip-name {
  font-weight: 700;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guest-stage-chip-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d9efe0;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.guest-stage-chip-btn:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(74, 222, 128, 0.7);
  color: #ffffff;
}

.guest-stage-chip-btn.is-danger:hover {
  background: rgba(220, 38, 38, 0.32);
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.stage-slot-cell.is-guest-col-slot {
  border-color: rgba(74, 222, 128, 0.32);
}

/* Ocultar por completo el menú flotante de selección de fuentes en cámaras principales / invitados ocupados */
.stage-slot-cell.is-source-menu-hidden .slot-hover-bottom,
.stage-slot-cell.is-source-menu-hidden .slot-empty-picker,
.stage-slot-cell.is-camera-clean-hover .slot-hover-bottom,
.stage-slot-cell.is-camera-clean-hover .slot-empty-picker {
  display: none !important;
}

/* Hover limpio en slots ocupados por cámara o invitado: únicamente botón discreto para nombre/zócalo */
.stage-slot-cell.is-camera-clean-hover .slot-hover-overlay {
  background: transparent !important;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 8px;
}

.stage-slot-cell.is-camera-clean-hover .slot-clean-lt-bar {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
}

.stage-slot-cell.is-camera-clean-hover .slot-mini-btn.is-lower-third-btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(7, 15, 11, 0.88);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: #ecfdf5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.48);
}

.stage-slot-cell.is-camera-clean-hover .slot-mini-btn.is-lower-third-btn:hover {
  background: rgba(22, 163, 74, 0.42);
  border-color: #4ade80;
  color: #ffffff;
}

/* Botón "X" roja arriba a la derecha en el contenedor de cámara sobre el lienzo */
.slot-camera-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #dc2626 !important;
  border: 1px solid rgba(254, 202, 202, 0.45) !important;
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  z-index: 10;
  transition: background 0.15s ease, transform 0.12s ease;
}

.slot-camera-close-btn:hover {
  background: #b91c1c !important;
  border-color: #fca5a5 !important;
  transform: scale(1.08);
}

#scene-camera-box .scene-cam-close-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dc2626;
  border: 1px solid rgba(254, 202, 202, 0.45);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease;
}

#scene-camera-box:hover .scene-cam-close-btn {
  opacity: 1;
  pointer-events: auto;
}

#scene-camera-box .scene-cam-close-btn:hover {
  background: #b91c1c;
}

/* Exclusivo Escena con invitados: cámaras principales (slot 1 y 2) e invitados (1, 2 y 3) como capas flotantes libres */
.stage-slot-cell.is-guests-free-layer {
  position: absolute;
}

.stage-slot-cell.is-guests-free-layer.is-hovered {
  box-shadow: inset 0 0 0 1.5px rgba(74, 222, 128, 0.48);
}

/* Mantener despejadas las 4 esquinas para los manejadores de redimensionado libre en Escena con invitados */
.stage-slot-cell.is-camera-clean-hover.is-guests-free-layer .slot-hover-overlay {
  justify-content: flex-end;
  align-items: center;
  padding: 10px 24px;
}

/* =========================================================================
   MULTICHAT NATIVO (PANEL DERECHO + CAPA FLOTANTE LIBRE SOBRE EL LIENZO)
   ========================================================================= */
.multichat-manager-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(10, 21, 15, 0.85);
  border: 1px solid rgba(74, 222, 128, 0.24);
  margin-bottom: 8px;
}

.multichat-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.multichat-manager-head h4 {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #f0fdf4;
}

.multichat-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #cbe6d2;
  cursor: pointer;
  user-select: none;
}

.multichat-add-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.multichat-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.multichat-platform-select {
  width: 112px;
  flex-shrink: 0;
  font-size: 11.5px !important;
  padding: 6px 7px !important;
}

.multichat-add-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.multichat-channels-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 148px;
  overflow-y: auto;
}

.multichat-channels-empty {
  font-size: 11px;
  color: #7f9f88;
  font-style: italic;
  padding: 4px 2px;
}

.multichat-channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.multichat-channel-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.multichat-plat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.multichat-plat-icon.plat-youtube {
  background: #dc2626;
}

.multichat-plat-icon.plat-twitch {
  background: #9333ea;
}

.multichat-plat-icon.plat-kick {
  background: #16a34a;
}

.multichat-plat-icon.plat-studio {
  background: #0284c7;
}

.multichat-channel-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.multichat-channel-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #ecfdf5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multichat-channel-status {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multichat-channel-status.is-connected {
  color: #4ade80;
}

.multichat-channel-status.is-connecting {
  color: #fbbf24;
}

.multichat-channel-status.is-error {
  color: #f87171;
}

.multichat-channel-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.multichat-channel-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: #dbece0;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
}

.multichat-channel-btn:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(74, 222, 128, 0.65);
  color: #ffffff;
}

.multichat-channel-btn.is-remove:hover {
  background: rgba(220, 38, 38, 0.32);
  border-color: rgba(248, 113, 113, 0.72);
  color: #fecaca;
}

/* Capa flotante libre de Multichat 100% transparente (sin caja ni bordes, letras blancas 100% opacas con sombra negra, solo arrastrable y redimensionable) */
#multichat-floating-layer,
.multichat-floating-layer {
  position: absolute;
  z-index: 22;
  display: flex;
  flex-direction: column;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
  user-select: none;
  box-sizing: border-box;
  cursor: move;
}

#multichat-floating-layer[hidden],
.multichat-floating-layer[hidden],
#multichat-floating-layer:not(.is-active),
.multichat-floating-layer:not(.is-active) {
  display: none !important;
  pointer-events: none !important;
}

#multichat-floating-layer[hidden] .mc-resize-handle,
.multichat-floating-layer[hidden] .mc-resize-handle,
#multichat-floating-layer:not(.is-active) .mc-resize-handle,
.multichat-floating-layer:not(.is-active) .mc-resize-handle {
  display: none !important;
  pointer-events: none !important;
}

#multichat-floating-layer:hover,
#multichat-floating-layer.is-dragging,
#multichat-floating-layer.is-resizing,
.multichat-floating-layer:hover,
.multichat-floating-layer.is-dragging,
.multichat-floating-layer.is-resizing {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.multichat-layer-header {
  display: none !important;
}

.multichat-layer-messages {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 2px;
  padding: 0;
  margin: 0;
  cursor: move;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.multichat-layer-msg {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 4px 10px;
  margin: 0;
  border-radius: 8px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
  opacity: 1 !important;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-shadow: 0 2px 4px #000000, 0 0 6px #000000, 1px 1px 2px #000000 !important;
  cursor: move !important;
  pointer-events: none;
}

.multichat-layer-msg:hover,
.multichat-layer-msg.is-highlighted {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.multichat-layer-msg-meta {
  display: inline;
  background: transparent !important;
  border: none !important;
}

.multichat-layer-dest-pill {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff !important;
  opacity: 1 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 2px;
  text-shadow: 0 2px 4px #000000, 0 0 6px #000000, 1px 1px 2px #000000 !important;
}

.multichat-layer-author {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff !important;
  opacity: 1 !important;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-shadow: 0 2px 4px #000000, 0 0 6px #000000, 1px 1px 2px #000000 !important;
}

.multichat-layer-text {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff !important;
  opacity: 1 !important;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-shadow: 0 2px 4px #000000, 0 0 6px #000000, 1px 1px 2px #000000 !important;
}

/* Manejadores de redimensionado libre en las 4 esquinas de la capa Multichat */
.mc-resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #4ade80;
  border: 2px solid #052e16;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.12s ease;
  z-index: 4;
}

.multichat-floating-layer:hover .mc-resize-handle,
.multichat-floating-layer.is-dragging .mc-resize-handle,
.multichat-floating-layer.is-resizing .mc-resize-handle {
  opacity: 1;
}

.mc-resize-handle:hover {
  transform: scale(1.18);
  background: #bbf7d0;
}

.mc-resize-handle.handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.mc-resize-handle.handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.mc-resize-handle.handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.mc-resize-handle.handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }

/* Placa de mensaje destacado en pantalla: respeta el tamaño redimensionado por el usuario */
.pinned-chat-transform-box {
  position: absolute;
  z-index: 24;
  box-sizing: border-box;
  min-width: 120px;
  min-height: 48px;
  padding: 8px 12px;
  margin: 0;
  border-radius: 12px;
  border: 1.5px solid #525761;
  background: linear-gradient(155deg, rgba(32, 37, 45, 0.86) 0%, rgba(18, 21, 27, 0.9) 100%);
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: move;
  user-select: none;
  overflow: visible;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.pinned-chat-transform-box.style-minimal-shadow {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(155deg, rgba(22, 26, 33, 0.56) 0%, rgba(14, 17, 22, 0.64) 100%);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.pinned-chat-transform-box.style-dark-bubbles {
  border-radius: 14px;
  border: 1.5px solid #525761;
  background: linear-gradient(155deg, rgba(20, 24, 31, 0.88) 0%, rgba(14, 17, 23, 0.94) 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.pinned-chat-transform-box.style-tv-neon {
  border-radius: 12px;
  border: 1.5px solid rgba(74, 222, 128, 0.65);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.26) 0%, rgba(124, 58, 237, 0.3) 100%);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.pinned-chat-transform-box.is-canvas-rendered {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  border-color: transparent;
}

.pinned-chat-transform-box.is-canvas-rendered .pinned-chat-content {
  opacity: 0;
}

.pinned-chat-transform-box[hidden],
.pinned-chat-transform-box:not(.is-active) {
  display: none !important;
  pointer-events: none !important;
}

.pinned-chat-transform-box[hidden] .mc-resize-handle,
.pinned-chat-transform-box:not(.is-active) .mc-resize-handle {
  display: none !important;
  pointer-events: none !important;
}

.pinned-chat-transform-box:hover,
.pinned-chat-transform-box.is-dragging,
.pinned-chat-transform-box.is-resizing {
  border-color: #7c8391;
}

.pinned-chat-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0 0 0 10px;
  margin: 0;
  border-radius: inherit;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
  box-sizing: border-box;
}

.pinned-chat-content::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #94a3b8 0%, #525761 100%);
}

.pinned-chat-transform-box.style-tv-neon .pinned-chat-content::before {
  background: linear-gradient(180deg, #4ade80 0%, #a78bfa 100%);
}

.pinned-chat-header-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  min-width: 0;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.pinned-chat-plat-pill {
  flex-shrink: 0;
  padding: 1px 6px;
  margin: 0;
  border-radius: 999px;
  background: rgba(52, 58, 69, 0.72);
  border: 1px solid rgba(154, 163, 178, 0.45);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}

.pinned-chat-author {
  margin: 0;
  padding: 0;
  color: #e2e8f0;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow:
    0 2px 5px rgba(0, 0, 0, 0.96),
    1px 1px 2px #000000;
}

.pinned-chat-body {
  margin: 0;
  padding: 0;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow: hidden;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.98),
    1px 1px 2px #000000;
}

.pinned-chat-transform-box .mc-resize-handle {
  opacity: 0;
}

.pinned-chat-transform-box:hover .mc-resize-handle,
.pinned-chat-transform-box.is-dragging .mc-resize-handle,
.pinned-chat-transform-box.is-resizing .mc-resize-handle {
  opacity: 1;
}

.pinned-chat-close-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 5;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(15, 23, 30, 0.72);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.14s ease, background-color 0.14s ease;
}

.pinned-chat-transform-box:hover .pinned-chat-close-btn {
  opacity: 1;
}

.pinned-chat-close-btn:hover {
  background: #dc2626;
  border-color: #f87171;
}

.chat-msg-channel-tag {
  font-size: 9.5px;
  font-weight: 700;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 4px;
  padding: 1px 5px;
  max-width: 105px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================================
   PANEL QR Y SPONSORS (RAIL DERECHO + GENERADOR QR + TARJETA EN ESCENA)
   ========================================================================= */
.rail-icon-btn-qr {
  height: auto;
  min-height: 46px;
  padding: 5px 2px;
}

.rail-icon-btn-qr .rail-qr-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.rail-icon-btn-qr span:last-child {
  font-size: 7.5px;
  line-height: 1.08;
  text-align: center;
}

.qr-generator-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(10, 21, 15, 0.9);
  border: 1px solid rgba(74, 222, 128, 0.26);
  margin-bottom: 10px;
}

.qr-generator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qr-generator-head h4 {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #f0fdf4;
}

.qr-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #cbe6d2;
  cursor: pointer;
  user-select: none;
}

.qr-generator-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qr-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qr-field-group label {
  font-size: 10.5px;
  font-weight: 600;
  color: #9ec0aa;
}

.qr-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qr-panel-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(6, 13, 9, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qr-panel-preview-card {
  flex-shrink: 0;
  width: 88px;
  padding: 5px;
  border-radius: 8px;
  background: #07100c;
  border: 1.5px solid #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.qr-panel-preview-card canvas {
  width: 76px;
  height: 76px;
  border-radius: 4px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.qr-panel-preview-caption {
  max-width: 100%;
  font-size: 9px;
  font-weight: 800;
  color: #f8fafc;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-panel-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.qr-panel-preview-info strong {
  font-size: 11.5px;
  color: #ecfdf5;
}

.qr-panel-preview-info p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: #8ca896;
}

.qr-history-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.qr-history-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.qr-history-empty {
  font-size: 11px;
  color: #7f9f88;
  font-style: italic;
  padding: 3px 2px;
}

.qr-history-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.035);
  color: #ecfdf5;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.qr-history-item:hover {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.6);
}

.qr-history-item.is-current {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(74, 222, 128, 0.72);
}

.qr-history-item-url {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #f0fdf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-history-item-caption {
  width: 100%;
  font-size: 10px;
  color: #93b39e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-sponsors-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(8, 17, 12, 0.85);
  border: 1px solid var(--line);
}

.qr-sponsors-card h4 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #e6f4ea;
}

.qr-sponsors-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #8ca394;
}

/* Caja interactiva arrastrable y redimensionable sobre la tarjeta QR proyectada en escena */
.qr-card-transform-box {
  position: absolute;
  z-index: 25;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: move;
  user-select: none;
  transition: border-color 0.14s ease;
}

.qr-card-transform-box[hidden],
.qr-card-transform-box:not(.is-active) {
  display: none !important;
  pointer-events: none !important;
}

.qr-card-transform-box[hidden] .mc-resize-handle,
.qr-card-transform-box:not(.is-active) .mc-resize-handle {
  display: none !important;
  pointer-events: none !important;
}

.qr-card-transform-box:hover,
.qr-card-transform-box.is-dragging,
.qr-card-transform-box.is-resizing {
  border-color: rgba(74, 222, 128, 0.92);
}

.qr-card-transform-box .mc-resize-handle {
  opacity: 0;
}

.qr-card-transform-box:hover .mc-resize-handle,
.qr-card-transform-box.is-dragging .mc-resize-handle,
.qr-card-transform-box.is-resizing .mc-resize-handle {
  opacity: 1;
}

.qr-card-close-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 18, 24, 0.88);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.14s ease, background-color 0.14s ease;
}

.qr-card-transform-box:hover .qr-card-close-btn {
  opacity: 1;
}

.qr-card-close-btn:hover {
  background: #dc2626;
  border-color: #f87171;
}

/* =========================================================================
   SECCIÓN EMPRESAS (SPONSORS CON VIDEO MP4 PANTALLA COMPLETA + ZÓCALO QR)
   ========================================================================= */
.sponsor-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sponsor-section-head h4 {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #f0fdf4;
}

.sponsor-active-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.24);
  border: 1px solid rgba(248, 113, 113, 0.7);
  color: #fecaca;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sponsor-company-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.sponsor-video-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sponsor-video-filename {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  color: #93b39e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-video-filename.has-file {
  color: #86efac;
  font-weight: 600;
}

.sponsor-zocalo-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sponsor-color-control {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 3px 7px;
}

.sponsor-color-control input[type="color"] {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.sponsor-color-control span {
  font-size: 11px;
  color: #cbd5e1;
  font-weight: 600;
}

.sponsor-glass-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

.sponsor-glass-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: #22c55e;
  width: 15px;
  height: 15px;
}

.sponsor-companies-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sponsor-company-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.sponsor-company-item.is-showing {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(74, 222, 128, 0.78);
}

.sponsor-company-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.sponsor-company-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.sponsor-company-name {
  font-size: 12px;
  font-weight: 700;
  color: #f0fdf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-company-web {
  font-size: 10.5px;
  color: #86efac;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-company-video-tag {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-company-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sponsor-toggle-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(22, 163, 74, 0.22);
  color: #dcfce7;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.sponsor-toggle-btn:hover {
  background: #16a34a;
  border-color: #4ade80;
  color: #031107;
}

.sponsor-toggle-btn.is-active {
  background: rgba(220, 38, 38, 0.28);
  border-color: rgba(248, 113, 113, 0.8);
  color: #fecaca;
}

.sponsor-toggle-btn.is-active:hover {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

.sponsor-delete-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sponsor-delete-btn:hover {
  background: rgba(220, 38, 38, 0.35);
  border-color: rgba(248, 113, 113, 0.78);
  color: #fecaca;
}

/* Al proyectar un sponsor en pantalla completa, ocultar temporalmente el chat flotante y overlays interactivos */
.scene-canvas-wrapper.is-sponsor-takeover #scene-transform-layer,
.scene-canvas-wrapper.is-sponsor-takeover #scene-camera-box,
.scene-canvas-wrapper.is-sponsor-takeover #multichat-floating-layer,
.scene-canvas-wrapper.is-sponsor-takeover #pinned-chat-transform-box,
.scene-canvas-wrapper.is-sponsor-takeover #zocalo-pro-transform-box,
.scene-canvas-wrapper.is-sponsor-takeover #qr-card-transform-box,
.scene-canvas-wrapper.is-sponsor-takeover .qr-card-transform-box,
.scene-canvas-wrapper.is-sponsor-takeover .ai-overlay-stage-box,
.scene-canvas-wrapper.is-sponsor-takeover #scene-webviews-layer,
.scene-canvas-wrapper.is-sponsor-takeover #scene-slots-overlay,
.scene-canvas-wrapper.is-sponsor-takeover #scene-video-transport-bar {
  display: none !important;
  pointer-events: none !important;
}

/* =========================================================================
   PANEL TELEGRAM AUDIOS (RAIL DERECHO + BOT API + REPRODUCTOR EN VIVO)
   ========================================================================= */
.rail-icon-btn-tg {
  height: auto;
  min-height: 46px;
  padding: 5px 2px;
}

.rail-icon-btn-tg .rail-tg-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.rail-icon-btn-tg span:last-child {
  font-size: 7.5px;
  line-height: 1.08;
  text-align: center;
}

.tg-bot-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(9, 19, 24, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.28);
  margin-bottom: 10px;
}

.tg-bot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tg-bot-head h4 {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #f0f9ff;
}

.tg-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  max-width: 145px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-status-pill.is-connected {
  background: rgba(22, 163, 74, 0.22);
  border-color: rgba(74, 222, 128, 0.65);
  color: #86efac;
}

.tg-status-pill.is-connecting {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(251, 191, 36, 0.65);
  color: #fde68a;
}

.tg-status-pill.is-error {
  background: rgba(220, 38, 38, 0.22);
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.tg-bot-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tg-token-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-token-row .form-control {
  flex: 1;
  min-width: 0;
}

.tg-eye-btn {
  flex-shrink: 0;
  padding: 6px 8px;
}

.tg-connect-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-bot-hint {
  font-size: 10.5px;
  line-height: 1.35;
  color: #94b4c6;
}

.tg-bot-hint.is-error {
  color: #fca5a5;
}

.tg-volume-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tg-volume-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #dbeafe;
}

.tg-volume-val {
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #7dd3fc;
}

.tg-volume-slider {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.tg-audios-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(8, 17, 12, 0.88);
  border: 1px solid var(--line);
}

.tg-audios-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tg-audios-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tg-audios-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 800;
}

.tg-audios-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 360px;
  overflow-y: auto;
}

.tg-audio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.tg-audio-item.is-playing {
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.78);
}

.tg-audio-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tg-audio-sender {
  font-size: 12px;
  font-weight: 700;
  color: #f0f9ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-audio-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-audio-ext-badge {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.tg-play-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(14, 165, 233, 0.22);
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.tg-play-btn:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.tg-play-btn.is-playing {
  background: rgba(220, 38, 38, 0.28);
  border-color: rgba(248, 113, 113, 0.8);
  color: #fecaca;
}

.tg-play-btn.is-playing:hover {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

/* =========================================================================
   LISTA PERSISTENTE MULTI-QR (GENERADOR QR CON TARJETAS INDEPENDIENTES)
   ========================================================================= */
.qr-active-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  white-space: nowrap;
}

.qr-active-count-badge.has-active {
  background: rgba(22, 163, 74, 0.24);
  border-color: rgba(74, 222, 128, 0.68);
  color: #86efac;
}

.qr-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qr-saved-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.42);
  color: #bbf7d0;
  font-size: 10px;
  font-weight: 800;
}

.qr-saved-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 240px;
  overflow-y: auto;
}

.qr-saved-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.qr-saved-item.is-visible {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(74, 222, 128, 0.78);
}

.qr-saved-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.qr-saved-thumb {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 5px;
  background: #ffffff;
  border: 1px solid #111111;
  padding: 2px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.qr-saved-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.qr-saved-title {
  font-size: 12px;
  font-weight: 700;
  color: #f0fdf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-saved-url {
  font-size: 10px;
  color: #86efac;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-saved-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qr-item-toggle-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(22, 163, 74, 0.22);
  color: #dcfce7;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.qr-item-toggle-btn:hover {
  background: #16a34a;
  border-color: #4ade80;
  color: #031107;
}

.qr-item-toggle-btn.is-active {
  background: rgba(220, 38, 38, 0.28);
  border-color: rgba(248, 113, 113, 0.8);
  color: #fecaca;
}

.qr-item-toggle-btn.is-active:hover {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
}

.qr-item-delete-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-item-delete-btn:hover {
  background: rgba(220, 38, 38, 0.35);
  border-color: rgba(248, 113, 113, 0.78);
  color: #fecaca;
}

/* =========================================================================
   PANEL OVERLAYS IA (RÁPIDO OFFLINE + IMAGEN + GEMINI IA + CAPAS EN LIENZO)
   ========================================================================= */
.rail-icon-btn-ai {
  height: auto;
  min-height: 46px;
  padding: 5px 2px;
}

.rail-icon-btn-ai .rail-ai-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.rail-icon-btn-ai span:last-child {
  font-size: 7.5px;
  line-height: 1.08;
  text-align: center;
}

.ai-ov-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(15, 12, 26, 0.9);
  border: 1px solid rgba(167, 139, 250, 0.3);
  margin-bottom: 10px;
}

.ai-ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ai-ov-head h4 {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #f5f3ff;
}

.ai-ov-tabs {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  pointer-events: auto;
}

.btn-ai-ov-tab {
  position: relative;
  z-index: 7;
  pointer-events: auto;
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  border-radius: 7px;
  padding: 6px 5px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.btn-ai-ov-tab:hover {
  background: rgba(139, 92, 246, 0.16);
  color: #f5f3ff;
}

.btn-ai-ov-tab.active {
  background: rgba(139, 92, 246, 0.28);
  border-color: rgba(196, 181, 253, 0.72);
  color: #ffffff;
}

.ai-ov-tab-panel {
  display: none !important;
  flex-direction: column;
  gap: 8px;
}

.ai-ov-tab-panel.is-active {
  display: flex !important;
}

.ai-ov-tab-panel[hidden] {
  display: none !important;
}

.ai-ov-save-key-btn {
  flex-shrink: 0;
  padding: 6px 9px;
  white-space: nowrap;
}

.ai-ov-ref-thumb {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid rgba(196, 181, 253, 0.5);
  background: #08110c;
  flex-shrink: 0;
}

.ai-ov-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ai-ov-color-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 7px;
  border-radius: 7px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  height: 32px;
}

.ai-ov-color-input {
  width: 24px;
  height: 22px;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.ai-ov-color-hex {
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

.ai-ov-preview-stage {
  position: relative;
  width: 100%;
  min-height: 76px;
  max-height: 116px;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle at 50% 45%, rgba(28, 39, 34, 0.9), rgba(7, 13, 10, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ai-ov-checker {
  background-color: #0b1210;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.06) 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}

.ai-ov-preview-stage img {
  max-width: 100%;
  max-height: 98px;
  object-fit: contain;
  display: block;
}

.ai-ov-preview-placeholder {
  font-size: 10.5px;
  color: #8ca394;
  font-style: italic;
}

.ai-ov-prompt-textarea {
  resize: vertical;
  min-height: 68px;
  line-height: 1.38;
  font-family: inherit;
}

.ai-ov-status-msg {
  font-size: 10.5px;
  line-height: 1.35;
  color: #c4b5fd;
}

.ai-ov-status-msg.is-error {
  color: #fca5a5;
}

.ai-ov-status-msg.is-ok {
  color: #86efac;
}

.ai-ov-list-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(8, 17, 12, 0.88);
  border: 1px solid var(--line);
}

.ai-ov-saved-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 290px;
  overflow-y: auto;
}

.ai-ov-saved-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.ai-ov-saved-item.is-visible {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(196, 181, 253, 0.78);
}

.ai-ov-saved-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.ai-ov-saved-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.ai-ov-kind-badge {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-ov-kind-badge.kind-quick {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: #86efac;
}

.ai-ov-kind-badge.kind-image {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.45);
  color: #bae6fd;
}

.ai-ov-kind-badge.kind-gemini {
  background: rgba(139, 92, 246, 0.24);
  border: 1px solid rgba(196, 181, 253, 0.55);
  color: #ddd6fe;
}

/* Capa flotante arrastrable y redimensionable de cada Overlay IA sobre el lienzo */
.ai-overlay-stage-box {
  position: absolute;
  z-index: 26;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: move;
  user-select: none;
  overflow: visible;
  transition: border-color 0.14s ease;
}

.ai-overlay-stage-box[hidden],
.ai-overlay-stage-box:not(.is-active) {
  display: none !important;
  pointer-events: none !important;
}

.ai-overlay-stage-box[hidden] .mc-resize-handle,
.ai-overlay-stage-box:not(.is-active) .mc-resize-handle {
  display: none !important;
  pointer-events: none !important;
}

.ai-overlay-stage-box:hover,
.ai-overlay-stage-box.is-dragging,
.ai-overlay-stage-box.is-resizing {
  border-color: rgba(196, 181, 253, 0.92);
}

.ai-overlay-stage-content {
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.ai-overlay-stage-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.ai-overlay-stage-box .mc-resize-handle {
  opacity: 0;
  background: #c4b5fd;
  border-color: #2e1065;
}

.ai-overlay-stage-box:hover .mc-resize-handle,
.ai-overlay-stage-box.is-dragging .mc-resize-handle,
.ai-overlay-stage-box.is-resizing .mc-resize-handle {
  opacity: 1;
}

.ai-overlay-stage-box .qr-card-close-btn {
  opacity: 0;
  z-index: 5;
}

.ai-overlay-stage-box:hover .qr-card-close-btn {
  opacity: 1;
}

/* Reproductor de video MP4 de Sponsors visible al decodificador (sin display:none para evitar frames negros) */
.sponsor-video-playback-el {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 320px;
  height: 180px;
  opacity: 0.01;
  display: block;
  pointer-events: none;
  z-index: -1;
}

.sponsor-codec-alert {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.72);
  color: #fecaca;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
}

.sponsor-codec-alert[hidden] {
  display: none !important;
}

/* =========================================================================
   PLANTILLA ZÓCALO TV PRO (ESTILO RESTREAM · 3 BANDAS + ARRASTRABLE/REDIMENSIONABLE)
   ========================================================================= */
.zocalo-tv-pro-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border-radius: 11px;
  background: rgba(11, 16, 30, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.42);
}

.zocalo-pro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.zocalo-pro-head h4 {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #eff6ff;
}

.zocalo-pro-fields {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.zocalo-pro-mini-preview {
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid rgba(147, 197, 253, 0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.42);
}

.zocalo-pro-band-top {
  padding: 5px 9px;
  background: linear-gradient(90deg, #1d4ed8 0%, #4f46e5 52%, #7c3aed 100%);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zocalo-pro-band-mid {
  padding: 4px 9px;
  background: #ffffff;
  color: #020617;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zocalo-pro-band-bot {
  padding: 3px 9px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zocalo-pro-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zocalo-pro-transform-box {
  position: absolute;
  z-index: 23;
  box-sizing: border-box;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: move;
  user-select: none;
  transition: border-color 0.14s ease;
}

.zocalo-pro-transform-box[hidden],
.zocalo-pro-transform-box:not(.is-active) {
  display: none !important;
  pointer-events: none !important;
}

.zocalo-pro-transform-box[hidden] .mc-resize-handle,
.zocalo-pro-transform-box:not(.is-active) .mc-resize-handle {
  display: none !important;
  pointer-events: none !important;
}

.zocalo-pro-transform-box:hover,
.zocalo-pro-transform-box.is-dragging,
.zocalo-pro-transform-box.is-resizing {
  border-color: rgba(147, 197, 253, 0.95);
}

.zocalo-pro-transform-box .mc-resize-handle {
  opacity: 0;
  background: #60a5fa;
  border-color: #1e1b4b;
}

.zocalo-pro-transform-box:hover .mc-resize-handle,
.zocalo-pro-transform-box.is-dragging .mc-resize-handle,
.zocalo-pro-transform-box.is-resizing .mc-resize-handle {
  opacity: 1;
}

.zocalo-pro-transform-box .qr-card-close-btn {
  opacity: 0;
  z-index: 5;
}

.zocalo-pro-transform-box:hover .qr-card-close-btn {
  opacity: 1;
}

/* =========================================================================
   FILA COMPACTA DE CÍRCULOS SUPERPUESTOS + POPOVER "FUENTES E INVITADOS" (RESTREAM)
   ========================================================================= */
.restream-participants-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #101f16 0%, #09130d 100%);
  border: 1px solid rgba(34, 197, 94, 0.36);
  color: #e6f4ea;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.restream-participants-trigger:hover,
.restream-participants-trigger.is-open {
  border-color: #22c55e;
  background: linear-gradient(180deg, #162b1f 0%, #0c1911 100%);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18), 0 6px 18px rgba(0, 0, 0, 0.42);
}

.restream-avatars-stack {
  display: inline-flex;
  align-items: center;
  padding-left: 2px;
}

.restream-avatar-circle {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: #132319;
  border: 2px solid #2b3f33;
  box-shadow: 0 0 0 2px #09130d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.restream-avatar-circle + .restream-avatar-circle {
  margin-left: -10px;
}

.restream-avatar-circle.is-on-air {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px #09130d, 0 0 10px rgba(34, 197, 94, 0.65);
}

.restream-avatar-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  background: #050b07;
}

.restream-avatar-video.has-stream {
  display: block;
}

.restream-avatar-fallback {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #bbf7d0;
  line-height: 1;
  user-select: none;
}

.restream-avatar-circle.has-live-video .restream-avatar-fallback {
  display: none;
}

.restream-trigger-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}

.restream-trigger-label {
  font-size: 11px;
  font-weight: 700;
  color: #e2f5e7;
  white-space: nowrap;
}

.restream-trigger-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.22);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: #86efac;
  font-size: 10px;
  font-weight: 800;
}

.restream-trigger-chevron {
  font-size: 10px;
  color: #86efac;
  transition: transform 0.16s ease;
}

.restream-participants-trigger.is-open .restream-trigger-chevron {
  transform: rotate(180deg);
}

/* Popover flotante "Fuentes e Invitados" */
.sources-guests-popover {
  position: fixed;
  bottom: calc(var(--footer-h) + 10px);
  right: 16px;
  z-index: 68;
  width: min(448px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 104px));
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px 14px;
  border-radius: 14px;
  background: rgba(10, 18, 14, 0.97);
  border: 1px solid rgba(74, 222, 128, 0.36);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.72), 0 0 24px rgba(34, 197, 94, 0.12);
  color: #e6f4ea;
  overflow: hidden;
}

.sources-guests-popover[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.sources-guests-popover.is-open {
  display: flex;
  pointer-events: auto;
  animation: sgPopoverSlideUp 0.16s ease-out;
}

@keyframes sgPopoverSlideUp {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sg-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sg-popover-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sg-popover-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.85);
  flex-shrink: 0;
}

.sg-popover-title-wrap strong {
  font-size: 13.5px;
  font-weight: 800;
  color: #f0fdf4;
  letter-spacing: 0.01em;
}

.sg-popover-count-pill {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #86efac;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.sg-popover-close {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.sg-popover-close:hover {
  background: rgba(220, 38, 38, 0.24);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.sg-popover-top-action {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sg-copy-guest-btn {
  width: 100%;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(110, 231, 183, 0.55);
  background: linear-gradient(90deg, #16a34a 0%, #059669 55%, #0d9488 100%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.28);
  transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.sg-copy-guest-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.42);
}

.sg-copy-guest-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.sg-copy-guest-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.sg-copy-guest-btn.is-copied {
  background: linear-gradient(90deg, #15803d 0%, #16a34a 100%);
  border-color: #86efac;
}

.sg-copy-guest-feedback {
  font-size: 10.5px;
  font-weight: 600;
  color: #86efac;
  line-height: 1.3;
  padding: 0 2px;
}

.sg-copy-guest-feedback.is-error {
  color: #fca5a5;
}

.sg-cards-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  max-height: 390px;
  padding-right: 2px;
}

.sg-participant-card {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 9px;
  border-radius: 11px;
  background: rgba(17, 29, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.sg-participant-card.is-on-air {
  border-color: rgba(34, 197, 94, 0.68);
  background: rgba(16, 34, 24, 0.96);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.22);
}

.sg-card-preview {
  position: relative;
  width: 104px;
  min-width: 104px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1610 0%, #13251b 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
}

.sg-participant-card.is-on-air .sg-card-preview {
  border-color: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}

.sg-card-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  background: #050b07;
}

.sg-card-preview-video.has-stream {
  display: block;
}

.sg-card-preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #9bb8a5;
  font-size: 18px;
  font-weight: 800;
  user-select: none;
}

.sg-card-preview-fallback small {
  font-size: 9px;
  font-weight: 700;
  color: #799684;
  text-transform: uppercase;
}

.sg-card-preview.has-live-video .sg-card-preview-fallback {
  display: none;
}

.sg-preview-air-pill {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(22, 163, 74, 0.92);
  color: #ffffff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  display: none;
}

.sg-participant-card.is-on-air .sg-preview-air-pill {
  display: inline-block;
}

.sg-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sg-card-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sg-card-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sg-card-name {
  font-size: 12px;
  font-weight: 800;
  color: #f0fdf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-card-role-tag {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #86efac;
  flex-shrink: 0;
}

.sg-card-role-tag.is-guest {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.sg-card-role-tag.is-cohost {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(192, 132, 252, 0.45);
  color: #d8b4fe;
}

/* Switch ON/OFF estilo Restream */
.sg-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  cursor: pointer;
}

.sg-switch-state-text {
  font-size: 9.5px;
  font-weight: 800;
  color: #94a3b8;
  min-width: 24px;
  text-align: right;
}

.sg-participant-card.is-on-air .sg-switch-state-text {
  color: #4ade80;
}

.sg-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.sg-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.sg-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #24332a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.sg-switch-track::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.16s ease, background 0.16s ease;
}

.sg-switch input:checked + .sg-switch-track {
  background: #16a34a;
  border-color: #4ade80;
}

.sg-switch input:checked + .sg-switch-track::before {
  transform: translateX(16px);
  background: #ffffff;
}

.sg-card-row-audio {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sg-mute-btn {
  width: 26px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #dcfce7;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.sg-mute-btn:hover {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.45);
}

.sg-mute-btn.is-muted {
  background: rgba(220, 38, 38, 0.24);
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.sg-vol-slider {
  flex: 1;
  min-width: 0;
  height: 4px;
  accent-color: #22c55e;
  cursor: pointer;
}

.sg-vol-val {
  font-size: 10px;
  font-family: Consolas, monospace;
  color: #86efac;
  min-width: 34px;
  text-align: right;
  flex-shrink: 0;
}

.sg-card-row-scene {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sg-scene-label {
  font-size: 10px;
  font-weight: 700;
  color: #93afa0;
  white-space: nowrap;
}

.sg-scene-select {
  flex: 1;
  min-width: 0;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0a140e;
  color: #e2f5e7;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.sg-scene-select:focus {
  border-color: rgba(74, 222, 128, 0.65);
}

.sg-empty-guests-hint {
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.11);
  color: #8ea999;
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
}

/* =========================================================================
   MOTOR GRÁFICO TELEVISIVO ESTILO vMix / TELEFE (PANEL TEXTOS & CARTELES)
   ========================================================================= */
.tv-broadcast-editor-card {
  gap: 9px;
}

.tv-editor-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.tv-brackets-tip {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.42);
  color: #fde047;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}

.tv-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tv-preset-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(10, 18, 14, 0.85);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.tv-preset-btn:last-child {
  grid-column: 1 / -1;
}

.tv-preset-btn:hover {
  border-color: rgba(125, 211, 252, 0.55);
  background: rgba(18, 30, 26, 0.96);
}

.tv-preset-btn.is-active {
  border-color: #38bdf8;
  background: rgba(14, 42, 68, 0.65);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 4px 12px rgba(0, 0, 0, 0.32);
}

.tv-preset-swatch {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
}

.tv-preset-swatch.swatch-telefe {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 55%, #facc15 100%);
}

.tv-preset-swatch.swatch-gato-verde {
  background: linear-gradient(135deg, #06130b 0%, #16a34a 65%, #4ade80 100%);
}

.tv-preset-swatch.swatch-breaking {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 60%, #facc15 100%);
}

.tv-preset-swatch.swatch-glass {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.55) 0%, rgba(56, 189, 248, 0.45) 55%, rgba(139, 92, 246, 0.65) 100%);
}

.tv-preset-swatch.swatch-sticker {
  background: repeating-linear-gradient(45deg, #1e293b 0 4px, #0f172a 4px 8px);
  box-shadow: inset 0 0 0 2px #f43f5e;
}

.tv-color-pickers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tv-color-picker-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(8, 15, 11, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
}

.tv-color-picker-item > span {
  font-size: 9.5px;
  font-weight: 700;
  color: #9bb8a5;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tv-color-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tv-color-input-wrap input[type="color"] {
  width: 24px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.tv-color-input-wrap span {
  font-size: 10px;
  font-family: Consolas, monospace;
  color: #e2e8f0;
}

/* Mini vista previa en vivo de doble nivel + píldoras */
.tv-banner-live-preview {
  padding: 10px 10px 9px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.14), transparent 60%),
    linear-gradient(135deg, #090f18 0%, #0d1712 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}

.tv-preview-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 8px;
  margin-left: 8px;
  margin-bottom: -2px;
  border-radius: 6px 10px 0 0;
  background: #2563eb;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.tv-preview-kicker[hidden] {
  display: none !important;
}

.tv-preview-plate {
  width: 100%;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #0f2b7a 0%, #1d4ed8 100%);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.tv-banner-live-preview.preset-glass .tv-preview-plate {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tv-banner-live-preview.preset-sticker .tv-preview-plate {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  padding: 4px 2px;
}

.tv-preview-accent-bar {
  width: 4px;
  border-radius: 999px;
  background: #38bdf8;
  flex-shrink: 0;
}

.tv-banner-live-preview.preset-sticker .tv-preview-accent-bar {
  display: none;
}

.tv-preview-texts {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tv-preview-title {
  font-size: 11.5px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.3;
  word-break: break-word;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.tv-banner-live-preview.preset-sticker .tv-preview-title {
  -webkit-text-stroke: 0.7px #000000;
  text-shadow: 0 2px 0 #000000, 0 4px 10px rgba(0, 0, 0, 0.85);
}

.tv-preview-sub {
  font-size: 10px;
  font-weight: 700;
  color: #dbeafe;
  line-height: 1.25;
  word-break: break-word;
}

.tv-preview-sub[hidden] {
  display: none !important;
}

.tv-inline-pill {
  display: inline-block;
  padding: 0 6px;
  margin: 0 2px;
  border-radius: 999px;
  background: #facc15;
  color: #09090b;
  font-weight: 900;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}

/* =========================================================================
   ESCENA / LAYOUT "5 - REACCIÓN" (PICTURE-IN-PICTURE EN CAPAS SUPERPUESTAS)
   z-index: 1 Fondo multimedia · z-index: 10 Cámaras flotantes · z-index: 20+ Overlays TV
   ========================================================================= */
.stage-slot-cell.is-reaction-bg,
.slot-webview-box.is-reaction-bg {
  z-index: 1 !important;
  border-radius: 0 !important;
}

.stage-slot-cell.is-reaction-pip,
.slot-webview-box.is-reaction-pip {
  z-index: 10 !important;
  border-radius: 18px !important;
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.72),
    0 0 0 1.5px rgba(74, 222, 128, 0.58),
    0 0 18px rgba(56, 189, 248, 0.24);
}

.stage-slot-cell.is-reaction-pip.is-pip-guest {
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.72),
    0 0 0 1.5px rgba(167, 139, 250, 0.65),
    0 0 18px rgba(56, 189, 248, 0.26);
}

.stage-slot-cell.is-reaction-pip.is-empty {
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.08) 0%, rgba(34, 38, 46, 0.34) 36%, rgba(16, 19, 24, 0.48) 100%);
  border: 2px solid #3c4048;
  border-top-color: #525761;
}

.stage-slot-cell.is-reaction-pip.is-empty .slot-empty-picker {
  padding: 8px 6px;
}

.stage-slot-cell.is-reaction-pip.is-empty .slot-options-grid {
  grid-template-columns: 1fr;
  gap: 4px;
}

/* Miniatura lateral y modal de la plantilla 5 - Reacción (PiP) */
.scene-mini-preview.tpl-5 {
  position: relative;
  display: block;
  padding: 0;
  overflow: hidden;
}

.scene-mini-preview.tpl-5 .scene-mini-slot.is-reaction-mini-bg {
  position: absolute;
  inset: 2px;
  z-index: 1;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.7);
}

.scene-mini-preview.tpl-5 .scene-mini-slot.is-reaction-mini-host {
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 22%;
  z-index: 10;
  border-radius: 5px;
  border: 1.5px solid rgba(74, 222, 128, 0.85);
  background: rgba(6, 24, 15, 0.88);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
}

.scene-mini-preview.tpl-5 .scene-mini-slot.is-reaction-mini-guest {
  position: absolute;
  right: 5px;
  top: 10px;
  bottom: 10px;
  width: 22%;
  z-index: 10;
  border-radius: 5px;
  border: 1.5px solid rgba(167, 139, 250, 0.88);
  background: rgba(24, 12, 42, 0.88);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
}

.tpl-mini-grid.tpl-5 {
  position: relative;
  display: block;
}

.tpl-mini-grid.tpl-5 .tpl-5-bg {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid rgba(125, 211, 252, 0.35);
}

.tpl-mini-grid.tpl-5 .tpl-5-host {
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 24%;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.65);
  border: 1px solid #86efac;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.tpl-mini-grid.tpl-5 .tpl-5-guest {
  position: absolute;
  right: 4px;
  top: 6px;
  bottom: 6px;
  width: 24%;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.65);
  border: 1px solid #c4b5fd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

/* Layout profesional TV 2 - Dos: 2 contenedores 50/50 al ras (82% superior) con object-fit: cover */
.stage-slot-cell.is-tv-split-2,
.slot-webview-box.is-tv-split-2 {
  border-radius: 0 !important;
  margin: 0 !important;
}

.stage-slot-cell.is-tv-split-2.is-empty {
  border: 1px dashed rgba(34, 197, 94, 0.25);
  border-top: 0;
}

.stage-slot-cell.is-tv-split-2 video,
.stage-slot-cell.is-tv-split-2 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================================
   BARRA INFERIOR LIMPIA (4 ELEMENTOS) + ENLACES CENTRALIZADOS EN POPOVER
   ========================================================================= */
.studio-footer.studio-footer-clean {
  justify-content: space-between;
  gap: 14px;
}

.studio-footer.studio-footer-clean .footer-dock-controls {
  gap: 8px;
}

.studio-footer.studio-footer-clean .footer-participants {
  gap: 10px;
}

.studio-footer.studio-footer-clean .participant-card.participant-card-guest {
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.studio-footer.studio-footer-clean .participant-card.participant-card-guest:hover {
  border-color: rgba(74, 222, 128, 0.55);
  background: #0c1912;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}

.sg-links-hub {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(15, 26, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sg-links-hub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.sg-links-hub .sg-role-select {
  height: 30px;
  min-width: 110px;
  flex: 1;
}

.sg-links-hub .sg-hub-btn {
  flex-shrink: 0;
}

.sg-links-hub-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sg-links-hub-status:empty {
  display: none;
}

/* Garantizar popovers ocultos por defecto y sin interceptar clics cuando no están abiertos */
.sources-guests-popover:not(.is-open),
.guests-column-popover:not(.is-open),
.guest-link-popover:not(.is-open),
.private-chat-popover:not(.is-open) {
  display: none !important;
  pointer-events: none !important;
}

.guests-column-popover[hidden],
.guest-link-popover[hidden],
.private-chat-popover[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* Ocultar de la vista directa las píldoras sueltas de invitados debajo de los botones de escenas */
#guests-stage-bar,
.guests-stage-bar {
  display: none !important;
  pointer-events: none !important;
}

/* Botón desplegable "Invitados" en barra inferior + Popover flotante de Invitado 1, 2 y 3 */
.restream-guests-trigger {
  padding-left: 10px;
  border-color: rgba(56, 189, 248, 0.36);
}

.restream-guests-trigger:hover,
.restream-guests-trigger.is-open {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18), 0 6px 18px rgba(0, 0, 0, 0.42);
}

.restream-guests-icon {
  font-size: 14px;
  line-height: 1;
}

.guests-column-popover {
  position: fixed;
  bottom: calc(var(--footer-h) + 10px);
  right: 16px;
  z-index: 68;
  width: min(410px, calc(100vw - 24px));
  max-height: min(480px, calc(100vh - 104px));
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px 14px;
  border-radius: 14px;
  background: rgba(10, 18, 16, 0.97);
  border: 1px solid rgba(56, 189, 248, 0.38);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.72), 0 0 22px rgba(56, 189, 248, 0.14);
  color: #e6f4ea;
  overflow: hidden;
}

.guests-column-popover.is-open {
  display: flex;
  pointer-events: auto;
  animation: sgPopoverSlideUp 0.16s ease-out;
}

.sg-guests-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.85);
}

.guests-popover-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.guest-popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 25, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.guest-popover-row.is-active {
  border-color: rgba(34, 197, 94, 0.62);
  background: rgba(14, 32, 23, 0.95);
}

.guest-popover-row-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.guest-popover-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #475569;
  flex-shrink: 0;
}

.guest-popover-row.is-active .guest-popover-status-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.guest-popover-name-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.guest-popover-name {
  font-size: 12px;
  font-weight: 800;
  color: #f0fdf4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guest-popover-sub {
  font-size: 10px;
  color: #8ea999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guest-popover-row.is-active .guest-popover-sub {
  color: #86efac;
}

.guest-popover-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.guest-popover-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.guest-popover-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
}

.guest-popover-btn.is-vis-on {
  background: rgba(22, 163, 74, 0.24);
  border-color: rgba(74, 222, 128, 0.65);
  color: #bbf7d0;
}

.guest-popover-btn.is-danger {
  width: 26px;
  padding: 0;
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.guest-popover-btn.is-danger:hover {
  background: rgba(220, 38, 38, 0.34);
  border-color: #f87171;
  color: #ffffff;
}

/* =========================================================================
   FORMAS DE CÁMARA Y CO-HOST (16:9 · 1:1 · REDONDO 50%) EN CONTENEDOR Y VIDEO
   ========================================================================= */
.subject-shape-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.subject-shape-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #9cb8a6;
  white-space: nowrap;
}

.subject-shape-group {
  flex: 1;
}

.subject-shape-group .btn-layout-opt {
  padding: 5px 8px;
  font-size: 10.5px;
}

/* Clases de forma aplicadas directamente a contenedores visibles y elementos <video> */
.cam-shape-rect {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
}

.cam-shape-square {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
}

.cam-shape-circle {
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  overflow: hidden;
}

.cam-shape-rect video,
.cam-shape-square video,
.cam-shape-circle video,
video.cam-shape-rect,
video.cam-shape-square,
video.cam-shape-circle {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transform: translateZ(0);
}

video.cam-shape-rect {
  aspect-ratio: 16 / 9;
}

video.cam-shape-square {
  aspect-ratio: 1 / 1;
}

video.cam-shape-circle {
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
}

.sg-card-preview.cam-shape-square,
.sg-card-preview.cam-shape-circle {
  width: 68px;
  min-width: 68px;
  height: 68px;
}

.sg-card-preview.cam-shape-rect {
  width: 104px;
  min-width: 104px;
  height: 60px;
}


/* =========================================================================
   TEXTOS (ZÓCALO SUPERIOR) Y BANNERS (ZÓCALO INFERIOR): PANELES INDEPENDIENTES
   ========================================================================= */
.drawer-panel.banners-single-panel.is-active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.banner-compact-block {
  display: flex;
  flex-direction: column;
  gap: 9px !important;
  padding: 11px !important;
  margin: 0 !important;
  border-radius: 10px;
}

.banner-compact-block.is-top-zocalo {
  border-color: rgba(56, 189, 248, 0.35);
}

.banner-compact-block.is-bottom-zocalo {
  border-color: rgba(74, 222, 128, 0.35);
}

.banner-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.banner-compact-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.banner-compact-title .eyebrow {
  font-size: 8.5px;
  line-height: 1.1;
}

.banner-compact-title h4 {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.2;
  color: #f8fafc;
}

.banner-compact-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.banner-compact-toggle-btn {
  padding: 5px 10px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.banner-compact-fields {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.banner-compact-input {
  padding: 6px 9px !important;
  font-size: 11px !important;
  height: 30px !important;
  min-height: 30px !important;
}

.banner-compact-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.banner-compact-presets .tv-preset-btn {
  padding: 5px 4px !important;
  font-size: 10px !important;
  gap: 4px !important;
  justify-content: center;
}

.banner-compact-presets .tv-preset-swatch {
  width: 9px !important;
  height: 9px !important;
}

.banner-compact-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.banner-compact-row.banner-compact-tools {
  flex-wrap: wrap;
}

.banner-compact-select {
  flex: 1 1 115px;
  min-width: 0;
  height: 29px !important;
  min-height: 29px !important;
  padding: 4px 7px !important;
  font-size: 10.5px !important;
}

.banner-compact-colors {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(10, 18, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.banner-compact-colors input[type='color'] {
  width: 19px;
  height: 19px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.rail-icon-btn-banners .rail-banners-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* =========================================================================
   ESTÉTICA CARBONO Y ESMERALDA (ARQUITECTURA DE DISEÑO RESTREAM · MINIMALISTA)
   ========================================================================= */

/* Paneles en #16191E sin líneas duras y con esquinas redondeadas 10px */
.card,
.scene-card,
.drawer,
.drawer-panel,
.studio-settings-card,
.multichat-manager-card,
.participant-card,
.sg-links-hub,
.banner-editor-card,
.scene-canvas-wrapper,
.stage-center-frame,
.modal-content,
.popover-box {
  background: var(--bg-surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}

/* Botones estilo pastilla con buen padding (Pill buttons) */
.dock-btn,
.btn-layout-opt,
.btn-cam-mode {
  border-radius: 999px !important;
  padding: 0 16px !important;
  height: 34px !important;
  background: #1F232B !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #E2E8F0 !important;
  font-weight: 600 !important;
  transition: all 0.15s cubic-bezier(0.2, 0, 0, 1) !important;
}

.dock-btn.dock-btn-compact {
  height: 32px !important;
  padding: 0 14px !important;
}

.dock-btn:hover:not(:disabled),
.btn-layout-opt:hover:not(:disabled),
.btn-cam-mode:hover:not(:disabled) {
  background: #282E39 !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #FFFFFF !important;
}

.btn-primary {
  border-radius: 999px !important;
  padding: 8px 18px !important;
  background: #1F232B !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #F1F5F9 !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

.btn-primary:hover:not(:disabled) {
  background: #282E39 !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #FFFFFF !important;
}

.btn-mini,
.slot-opt-btn {
  border-radius: 999px !important;
  padding: 4px 12px !important;
  background: #1F232B !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #CBD5E1 !important;
}

.btn-mini:hover:not(:disabled),
.slot-opt-btn:hover:not(:disabled) {
  background: #282E39 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #FFFFFF !important;
}

/* Verde Esmeralda (#10B981) reservado ÚNICAMENTE para lo que está ACTIVO */
.dock-btn.is-active,
.dock-btn.active,
.btn-primary.is-active,
.btn-primary.active,
.btn-layout-opt.is-active,
.btn-cam-mode.is-active,
.scene-card.is-active,
.rail-icon-btn.is-active,
.btn-chat-tab.active,
.btn-music-tab.active,
.tv-preset-btn.is-active {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10B981 !important;
  color: #10B981 !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3) !important;
}

.scene-card.is-active {
  border-color: #10B981 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 8px 20px rgba(0, 0, 0, 0.4) !important;
}

.live-badge.is-live,
.is-live-indicator.is-live {
  background: #10B981 !important;
  color: #0D0F12 !important;
}

/* Zócalo de texto más compacto y translúcido */
.banner-compact-block,
.tv-zocalo-editor-card,
.zocalo-tv-pro-card,
.chat-pinned-banner {
  background: rgba(22, 25, 30, 0.72) !important;
  backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
}

.banner-compact-input {
  height: 26px !important;
  min-height: 26px !important;
  padding: 4px 8px !important;
  font-size: 11px !important;
  background: rgba(18, 21, 26, 0.8) !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.zocalo-pro-mini-preview {
  border-radius: 8px !important;
  opacity: 0.88 !important;
}

/* =========================================================================
   MEZCLADORA EN LÍNEA TIPO ACORDEÓN (4 BOTONES EN FILA INFERIOR IZQUIERDA)
   ========================================================================= */
.inline-audio-mixer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  flex-shrink: 0;
  user-select: none;
}

.mixer-item {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: #16191E;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 96px;
  min-width: 80px;
  transition: max-width 0.18s cubic-bezier(0.2, 0, 0, 1), background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  box-sizing: border-box;
}

.mixer-item:hover,
.mixer-item:focus-within,
.mixer-item.is-expanded {
  background: #1F232B;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

#mixer-item-video:hover,
#mixer-item-video:focus-within,
#mixer-item-video.is-expanded {
  max-width: 300px;
}

#mixer-item-screen:hover,
#mixer-item-screen:focus-within,
#mixer-item-screen.is-expanded {
  max-width: 255px;
}

#mixer-item-guests:hover,
#mixer-item-guests:focus-within,
#mixer-item-guests.is-expanded {
  max-width: 255px;
}

#mixer-item-music:hover,
#mixer-item-music:focus-within,
#mixer-item-music.is-expanded {
  max-width: 325px;
}

.mixer-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #CBD5E1;
  flex-shrink: 0;
  pointer-events: none;
}

.mixer-item:hover .mixer-tab-btn,
.mixer-item:focus-within .mixer-tab-btn,
.mixer-item.is-expanded .mixer-tab-btn {
  color: #10B981;
}

.mixer-tab-icon {
  font-size: 13px;
  line-height: 1;
}

.mixer-tab-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mixer-inline-expanded {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}

.mixer-item:hover .mixer-inline-expanded,
.mixer-item:focus-within .mixer-inline-expanded,
.mixer-item.is-expanded .mixer-inline-expanded {
  display: inline-flex;
}

.mixer-mini-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #12151A;
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #F1F5F9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  flex-shrink: 0;
}

.mixer-mini-btn:hover {
  background: #282E39;
  border-color: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.mixer-mini-btn.is-active {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10B981 !important;
  color: #10B981 !important;
}

.mixer-mini-btn.is-muted {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}

.mixer-slider {
  width: 72px;
  height: 4px;
  accent-color: #10B981;
  cursor: pointer;
  margin: 0;
  background: #12151A;
  border-radius: 999px;
  border: none;
  outline: none;
  flex-shrink: 0;
}

.mixer-val {
  font-size: 10px;
  font-family: Consolas, monospace;
  font-weight: 600;
  color: #10B981;
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* =========================================================================
   REDISEÑO PROFESIONAL DE CONSOLA: GRIS GRAFITO Y VERDE ESMERALDA
   ========================================================================= */
:root {
  --console-graphite-bg: #23272f;
  --console-graphite-bg-hover: #2a303a;
  --console-graphite-border: rgba(255, 255, 255, 0.11);
  --console-graphite-text: #d6dde6;

  --console-emerald-hover-border: rgba(16, 185, 129, 0.44);
  --console-emerald-hover-glow: 0 0 10px rgba(16, 185, 129, 0.18);

  --console-emerald-active-bg: rgba(16, 185, 129, 0.16);
  --console-emerald-active-border: rgba(16, 185, 129, 0.68);
  --console-emerald-active-text: #a7f3d0;
  --console-emerald-active-glow: 0 0 0 1px rgba(16, 185, 129, 0.2), 0 0 12px rgba(16, 185, 129, 0.14);

  --console-btn-radius: 8px;
  --console-btn-h: 34px;
  --console-transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

/* 1. Forma rectangular con esquinas suavemente redondeadas y estado inactivo Gris Grafito */
.dock-btn,
.dock-btn.dock-btn-compact,
.dock-btn.dock-btn-private-chat,
.dock-btn.dock-btn-compact.dock-btn-studio-settings,
.btn-layout-opt,
.btn-cam-mode,
.btn-primary,
.btn-mini,
.slot-opt-btn,
.btn-header-gear,
.btn-cinema-header,
.restream-participants-trigger,
.restream-guests-trigger,
.inline-audio-mixer .mixer-item,
#gv-audioclips-bar,
#gv-trans-escena-btn {
  border-radius: var(--console-btn-radius) !important;
  background: var(--console-graphite-bg) !important;
  border: 1px solid var(--console-graphite-border) !important;
  color: var(--console-graphite-text) !important;
  box-shadow: none !important;
  transition: var(--console-transition) !important;
}

/* 2. Hover: brillo verde esmeralda sutil y breve (sin quedarse pegado al retirar el mouse) */
.dock-btn:hover:not(:disabled),
.dock-btn.dock-btn-private-chat:hover:not(:disabled),
.dock-btn.dock-btn-compact.dock-btn-studio-settings:hover:not(:disabled),
.btn-layout-opt:hover:not(:disabled),
.btn-cam-mode:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.btn-mini:hover:not(:disabled),
.slot-opt-btn:hover:not(:disabled),
.btn-header-gear:hover,
.btn-cinema-header:hover,
.restream-participants-trigger:hover,
.restream-guests-trigger:hover,
.inline-audio-mixer .mixer-item:hover,
#gv-audioclips-bar:hover,
#gv-trans-escena-btn:hover,
.rail-icon-btn:hover {
  background: var(--console-graphite-bg-hover) !important;
  border-color: var(--console-emerald-hover-border) !important;
  color: #f1f5f9 !important;
  box-shadow: var(--console-emerald-hover-glow) !important;
}

/* 3. Estado ACTIVO: verde esmeralda tenue y permanente (se mantiene al retirar el mouse) */
.dock-btn.is-active,
.dock-btn.active,
.dock-btn.dock-btn-private-chat.is-active,
.dock-btn.dock-btn-compact.dock-btn-studio-settings.is-active,
.dock-btn.dock-btn-compact.dock-btn-studio-settings.active,
.btn-layout-opt.active,
.btn-layout-opt.is-active,
.btn-cam-mode.active,
.btn-cam-mode.is-active,
.btn-primary.is-active,
.btn-primary.active,
.btn-header-gear.is-active,
.restream-participants-trigger.is-open,
.restream-participants-trigger.is-active,
.restream-guests-trigger.is-open,
.restream-guests-trigger.is-active,
.inline-audio-mixer .mixer-item.is-expanded,
.inline-audio-mixer .mixer-item.is-active,
#gv-audioclips-bar.is-expanded,
#gv-audioclips-bar.is-active,
.rail-icon-btn.is-active,
.rail-icon-btn.active,
.btn-chat-tab.active,
.btn-music-tab.active,
.tv-preset-btn.is-active,
.scene-card.is-active {
  background: var(--console-emerald-active-bg) !important;
  border-color: var(--console-emerald-active-border) !important;
  color: var(--console-emerald-active-text) !important;
  box-shadow: var(--console-emerald-active-glow) !important;
}

/* Mantener estado activo aunque se pase el mouse por encima */
.dock-btn.is-active:hover:not(:disabled),
.dock-btn.dock-btn-compact.dock-btn-studio-settings.is-active:hover:not(:disabled),
.dock-btn.dock-btn-compact.dock-btn-studio-settings.active:hover:not(:disabled),
.btn-layout-opt.active:hover:not(:disabled),
.btn-layout-opt.is-active:hover:not(:disabled),
.btn-cam-mode.active:hover:not(:disabled),
.btn-cam-mode.is-active:hover:not(:disabled),
.restream-participants-trigger.is-open:hover,
.restream-guests-trigger.is-open:hover,
.inline-audio-mixer .mixer-item.is-expanded:hover,
.inline-audio-mixer .mixer-item.is-active:hover,
#gv-audioclips-bar.is-active:hover,
#gv-audioclips-bar.is-expanded:hover,
.rail-icon-btn.is-active:hover,
.rail-icon-btn.active:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  color: #d1fae5 !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.28), 0 0 14px rgba(16, 185, 129, 0.22) !important;
}

/* =========================================================================
   TAMAÑO UNIFORME POR GRUPO DE CONTROLES
   ========================================================================= */

/* Grupo 1: Barra inferior (Chat privado, Ajustes solo ícono, Mezcladora, Fuentes) */
.studio-footer.studio-footer-clean {
  gap: 8px;
}

.studio-footer.studio-footer-clean .footer-dock-controls {
  gap: 6px;
}

.studio-footer .dock-btn-private-chat {
  width: 116px !important;
  min-width: 116px !important;
  height: var(--console-btn-h) !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  justify-content: center;
  flex-shrink: 0;
}

/* Botón Ajustes: solo ícono, misma altura y forma rectangular redondeada que la consola */
.studio-footer .dock-btn.dock-btn-compact.dock-btn-studio-settings {
  width: var(--console-btn-h) !important;
  min-width: var(--console-btn-h) !important;
  height: var(--console-btn-h) !important;
  padding: 0 !important;
  justify-content: center;
  flex-shrink: 0;
}

/* Subgrupo Mezcladora: los 5 botones (Video, Audioclips, Audio pantalla, Invitados, Música MP3) del mismo tamaño en reposo */
.inline-audio-mixer {
  gap: 6px;
  height: var(--console-btn-h);
}

.inline-audio-mixer .mixer-item,
#gv-audioclips-bar {
  height: var(--console-btn-h) !important;
  min-width: 116px;
  max-width: 116px;
  padding: 0 10px !important;
  margin-left: 0 !important;
  font-size: 11px !important;
  justify-content: center;
  box-sizing: border-box !important;
  transition:
    max-width 0.18s cubic-bezier(0.2, 0, 0, 1),
    var(--console-transition) !important;
}

.inline-audio-mixer .mixer-item:hover,
.inline-audio-mixer .mixer-item:focus-within,
.inline-audio-mixer .mixer-item.is-expanded,
.inline-audio-mixer .mixer-item.is-active {
  justify-content: flex-start;
}

.inline-audio-mixer #mixer-item-video:hover,
.inline-audio-mixer #mixer-item-video:focus-within,
.inline-audio-mixer #mixer-item-video.is-expanded,
.inline-audio-mixer #mixer-item-video.is-active {
  max-width: 310px;
}

.inline-audio-mixer #mixer-item-screen:hover,
.inline-audio-mixer #mixer-item-screen:focus-within,
.inline-audio-mixer #mixer-item-screen.is-expanded,
.inline-audio-mixer #mixer-item-screen.is-active {
  max-width: 270px;
}

.inline-audio-mixer #mixer-item-guests:hover,
.inline-audio-mixer #mixer-item-guests:focus-within,
.inline-audio-mixer #mixer-item-guests.is-expanded,
.inline-audio-mixer #mixer-item-guests.is-active {
  max-width: 270px;
}

.inline-audio-mixer #mixer-item-music:hover,
.inline-audio-mixer #mixer-item-music:focus-within,
.inline-audio-mixer #mixer-item-music.is-expanded,
.inline-audio-mixer #mixer-item-music.is-active {
  max-width: 340px;
}

.inline-audio-mixer .mixer-item.is-active .mixer-inline-expanded {
  display: inline-flex;
}

.inline-audio-mixer .mixer-item.is-expanded .mixer-tab-btn,
.inline-audio-mixer .mixer-item.is-active .mixer-tab-btn,
#gv-audioclips-bar.is-active #gv-ac-label,
#gv-audioclips-bar.is-expanded #gv-ac-label {
  color: var(--console-emerald-active-text) !important;
}

.inline-audio-mixer .mixer-item:not(.is-expanded):not(.is-active) .mixer-tab-btn {
  color: var(--console-graphite-text);
}

.inline-audio-mixer .mixer-item:hover:not(.is-expanded):not(.is-active) .mixer-tab-btn {
  color: #f1f5f9;
}

#gv-audioclips-bar:hover,
#gv-audioclips-bar.is-expanded,
#gv-audioclips-bar.is-active {
  max-width: 280px;
  justify-content: flex-start;
}

#gv-audioclips-bar #gv-ac-label {
  font-size: 11px !important;
  font-weight: 600 !important;
}

/* Subgrupo Participantes derecha del footer (Fuentes / Invitados en guest.html) */
.footer-participants .restream-participants-trigger,
.footer-participants .restream-guests-trigger {
  min-width: 142px !important;
  height: var(--console-btn-h) !important;
  padding: 0 10px !important;
  justify-content: center;
}

.footer-participants .restream-avatar-circle {
  width: 22px;
  height: 22px;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1.5px var(--console-graphite-bg);
}

.footer-participants .restream-trigger-label {
  color: inherit;
}

.footer-participants .restream-trigger-count {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.footer-participants .restream-participants-trigger.is-open .restream-trigger-count,
.footer-participants .restream-guests-trigger.is-open .restream-trigger-count {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(16, 185, 129, 0.6);
  color: #a7f3d0;
}

.footer-participants .restream-trigger-chevron {
  color: inherit;
  opacity: 0.78;
}

/* Grupo 2: Controles de dispositivos bajo el lienzo (Mic, Cámara, Espejo / Salir) */
.stage-controls-group > .dock-btn,
.stage-controls-group .dock-mic-cluster > .dock-btn {
  min-width: 136px !important;
  height: var(--console-btn-h) !important;
  padding: 0 12px !important;
  justify-content: center;
}

.dock-mic-cluster {
  border-radius: var(--console-btn-radius) !important;
  background: #171a20 !important;
  border: 1px solid var(--console-graphite-border) !important;
}

/* Grupo 3: Plantillas de grilla (Trans. escena + 1·Entera .. Invitados) */
.layout-btn-group .btn-layout-opt,
.layout-btn-group #gv-trans-escena-btn {
  min-width: 102px !important;
  height: var(--console-btn-h) !important;
  padding: 0 10px !important;
  justify-content: center;
}

/* Grupo 4: Rail vertical derecho (todos exactamente iguales) */
.right-icon-rail {
  background: #16191e;
}

.right-icon-rail .rail-icon-btn {
  width: 46px !important;
  height: 46px !important;
  border-radius: var(--console-btn-radius) !important;
  background: var(--console-graphite-bg) !important;
  border: 1px solid var(--console-graphite-border) !important;
  color: var(--console-graphite-text) !important;
  transition: var(--console-transition) !important;
}

/* Grupo 5: Header superior (ajustado a forma rectangular redondeada y paleta grafito/esmeralda) */
.topbar .btn-stream {
  border-radius: var(--console-btn-radius) !important;
  height: var(--console-btn-h) !important;
  background: var(--console-graphite-bg) !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  color: #e2e8f0 !important;
  transition: var(--console-transition) !important;
}

.topbar .btn-stream:hover:not(:disabled) {
  background: var(--console-graphite-bg-hover) !important;
  border-color: #10b981 !important;
  box-shadow: var(--console-emerald-hover-glow) !important;
}

.topbar .btn-stream.is-live {
  background: #b91c1c !important;
  border-color: #f87171 !important;
  color: #ffffff !important;
}

.topbar .btn-stream.is-connecting {
  background: #b45309 !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
}

.topbar .btn-header-gear {
  width: var(--console-btn-h) !important;
  height: var(--console-btn-h) !important;
}

/* Botón + Agregar escena en panel izquierdo */
.btn-add-scene {
  height: var(--console-btn-h);
  border-radius: var(--console-btn-radius);
  background: var(--console-graphite-bg);
  border: 1px solid var(--console-graphite-border);
  color: var(--console-graphite-text);
  transition: var(--console-transition);
}

.btn-add-scene:hover {
  filter: none;
  transform: none;
  background: var(--console-graphite-bg-hover);
  border-color: var(--console-emerald-hover-border);
  color: #f8fafc;
  box-shadow: var(--console-emerald-hover-glow);
}

/* =========================================================================
   CUBIERTA SUPERIOR UNIFICADA (VENTANA PRINCIPAL index.html)
   Fusión visual de barra nativa de ventana + header .studio-header
   ========================================================================= */
.app-shell.has-unified-top-cover {
  --header-h: 36px;
}

.topbar.studio-header.topbar-unified-cover {
  position: relative;
  height: var(--header-h);
  padding: 0 clamp(148px, calc(100vw - env(titlebar-area-width, calc(100vw - 144px)) + 10px), 192px) 0 12px;
  background: #1f232b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  overflow: hidden;
  -webkit-app-region: drag;
  user-select: none;
}

.topbar.studio-header.topbar-unified-cover .header-left {
  gap: 10px;
  height: 100%;
}

.topbar.studio-header.topbar-unified-cover .top-cover-reveal {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  visibility: visible;
  -webkit-app-region: no-drag;
}

.topbar.studio-header.topbar-unified-cover .topbar-right button,
.topbar.studio-header.topbar-unified-cover .topbar-right .live-status {
  -webkit-app-region: no-drag;
}

.topbar.studio-header.topbar-unified-cover .live-status {
  background: #171b22;
  border-color: rgba(255, 255, 255, 0.09);
}

/* =========================================================================
   CONSOLA INFERIOR UNIFICADA CON TAPA ABATIBLE INTEGRADA (DEBAJO DEL LIENZO)
   Unifica #multiview-panel (.stage-controls-bar) + .studio-footer en una
   sola consola fija gris grafito de extremo a extremo con tapa abatible
   y silueta minimalista del gato centrada (solo index.html)
   ========================================================================= */
.app-shell.has-unified-bottom-console {
  --footer-h: 102px;
  --stage-aspect-w: 16;
  --stage-aspect-h: 9;
  --stage-preview-scale: 0.78;
  grid-template-areas:
    "header header header"
    "left center right"
    "left footer right";
}

/* Eliminar el marco falso duplicado detrás del lienzo y centrar la vista previa compacta */
.app-shell.has-unified-bottom-console .stage-center-frame {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
}

/* Escala visual compacta del lienzo de vista previa (~78% del espacio disponible, 16:9 exacto y adaptable) */
.app-shell.has-unified-bottom-console .scene-canvas-wrapper {
  width: min(
    calc(100cqw * var(--stage-preview-scale)),
    calc(100cqh * var(--stage-preview-scale) * var(--stage-aspect-w) / var(--stage-aspect-h))
  );
  height: auto;
  max-width: calc(100cqw * var(--stage-preview-scale));
  max-height: calc(100cqh * var(--stage-preview-scale));
  margin: auto;
  aspect-ratio: var(--stage-aspect-w) / var(--stage-aspect-h);
  transition: width 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Adaptación automática cuando se seleccione formato vertical 9:16 */
.app-shell.has-unified-bottom-console .scene-canvas-wrapper.is-vertical,
.app-shell.has-unified-bottom-console .scene-canvas-wrapper[data-aspect="9:16"],
.app-shell.has-unified-bottom-console .scene-canvas-wrapper[data-format="vertical"],
.app-shell.has-unified-bottom-console[data-canvas-format="vertical"] .scene-canvas-wrapper,
body.is-vertical-format .app-shell.has-unified-bottom-console .scene-canvas-wrapper {
  --stage-aspect-w: 9;
  --stage-aspect-h: 16;
}

.studio-footer.studio-footer-clean.unified-bottom-console {
  position: relative;
  grid-area: footer;
  justify-self: center;
  align-self: start;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  /* Mantiene el ancho y posición originales exactos de la consola, la tapa y los botones,
     desacoplándolos del tamaño reducido (78%) del lienzo de vista previa */
  width: min(calc(100% - 32px), calc((100dvh - 198px) * var(--stage-aspect-w) / var(--stage-aspect-h)));
  max-width: calc(100% - 32px);
  height: calc(var(--footer-h) - 6px);
  padding: 0;
  background: #1d2129;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: visible;
  perspective: 1100px;
  perspective-origin: 50% 0%;
  z-index: 30;
}

/* Cuerpo único que unifica ambas franjas sin bordes duplicados ni separaciones */
.studio-footer.unified-bottom-console .unified-console-controls {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  width: 100%;
  margin-left: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.28s ease 0.06s;
}

.studio-footer.unified-bottom-console.is-console-open .unified-console-controls {
  opacity: 1;
  pointer-events: auto;
}

/* Tapa física gris grafito de punta a punta del lienzo que se levanta como una tapa */
.studio-footer.unified-bottom-console .console-lid-surface {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #272c36 0%, #1e232b 100%);
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.32);
  transform-origin: center top;
  transform: rotateX(0deg);
  opacity: 1;
  backface-visibility: hidden;
  pointer-events: auto;
  will-change: transform, opacity, border-color, box-shadow;
  transition:
    transform 0.54s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.34s ease 0.04s,
    border-color 0.32s ease,
    box-shadow 0.36s ease;
}

/* Iluminación sincronizada de los 4 bordes de la tapa en verde esmeralda al activar el botón central */
.studio-footer.unified-bottom-console .console-lid-surface.is-lid-illuminated,
.studio-footer.unified-bottom-console .console-lid-surface:has(.console-lid-toggle:hover),
.studio-footer.unified-bottom-console.is-console-open .console-lid-surface {
  border-color: rgba(16, 185, 129, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(52, 211, 153, 0.55),
    inset 0 0 24px rgba(16, 185, 129, 0.28),
    0 0 24px rgba(16, 185, 129, 0.38);
}

.studio-footer.unified-bottom-console.is-console-open .console-lid-surface {
  transform: rotateX(88deg);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.36s ease 0.29s,
    border-color 0.22s ease,
    box-shadow 0.26s ease;
}

/* Botón táctil circular centrado exactamente en la tapa (fondo transparente, grafito en reposo) */
.studio-footer.unified-bottom-console .console-lid-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #545e6f;
  cursor: pointer;
  outline: none;
  transition:
    color 0.2s ease,
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.studio-footer.unified-bottom-console .console-lid-cat-svg {
  display: block;
  width: 70px;
  height: 70px;
  overflow: visible;
  filter: none;
  transition:
    filter 0.22s ease,
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Iluminación fluida en verde esmeralda del rostro felino y su círculo al pasar el cursor */
.studio-footer.unified-bottom-console .console-lid-toggle:hover,
.studio-footer.unified-bottom-console .console-lid-toggle:focus-visible,
.studio-footer.unified-bottom-console .console-lid-surface.is-lid-illuminated .console-lid-toggle,
.studio-footer.unified-bottom-console.is-console-open .console-lid-toggle {
  color: #34d399;
}

.studio-footer.unified-bottom-console .console-lid-toggle:hover .console-lid-cat-svg,
.studio-footer.unified-bottom-console .console-lid-toggle:focus-visible .console-lid-cat-svg,
.studio-footer.unified-bottom-console .console-lid-surface.is-lid-illuminated .console-lid-cat-svg,
.studio-footer.unified-bottom-console.is-console-open .console-lid-cat-svg {
  filter:
    drop-shadow(0 0 6px rgba(16, 185, 129, 0.82))
    drop-shadow(0 0 16px rgba(16, 185, 129, 0.48))
    drop-shadow(0 0 26px rgba(16, 185, 129, 0.22));
}

/* Fila superior reutilizada (#multiview-panel): integrada sin caja ni borde propio */
.studio-footer.unified-bottom-console .stage-controls-bar.unified-console-row-top {
  width: 100%;
  max-width: none;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 34px;
}

.studio-footer.unified-bottom-console .stage-controls-bar.unified-console-row-top .stage-controls-sep {
  display: none;
}

.studio-footer.unified-bottom-console .stage-controls-bar.unified-console-row-top .stage-controls-group,
.studio-footer.unified-bottom-console .stage-controls-bar.unified-console-row-top .layout-btn-group {
  flex-wrap: nowrap;
  min-width: 0;
}

/* Fila inferior reutilizada (dock + mezcladora + fuentes): misma superficie continua */
.studio-footer.unified-bottom-console .unified-console-row-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 34px;
}

/* =========================================================================
   CONTROL DE MICRÓFONO COMPACTO CON MEDIDOR INTEGRADO Y PANEL DESPLEGABLE
   Misma altura y ancho que los demás botones de la consola (solo index.html)
   ========================================================================= */
.studio-footer.unified-bottom-console .dock-mic-cluster {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--console-btn-h) !important;
  min-width: 136px;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: var(--console-btn-radius) !important;
  flex-shrink: 0;
}

.studio-footer.unified-bottom-console .dock-mic-cluster > #btn-toggle-mic-preview {
  position: relative;
  width: 100%;
  min-width: 136px !important;
  height: var(--console-btn-h) !important;
  padding: 0 12px 4px !important;
  justify-content: center;
}

/* Medidor de nivel integrado dentro del botón de micrófono */
.studio-footer.unified-bottom-console .mic-btn-meter-track {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 3px;
  height: 3px;
  border-radius: 999px;
  background: rgba(8, 12, 16, 0.78);
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.studio-footer.unified-bottom-console .mic-btn-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981 0%, #34d399 60%, #eab308 82%, #ef4444 100%);
  transition: width 0.05s ease-out;
}

/* Panel desplegable hacia arriba al pasar el cursor sobre el botón de micrófono */
.studio-footer.unified-bottom-console .mic-hover-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 236px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1b2028;
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(16, 185, 129, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 70;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0.2s;
}

/* Puente invisible para desplazar el cursor del botón al panel sin cerrarlo */
.studio-footer.unified-bottom-console .mic-hover-popover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.studio-footer.unified-bottom-console.is-console-open .dock-mic-cluster:hover .mic-hover-popover,
.studio-footer.unified-bottom-console.is-console-open .dock-mic-cluster:focus-within .mic-hover-popover,
.studio-footer.unified-bottom-console.is-console-open .dock-mic-cluster.is-mic-dragging .mic-hover-popover {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 0.18s ease,
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.studio-footer.unified-bottom-console .mic-popover-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.studio-footer.unified-bottom-console .mic-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.studio-footer.unified-bottom-console .mic-popover-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #cbd5e1;
}

.studio-footer.unified-bottom-console .mic-popover-head .vu-db,
.studio-footer.unified-bottom-console .mic-popover-head .mic-gain-readout {
  font-size: 10.5px;
  font-family: Consolas, monospace;
  font-weight: 600;
  color: #6ee7b7;
  min-width: 34px;
  text-align: right;
}

.studio-footer.unified-bottom-console .mic-hover-popover .stage-vu-floating {
  display: flex;
  width: 100%;
}

.studio-footer.unified-bottom-console .mic-hover-popover .vu-track {
  width: 100%;
  height: 8px;
  background: #10141b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.studio-footer.unified-bottom-console .mic-hover-popover .vu-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 58%, #eab308 82%, #ef4444 100%);
}

.studio-footer.unified-bottom-console .mic-hover-popover .dock-mic-gain {
  display: flex;
  width: 100%;
}

.studio-footer.unified-bottom-console .mic-hover-popover .dock-mic-gain input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 0;
  accent-color: #10b981;
  cursor: pointer;
}

/* =========================================================================
   PANELES DESPLEGABLES HACIA ARRIBA PARA LOS 5 BOTONES DE LA MEZCLADORA
   (Video, Audioclips, Audio pantalla, Invitados, Música MP3 · solo index.html)
   Los botones mantienen su posición y tamaño fijos; sus paneles abren hacia arriba
   ========================================================================= */
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item:not(.is-custom-pos),
.studio-footer.unified-bottom-console .inline-audio-mixer #gv-audioclips-bar:not(.is-custom-pos) {
  position: relative !important;
}

.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item,
.studio-footer.unified-bottom-console .inline-audio-mixer #gv-audioclips-bar,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music.is-active,
.studio-footer.unified-bottom-console #gv-audioclips-bar:hover,
.studio-footer.unified-bottom-console #gv-audioclips-bar:focus-within,
.studio-footer.unified-bottom-console #gv-audioclips-bar.is-expanded,
.studio-footer.unified-bottom-console #gv-audioclips-bar.is-active {
  overflow: visible !important;
  width: 116px !important;
  min-width: 116px !important;
  max-width: 116px !important;
  justify-content: center !important;
}

.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer .mixer-item:hover,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer .mixer-item.is-mixer-dragging {
  z-index: 75 !important;
}

/* Asegurar que Audioclips quede por delante de #gv-trans-escena-control (z-index: 9999) */
.studio-footer.unified-bottom-console.is-console-open #gv-audioclips-bar:hover,
.studio-footer.unified-bottom-console.is-console-open #gv-audioclips-bar.is-mixer-dragging {
  z-index: 10050 !important;
}

/* Paneles de Video, Audio pantalla, Invitados y Música MP3 abriendo hacia arriba SOLO con hover */
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item .mixer-inline-expanded {
  position: absolute !important;
  left: 50%;
  bottom: calc(100% + 8px);
  display: none !important;
  align-items: center;
  gap: 7px;
  margin-left: 0 !important;
  padding: 8px 10px !important;
  border-radius: 9px;
  background: #1b2028;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(16, 185, 129, 0.14);
  z-index: 80;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(0);
  pointer-events: none;
  visibility: hidden;
}

/* Puente invisible para pasar el cursor desde el botón al panel superior sin cerrarlo */
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item .mixer-inline-expanded::after,
.studio-footer.unified-bottom-console #gv-audioclips-bar #gv-ac-controls::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer .mixer-item:hover .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer .mixer-item.is-mixer-dragging .mixer-inline-expanded {
  display: inline-flex !important;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
  visibility: visible;
}

/* Panel de Audioclips (#gv-ac-controls) abriendo hacia arriba SOLO con hover, por delante de Trans. escena */
.studio-footer.unified-bottom-console #gv-audioclips-bar #gv-ac-controls {
  position: absolute !important;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  display: none !important;
  align-items: center;
  padding: 8px 10px !important;
  border-radius: 9px;
  background: #1b2028;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(16, 185, 129, 0.14);
  z-index: 10060 !important;
  white-space: nowrap;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.studio-footer.unified-bottom-console.is-console-open #gv-audioclips-bar:hover #gv-ac-controls,
.studio-footer.unified-bottom-console.is-console-open #gv-audioclips-bar.is-mixer-dragging #gv-ac-controls {
  display: inline-flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  z-index: 10060 !important;
}

/* Ocultar completamente los 5 paneles si la tapa de la consola está cerrada */
.studio-footer.unified-bottom-console:not(.is-console-open) .inline-audio-mixer .mixer-inline-expanded,
.studio-footer.unified-bottom-console:not(.is-console-open) #gv-audioclips-bar #gv-ac-controls {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* =========================================================================
   DISTRIBUCIÓN COMPACTA VERTICAL EXCLUSIVA PARA EL PANEL DE AUDIO DE VIDEO
   (#mixer-item-video · sin modificar ningún otro panel ni botón)
   ========================================================================= */
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-video:hover,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-video.is-mixer-dragging {
  z-index: 10040 !important;
}

.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-video:hover .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-video.is-mixer-dragging .mixer-inline-expanded {
  display: grid !important;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 7px;
  width: 118px;
  padding: 8px 9px !important;
  z-index: 10045 !important;
}

.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video #mixer-video-play {
  grid-column: 1;
  grid-row: 1;
}

.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video #mixer-video-mute {
  grid-column: 2;
  grid-row: 1;
}

.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video #mixer-video-val {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  min-width: 0;
}

.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video #mixer-video-vol {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
}

/* =========================================================================
   CONSOLA INFERIOR: TAMAÑO UNIFORME (REFERENCIA: TRANS. ESCENA) Y ARRASTRE
   Aplicado exclusivamente dentro de #studio-unified-console (solo index.html)
   ========================================================================= */
.studio-footer.unified-bottom-console {
  --console-uniform-btn-w: 112px;
  --console-uniform-btn-h: 34px;
}

/* Igualar exactamente ancho y alto de todos los botones de la consola inferior al de Trans. escena */
.studio-footer.unified-bottom-console .dock-mic-cluster,
.studio-footer.unified-bottom-console .dock-mic-cluster > #btn-toggle-mic-preview,
.studio-footer.unified-bottom-console .stage-controls-group > .dock-btn,
.studio-footer.unified-bottom-console #gv-trans-escena-control,
.studio-footer.unified-bottom-console #gv-trans-escena-btn,
.studio-footer.unified-bottom-console .layout-btn-group .btn-layout-opt,
.studio-footer.unified-bottom-console #btn-reset-screen-crop,
.studio-footer.unified-bottom-console .dock-btn-private-chat,
.studio-footer.unified-bottom-console .dock-btn.dock-btn-compact.dock-btn-studio-settings,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-video.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-screen.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-guests.is-active,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music:hover,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music:focus-within,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music.is-expanded,
.studio-footer.unified-bottom-console .inline-audio-mixer #mixer-item-music.is-active,
.studio-footer.unified-bottom-console #gv-audioclips-bar,
.studio-footer.unified-bottom-console #gv-audioclips-bar:hover,
.studio-footer.unified-bottom-console #gv-audioclips-bar:focus-within,
.studio-footer.unified-bottom-console #gv-audioclips-bar.is-expanded,
.studio-footer.unified-bottom-console #gv-audioclips-bar.is-active,
.studio-footer.unified-bottom-console .footer-participants .restream-participants-trigger {
  width: var(--console-uniform-btn-w) !important;
  min-width: var(--console-uniform-btn-w) !important;
  max-width: var(--console-uniform-btn-w) !important;
  height: var(--console-uniform-btn-h) !important;
  min-height: var(--console-uniform-btn-h) !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.studio-footer.unified-bottom-console #gv-trans-escena-control {
  margin: 0 !important;
}

/* Adaptación proporcionada de textos, íconos y paddings para que entren completos y centrados */
.studio-footer.unified-bottom-console .stage-controls-group > .dock-btn,
.studio-footer.unified-bottom-console .layout-btn-group .btn-layout-opt,
.studio-footer.unified-bottom-console #gv-trans-escena-btn,
.studio-footer.unified-bottom-console #btn-reset-screen-crop,
.studio-footer.unified-bottom-console .dock-btn-private-chat,
.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-item,
.studio-footer.unified-bottom-console #gv-audioclips-bar,
.studio-footer.unified-bottom-console .footer-participants .restream-participants-trigger {
  padding: 0 6px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  gap: 4px !important;
  justify-content: center !important;
  text-align: center;
  white-space: nowrap;
}

.studio-footer.unified-bottom-console .dock-mic-cluster > #btn-toggle-mic-preview {
  padding: 0 5px 4px !important;
  font-size: 9.5px !important;
  line-height: 1.1 !important;
  gap: 3px !important;
  letter-spacing: -0.01em;
}

.studio-footer.unified-bottom-console #btn-footer-cam-toggle {
  padding: 0 4px !important;
  font-size: 9.2px !important;
  letter-spacing: -0.015em;
}

.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-tab-btn {
  gap: 4px !important;
  font-size: 10px !important;
}

.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-tab-icon {
  font-size: 11.5px !important;
}

.studio-footer.unified-bottom-console .inline-audio-mixer .mixer-tab-title,
.studio-footer.unified-bottom-console #gv-audioclips-bar #gv-ac-label {
  font-size: 10px !important;
  letter-spacing: 0 !important;
}

.studio-footer.unified-bottom-console .dock-btn.dock-btn-compact.dock-btn-studio-settings {
  padding: 0 !important;
}

.studio-footer.unified-bottom-console .dock-btn.dock-btn-compact.dock-btn-studio-settings .dock-gear-svg {
  width: 16px;
  height: 16px;
}

.studio-footer.unified-bottom-console .footer-participants .restream-avatars-stack {
  gap: 0;
}

.studio-footer.unified-bottom-console .footer-participants .restream-avatar-circle {
  width: 18px !important;
  height: 18px !important;
  font-size: 9px !important;
}

.studio-footer.unified-bottom-console .footer-participants .restream-trigger-meta {
  gap: 4px !important;
}

.studio-footer.unified-bottom-console .footer-participants .restream-trigger-label {
  font-size: 10px !important;
}

.studio-footer.unified-bottom-console .footer-participants .restream-trigger-count {
  font-size: 9.5px !important;
  padding: 1px 5px !important;
}

.studio-footer.unified-bottom-console .footer-participants .restream-trigger-chevron {
  font-size: 9.5px !important;
}

/* Distribución libre arrastrable dentro de la consola inferior (sin mover nodos DOM ni romper eventos) */
#studio-unified-console #unified-console-controls .gv-console-draggable.is-custom-pos,
#studio-unified-console #unified-console-controls #mixer-item-screen.is-custom-pos,
#studio-unified-console #unified-console-controls #mixer-item-screen.is-custom-pos:hover,
#studio-unified-console #unified-console-controls #mixer-item-guests.is-custom-pos,
#studio-unified-console #unified-console-controls #mixer-item-guests.is-custom-pos:hover,
#studio-unified-console #unified-console-controls #mixer-item-music.is-custom-pos,
#studio-unified-console #unified-console-controls #mixer-item-music.is-custom-pos:hover {
  position: absolute !important;
  left: var(--btn-x, 0px) !important;
  top: var(--btn-y, 0px) !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
}

/* Mantener los desplegables de Pantalla, Invitados (audio) y Música MP3 estables y por delante al abrir */
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-screen:hover,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-screen.is-mixer-dragging,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-guests:hover,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-guests.is-mixer-dragging,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-music:hover,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-music.is-mixer-dragging {
  z-index: 10040 !important;
}

.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-screen:hover .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-screen.is-mixer-dragging .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-guests:hover .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-guests.is-mixer-dragging .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-music:hover .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-console-open .inline-audio-mixer #mixer-item-music.is-mixer-dragging .mixer-inline-expanded {
  z-index: 10045 !important;
}

.studio-footer.unified-bottom-console.is-console-open .unified-console-controls .gv-console-draggable {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.studio-footer.unified-bottom-console.is-console-open .unified-console-controls .gv-console-draggable.is-btn-dragging {
  cursor: grabbing !important;
  z-index: 10100 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55) !important;
}

/* Ocultar desplegables únicamente mientras se está arrastrando activamente un botón */
.studio-footer.unified-bottom-console.is-dragging-any-btn .mic-hover-popover,
.studio-footer.unified-bottom-console.is-dragging-any-btn .mixer-inline-expanded,
.studio-footer.unified-bottom-console.is-dragging-any-btn #gv-ac-controls,
.studio-footer.unified-bottom-console.is-dragging-any-btn #gv-trans-escena-menu {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* =========================================================================
   PANELES DESPLEGABLES FLOTANTES (DERECHA) + HOVER ESMERALDA EN RAIL DERECHO
   No comprimen ni desplazan el lienzo de vista previa ni la consola inferior
   ========================================================================= */
.right-tools-area {
  width: var(--rail-w, 58px);
  min-width: var(--rail-w, 58px);
  overflow: visible;
  z-index: 40;
}

.right-icon-rail {
  position: relative;
  z-index: 52;
}

.right-drawer {
  position: fixed;
  top: var(--header-h, 36px);
  right: var(--rail-w, 58px);
  bottom: var(--footer-h, 102px);
  height: auto;
  width: 320px;
  max-width: calc(100vw - var(--rail-w, 58px) - 16px);
  z-index: 48;
  background: var(--bg-surface, #16191e);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 10px;
  box-shadow: -14px 4px 32px rgba(0, 0, 0, 0.52), -2px 0 10px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateX(18px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, visibility 0.2s ease;
}

.right-drawer.is-open {
  width: 320px;
  border-left-width: 1px;
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.right-drawer .drawer-scroll-body {
  width: 100%;
  padding: 10px 12px 14px;
}

.right-drawer [data-drawer-panel="graficos"] .graphics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

/* Hover verde esmeralda delicado en todos los botones de la barra vertical derecha */
.right-icon-rail .rail-icon-btn {
  transition: all 0.2s ease !important;
}

.right-icon-rail .rail-icon-btn:hover:not(.is-active):not(.active) {
  background: #242a34 !important;
  border-color: rgba(16, 185, 129, 0.68) !important;
  color: #f1f5f9 !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.18), 0 0 10px rgba(16, 185, 129, 0.22) !important;
}

/* Estado activo bien diferenciado del estado hover */
.right-icon-rail .rail-icon-btn.is-active,
.right-icon-rail .rail-icon-btn.active {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  color: #d1fae5 !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.32), 0 0 14px rgba(16, 185, 129, 0.28) !important;
}

.right-icon-rail .rail-icon-btn.is-active:hover,
.right-icon-rail .rail-icon-btn.active:hover {
  background: rgba(16, 185, 129, 0.28) !important;
  border-color: #34d399 !important;
  color: #ecfdf5 !important;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.36), 0 0 16px rgba(16, 185, 129, 0.32) !important;
}

/* =========================================================================
   BOTÓN "REC" EN BARRA SUPERIOR + SEPARADOR + AVISO DE GRABACIÓN GUARDADA
   ========================================================================= */
@keyframes recDotPulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.85);
  }
  50% {
    opacity: 0.28;
    box-shadow: 0 0 2px rgba(239, 68, 68, 0.25);
  }
}

.topbar.studio-header #btn-record-toggle.btn-rec-header {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  align-self: center !important;
  width: fit-content !important;
  height: 22px !important;
  min-height: 0 !important;
  min-width: 0 !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  gap: 5px !important;
  background: #171b22;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  -webkit-app-region: no-drag;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.topbar.studio-header #btn-record-toggle.btn-rec-header:hover:not(:disabled) {
  background: #212731;
  border-color: rgba(239, 68, 68, 0.55);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.18);
}

.topbar.studio-header #btn-record-toggle.btn-rec-header:disabled {
  opacity: 0.6;
  cursor: wait;
}

.topbar.studio-header #btn-record-toggle.btn-rec-header .rec-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #ef4444;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.55);
}

.topbar.studio-header #btn-record-toggle.btn-rec-header .rec-timer {
  font-family: Consolas, monospace;
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fecaca;
  padding-left: 2px;
}

.topbar.studio-header #btn-record-toggle.btn-rec-header.is-recording {
  background: rgba(127, 29, 29, 0.34);
  border-color: rgba(239, 68, 68, 0.72);
  color: #fee2e2;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.22), 0 0 12px rgba(239, 68, 68, 0.24);
}

.topbar.studio-header #btn-record-toggle.btn-rec-header.is-recording .rec-dot {
  animation: recDotPulse 1.15s ease-in-out infinite;
}

/* Separador vertical sutil con margen amplio (~30px total) para evitar clics accidentales */
.topbar-rec-divider {
  display: inline-block;
  width: 1px;
  height: 16px;
  margin: 0 11px 0 11px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
  pointer-events: none;
}

/* Aviso breve de confirmación de grabación guardada */
.rec-saved-toast {
  position: fixed;
  top: calc(var(--header-h, 36px) + 12px);
  right: calc(var(--rail-w, 58px) + 14px);
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 390px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #171c23;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  color: #e2e8f0;
  animation: recToastIn 0.2s ease;
}

.rec-saved-toast[hidden] {
  display: none !important;
}

@keyframes recToastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rec-saved-toast-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.rec-saved-toast-info strong {
  font-size: 12px;
  color: #6ee7b7;
}

.rec-saved-toast-info span {
  font-size: 10.5px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-saved-toast-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-rec-open-folder {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.18);
  color: #d1fae5;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.btn-rec-open-folder:hover {
  background: rgba(16, 185, 129, 0.32);
  border-color: #34d399;
  color: #ffffff;
}

.btn-rec-toast-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #94a3b8;
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.btn-rec-toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* =========================================================================
   REDISEÑO DE FUENTES DE ESCENA: VIDRIO GRUESITO GRAFITO, COMPACTO Y NÍTIDO
   CSS ligero (sin backdrop-filter blur, sin animaciones permanentes, sin verde)
   ========================================================================= */

/* 1. PANEL LATERAL: TARJETAS COMPACTAS CON ESTÉTICA DE VIDRIO GRUESITO GRIS GRAFITO */
.left-scenes-panel .scenes-list {
  padding: 6px 6px 12px;
  gap: 6px;
}

.left-scenes-panel .scenes-count-badge {
  background: rgba(82, 87, 97, 0.24);
  border-color: #525761;
  color: #d8dee9;
}

.left-scenes-panel .scene-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 5px 5px;
  border-radius: 9px !important;
  /* Vidrio translúcido con reflejo superior sutil (cero blur) */
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(50, 55, 65, 0.44) 24%,
    rgba(21, 24, 30, 0.72) 100%
  ) !important;
  /* Canto gruesito gris grafito (#3c4048 / #525761) con espesor real biselado */
  border: 2px solid #3c4048 !important;
  border-top-color: #525761 !important;
  border-left-color: #494e58 !important;
  border-right-color: #3c4048 !important;
  border-bottom-color: #2c3038 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 2px 3px rgba(255, 255, 255, 0.05),
    inset 0 -2px 0 rgba(8, 10, 14, 0.56),
    0 4px 10px rgba(0, 0, 0, 0.44),
    0 1px 0 rgba(82, 87, 97, 0.24) !important;
  color: #e6ebf2 !important;
  overflow: hidden;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

/* Reflejo superior sutil de cristal */
.left-scenes-panel .scene-card::before {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 0;
  height: 28%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 2;
}

.left-scenes-panel .scene-card:hover {
  border-color: #525761 !important;
  border-top-color: #676d79 !important;
  border-left-color: #585e69 !important;
  border-bottom-color: #353942 !important;
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(58, 64, 75, 0.48) 24%,
    rgba(25, 29, 36, 0.74) 100%
  ) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -2px 0 rgba(8, 10, 14, 0.52),
    0 6px 14px rgba(0, 0, 0, 0.48),
    0 1px 0 rgba(103, 109, 121, 0.32) !important;
}

/* Estado activo: mismo cristal gruesito grafito elevado, sin sumar tonos verdes */
.left-scenes-panel .scene-card.is-active {
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.17) 0%,
    rgba(66, 72, 84, 0.54) 24%,
    rgba(28, 32, 40, 0.8) 100%
  ) !important;
  border: 2px solid #525761 !important;
  border-top-color: #7c8391 !important;
  border-left-color: #666c78 !important;
  border-right-color: #525761 !important;
  border-bottom-color: #3c4048 !important;
  color: #f8fafc !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 2px 5px rgba(255, 255, 255, 0.08),
    inset 0 -2px 0 rgba(10, 12, 16, 0.62),
    0 0 0 1px rgba(130, 138, 152, 0.42),
    0 7px 16px rgba(0, 0, 0, 0.52) !important;
}

/* Miniatura compacta y nítida (altura reducida sin deformar ni ensanchar) */
.left-scenes-panel .scene-mini-preview {
  position: relative;
  width: 100%;
  height: 66px;
  aspect-ratio: auto;
  padding: 0;
  display: block;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(82, 87, 97, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, rgba(22, 25, 32, 0.94) 0%, rgba(13, 16, 22, 0.98) 100%);
}

/* Esquemas geométricos sobrios en gris grafito (sin miniaturas de cámara ni tonos verdes) */
.left-scenes-panel .scene-mini-schematic {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  pointer-events: none;
}

.left-scenes-panel .scene-mini-box {
  display: block;
  box-sizing: border-box;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(44, 49, 58, 0.34) 100%);
  border: 1px solid #494f5b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.35);
}

.left-scenes-panel .scene-mini-box.is-filled {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(64, 70, 82, 0.5) 100%);
  border-color: #6b7382;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Escena 1: 1 cuadradito centrado */
.left-scenes-panel .scene-mini-schematic.is-tpl-1 {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
}

.left-scenes-panel .scene-mini-schematic.is-tpl-1 .scene-mini-box.is-single {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

/* Escena 2: 2 cuadraditos bien acomodados lado a lado */
.left-scenes-panel .scene-mini-schematic.is-tpl-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 9px 12px;
}

/* Escena 3: 2 cuadraditos arriba + 1 centrado abajo */
.left-scenes-panel .scene-mini-schematic.is-tpl-3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 6px 12px;
}

.left-scenes-panel .scene-mini-schematic.is-tpl-3 .scene-mini-box.is-third-center {
  grid-column: 1 / -1;
  width: 50%;
  justify-self: center;
}

/* Escena 4: 4 cuadraditos en grilla 2x2 */
.left-scenes-panel .scene-mini-schematic.is-tpl-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 6px 12px;
}

/* Escena 5 (Reacciones): fondo sutil + rectángulo chiquito a la izquierda y otro a la derecha */
.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-bg {
  position: absolute;
  inset: 5px 8px;
  border-radius: 4px;
  background: rgba(24, 28, 36, 0.56);
  border: 1px dashed #3e434d;
  box-shadow: none;
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-bg.is-filled {
  background: rgba(44, 49, 59, 0.44);
  border-style: solid;
  border-color: #545b68;
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-left,
.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-right {
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 21%;
  z-index: 2;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(52, 58, 69, 0.72) 100%);
  border: 1px solid #5f6674;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 5px rgba(0, 0, 0, 0.55);
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-left {
  left: 12px;
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-right {
  right: 12px;
}

/* Escena Invitados (en reposo sin invitados presentes): columna lateral + 2 fuentes arriba + visor abajo */
.left-scenes-panel .scene-mini-schematic.is-tpl-guests {
  display: flex;
  align-items: stretch;
  gap: 5px;
  padding: 6px 8px;
}

.left-scenes-panel .scene-mini-guests-col {
  width: 21%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.left-scenes-panel .scene-mini-guests-col .scene-mini-box.is-guest-slot {
  flex: 1;
  border-style: dashed;
  border-color: #464c58;
}

.left-scenes-panel .scene-mini-guests-col .scene-mini-box.is-guest-slot.is-filled {
  border-style: solid;
  border-color: #6b7382;
}

.left-scenes-panel .scene-mini-guests-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.left-scenes-panel .scene-mini-guests-cams {
  height: 38%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.left-scenes-panel .scene-mini-box.is-guest-visor {
  flex: 1;
}

.left-scenes-panel .scene-mini-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Píldora ACTIVA / AL AIRE neutra y compacta (sin verde) */
.left-scenes-panel .scene-mini-live-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(24, 28, 35, 0.84);
  border: 1px solid #525761;
  color: #e2e8f0;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.3;
  pointer-events: none;
}

.left-scenes-panel .scene-mini-live-pill.is-live {
  background: rgba(127, 29, 29, 0.88);
  border-color: rgba(248, 113, 113, 0.72);
  color: #fee2e2;
}

/* Presencia sutil de invitados en espera (solo en escena Invitados cuando hay invitados esperando) */
.left-scenes-panel .scene-mini-waiting-pill {
  position: absolute;
  right: 4px;
  top: 4px;
  max-width: calc(100% - 56px);
  z-index: 3;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(20, 23, 29, 0.86);
  border: 1px solid #525761;
  color: #cbd5e1;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Pie compacto con nombre editable directamente en la tarjeta */
.left-scenes-panel .scene-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 18px;
  padding: 0 1px;
  position: relative;
  z-index: 3;
}

.left-scenes-panel .scene-card-meta {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.left-scenes-panel .scene-card-name {
  font-size: 11px;
  font-weight: 650;
  color: #eef2f7;
  line-height: 1.25;
  padding: 1px 3px;
  margin-left: -3px;
  border-radius: 4px;
  cursor: text;
  min-width: 0;
  flex: 1 1 auto;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.left-scenes-panel .scene-card-name:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.left-scenes-panel .scene-card-name-input {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 11px;
  font-weight: 650;
  font-family: inherit;
  line-height: 1.25;
  color: #ffffff;
  background: rgba(15, 18, 23, 0.92);
  border: 1px solid #6b7280;
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: -3px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.left-scenes-panel .scene-card-sub {
  font-size: 8.8px;
  color: #9aa3b2;
  flex-shrink: 0;
  max-width: 44%;
}

.left-scenes-panel .scene-card-badges {
  gap: 3px;
  margin-top: -1px;
  position: relative;
  z-index: 3;
}

.left-scenes-panel .scene-mini-badge {
  font-size: 8px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(60, 64, 72, 0.5);
  border: 1px solid rgba(120, 128, 142, 0.38);
  color: #d1d5db;
}

.left-scenes-panel .scene-drag-grip {
  font-size: 10.5px;
  color: #6b7280;
  padding: 0 2px;
}

.left-scenes-panel .scene-card:hover .scene-drag-grip {
  color: #cbd5e1;
}

.left-scenes-panel .scene-card-delete {
  top: 7px;
  right: 7px;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: rgba(20, 23, 29, 0.82);
  border: 1px solid #525761;
  color: #cbd5e1;
  font-size: 10px;
}

/* 2. REORDENAMIENTO FLUIDO CON DESPLAZAMIENTO AUTOMÁTICO + ARRASTRE AL LIENZO */
.left-scenes-panel .scenes-list.is-reordering .scene-card {
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.16s ease;
  will-change: transform;
}

.left-scenes-panel .scene-card.is-dragging {
  opacity: 0.36;
  border-style: dashed !important;
  border-color: #6b7280 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
}

.left-scenes-panel .scene-card.drop-before::before,
.left-scenes-panel .scene-card.drop-after::after {
  display: none !important;
}

/* Indicador de soltado de escena sobre el lienzo (vidrio grafito sin verde ni blur) */
.scene-canvas-wrapper.is-scene-drop-target {
  box-shadow:
    inset 0 0 0 2px #6b7280,
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    0 0 0 2px rgba(82, 87, 97, 0.55),
    0 16px 40px rgba(0, 0, 0, 0.55) !important;
}

.scene-canvas-wrapper.is-scene-drop-target::after {
  content: "Soltá para cargar la escena y elegir cámaras";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 45;
  padding: 9px 16px;
  border-radius: 9px;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.14) 0%, rgba(36, 40, 48, 0.86) 30%, rgba(18, 21, 27, 0.92) 100%);
  border: 2px solid #525761;
  border-top-color: #7c8391;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 10px 26px rgba(0, 0, 0, 0.58);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}

/* Selector de ventanas de cámara dentro del modal al soltar escenas multicámara */
.camera-picker-slot-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(82, 87, 97, 0.45);
}

.camera-picker-slot-tab {
  padding: 5px 11px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(34, 38, 46, 0.82) 100%);
  border: 1.5px solid #3c4048;
  border-top-color: #525761;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.camera-picker-slot-tab:hover {
  border-color: #6b7280;
  color: #ffffff;
}

.camera-picker-slot-tab.is-current {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(62, 68, 79, 0.9) 100%);
  border-color: #7c8391;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.camera-picker-slot-tab.is-assigned:not(.is-current) {
  border-color: #525761;
  color: #e2e8f0;
}

/* 3. FUENTES DE ESCENA EN EL LIENZO: VIDRIO GRUESITO GRAFITO + CONTROLES SUTILES CON RETARDO */
#scene-slots-overlay .stage-slot-cell.is-empty:not(.is-lower-zone) {
  pointer-events: auto;
  /* Transparencia liviana que deja traslucir el fondo del lienzo sin tapar el contenido */
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.065) 0%,
    rgba(36, 40, 48, 0.18) 30%,
    rgba(16, 19, 24, 0.26) 100%
  );
  border: 2px solid #3c4048;
  border-top-color: #525761;
  border-left-color: #484d57;
  border-bottom-color: #2c3038;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 rgba(8, 10, 14, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.26);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#scene-slots-overlay .stage-slot-cell.is-empty:not(.is-lower-zone):hover {
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(40, 45, 54, 0.44) 28%,
    rgba(18, 21, 27, 0.56) 100%
  );
  border-color: #525761;
  border-top-color: #6f7684;
  border-bottom-color: #343841;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -2px 0 rgba(8, 10, 14, 0.5),
    0 8px 18px rgba(0, 0, 0, 0.36);
}

#scene-slots-overlay .stage-slot-cell.is-tv-split-2.is-empty:not(.is-lower-zone) {
  border-top-width: 2px;
}

/* Controles internos bien organizados, más separados entre sí, integrados en el vidrio con leve retardo al hover */
#scene-slots-overlay .slot-empty-picker {
  gap: 10px;
  padding: 12px;
  opacity: 0;
  transform: translateY(4px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.16s ease 0s, transform 0.16s ease 0s;
}

#scene-slots-overlay .stage-slot-cell.is-empty:hover .slot-empty-picker,
#scene-slots-overlay .stage-slot-cell.is-empty.is-hovered .slot-empty-picker {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  transition:
    opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1) 0.11s,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1) 0.11s;
}

#scene-slots-overlay .slot-empty-title {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
  color: #dbe2ec;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(24, 28, 34, 0.72) 100%);
  border: 1px solid #525761;
  border-radius: 7px;
  padding: 3px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

#scene-slots-overlay .slot-options-grid {
  gap: 9px 10px;
  max-width: 440px;
}

#scene-slots-overlay .slot-opt-btn {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(38, 43, 52, 0.72) 100%
  ) !important;
  color: #edf1f7 !important;
  border: 1px solid #525761 !important;
  border-bottom-color: #3c4048 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.3) !important;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.14s ease !important;
}

#scene-slots-overlay .slot-opt-btn:hover:not(:disabled) {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(58, 64, 76, 0.86) 100%
  ) !important;
  border-color: #7c8391 !important;
  color: #ffffff !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 4px 10px rgba(0, 0, 0, 0.38) !important;
  transform: translateY(-1px);
}

/* Overlay al pasar el mouse sobre fuentes cargadas: suave, con retardo y estética de vidrio grafito */
#scene-slots-overlay .slot-hover-overlay {
  padding: 8px 10px;
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(16, 19, 25, 0.62) 0%,
    rgba(16, 19, 25, 0.02) 32%,
    rgba(16, 19, 25, 0.02) 66%,
    rgba(16, 19, 25, 0.68) 100%
  );
  transition: opacity 0.16s ease 0s, transform 0.16s ease 0s;
}

#scene-slots-overlay .stage-slot-cell:hover .slot-hover-overlay,
#scene-slots-overlay .stage-slot-cell.is-hovered .slot-hover-overlay,
#scene-slots-overlay .stage-slot-cell.is-toolbar-pinned .slot-hover-overlay,
#scene-slots-overlay .stage-slot-cell.is-control-focused .slot-hover-overlay {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1) 0.11s,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1) 0.11s;
}

#scene-slots-overlay .slot-hover-bottom {
  gap: 8px;
  padding: 3px 0;
}

#scene-slots-overlay .slot-source-pill {
  color: #e6ebf2;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(24, 28, 34, 0.78) 100%);
  border: 1px solid #525761;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

#scene-slots-overlay .slot-mini-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(34, 38, 46, 0.78) 100%) !important;
  color: #e6ebf2 !important;
  border: 1px solid #525761 !important;
  border-bottom-color: #3c4048 !important;
  border-radius: 7px !important;
  padding: 4px 9px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 5px rgba(0, 0, 0, 0.28) !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

#scene-slots-overlay .slot-mini-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(56, 62, 74, 0.88) 100%) !important;
  border-color: #7c8391 !important;
  color: #ffffff !important;
}

#scene-slots-overlay .slot-mini-btn.is-danger:hover {
  background: rgba(185, 28, 28, 0.86) !important;
  border-color: rgba(248, 113, 113, 0.75) !important;
  color: #ffffff !important;
}

#scene-slots-overlay .stage-slot-cell.is-camera-clean-hover .slot-mini-btn.is-lower-third-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(28, 32, 40, 0.8) 100%) !important;
  border: 1px solid #525761 !important;
  color: #e6ebf2 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 12px rgba(0, 0, 0, 0.42) !important;
}

/* En Vista 2 (cámara izquierda), ubicar el botón Nombre/Zócalo abajo a la izquierda para no cruzarse con la zona inferior central */
#scene-slots-overlay .stage-slot-cell.is-tv-split-left.is-camera-clean-hover .slot-hover-overlay {
  align-items: flex-start;
}

#scene-slots-overlay .stage-slot-cell.is-guest-col-slot,
#scene-slots-overlay .stage-slot-cell.is-guests-free-layer.is-hovered {
  border-color: #525761;
  box-shadow: inset 0 0 0 1.5px rgba(130, 138, 152, 0.48);
}

#scene-slots-overlay .stage-slot-cell.is-reaction-pip {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 26px rgba(0, 0, 0, 0.56),
    0 0 0 1.5px #525761;
}

/* 4. ZONA INFERIOR DEL LIENZO: 100% LIMPIA EN REPOSO; GUÍAS + CARGA + BOTÓN X DISCRETO AL HOVER */
#scene-slots-overlay .stage-slot-cell.is-lower-zone {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#scene-slots-overlay .stage-slot-cell.is-lower-zone.is-empty {
  pointer-events: auto;
}

/* Líneas guía sutiles de ubicación en la zona inferior (invisibles en reposo, visibles suavemente al hover) */
#scene-slots-overlay .slot-lower-guides {
  position: absolute;
  inset: 4px;
  border-radius: 7px;
  border: 1px dashed rgba(154, 163, 178, 0.34);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.16s ease 0s;
}

#scene-slots-overlay .stage-slot-cell.is-lower-zone:hover .slot-lower-guides,
#scene-slots-overlay .stage-slot-cell.is-lower-zone.is-hovered .slot-lower-guides {
  opacity: 1;
  transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1) 0.11s;
}

#scene-slots-overlay .slot-lower-guides .lg-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: rgba(203, 213, 225, 0.68);
  border-style: solid;
  border-width: 0;
}

#scene-slots-overlay .slot-lower-guides .lg-tl {
  top: -1px;
  left: -1px;
  border-top-width: 2px;
  border-left-width: 2px;
  border-top-left-radius: 5px;
}

#scene-slots-overlay .slot-lower-guides .lg-tr {
  top: -1px;
  right: -1px;
  border-top-width: 2px;
  border-right-width: 2px;
  border-top-right-radius: 5px;
}

#scene-slots-overlay .slot-lower-guides .lg-bl {
  bottom: -1px;
  left: -1px;
  border-bottom-width: 2px;
  border-left-width: 2px;
  border-bottom-left-radius: 5px;
}

#scene-slots-overlay .slot-lower-guides .lg-br {
  bottom: -1px;
  right: -1px;
  border-bottom-width: 2px;
  border-right-width: 2px;
  border-bottom-right-radius: 5px;
}

/* Fondo vidrio sutil SOLO al pasar el mouse por la zona inferior vacía */
#scene-slots-overlay .stage-slot-cell.is-lower-zone.is-empty:hover {
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(30, 34, 42, 0.36) 35%,
    rgba(16, 19, 24, 0.48) 100%
  ) !important;
}

/* Botón X discreto y escondido en la zona inferior para cerrar el medio cargado y subir otro */
#scene-slots-overlay .stage-slot-cell.is-lower-zone .slot-lower-close-btn {
  width: 22px;
  height: 22px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px !important;
  background: rgba(20, 23, 29, 0.74) !important;
  border: 1px solid rgba(130, 138, 152, 0.45) !important;
  color: #cbd5e1 !important;
  font-size: 10.5px !important;
  opacity: 0.72;
  transition: opacity 0.16s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

#scene-slots-overlay .stage-slot-cell.is-lower-zone .slot-lower-close-btn:hover {
  opacity: 1;
  background: rgba(185, 28, 28, 0.86) !important;
  border-color: rgba(248, 113, 113, 0.78) !important;
  color: #ffffff !important;
}

/* Mantener botón X de cierre de cámara con acabado discreto y limpio */
#scene-slots-overlay .stage-slot-cell.is-lower-zone .slot-camera-close-btn.slot-lower-close-btn {
  top: 7px;
  right: 7px;
  background: rgba(20, 23, 29, 0.76) !important;
  border-color: rgba(130, 138, 152, 0.48) !important;
}

/* Modal "+ Agregar escena": estética limpia grafito coherente sin campo de nombre */
#add-scene-modal .template-pick-card {
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.06) 0%, rgba(28, 32, 40, 0.82) 100%);
  border: 1.5px solid #3c4048;
  border-top-color: #525761;
  color: #dce3ee;
}

#add-scene-modal .template-pick-card:hover {
  border-color: #6b7280;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.1) 0%, rgba(38, 43, 53, 0.88) 100%);
}

#add-scene-modal .template-pick-card.active {
  border-color: #7c8391;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.14) 0%, rgba(50, 56, 68, 0.92) 100%);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 0 0 1px rgba(130, 138, 152, 0.45);
}

#add-scene-modal .tpl-mini-grid {
  background: #101319;
  border-color: #3c4048;
}

#add-scene-modal .tpl-mini-grid span {
  background: rgba(82, 87, 97, 0.38);
  border-color: rgba(138, 145, 158, 0.65);
}

#add-scene-modal .tpl-mini-grid.tpl-2 .tpl-2-zocalo {
  background: linear-gradient(180deg, #1b1f27 0% 62%, #2d333f 62% 100%);
  border-top-color: #525761;
}

/* =========================================================================
   REDISEÑO PANEL LATERAL DE CHAT, CONEXIONES EN RTMP Y REDIMENSIONADO LIENZO
   Estética sobria gris grafito · Sin botones Prueba/Limpiar · Sin barras en lienzo
   ========================================================================= */

/* Cuando el panel de Chat está activo, aprovechar el 100% vertical con encabezado y barra de envío fijos */
.right-drawer.is-chat-panel-open .drawer-scroll-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 10px 10px;
}

.right-drawer .drawer-panel.chat-panel-clean.is-active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Encabezado superior del panel de Chat (título, canales, Estilo desplegable e interruptor En pantalla) */
.chat-panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(28, 32, 39, 0.92) 100%);
  border: 1px solid #3c4048;
  border-top-color: #525761;
  flex-shrink: 0;
}

.chat-topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-topbar-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}

.chat-channels-status-pill {
  appearance: none;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(52, 58, 69, 0.55);
  border: 1px solid #494e58;
  color: #cbd5e1;
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.chat-channels-status-pill:hover {
  background: rgba(74, 81, 94, 0.72);
  border-color: #6b7280;
  color: #ffffff;
}

.chat-channels-status-pill.has-connected {
  border-color: #6b7280;
  color: #f1f5f9;
}

.chat-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.chat-topbar-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 8px;
  border-radius: 6px;
  background: #23272f;
  border: 1px solid #494e58;
  color: #dce3ee;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.chat-topbar-btn:hover,
.chat-topbar-btn.is-open {
  background: #2e3440;
  border-color: #6b7280;
  color: #ffffff;
}

.chat-topbar-btn .chat-btn-caret {
  font-size: 9px;
  transition: transform 0.16s ease;
}

.chat-topbar-btn.is-open .chat-btn-caret {
  transform: rotate(180deg);
}

.chat-onscreen-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

/* Desplegable interno de apariencia debajo del encabezado del Chat */
.chat-style-dropdown-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #1a1e26;
  border: 1px solid #525761;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.42);
  flex-shrink: 0;
}

.chat-style-dropdown-panel[hidden] {
  display: none !important;
}

.chat-style-dropdown-panel .multichat-style-field label {
  color: #cbd5e1;
  font-size: 10px;
}

.chat-style-dropdown-panel select.form-control {
  background: #13171e;
  border: 1px solid #3c4048;
  color: #f1f5f9;
}

.chat-style-dropdown-panel select.form-control:focus {
  border-color: #6b7280;
}

/* Banner de mensaje proyectado en pantalla (sobrio en gris grafito) */
.chat-panel-clean .chat-pinned-banner {
  background: rgba(34, 39, 48, 0.92) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid #525761 !important;
  border-radius: 8px !important;
  padding: 6px 9px !important;
  flex-shrink: 0;
}

.chat-panel-clean .chat-pinned-banner .eyebrow {
  color: #cbd5e1;
  font-size: 9px;
}

/* Área amplia de lectura de mensajes */
.chat-panel-clean .studio-chat-feed.chat-feed-expanded {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 8px;
  gap: 6px;
  border-radius: 9px;
  background: #12151b;
  border: 1px solid #3c4048;
}

.chat-feed-empty {
  margin: auto;
  padding: 18px 14px;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: #8f99a8;
}

.chat-panel-clean .chat-msg-card {
  padding: 8px 9px;
  border-radius: 8px;
  background: #191d25;
  border: 1px solid #333842;
}

.chat-panel-clean .chat-msg-card:hover {
  background: #202631;
  border-color: #525761;
}

.chat-panel-clean .chat-msg-card.is-pinned {
  background: #252c38;
  border-color: #7c8391;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.chat-panel-clean .chat-msg-live-pill {
  background: #3c424e;
  border: 1px solid #6b7280;
  color: #f8fafc;
  font-size: 8.5px;
  padding: 1px 6px;
}

.chat-panel-clean .chat-msg-author {
  color: #f1f5f9;
}

.chat-panel-clean .chat-msg-text {
  color: #d6dde6;
}

.chat-panel-clean .chat-msg-time {
  color: #7d8696;
}

/* Barra inferior de escritura/envío con selector desplegable hacia arriba */
.chat-compose-dock {
  position: relative;
  flex-shrink: 0;
}

.chat-channel-dropup {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 9px;
  background: #1a1e26;
  border: 1.5px solid #525761;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.55);
  max-height: 210px;
  overflow-y: auto;
}

.chat-channel-dropup[hidden] {
  display: none !important;
}

.chat-channel-dropup-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-dropup-option {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #dce3ee;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.chat-dropup-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #494e58;
}

.chat-dropup-option.is-selected {
  background: #272d38;
  border-color: #6b7280;
  color: #ffffff;
}

.chat-dropup-opt-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.chat-dropup-opt-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.chat-dropup-opt-meta {
  font-size: 9.5px;
  color: #8f99a8;
  flex-shrink: 0;
}

.chat-dropup-opt-meta.is-live {
  color: #e2e8f0;
  font-weight: 700;
}

.chat-dropup-manage-btn {
  appearance: none;
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px dashed #494e58;
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.chat-dropup-manage-btn:hover {
  background: #272d38;
  border-color: #6b7280;
  color: #ffffff;
}

.chat-compose-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border-radius: 9px;
  background: #171b22;
  border: 1px solid #3c4048;
  border-top-color: #525761;
}

.chat-channel-picker-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  max-width: 104px;
  padding: 0 7px;
  border-radius: 6px;
  background: #23272f;
  border: 1px solid #494e58;
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.chat-channel-picker-btn:hover,
.chat-channel-picker-btn.is-open {
  background: #2e3440;
  border-color: #6b7280;
  color: #ffffff;
}

.chat-channel-picker-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-channel-picker-caret {
  font-size: 9px;
  transition: transform 0.16s ease;
}

.chat-channel-picker-btn.is-open .chat-channel-picker-caret {
  transform: rotate(180deg);
}

.chat-compose-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  background: #11141a;
  border: 1px solid #333842;
  color: #f1f5f9;
  font-size: 11.5px;
  outline: none;
}

.chat-compose-input:focus {
  border-color: #6b7280;
}

.chat-compose-send-btn {
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #282e39;
  border: 1px solid #525761;
  color: #f1f5f9;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.chat-compose-send-btn:hover {
  background: #363e4d;
  border-color: #7c8391;
  color: #ffffff;
}

/* Multichat y Chat Popout dentro de Ajustes RTMP (bordes gris grafito sobrios) */
.rtmp-multichat-card {
  background: #171b22 !important;
  border: 1px solid #3c4048 !important;
  border-radius: 10px !important;
  padding: 10px !important;
  margin-bottom: 0 !important;
}

.rtmp-multichat-card .eyebrow {
  color: #9aa3b2;
}

.rtmp-multichat-card h4 {
  color: #f1f5f9;
}

.rtmp-chat-popout-details {
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #12151b;
  border: 1px solid #333842;
}

.rtmp-chat-popout-details summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  user-select: none;
}

.rtmp-chat-popout-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.rtmp-chat-webview-container {
  height: 220px;
  min-height: 180px;
  border-color: #3c4048;
  background: #0e1117;
}

/* Redimensionado limpio y responsivo en el lienzo (Multichat + Placa proyectada · 8 manejadores grafito) */
#multichat-floating-layer:hover,
#multichat-floating-layer.is-dragging,
#multichat-floating-layer.is-resizing {
  outline: 1px dashed rgba(154, 163, 178, 0.58) !important;
  outline-offset: -1px;
}

#multichat-floating-layer .mc-resize-handle,
#pinned-chat-transform-box .mc-resize-handle {
  background: #cbd5e1;
  border: 1.5px solid #2b303a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

#multichat-floating-layer .mc-resize-handle:hover,
#pinned-chat-transform-box .mc-resize-handle:hover {
  background: #ffffff;
  border-color: #525761;
}

#multichat-floating-layer .mc-resize-handle.handle-n,
#pinned-chat-transform-box .mc-resize-handle.handle-n {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 7px;
  border-radius: 4px;
  cursor: ns-resize;
}

#multichat-floating-layer .mc-resize-handle.handle-s,
#pinned-chat-transform-box .mc-resize-handle.handle-s {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 7px;
  border-radius: 4px;
  cursor: ns-resize;
}

#multichat-floating-layer .mc-resize-handle.handle-e,
#pinned-chat-transform-box .mc-resize-handle.handle-e {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 22px;
  border-radius: 4px;
  cursor: ew-resize;
}

#multichat-floating-layer .mc-resize-handle.handle-w,
#pinned-chat-transform-box .mc-resize-handle.handle-w {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 22px;
  border-radius: 4px;
  cursor: ew-resize;
}

#multichat-floating-layer .mc-resize-handle.handle-n:hover,
#multichat-floating-layer .mc-resize-handle.handle-s:hover,
#pinned-chat-transform-box .mc-resize-handle.handle-n:hover,
#pinned-chat-transform-box .mc-resize-handle.handle-s:hover {
  transform: translateX(-50%) scale(1.1);
}

#multichat-floating-layer .mc-resize-handle.handle-e:hover,
#multichat-floating-layer .mc-resize-handle.handle-w:hover,
#pinned-chat-transform-box .mc-resize-handle.handle-e:hover,
#pinned-chat-transform-box .mc-resize-handle.handle-w:hover {
  transform: translateY(-50%) scale(1.1);
}

/* =========================================================================
   ESCENA DE INVITADOS: FUENTES SUPERIORES 1 Y 2 SOLO CON BOTÓN DE CÁMARA CENTRADO
   Estética sobria gris grafito · Sin afectar otras escenas ni el visor inferior
   ========================================================================= */
#scene-slots-overlay .stage-slot-cell.is-guests-top-cam-only.is-empty .slot-empty-picker {
  width: 100%;
  height: 100%;
  max-width: 100%;
  padding: 6px;
  gap: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scene-slots-overlay .stage-slot-cell.is-guests-top-cam-only .slot-opt-btn.is-guests-cam-only-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #edf1f7 !important;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(36, 41, 50, 0.84) 100%
  ) !important;
  border: 1.5px solid #525761 !important;
  border-bottom-color: #3c4048 !important;
  border-radius: 8px !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 3px 8px rgba(0, 0, 0, 0.34) !important;
}

#scene-slots-overlay .stage-slot-cell.is-guests-top-cam-only .slot-opt-btn.is-guests-cam-only-btn:hover {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.17) 0%,
    rgba(56, 62, 74, 0.92) 100%
  ) !important;
  border-color: #7c8391 !important;
  color: #ffffff !important;
}

#scene-slots-overlay .stage-slot-cell.is-guests-top-cam-only .guests-cam-only-icon {
  flex-shrink: 0;
}

/* =========================================================================
   COLUMNA LATERAL DE ESCENAS: FONDO VERDE ESMERALDA LIMPIO DETRÁS DE
   MINIATURAS VIDRIADAS/ESPEJADAS (SIN CAPAS NI ::after SUPERPUESTOS AL SCROLL)
   ========================================================================= */
.left-scenes-panel {
  background: linear-gradient(
    180deg,
    #123c26 0%,
    #0e301e 52%,
    #0a2416 100%
  );
  border-right: 1px solid rgba(52, 211, 153, 0.2);
}

.left-scenes-panel .left-scenes-header {
  background: rgba(8, 22, 15, 0.48);
  border-bottom: 1px solid rgba(52, 211, 153, 0.16);
}

.left-scenes-panel .scenes-list {
  flex: 1 1 auto;
  min-height: 0;
  background: transparent;
  padding: 6px 6px 12px;
}

.left-scenes-panel .scene-card {
  flex-shrink: 0;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(167, 243, 208, 0.08) 24%,
    rgba(14, 28, 22, 0.36) 58%,
    rgba(9, 20, 15, 0.48) 100%
  ) !important;
  border: 1.5px solid rgba(167, 243, 208, 0.28) !important;
  border-top-color: rgba(236, 253, 245, 0.42) !important;
  border-left-color: rgba(190, 228, 210, 0.32) !important;
  border-bottom-color: rgba(6, 18, 12, 0.62) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(5, 16, 11, 0.44),
    0 4px 10px rgba(0, 0, 0, 0.28) !important;
}

.left-scenes-panel .scene-card::before {
  height: 36%;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(209, 250, 229, 0.06) 46%,
    rgba(255, 255, 255, 0) 100%
  );
}

.left-scenes-panel .scene-card:hover {
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.24) 0%,
    rgba(167, 243, 208, 0.12) 24%,
    rgba(18, 36, 28, 0.4) 60%,
    rgba(11, 24, 18, 0.52) 100%
  ) !important;
  border-color: rgba(167, 243, 208, 0.46) !important;
  border-top-color: rgba(236, 253, 245, 0.56) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.36),
    inset 0 -1px 0 rgba(5, 16, 11, 0.45),
    0 6px 14px rgba(0, 0, 0, 0.34) !important;
}

.left-scenes-panel .scene-card.is-active {
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.28) 0%,
    rgba(110, 231, 183, 0.16) 26%,
    rgba(16, 42, 30, 0.44) 62%,
    rgba(9, 28, 19, 0.56) 100%
  ) !important;
  border: 1.5px solid rgba(110, 231, 183, 0.66) !important;
  border-top-color: rgba(236, 253, 245, 0.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.44),
    inset 0 -1px 0 rgba(5, 16, 11, 0.5),
    0 0 0 1px rgba(52, 211, 153, 0.34),
    0 6px 16px rgba(0, 0, 0, 0.38) !important;
}

.left-scenes-panel .scene-mini-preview {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.09) 0%,
    rgba(12, 32, 22, 0.4) 46%,
    rgba(6, 19, 13, 0.54) 100%
  );
  border-color: rgba(167, 243, 208, 0.26);
}

.left-scenes-panel .scene-mini-box {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(18, 42, 31, 0.3) 100%
  );
  border-color: rgba(167, 243, 208, 0.3);
}

.left-scenes-panel .scene-mini-box.is-filled {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(38, 78, 58, 0.44) 100%
  );
  border-color: rgba(167, 243, 208, 0.52);
}

/* Unificación de la miniatura de Escena Reacción (tpl-5 / is-tpl-5): mismo verde esmeralda y vidrio espejado */
.left-scenes-panel .scene-mini-preview.tpl-5,
.left-scenes-panel .scene-card.is-active .scene-mini-preview.tpl-5 {
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.11) 0%,
    rgba(16, 42, 29, 0.4) 46%,
    rgba(8, 24, 16, 0.52) 100%
  );
  border-color: rgba(167, 243, 208, 0.3);
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-bg {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(18, 44, 32, 0.32) 100%
  );
  border: 1px dashed rgba(167, 243, 208, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-bg.is-filled {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(34, 74, 54, 0.44) 100%
  );
  border-style: solid;
  border-color: rgba(167, 243, 208, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-left,
.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-right {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(26, 62, 45, 0.44) 100%
  );
  border: 1px solid rgba(167, 243, 208, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 5px rgba(0, 0, 0, 0.32);
}

.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-left.is-filled,
.left-scenes-panel .scene-mini-schematic.is-tpl-5 .scene-mini-box.is-reaction-right.is-filled {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.25) 0%,
    rgba(42, 88, 65, 0.52) 100%
  );
  border-color: rgba(167, 243, 208, 0.64);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 2px 6px rgba(0, 0, 0, 0.36);
}

/* =========================================================================
   REORDENAMIENTO POR ARRASTRE EXCLUSIVO DE LA BARRA LATERAL DERECHA
   ========================================================================= */
.right-icon-rail.is-rail-reordering {
  user-select: none;
  overflow-x: hidden;
}

.right-icon-rail.is-rail-reordering .rail-icon-btn {
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1) !important;
  will-change: transform;
}

.right-icon-rail .rail-icon-btn.is-rail-dragging {
  position: relative;
  z-index: 60;
  cursor: grabbing !important;
  transition: none !important;
  border-color: rgba(52, 211, 153, 0.78) !important;
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(16, 185, 129, 0.55) !important;
}

/* =========================================================================
   BOTÓN ESPEJO DENTRO DE CONFIGURACIÓN DE CÁMARA
   ========================================================================= */
.studio-camera-mirror-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.studio-camera-mirror-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.studio-camera-mirror-copy label {
  margin: 0;
}

.studio-camera-mirror-btn {
  min-width: 108px;
  height: 30px !important;
  padding: 0 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
}

.studio-camera-mirror-btn.is-active {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #a7f3d0 !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25), 0 0 12px rgba(16, 185, 129, 0.2) !important;
}

/* =========================================================================
   PANEL TEXTOS: SELECTOR DE COLOR ÚNICO + LISTA RÁPIDA DE TEXTOS GUARDADOS
   ========================================================================= */
.banner-single-color-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 2px 7px 2px 4px;
  border-radius: 7px;
  background: #12151a;
  border: 1px solid rgba(255, 255, 255, 0.11);
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.banner-single-color-picker:focus-within,
.banner-single-color-picker:hover {
  border-color: rgba(16, 185, 129, 0.55);
}

.banner-single-color-picker input[type='color'] {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.banner-single-color-picker input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

.banner-single-color-picker input[type='color']::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.banner-single-color-hex-input {
  width: 58px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-family: Consolas, 'Fira Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  outline: none;
  padding: 0;
}

.banner-save-caption-btn {
  height: 29px !important;
  padding: 0 10px !important;
  font-size: 10.5px !important;
  white-space: nowrap;
}

.banner-cancel-edit-btn {
  height: 29px !important;
  padding: 0 8px !important;
  font-size: 10.5px !important;
}

.banner-font-size-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(15, 19, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.banner-font-size-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
}

.banner-font-size-slider {
  flex: 1;
  min-width: 60px;
  accent-color: #10b981;
  cursor: pointer;
}

.banner-font-size-num-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #12151a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.banner-font-size-num {
  width: 38px;
  border: none;
  background: transparent;
  color: #f8fafc;
  font-family: Consolas, 'Fira Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  outline: none;
  padding: 0;
}

.banner-font-size-unit {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

[data-drawer-panel='textos'] .tv-banner-live-preview {
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(11, 15, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

[data-drawer-panel='textos'] .tv-banner-live-preview:hover {
  border-color: rgba(16, 185, 129, 0.48);
  background: rgba(15, 22, 30, 0.92);
}

[data-drawer-panel='textos'] .tv-banner-live-preview.is-live {
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.28), 0 0 12px rgba(16, 185, 129, 0.22);
}

[data-drawer-panel='banners'] .zocalo-pro-mini-preview {
  cursor: pointer;
  opacity: 1 !important;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

[data-drawer-panel='banners'] .zocalo-pro-mini-preview:hover {
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(16, 185, 129, 0.25);
}

[data-drawer-panel='banners'] .zocalo-pro-mini-preview.is-live {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 1.5px rgba(16, 185, 129, 0.42), 0 0 14px rgba(16, 185, 129, 0.3) !important;
}

[data-drawer-panel='textos'] .tv-preview-plate {
  padding: 6px 9px;
  border-radius: 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36);
}

.banner-saved-captions-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(22, 25, 30, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.banner-saved-captions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.banner-saved-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
}

[data-drawer-panel='textos'] .saved-banners-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 255px;
  overflow-y: auto;
  padding-right: 2px;
}

[data-drawer-panel='textos'] .banner-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #171b22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

[data-drawer-panel='textos'] .banner-item-card:hover {
  background: #1f2530;
  border-color: rgba(16, 185, 129, 0.42);
}

[data-drawer-panel='textos'] .banner-item-card.is-live {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.22);
}

[data-drawer-panel='textos'] .banner-item-card.is-editing {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.banner-item-swatch {
  width: 9px;
  height: 26px;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

[data-drawer-panel='textos'] .banner-item-card.is-live .banner-item-copy small {
  color: #6ee7b7;
  font-weight: 600;
}

[data-drawer-panel='textos'] .banner-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

[data-drawer-panel='textos'] .banner-item-icon-btn {
  width: 24px !important;
  height: 24px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px !important;
}

.banner-saved-empty {
  padding: 12px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 10.5px;
  text-align: center;
}

/* =========================================================================
   STICKER EN BARRA LATERAL DERECHA + PANEL RÁPIDO HOVER (TOGGLE EN LIENZO)
   ========================================================================= */
[data-drawer-panel='textos'] .banner-compact-presets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.right-icon-rail .rail-icon-btn-sticker {
  position: relative;
}

.right-icon-rail .rail-icon-btn-sticker .rail-sticker-icon {
  font-size: 15px;
  line-height: 1;
}

.right-icon-rail .rail-icon-btn-sticker .rail-sticker-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.right-icon-rail .rail-icon-btn-sticker.is-open:not(.has-active-stickers) {
  background: #242a34 !important;
  border-color: rgba(16, 185, 129, 0.68) !important;
  color: #f1f5f9 !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.18), 0 0 10px rgba(16, 185, 129, 0.22) !important;
}

.right-icon-rail .rail-icon-btn-sticker.has-active-stickers {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  color: #d1fae5 !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.32), 0 0 14px rgba(16, 185, 129, 0.28) !important;
}

.right-icon-rail .rail-icon-btn-sticker.has-active-stickers:hover {
  background: rgba(16, 185, 129, 0.28) !important;
  border-color: #34d399 !important;
  color: #ecfdf5 !important;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.36), 0 0 16px rgba(16, 185, 129, 0.32) !important;
}

.rail-sticker-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #10b981;
  color: #062115;
  font-style: normal;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.rail-sticker-badge[hidden] {
  display: none !important;
}

.left-sticker-popover {
  position: fixed;
  top: 190px;
  left: auto;
  right: calc(var(--rail-w, 58px) + 8px);
  width: 296px;
  max-width: calc(100vw - var(--rail-w, 58px) - 24px);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px;
  border-radius: 11px;
  background: #16191e;
  border: 1px solid rgba(16, 185, 129, 0.34);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.left-sticker-popover[hidden] {
  display: none !important;
}

.left-sticker-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.left-sticker-popover-head .eyebrow {
  display: block;
  font-size: 8.5px;
  line-height: 1.1;
}

.left-sticker-popover-head h4 {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #f8fafc;
}

.left-sticker-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.left-sticker-form-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.left-sticker-color-picker {
  padding-right: 8px;
}

.left-sticker-color-hex {
  font-family: Consolas, 'Fira Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #cbd5e1;
}

.left-sticker-form-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.left-sticker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}

.left-sticker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #1b2029;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.left-sticker-item:hover {
  background: #232936;
  border-color: rgba(16, 185, 129, 0.45);
}

.left-sticker-item.is-visible {
  background: rgba(16, 185, 129, 0.17);
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.24);
}

.left-sticker-item.is-editing {
  border-color: rgba(56, 189, 248, 0.72);
}

.left-sticker-item-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.left-sticker-item-copy strong {
  font-size: 11px;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.left-sticker-item-copy small {
  font-size: 9.5px;
  color: #94a3b8;
}

.left-sticker-item.is-visible .left-sticker-item-copy small {
  color: #6ee7b7;
  font-weight: 600;
}

.left-sticker-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* =========================================================================
   RETRANSMISIÓN MÚLTIPLE MEDIAMTX (PANEL RTMP)
   ========================================================================= */
.mediamtx-restream-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #141920;
  border: 1px solid #2b3440;
  border-radius: 10px;
  padding: 11px;
  margin-top: 4px;
}

.mediamtx-restream-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.mediamtx-restream-head h4 {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.mediamtx-count-pill {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: #86efac;
  background: rgba(22, 163, 74, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.mediamtx-hint {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: #94a3b8;
}

.mediamtx-hint code {
  font-family: Consolas, 'Fira Mono', monospace;
  font-size: 10px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid #293240;
  border-radius: 4px;
  padding: 1px 4px;
}

.mediamtx-folder-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: #0f1318;
  border: 1px solid #242c37;
  border-radius: 8px;
  padding: 8px 9px;
}

.mediamtx-folder-box label {
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.mediamtx-folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mediamtx-folder-row .form-control {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  font-size: 11px;
}

.mediamtx-folder-row .btn-mini {
  white-space: nowrap;
  padding: 6px 8px;
  font-size: 10.5px;
}

.mediamtx-dir-status {
  font-size: 10px;
  line-height: 1.35;
  color: #94a3b8;
}

.mediamtx-dir-status.is-ok {
  color: #86efac;
}

.mediamtx-dir-status.is-warn {
  color: #fcd34d;
}

.mediamtx-dir-status.is-err {
  color: #fca5a5;
}

.mediamtx-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mediamtx-group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px 2px;
  border-bottom: 1px solid #242c37;
}

.mediamtx-group-title span {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

.mediamtx-group-title.is-primary span {
  color: #fde68a;
}

.mediamtx-group-title.is-mine span {
  color: #86efac;
}

.mediamtx-group-title.is-luciana span {
  color: #d8b4fe;
}

.mediamtx-group-title small {
  font-size: 9.5px;
  color: #8190a4;
}

.mtx-slot-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #10141a;
  border: 1px solid #262e3a;
  border-radius: 8px;
  padding: 8px 9px;
  transition: border-color 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
  opacity: 0.78;
}

.mtx-slot-card.is-enabled {
  opacity: 1;
  background: #121a16;
  border-color: rgba(34, 197, 94, 0.52);
}

.mtx-slot-card.is-primary.is-enabled {
  background: #181710;
  border-color: rgba(250, 204, 21, 0.55);
}

.mtx-slot-card.is-luciana.is-enabled {
  background: #171320;
  border-color: rgba(192, 132, 252, 0.56);
}

.mtx-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mtx-slot-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: #1f2631;
  color: #cbd5e1;
  border: 1px solid #334155;
}

.mtx-slot-badge.is-primary {
  background: rgba(250, 204, 21, 0.15);
  color: #fde68a;
  border-color: rgba(250, 204, 21, 0.4);
}

.mtx-slot-badge.is-mine {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.36);
}

.mtx-slot-badge.is-luciana {
  background: rgba(168, 85, 247, 0.16);
  color: #e9d5ff;
  border-color: rgba(192, 132, 252, 0.4);
}

.mtx-slot-fields {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mtx-input {
  padding: 6px 9px !important;
  font-size: 11px !important;
  border-radius: 7px !important;
}

/* Interruptor ON/OFF táctil independiente */
.mtx-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.mtx-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.mtx-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #232833;
  border: 1px solid #3c4556;
  transition: background-color 0.18s ease, border-color 0.18s ease;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.mtx-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.mtx-switch-label-on {
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.mtx-switch-label-off {
  color: #94a3b8;
  opacity: 1;
  margin-left: auto;
  transition: opacity 0.15s ease;
}

.mtx-switch input:checked + .mtx-switch-track {
  background: #15803d;
  border-color: #4ade80;
}

.mtx-slot-card.is-luciana .mtx-switch input:checked + .mtx-switch-track {
  background: #7e22ce;
  border-color: #c084fc;
}

.mtx-slot-card.is-primary .mtx-switch input:checked + .mtx-switch-track {
  background: #a16207;
  border-color: #facc15;
}

.mtx-switch input:checked + .mtx-switch-track .mtx-switch-thumb {
  transform: translateX(32px);
  background: #ffffff;
}

.mtx-switch input:checked + .mtx-switch-track .mtx-switch-label-on {
  opacity: 1;
}

.mtx-switch input:checked + .mtx-switch-track .mtx-switch-label-off {
  opacity: 0;
}

.mediamtx-feedback-banner {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.4;
  word-break: break-word;
}

.mediamtx-feedback-banner.is-success {
  background: rgba(20, 83, 45, 0.35);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: #bbf7d0;
}

.mediamtx-feedback-banner.is-warn {
  background: rgba(120, 53, 15, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.mediamtx-feedback-banner.is-error {
  background: rgba(127, 29, 29, 0.35);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.mediamtx-saved-toast {
  position: fixed;
  right: 18px;
  bottom: 72px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  background: #102017;
  border: 1px solid rgba(74, 222, 128, 0.6);
  border-radius: 10px;
  padding: 11px 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  color: #e6f4ea;
}

.mediamtx-saved-toast[hidden] {
  display: none !important;
}

.mediamtx-saved-toast.is-warn {
  background: #221a0d;
  border-color: rgba(251, 191, 36, 0.65);
  color: #fef3c7;
}

.mediamtx-saved-toast.is-error {
  background: #231214;
  border-color: rgba(248, 113, 113, 0.65);
  color: #fee2e2;
}

.mediamtx-saved-toast-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mediamtx-saved-toast-info strong {
  font-size: 12px;
  font-weight: 700;
}

.mediamtx-saved-toast-info span {
  font-size: 11px;
  opacity: 0.9;
  line-height: 1.35;
}
