/* ════════════════════════════════════════════════════════════════════
   Dashboard del operador — panel de control del lower third
   Convive con los tokens definidos en layouts/operator.html.erb
   (--base, --s1..--s3, --amber, --t1..--t3, --bdr-*, --green, --red…)
   ════════════════════════════════════════════════════════════════════ */

:root {
  --elev2: 0 6px 28px rgba(0,0,0,0.55);
  --elev3: 0 16px 60px rgba(0,0,0,0.65);
  --r-xl: 16px;
  --live: #F8504B;
  --live-bg: rgba(248,80,75,0.10);
  --live-bdr: rgba(248,80,75,0.30);
}

/* ── Contenedor ── */
.dash-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ════════════════════════════════════════════
   Barra AL AIRE (persistente, sobre las pestañas)
   ════════════════════════════════════════════ */
.onair {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 9px 18px;
  background: var(--s1);
  border-bottom: 1px solid var(--bdr-f);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 25;
  transition: background 0.3s, border-color 0.3s;
}
.onair.is-live {
  background: linear-gradient(180deg, rgba(248,80,75,0.14), rgba(248,80,75,0.05)), var(--s1);
  border-bottom-color: var(--live-bdr);
}

.onair-tally {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}
.onair-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--t3);
  flex-shrink: 0;
  transition: background 0.3s;
}
.onair.is-live .onair-dot {
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  animation: onair-pulse 1.6s ease-in-out infinite;
}
@keyframes onair-pulse { 0%,100%{opacity:1} 50%{opacity:0.45} }
.onair-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--t3);
  text-transform: uppercase;
  white-space: nowrap;
}
.onair.is-live .onair-label { color: var(--live); }

.onair-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onair-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.onair-text .onair-role { color: var(--t2); font-weight: 400; }
.onair-text.muted { color: var(--t3); font-weight: 400; font-size: 13px; }

/* Progreso de la duración */
.onair-progress {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  max-width: 420px;
  display: none;
}
.onair.is-live.has-timer .onair-progress { display: block; }
.onair-progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: var(--live);
  transition: width 0.25s linear;
}

.onair-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.onair-timer {
  font-size: 13px;
  font-weight: 700;
  color: var(--live);
  font-variant-numeric: tabular-nums;
  display: none;
  white-space: nowrap;
}
.onair.is-live.has-timer .onair-timer { display: block; }
.onair-manual-badge {
  display: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--live);
  border: 1px solid var(--live-bdr);
  border-radius: 12px;
  padding: 3px 9px;
  white-space: nowrap;
}
.onair.is-live.is-manual .onair-manual-badge { display: block; }

.btn-onair-hide {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--live-bdr);
  background: rgba(248,80,75,0.12);
  color: #FFB4B2;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.13s;
  white-space: nowrap;
}
.onair.is-live .btn-onair-hide { display: inline-flex; }
.btn-onair-hide:hover { background: var(--live); color: #fff; border-color: var(--live); }
.btn-onair-hide:active { transform: scale(0.97); }

/* Conexión */
.conn-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  white-space: nowrap;
}
.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--t3);
  transition: background 0.3s;
}
.conn-pill.ok .conn-dot { background: var(--green); box-shadow: 0 0 5px var(--green); }
.conn-pill.ok { color: var(--green); }
.conn-pill.err .conn-dot { background: var(--red); }
.conn-pill.err { color: var(--red); }

/* ════════════════════════════════════════════
   Pestañas
   ════════════════════════════════════════════ */
.tabs-bar {
  background: var(--s1);
  border-bottom: 1px solid var(--bdr-f);
  display: flex;
  padding: 0 18px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t3);
  letter-spacing: 0.02em;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.13s;
  white-space: nowrap;
}
.tab-btn svg { opacity: 0.7; }
.tab-btn:hover { color: var(--t2); }
.tab-btn.active { color: var(--amb-tx); border-bottom-color: var(--amber); }
.tab-btn.active svg { opacity: 1; }

.tab-pane { display: none; flex: 1; overflow: hidden; min-height: 0; }
.tab-pane.active { display: flex; flex: 1; }

/* ════════════════════════════════════════════
   Pestaña Control — grid principal
   ════════════════════════════════════════════ */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.col-main {
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  min-height: 0;
}
.col-side {
  border-left: 1px solid var(--bdr-f);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--s1);
  min-height: 0;
}

.sec-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 9px;
}

/* ── Barra de favoritos (disparo rápido) ── */
.quickbar { display: flex; flex-direction: column; }
.quickbar-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.quickfire {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 9px;
  border-radius: 24px;
  border: 1px solid var(--bdr-d);
  background: var(--s2);
  color: var(--t1);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 240px;
}
.quickfire:hover { border-color: var(--amber); background: var(--amb-bg); }
.quickfire:active { transform: scale(0.96); }
.quickfire.firing { border-color: var(--live); background: var(--live-bg); }
.quickfire-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--amb-bg);
  border: 1px solid var(--amb-rg);
  color: var(--amb-tx);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.quickfire-name { overflow: hidden; text-overflow: ellipsis; }
.quickbar-empty {
  font-size: 12px;
  color: var(--t3);
  padding: 6px 2px;
}
.quickbar-empty .star-hint { color: var(--amb-tx); }

/* ── Tarjeta de preparación ── */
.compose-card {
  background: var(--s1);
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.compose-head .sec-label { margin-bottom: 0; }

/* Tipo de contenido */
.type-row { display: flex; gap: 6px; flex-wrap: wrap; }
.type-chip {
  padding: 6px 13px;
  border-radius: 20px;
  border: 1px solid var(--bdr-d);
  background: transparent;
  color: var(--t3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s;
  font-family: inherit;
}
.type-chip:hover { color: var(--t2); border-color: var(--bdr-st); }
.type-chip.active {
  border-color: var(--amber);
  color: var(--amb-tx);
  background: var(--amb-bg);
  font-weight: 600;
}

/* Campos */
.input-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.input-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.input-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  letter-spacing: 0.03em;
}
.input-text {
  background: var(--s2);
  border: 1px solid var(--bdr-d);
  color: var(--t1);
  font-size: 15px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  outline: none;
  transition: border-color 0.14s, box-shadow 0.14s;
  width: 100%;
  font-family: inherit;
}
.input-text:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amb-rg); }
.input-text::placeholder { color: var(--t3); }

/* Estilo + duración en una fila */
.opts-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}
.style-grid { display: flex; gap: 7px; }
.style-card {
  border: 1px solid var(--bdr-d);
  border-radius: var(--r-md);
  padding: 8px 10px 7px;
  background: var(--s2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.14s;
  width: 76px;
}
.style-card:hover { border-color: var(--bdr-st); background: var(--s3); }
.style-card.active { border-color: var(--amber); background: var(--amb-bg); }
.style-mini {
  width: 100%;
  height: 26px;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.mini-band { height: 13px; background: rgba(212,168,75,0.22); border-radius: 2px; }
.mini-left  .mini-band { width: 70%; border-left: 2px solid var(--amber); clip-path: polygon(0 0,100% 0,calc(100% - 4px) 100%,0 100%); }
.mini-center { justify-content: center; }
.mini-center .mini-band { width: 100%; border-top: 2px solid var(--amber); }
.mini-right { justify-content: flex-end; }
.mini-right .mini-band { width: 70%; border-right: 2px solid var(--amber); clip-path: polygon(4px 0,100% 0,100% 100%,0 100%); }
.style-label { font-size: 10.5px; font-weight: 600; color: var(--t3); }
.style-card.active .style-label { color: var(--amb-tx); }

.dur-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dur-btn {
  padding: 7px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--bdr-d);
  background: var(--s2);
  color: var(--t2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  font-family: inherit;
}
.dur-btn:hover { color: var(--t1); border-color: var(--bdr-st); background: var(--s3); }
.dur-btn.active { border-color: var(--amber); color: var(--amb-tx); background: var(--amb-bg); }
.dur-hint { font-size: 11px; color: var(--t3); margin-top: 6px; }

/* ── Acciones (TAKE) ── */
.action-row { display: flex; gap: 9px; align-items: stretch; }
.btn-take {
  flex: 1;
  padding: 14px 16px;
  background: var(--amber);
  color: var(--onamb);
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.13s, transform 0.1s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  text-transform: uppercase;
}
.btn-take:hover { background: var(--amb-hi); }
.btn-take:active { transform: scale(0.985); }
.btn-take:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-take.success { background: var(--green); color: #06251A; }
.btn-secondary {
  padding: 12px 16px;
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--bdr-d);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-secondary:hover { color: var(--t1); border-color: var(--bdr-st); background: var(--s2); }

.hint-keys {
  font-size: 11px;
  color: var(--t3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hint-keys kbd {
  background: var(--s2);
  border: 1px solid var(--bdr-d);
  border-radius: var(--r-sm);
  padding: 1px 6px;
  font-size: 10px;
  font-family: inherit;
  color: var(--t2);
}

/* ════════════════════════════════════════════
   Escenario de vista previa (réplica fiel del overlay, escala 16:9)
   ════════════════════════════════════════════ */
.lt-stage-wrap {
  border-radius: var(--r-lg);
  border: 1px solid var(--bdr-s);
  overflow: hidden;
  background: var(--void);
}
.lt-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--bdr-f);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
}
.lt-stage-head .stage-note { font-weight: 400; letter-spacing: 0.02em; text-transform: none; font-size: 11px; }
.lt-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  /* sugiere un fotograma de video sin distraer */
  background:
    radial-gradient(ellipse 65% 55% at 50% 38%, rgba(70,90,130,0.20), transparent 70%),
    linear-gradient(180deg, #11141C 0%, #0A0D14 70%, #07090E 100%);
}
.lt-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: top left;
  pointer-events: none;
}

/* Réplica exacta del CSS del overlay, con ámbito .lt-canvas */
.lt-canvas .lt {
  position: absolute;
  opacity: 1;
}
.lt-canvas .lt-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: 0 2px 14px rgba(0,0,0,0.9);
}
.lt-canvas .lt-role {
  font-family: 'Raleway', sans-serif;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}
.lt-canvas .lt-role:empty { display: none; }

.lt-canvas .lt.kind-cita .lt-name {
  font-family: 'Raleway', sans-serif;
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: normal;
  max-width: 900px;
}
.lt-canvas .lt.kind-cita .lt-role { font-weight: 600; letter-spacing: 0.22em; }
.lt-canvas .lt.kind-anuncio .lt-name {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.lt-canvas .lt.kind-anuncio .lt-role { text-transform: none; letter-spacing: 0.06em; font-weight: 400; }

.lt-canvas .lt.style-left  { display: flex; flex-direction: column; }
.lt-canvas .lt.style-left  .lt-band { border-left: 5px solid var(--lt-accent); padding: 14px 52px 14px 22px; clip-path: polygon(0 0,100% 0,calc(100% - 16px) 100%,0 100%); display: flex; flex-direction: column; gap: 5px; }
.lt-canvas .lt.style-left  .lt-line { height: 2px; margin-left: 5px; }
.lt-canvas .lt.style-right { display: flex; flex-direction: column; align-items: flex-end; }
.lt-canvas .lt.style-right .lt-band { border-right: 5px solid var(--lt-accent); padding: 14px 22px 14px 52px; clip-path: polygon(16px 0,100% 0,100% 100%,0 100%); display: flex; flex-direction: column; gap: 5px; align-items: flex-end; text-align: right; }
.lt-canvas .lt.style-right .lt-line { height: 2px; margin-right: 5px; }
.lt-canvas .lt.style-center { display: flex; flex-direction: column; align-items: center; width: 1400px; }
.lt-canvas .lt.style-center .lt-band { width: 100%; border-top: 3px solid var(--lt-accent); border-bottom: 1px solid var(--lt-accent-soft); padding: 16px 48px; display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.lt-canvas .lt.style-center .lt-name { white-space: normal; text-align: center; line-height: 1.3; }
.lt-canvas .lt.style-center .lt-role { white-space: normal; text-align: center; }
.lt-canvas .lt.style-center .lt-line { height: 2px; }

/* ════════════════════════════════════════════
   Panel lateral: presets + historial
   ════════════════════════════════════════════ */
.side-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.side-panel.hist-panel {
  border-top: 1px solid var(--bdr-f);
  flex: 0 0 auto;
  max-height: 200px;
}

.preset-head { display: flex; align-items: center; gap: 6px; }
.preset-head .sec-label { margin-bottom: 0; flex: 1; }
.preset-count {
  font-size: 9px;
  font-weight: 600;
  color: var(--t3);
  background: var(--s2);
  border: 1px solid var(--bdr-s);
  border-radius: 10px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.panel-tool {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--t3);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.panel-tool:hover { background: var(--s3); color: var(--t2); }
.panel-tool.active { color: var(--amb-tx); background: var(--amb-bg); }

.preset-search-wrap { position: relative; }
.preset-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--t3);
  pointer-events: none;
}
.preset-search { padding: 8px 11px 8px 31px; font-size: 13px; }

.preset-cats { display: flex; gap: 4px; flex-wrap: wrap; }
.cat-chip {
  padding: 3px 10px;
  border-radius: 14px;
  border: 1px solid var(--bdr-d);
  background: transparent;
  color: var(--t3);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s;
  font-family: inherit;
}
.cat-chip:hover { color: var(--t2); border-color: var(--bdr-st); }
.cat-chip.active { border-color: var(--amber); color: var(--amb-tx); background: var(--amb-bg); font-weight: 600; }

#preset-list { display: flex; flex-direction: column; gap: 7px; }
.preset-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--t3);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}
.preset-group-label.fav { color: var(--amb-tx); }
.preset-group-label:first-child { margin-top: 0; }

.preset-item {
  background: var(--s2);
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-md);
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.13s, background 0.13s;
}
.preset-item:hover { border-color: var(--bdr-d); }
.preset-item.just-fired { border-color: var(--live-bdr); background: var(--live-bg); }
.preset-info { flex: 1; min-width: 0; cursor: pointer; border-radius: var(--r-sm); }
.preset-info:hover .preset-name { color: var(--amb-tx); }
.preset-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s;
}
.preset-meta {
  font-size: 11px;
  color: var(--t3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preset-meta .pm-type { font-weight: 600; letter-spacing: 0.05em; font-size: 9px; }
.preset-num {
  width: 14px;
  font-size: 10px;
  font-weight: 700;
  color: var(--amb-tx);
  text-align: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.preset-star {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--t3);
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.preset-star:hover { background: var(--s3); color: var(--amb-hi); }
.preset-star.is-fav { color: var(--amber); }
.preset-actions { display: flex; gap: 3px; }
.icon-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--t3);
  border-radius: var(--r-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--s3); color: var(--amb-tx); }
.icon-btn.del:hover { color: var(--red); background: var(--red-bg); }
.icon-btn.fire {
  color: var(--amb-tx);
  background: var(--amb-bg);
  border: 1px solid var(--amb-rg);
}
.icon-btn.fire:hover { background: var(--amber); color: var(--onamb); }
.preset-handle { cursor: grab; color: var(--t3); font-size: 13px; flex-shrink: 0; user-select: none; }
.preset-item.dragging { opacity: 0.4; }
.preset-item.drag-over { border-color: var(--amber); }

.preset-footer { display: flex; gap: 7px; }
.btn-panel {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  color: var(--t3);
  border: 1px dashed var(--bdr-d);
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.btn-panel:hover { color: var(--amb-tx); border-color: var(--amber); border-style: solid; background: var(--amb-bg); }

.empty-msg { font-size: 12px; color: var(--t3); text-align: center; padding: 14px 6px; line-height: 1.6; }
.empty-msg strong { color: var(--t2); }

/* Historial */
.hist-item {
  padding: 7px 9px;
  border-radius: var(--r-md);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.12s;
}
.hist-item:hover { background: var(--s2); border-left-color: var(--bdr-d); }
.hist-name { font-size: 12px; font-weight: 600; color: var(--t1); }
.hist-style { font-size: 9px; color: var(--t3); font-weight: 600; letter-spacing: 0.06em; margin-left: 4px; }
.hist-role { font-size: 11px; color: var(--t3); }
.hist-time { font-size: 10px; color: var(--t3); margin-top: 1px; }

/* ════════════════════════════════════════════
   Toasts
   ════════════════════════════════════════════ */
.toast-zone {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 80;
  max-width: 360px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--s2);
  border: 1px solid var(--bdr-d);
  border-radius: var(--r-md);
  box-shadow: var(--elev2);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t1);
  animation: toast-in 0.22s cubic-bezier(0.22,1,0.36,1);
}
.toast.out { opacity: 0; transform: translateY(6px); transition: all 0.25s; }
.toast.ok  { border-color: rgba(52,211,153,0.3); }
.toast.ok  .toast-icon { color: var(--green); }
.toast.err { border-color: rgba(248,113,113,0.3); }
.toast.err .toast-icon { color: var(--red); }
.toast-icon { flex-shrink: 0; display: flex; }
.toast-msg { flex: 1; line-height: 1.45; }
.toast-action {
  color: var(--amb-tx);
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  flex-shrink: 0;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ════════════════════════════════════════════
   Modales
   ════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2,5,12,0.72);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: sb-fade 0.18s ease;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--s1);
  border: 1px solid var(--bdr-d);
  border-radius: var(--r-xl);
  box-shadow: var(--elev3);
  width: 100%;
  max-width: 480px;
  max-height: min(86dvh, 720px);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.22s cubic-bezier(0.22,1,0.36,1);
}
.modal.wide { max-width: 560px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--bdr-f);
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--t1); }
.modal-sub { font-size: 12px; color: var(--t3); margin-top: 3px; line-height: 1.5; }
.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--t3);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.12s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--s3); color: var(--t1); }
.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
  min-height: 0;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px 16px;
  border-top: 1px solid var(--bdr-f);
  flex-shrink: 0;
}
.btn-modal {
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.13s;
  font-family: inherit;
}
.btn-modal.primary { background: var(--amber); color: var(--onamb); border: none; }
.btn-modal.primary:hover { background: var(--amb-hi); }
.btn-modal.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-modal.ghost { background: transparent; color: var(--t2); border: 1px solid var(--bdr-d); }
.btn-modal.ghost:hover { color: var(--t1); border-color: var(--bdr-st); }
.btn-modal.danger { background: var(--red); color: #2A0605; border: none; }
.btn-modal.danger:hover { filter: brightness(1.1); }

/* Filas de chips dentro del modal */
.chips-row { display: flex; gap: 5px; flex-wrap: wrap; }
.m-chip {
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--bdr-d);
  background: transparent;
  color: var(--t3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s;
  font-family: inherit;
}
.m-chip:hover { color: var(--t2); border-color: var(--bdr-st); }
.m-chip.active { border-color: var(--amber); color: var(--amb-tx); background: var(--amb-bg); font-weight: 600; }

/* Importación masiva */
.bulk-textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.7;
  font-size: 13.5px;
}
.bulk-preview {
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-md);
  max-height: 170px;
  overflow-y: auto;
  display: none;
}
.bulk-preview.show { display: block; }
.bulk-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--bdr-f);
}
.bulk-row:last-child { border-bottom: none; }
.bulk-row .b-name { color: var(--t1); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-row .b-role { color: var(--t3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-count { font-size: 11px; color: var(--t3); }

/* ════════════════════════════════════════════
   Pestaña Apariencia
   ════════════════════════════════════════════ */
.cfg-wrap {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 20px;
  flex: 1;
  overflow-y: auto;
  align-content: start;
}
.cfg-controls { display: flex; flex-direction: column; gap: 14px; }
.cfg-section {
  background: var(--s1);
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.cfg-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 2px;
}
.cfg-row {
  display: grid;
  grid-template-columns: 120px 1fr 52px;
  align-items: center;
  gap: 10px;
}
.cfg-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfg-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--s3);
  outline: none;
  cursor: pointer;
  width: 100%;
}
.cfg-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  border: 2px solid var(--s2);
  box-shadow: 0 0 0 2px var(--amb-rg);
  transition: box-shadow 0.15s;
}
.cfg-slider:hover::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--amb-rg); }
.cfg-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  border: 2px solid var(--s2);
}
.cfg-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.cfg-color-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 10px;
}
.cfg-color-wrap { display: flex; align-items: center; gap: 10px; }
.cfg-color {
  width: 36px;
  height: 28px;
  border: 1px solid var(--bdr-d);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.cfg-color-hex {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--t2);
  background: var(--s3);
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-sm);
  padding: 5px 8px;
  width: 88px;
}

.cfg-aside {
  display: flex;
  flex-direction: column;
  gap: 13px;
  position: sticky;
  top: 0;
  height: fit-content;
  min-width: 0;
}
.cfg-actions { display: flex; flex-direction: column; gap: 8px; }
.cfg-btn-save {
  width: 100%;
  padding: 12px;
  background: var(--amber);
  color: var(--onamb);
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.13s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.cfg-btn-save:hover { background: var(--amb-hi); }
.cfg-btn-save:active { transform: scale(0.98); }
.cfg-btn-save:disabled { opacity: 0.55; cursor: wait; }
.cfg-save-note { font-size: 11px; color: var(--t3); text-align: center; line-height: 1.5; }
.cfg-btn-reset {
  width: 100%;
  padding: 7px;
  background: transparent;
  color: var(--t3);
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.13s;
}
.cfg-btn-reset:hover { color: var(--red); }

/* ════════════════════════════════════════════
   Pestaña Configurar OBS
   ════════════════════════════════════════════ */
.obs-wrap {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 620px;
  overflow-y: auto;
  flex: 1;
}
.url-card {
  background: var(--s2);
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.url-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--amb-tx);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  padding: 7px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--bdr-d);
  background: var(--s3);
  color: var(--t2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}
.copy-btn:hover { color: var(--t1); border-color: var(--bdr-st); }
.copy-btn.copied { color: var(--green); border-color: rgba(52,211,153,0.25); background: var(--grn-bg); }

.url-steps { display: flex; flex-direction: column; gap: 10px; }
.url-step { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--s3);
  border: 1px solid var(--bdr-d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--amb-tx);
  flex-shrink: 0;
  margin-top: 1px;
}
.step-text { font-size: 13px; color: var(--t2); line-height: 1.55; }
.step-text strong { color: var(--t1); font-weight: 600; }
.obs-note {
  background: var(--s2);
  border: 1px solid var(--bdr-s);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--t2);
  line-height: 1.6;
}
.obs-note strong { color: var(--t1); font-weight: 600; }
.btn-open-overlay {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 9px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--bdr-d);
  color: var(--t2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.13s;
}
.btn-open-overlay:hover { color: var(--t1); border-color: var(--bdr-st); background: var(--s2); }

/* ════════════════════════════════════════════
   Pestaña Ayuda
   ════════════════════════════════════════════ */
.help-wrap {
  padding: 24px 20px;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  flex: 1;
}
.help-header { display: flex; flex-direction: column; gap: 4px; }
.help-title { font-size: 18px; font-weight: 700; color: var(--t1); letter-spacing: -0.01em; }
.help-subtitle { font-size: 13px; color: var(--t3); }
.help-divider { height: 1px; background: var(--bdr-f); }
.help-section { display: flex; flex-direction: column; gap: 14px; }
.help-section-hd { display: flex; align-items: center; gap: 10px; }
.help-section-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--r-md);
  background: var(--amb-bg);
  border: 1px solid rgba(212,168,75,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--amber);
}
.help-section-title { font-size: 13px; font-weight: 700; color: var(--t1); letter-spacing: 0.01em; }
.help-steps { display: flex; flex-direction: column; padding-left: 40px; position: relative; }
.help-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--bdr-f);
}
.help-step:last-child { border-bottom: none; }
.help-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--s3);
  border: 1px solid var(--bdr-d);
  font-size: 11px;
  font-weight: 700;
  color: var(--amb-tx);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.help-step-body { flex: 1; }
.help-step-text { font-size: 13px; color: var(--t2); line-height: 1.6; }
.help-step-text strong { color: var(--t1); font-weight: 600; }
.help-step-text kbd {
  background: var(--s3);
  border: 1px solid var(--bdr-d);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--t2);
  font-family: inherit;
}
.help-step-note { font-size: 11px; color: var(--t3); margin-top: 3px; line-height: 1.5; }
.help-note-box {
  background: var(--s2);
  border: 1px solid var(--bdr-s);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--t2);
  line-height: 1.6;
  margin-left: 40px;
}
.help-note-box strong { color: var(--t1); font-weight: 600; }
.help-kbd-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  background: var(--s1);
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-left: 40px;
}
.kbd-row { display: contents; }
.kbd-row > * {
  padding: 10px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--bdr-f);
}
.kbd-row:last-child > * { border-bottom: none; }
.kbd-key {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--s2);
  border-right: 1px solid var(--bdr-f);
  white-space: nowrap;
}
.kbd-key kbd {
  background: var(--s3);
  border: 1px solid var(--bdr-d);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  font-size: 11px;
  font-family: inherit;
  color: var(--t1);
  font-weight: 700;
}
.kbd-desc { color: var(--t2); align-self: center; }
.help-tips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-left: 40px;
}
.help-tip {
  background: var(--s1);
  border: 1px solid var(--bdr-s);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.help-tip-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--amb-tx);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.help-tip-text { font-size: 12px; color: var(--t2); line-height: 1.55; }

/* ════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════ */
@media (max-width: 1080px) {
  .main-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .cfg-wrap { grid-template-columns: 1fr; }
  .cfg-aside { position: static; }
}
@media (max-width: 768px) {
  .main-grid { grid-template-columns: 1fr; overflow: auto; }
  .col-main { overflow: visible; }
  .col-side {
    border-left: none;
    border-top: 1px solid var(--bdr-f);
    overflow: visible;
  }
  .side-panel { max-height: none; overflow: visible; }
  .side-panel.hist-panel { max-height: none; }
  .onair { padding: 9px 14px; gap: 10px; }
  .onair-label { display: none; }
  .onair.is-live .onair-label { display: block; font-size: 10px; }
  .conn-pill span { display: none; }
  .hint-keys { display: none; }
  .tabs-bar { padding: 0 14px; }
  .input-text { font-size: 16px; } /* evita el auto-zoom de iOS */
  .input-pair { grid-template-columns: 1fr; }
  .opts-row { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 480px) {
  .tabs-bar { padding: 0 8px; }
  .tab-btn { padding: 10px 11px; font-size: 11.5px; }
  .col-main { padding: 14px; gap: 14px; }
  .compose-card { padding: 13px; }
  .action-row { flex-direction: column; }
  .btn-take { padding: 15px 12px; }
  .type-chip { padding: 9px 14px; min-height: 40px; display: inline-flex; align-items: center; }
  .dur-btn { padding: 9px 12px; min-height: 40px; }
  .style-card { width: auto; flex: 1; }
  .style-grid { width: 100%; }
  .quickfire { padding: 10px 15px 10px 10px; }
  .preset-item .icon-btn, .preset-star { width: 38px; height: 38px; font-size: 15px; }
  .preset-num { display: none; }
  .onair-info { gap: 3px; }
  .onair-text { font-size: 13px; }
  .btn-onair-hide { padding: 9px 13px; font-size: 12px; }
  .modal { max-width: none; }
  .help-steps, .help-note-box, .help-kbd-grid, .help-tips { margin-left: 0; }
  .help-tips { grid-template-columns: 1fr; }
  .cfg-row { grid-template-columns: 100px 1fr 46px; }
  .cfg-color-row { grid-template-columns: 100px 1fr; }
  .cfg-color-hex { font-size: 16px; } /* evita el auto-zoom de iOS */
}
@media (max-width: 380px) {
  .col-main { padding: 12px; gap: 12px; }
  .tabs-bar { padding: 0 4px; }
  .tab-btn { padding: 9px 9px; font-size: 11px; }
  .sec-label { font-size: 9px; }
}
