:root {
  /* Estilo «Nocturno» */
  --bg: #07080B;
  --surface: #12151C;
  --surface-2: #1A1F29;
  --surface-3: #262D3D;
  --text: #ECEFF4;
  --muted: #A3ABBD;
  --primary: #FFCC00;
  --primary-hover: #FFD633;
  --danger: #FF6B6B;
  --danger-hover: #FF8585;
  --success: #4FD1C5;
  --warning: #F5C451;
  --speaking: #FFCC00;
  --radius: 18px;
  --landing-bg: #0B0D12;
  --landing-card: #12151C;
  --landing-text: #ECEFF4;
  --landing-muted: #A3ABBD;
  --landing-border: #2A3140;
  --brand: #FFCC00;
  --violet: #8B7CF6;
  --font-display: "Sora", system-ui, sans-serif;
  /* Variables que cambia el diseño de cada cliente (ver theme.js) */
  --on-primary: #0B0D12;
  --primary-soft: rgba(255, 204, 0, .25);
  --primary-faint: rgba(255, 204, 0, .18);
  --primary-glow: rgba(255, 204, 0, .55);
  --line: #1E2430;
  --line-2: #2A3140;
  --field: #0B0D12;
  --chip: #151922;
  --ctrl: #1E2430;
  --table-rim: #0E1117;
  --table-1: #1D2330;
  --table-2: #161B25;
  --table-3: #10141B;
  --danger-text: #FF9A9A;
  --violet-text: #B9AFFF;
  --overlay: rgba(7, 8, 11, .7);
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--landing-bg);
  color: var(--landing-text);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* ---------- Botones ---------- */
.btn {
  border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600;
  background: var(--surface-3); color: var(--text); transition: background .15s;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.landing .btn.primary, .center-screen .btn.primary { background: var(--brand); border-radius: 999px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-hover); }
.btn.ghost { background: transparent; color: inherit; border: 1px solid var(--landing-border); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Inicio ---------- */
.landing {
  min-height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px 16px; gap: 20px;
}
.brand { font: 800 24px var(--font-display); display: flex; align-items: center; gap: 10px; color: var(--landing-text); text-decoration: none; }
.logo {
  width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-size: 18px;
}
.card {
  width: 100%; max-width: 420px; background: var(--landing-card); border-radius: 16px;
  border: 1px solid var(--landing-border); padding: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--landing-bg); padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.tab { border: 0; background: transparent; color: var(--landing-muted); padding: 9px; border-radius: 8px; font-weight: 600; }
.tab.active { background: var(--landing-card); color: var(--landing-text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--landing-muted); }
.form input:not([type=checkbox]) {
  padding: 11px 12px; border-radius: 9px; border: 1px solid var(--landing-border);
  background: var(--landing-bg); color: var(--landing-text); font-size: 16px;
}
.form input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.code-input { text-transform: uppercase; letter-spacing: 3px; font-weight: 700; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; }
.form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--landing-text); }
.form-msg { min-height: 20px; margin: 14px 0 0; font-size: 14px; color: var(--danger); }
.foot { color: var(--landing-muted); font-size: 14px; margin: 0; }

/* ---------- Pantallas centradas ---------- */
.center-screen {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 16px; gap: 8px;
}
.center-screen p { color: var(--landing-muted); max-width: 440px; }
.spinner {
  width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--landing-border);
  border-top-color: var(--primary); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reunión ---------- */
.meeting {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--surface-2);
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-left strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgba(229,72,77,.25); flex: none; }
.chip { background: var(--surface-2); color: var(--text); border: 0; padding: 6px 10px; border-radius: 8px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip.button:hover { background: var(--surface-3); }

.main { flex: 1; display: flex; min-height: 0; }
.stage-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 10px; gap: 10px; }
.stage-wrap.sharing { display: grid; grid-template-columns: minmax(0,1fr) 220px; grid-template-rows: minmax(0,1fr) auto; }
.stage-wrap.sharing .screen-stage { grid-row: 1 / 3; }

.screen-stage { position: relative; flex: 1; background: #000; border-radius: var(--radius); overflow: hidden; min-height: 0; }
.screen-stage video { width: 100%; height: 100%; object-fit: contain; display: block; }
.screen-label { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.6); padding: 5px 10px; border-radius: 6px; font-size: 13px; }

.grid {
  flex: 1; display: grid; gap: 8px; min-height: 0;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}
.stage-wrap.sharing .grid { grid-column: 2; grid-template-columns: 1fr; grid-auto-rows: 124px; overflow-y: auto; align-content: start; }

.tile {
  position: relative; background: var(--surface-2); border-radius: var(--radius); overflow: hidden;
  display: grid; place-items: center; min-height: 0; outline: 3px solid transparent; outline-offset: -3px;
  transition: outline-color .15s;
}
.tile.speaking { outline-color: var(--speaking); }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile.local video { transform: scaleX(-1); }
.avatar {
  height: clamp(32px, 45%, 110px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: clamp(13px, 2.4vw, 34px); color: #fff; user-select: none;
}
.tile .label {
  position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; align-items: center; gap: 6px;
  font-size: 13px; pointer-events: none;
}
.tile .label .nm { background: rgba(0,0,0,.6); padding: 3px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .micoff { background: var(--danger); border-radius: 6px; padding: 3px 5px; display: grid; place-items: center; }
.tile .micoff svg { width: 13px; height: 13px; }
.tile .hand { position: absolute; top: 6px; right: 6px; font-size: 22px; }
.role-badge { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-left: 4px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.stage-wrap.sharing .pager { grid-column: 2; }
.pg-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); font-size: 20px; line-height: 1; }
.pg-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Panel lateral ---------- */
.side { width: 330px; background: var(--surface); border-left: 1px solid var(--surface-2); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 10px; border-bottom: 1px solid var(--surface-2); }
.side-tabs { display: flex; gap: 4px; }
.stab { border: 0; background: transparent; color: var(--muted); padding: 7px 10px; border-radius: 8px; font-weight: 600; position: relative; }
.stab.active { background: var(--surface-2); color: var(--text); }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 16px; padding: 6px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.panel { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 10px; gap: 10px; }
.search { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--surface-3); background: var(--bg); color: var(--text); }
.host-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.host-actions .btn { flex: 1; }
.people-summary { font-size: 13px; color: var(--muted); }
.people .acts { display: flex; gap: 4px; flex: none; }
.people { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.people li { display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 8px; font-size: 14px; }
.people li:hover { background: var(--surface-2); }
.people .pav { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.people .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .st { display: flex; gap: 4px; color: var(--muted); align-items: center; }
.people .st svg { width: 16px; height: 16px; }
.people .st .off { color: var(--danger); }
.people .act { border: 0; background: var(--surface-3); color: var(--text); font-size: 12px; padding: 4px 7px; border-radius: 6px; }
.people .act.kick { background: transparent; color: var(--danger); }
.people .more { color: var(--muted); font-size: 13px; text-align: center; padding: 8px; }

.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.msg .who { font-size: 12px; color: var(--muted); }
.msg .who b { color: var(--text); }
.msg .txt { background: var(--surface-2); padding: 7px 10px; border-radius: 10px; margin-top: 3px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
.msg.mine .txt { background: rgba(45,140,255,.25); }
.chat-form { display: flex; gap: 6px; }
.chat-form input { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--surface-3); background: var(--bg); color: var(--text); }
.badge { background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; margin-left: 4px; }

/* ---------- Controles ---------- */
.controls {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--surface); border-top: 1px solid var(--surface-2);
}
.ctrl-group { display: flex; gap: 4px; align-items: center; }
.ctrl {
  border: 0; background: transparent; color: var(--text); display: flex; flex-direction: column;
  align-items: center; gap: 3px; padding: 6px 10px; border-radius: 10px; min-width: 70px; position: relative;
}
.ctrl:hover { background: var(--surface-2); }
.ctrl .ic svg { width: 24px; height: 24px; display: block; }
.ctrl .lb { font-size: 12px; color: var(--muted); }
.ctrl.off .ic { color: var(--danger); }
.ctrl.on-accent .ic { color: var(--success); }
.ctrl.active { background: var(--surface-2); }
.ctrl .badge { position: absolute; top: 2px; right: 10px; }

.audio-banner {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: var(--surface-3); color: var(--text);
  display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; z-index: 30; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.toasts { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 40; align-items: center; pointer-events: none; }
.toast { background: rgba(30,33,41,.96); color: #fff; padding: 9px 14px; border-radius: 9px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.35); animation: tin .2s ease-out; max-width: 90vw; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .ctrl { min-width: 0; padding: 6px; }
  .ctrl .lb { display: none; }
  .controls { padding: 6px 8px; }
  .side { position: fixed; inset: 0 0 64px 0; width: auto; z-index: 20; }
  .stage-wrap.sharing { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) 110px auto; }
  .stage-wrap.sharing .screen-stage { grid-row: auto; }
  .stage-wrap.sharing .grid, .stage-wrap.sharing .pager { grid-column: 1; }
  .stage-wrap.sharing .grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 150px; grid-auto-rows: 1fr; overflow-x: auto; overflow-y: hidden; }
  #copyLink { display: none; }
  .topbar { padding: 8px 12px; }
}

/* ---------- Acceso (marca) ---------- */
.card-title { font: 800 26px/1.15 var(--font-display); margin: 0 0 6px; }
.card-sub { color: var(--landing-muted); margin: 0 0 14px; }
.card-desc { margin: 0 0 18px; font-size: 15px; line-height: 1.55; }
.form .consent { font-weight: 400; font-size: 14px; align-items: flex-start; }
.form .consent input { margin-top: 3px; }
.form .consent a, .foot a { color: var(--brand); }
.landing .form input:focus { outline-color: var(--brand); }
.wait-when { font-weight: 700; color: var(--landing-text) !important; text-transform: none; }
.wait-when:first-letter { text-transform: uppercase; }
.center-screen h2 { font-family: var(--font-display); }


/* =============================================================
   Estilo «Nocturno» (ajustes sobre la base)
   ============================================================= */
.btn { border-radius: 999px; font-weight: 700; }
.btn.primary, .landing .btn.primary, .center-screen .btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--danger); color: #0B0D12; }
.btn.ghost { border-color: var(--landing-border); color: var(--text); }

/* Acceso */
.brand { color: var(--text); }
.card { background: var(--landing-card); border: 0; box-shadow: 0 0 0 1px var(--line); border-radius: 24px; padding: 30px 28px; }
.card-title { font: 700 28px/1.12 var(--font-display); letter-spacing: -0.03em; }
.form input:not([type=checkbox]) { background: var(--field); border-color: var(--landing-border); color: var(--text); border-radius: 14px; padding: 13px 15px; }
.form input:focus, .landing .form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form .check input { accent-color: var(--primary); }
.form-msg { color: var(--danger-text); }
.foot a, .form .consent a { color: var(--primary); }
.spinner { border-color: var(--line); border-top-color: var(--primary); }
.center-screen h2 { font: 600 26px var(--font-display); letter-spacing: -0.02em; }
.wait-when { color: var(--primary) !important; }

/* Reunión */
.meeting { background: var(--bg); }
.topbar { background: transparent; border-bottom: 0; padding: 16px 22px; }
.tb-left strong { font: 600 17px var(--font-display); letter-spacing: -0.01em; }
.live-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 107, 107, .2); }
.chip { background: var(--chip); border-radius: 999px; padding: 8px 14px; font-weight: 600; }
.chip.button:hover { background: var(--surface-2); }
.stage-wrap { padding: 4px 22px 0; gap: 10px; }
.grid { gap: 10px; }
.tile { background: var(--surface-2); border-radius: var(--radius); outline-width: 3px; }
.tile.speaking { outline-color: var(--speaking); }
.tile .label .nm { background: rgba(7, 8, 11, .7); border-radius: 999px; padding: 4px 10px; font-weight: 600; }
.tile .micoff { border-radius: 999px; padding: 4px 6px; }
.avatar { font-family: var(--font-display); }
.screen-stage { border-radius: 22px; }
.screen-label { border-radius: 999px; background: rgba(7, 8, 11, .7); padding: 6px 12px; font-weight: 600; }
.role-badge { background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 2px 8px; }
.pg-btn { background: var(--chip); }

/* Barra de controles: una píldora centrada con botones redondos */
.controls { justify-content: center; background: transparent; border-top: 0; padding: 14px 22px 18px; gap: 0; }
.controls > .ctrl-group { background: var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 8px; gap: 8px; }
.controls > .ctrl-group:first-child { border-radius: 999px 0 0 999px; padding-right: 4px; }
.controls > .ctrl-group:nth-child(2) { border-radius: 0; padding-left: 4px; padding-right: 4px; }
.controls > .ctrl-group:last-child { border-radius: 0 999px 999px 0; padding-left: 4px; }
.ctrl { width: 50px; height: 50px; min-width: 0; padding: 0; border-radius: 50%; background: var(--ctrl); justify-content: center; }
.ctrl:hover { background: var(--surface-3); }
.ctrl .ic svg { width: 21px; height: 21px; }
.ctrl .lb { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ctrl.off { background: rgba(255, 107, 107, .16); }
.ctrl.off .ic { color: var(--danger); }
.ctrl.on-accent, .ctrl.active { background: var(--primary); }
.ctrl.on-accent .ic, .ctrl.active .ic { color: var(--on-primary); }
.ctrl .badge { top: -2px; right: -2px; }
#btnShare:not(.on-accent) .ic { color: var(--primary); }
#btnLeave { height: 50px; border-radius: 999px; padding: 0 22px; background: var(--danger); color: #0B0D12; }

/* Panel lateral */
.side { background: var(--surface); border-left: 0; margin: 4px 22px 0 0; border-radius: 22px; box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.side-head { border-bottom-color: var(--line); }
.stab { border-radius: 999px; }
.stab.active { background: var(--surface-3); }
.search, .chat-form input { background: var(--field); border-color: var(--line-2); border-radius: 999px; padding: 10px 14px; }
.host-actions .btn { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); border-radius: 999px; }
.people li:hover { background: var(--surface-2); }
.people .act { border-radius: 999px; background: var(--surface-3); }
.msg .txt { background: var(--surface-2); border-radius: 14px; }
.msg.mine .txt { background: var(--primary-faint); }
.badge { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.audio-banner { background: var(--chip); border-radius: 999px; box-shadow: 0 0 0 1px var(--line-2); }

@media (max-width: 760px) {
  .controls > .ctrl-group { padding: 6px; gap: 6px; }
  .ctrl { width: 42px; height: 42px; }
  #btnLeave { height: 42px; padding: 0 14px; }
  .side { margin: 0; border-radius: 0; }
}

/* Grabación */
.rec-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--danger-text); background: rgba(255, 107, 107, .14); font-weight: 700; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: rec-blink 1.4s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: .35; } }
.ctrl.recording { background: var(--danger) !important; color: #0B0D12 !important; }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.rec-chip[hidden] { display: none; }

.chip.chip-warn { background: rgba(245, 196, 81, .18); color: var(--warning); }

/* Chat: controles del anfitrión y aviso */
.chat-host { display: grid; gap: 10px; padding: 12px; margin: 0 0 10px; border-radius: 12px; background: var(--surface-2); }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; user-select: none; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-row .sw { flex: none; position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.switch-row .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch-row input:checked + .sw { background: var(--primary); }
.switch-row input:checked + .sw::after { transform: translateX(16px); background: var(--field); }
.switch-row input:focus-visible + .sw { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-row input:disabled ~ span { opacity: .45; }
.switch-row:has(input:disabled) { cursor: not-allowed; }
.chat-note { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; text-align: center; }

/* Fondo de la cámara */
.bg-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(4, 5, 8, .62); backdrop-filter: blur(4px); }
.bg-box { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 1px var(--surface-3), 0 30px 80px rgba(0, 0, 0, .55); }
.bg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bg-head h3 { margin: 0; font: 600 18px var(--font-display); }
.bg-sub { margin: 6px 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.bg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bg-opt { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: var(--muted); text-align: center; font-size: 12.5px; }
.bg-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--surface-2) center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--surface-3); transition: box-shadow .15s; }
.bg-opt:hover .bg-thumb { box-shadow: inset 0 0 0 2px var(--muted); }
.bg-opt.on { color: var(--text); font-weight: 600; }
.bg-opt.on .bg-thumb { box-shadow: inset 0 0 0 3px var(--primary); }
.bg-opt:focus-visible { outline: none; } .bg-opt:focus-visible .bg-thumb { box-shadow: inset 0 0 0 3px var(--primary), 0 0 0 3px var(--primary-soft); }
.bg-none::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2px solid var(--muted); border-radius: 50%; background: linear-gradient(45deg, transparent 45%, var(--muted) 45%, var(--muted) 55%, transparent 55%); }
.bg-blur { background: radial-gradient(circle at 50% 70%, #5b6478 0 22%, transparent 23%), radial-gradient(circle at 50% 42%, #5b6478 0 12%, transparent 13%), linear-gradient(135deg, #3a4254, #262d3d); filter: none; }
.bg-blur::after { content: ""; position: absolute; inset: 0; border-radius: inherit; backdrop-filter: blur(1px); }
.bg-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.bg-hint { color: var(--muted); font-size: 13px; }
@media (max-width: 480px) { .bg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Sala de espera de expulsados (anfitrión) */
.lobby { margin: 0 0 12px; padding: 12px; border-radius: 12px; background: rgba(245, 196, 81, .12); box-shadow: inset 0 0 0 1px rgba(245, 196, 81, .35); }
.lobby-title { font-weight: 700; font-size: 13px; color: var(--warning); margin-bottom: 8px; }
.lobby-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.lobby-row + .lobby-row { border-top: 1px solid rgba(255, 255, 255, .06); }
.lobby-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lobby-who b, .lobby-who small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-who small { color: var(--muted); font-size: 12px; }
.badge.badge-warn { background: var(--warning); color: #1a1406; }

/* Micro / cámara bloqueados por el anfitrión */
.ctrl.locked { opacity: .5; }
.ctrl.locked .lb { color: var(--warning); }
#permHost { margin-bottom: 12px; }

/* Dar la palabra */
.role-badge.floor-badge { background: rgba(79, 209, 197, .18); color: var(--success); }
.act.on { background: rgba(79, 209, 197, .18); color: var(--success); }

/* =============================================================
   Reunión: vista «mesa»
   ============================================================= */
.table-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.table-top {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, .06), transparent 60%),
    radial-gradient(ellipse at 50% 50%, var(--table-1) 0%, var(--table-2) 62%, var(--table-3) 100%);
  box-shadow: 0 0 0 1px var(--line-2), 0 0 0 10px var(--table-rim), 0 0 0 11px var(--line), 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 60px rgba(0, 0, 0, .45);
  display: grid; place-items: center;
  transition: width .35s ease, height .35s ease;
}
.table-center {
  position: relative; border-radius: 18px; overflow: hidden; background: var(--field);
  display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px rgba(0, 0, 0, .5);
  transition: box-shadow .25s ease, width .35s ease, height .35s ease;
}
.table-center.speaking { box-shadow: 0 0 0 3px var(--speaking), 0 18px 40px rgba(0, 0, 0, .5); }
.table-center video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: center-in .35s ease; }
.table-center.screen { background: #000; }
.table-center.screen video { object-fit: contain; }
.table-center.local video { transform: scaleX(-1); }
.table-center.empty { background: transparent; box-shadow: none; }
.table-center.empty .center-label { position: static; background: none; font: 600 clamp(16px, 2vw, 24px) var(--font-display); color: rgba(236, 239, 244, .35); letter-spacing: -0.01em; text-align: center; padding: 0 12px; max-width: 100%; white-space: normal; }
.center-avatar { width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font: 700 clamp(20px, 4vw, 54px) var(--font-display); color: #fff; animation: center-in .35s ease; }
.center-label { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); background: rgba(7, 8, 11, .72); padding: 5px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center-full { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(7, 8, 11, .72); color: var(--text); font-size: 17px; }
.center-full:hover { background: var(--primary); color: var(--on-primary); }
.table-center:fullscreen { border-radius: 0; width: 100% !important; height: 100% !important; }
@keyframes center-in { from { opacity: 0; transform: scale(.98); } }

.seats { position: absolute; inset: 0; pointer-events: none; }
.seat {
  position: absolute; width: var(--s); height: var(--s); transform: translate(-50%, -50%);
  transition: left .4s ease, top .4s ease, width .4s ease, height .4s ease; pointer-events: auto;
}
.seat-disc {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line-2), 0 12px 28px rgba(0, 0, 0, .45);
  transition: box-shadow .15s ease;
}
.seat.speaking .seat-disc { box-shadow: 0 0 0 3px var(--speaking), 0 0 0 7px var(--primary-faint), 0 12px 28px rgba(0, 0, 0, .45); }
.seat.featured:not(.speaking) .seat-disc { box-shadow: 0 0 0 3px var(--primary-glow), 0 12px 28px rgba(0, 0, 0, .45); }
.seat video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.seat.local video { transform: scaleX(-1); }
.seat .avatar { height: 62%; font-size: calc(var(--s) * .26); }
.seat .micoff { position: absolute; bottom: 8%; left: 50%; transform: translateX(-50%); background: var(--danger); color: #0B0D12; border-radius: 999px; padding: 3px 6px; display: grid; place-items: center; }
.seat .micoff svg { width: 12px; height: 12px; }
.seat .label { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); max-width: calc(var(--s) * 1.6); display: flex; justify-content: center; }
.seat .label .nm { background: rgba(7, 8, 11, .72); padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .label .role-badge { font-size: 10px; }
.seat .hand { position: absolute; top: -4px; right: -4px; font-size: 20px; }

/* Botón «Finalizar» del organizador de una reunión */
.btn.ghost-danger { height: 50px; border-radius: 999px; padding: 0 18px; margin-right: 8px; background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px rgba(255, 107, 107, .55); }
.btn.ghost-danger:hover { background: rgba(255, 107, 107, .12); }
@media (max-width: 760px) { .btn.ghost-danger { height: 42px; padding: 0 12px; } }
@media (prefers-reduced-motion: reduce) { .seat, .table-top, .table-center { transition: none; } .table-center video, .center-avatar { animation: none; } }

/* Co-anfitrión */
.role-badge.cohost-badge { background: rgba(139, 124, 246, .22); color: var(--violet-text); }
/* Lista de participantes: los botones de moderación, en una segunda línea para que se lean los nombres */
.people li { flex-wrap: wrap; row-gap: 6px; }
.people li .acts { flex: 1 0 100%; padding-left: 36px; flex-wrap: wrap; gap: 6px; }
.people .act { white-space: nowrap; }

/* Inscripción previa (formulario público y aviso en la sala) */
.card-wide { max-width: 480px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.form .req { color: var(--primary); }
.form .hint, .result .hint { margin: 0; font-size: 13px; color: var(--landing-muted); text-align: center; }
.form-errors { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 107, 107, .12); color: var(--danger-text); font-size: 14px; }
.form-errors p { margin: 2px 0; }
.result { padding: 18px; border-radius: 16px; background: var(--field); box-shadow: inset 0 0 0 1px var(--landing-border); }
.result h2 { margin: 0 0 6px; font: 600 20px var(--font-display); }
.result p { margin: 0 0 8px; line-height: 1.5; color: var(--landing-text); }
.result-approved { box-shadow: inset 0 0 0 1px rgba(79, 209, 197, .5); }
.result-approved h2 { color: var(--success); }
.reg-box { display: grid; gap: 14px; }
.reg-box .btn { text-align: center; text-decoration: none; }
.reg-resend { display: flex; gap: 8px; margin-top: 4px; }
.reg-resend input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--landing-border); background: var(--field); color: var(--text); }
.reg-hello { margin: 0 0 4px; font-size: 15px; }
.flash-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(79, 209, 197, .12); color: var(--success); font-size: 14px; }

/* Traslado de la sala a otro servidor */
.move-banner { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; max-width: min(720px, calc(100vw - 24px)); padding: 12px 14px 12px 18px; border-radius: 14px; background: rgba(30, 33, 41, .97); color: #fff; font-size: 14px; line-height: 1.45; box-shadow: 0 0 0 1.5px var(--primary), 0 12px 32px rgba(0, 0, 0, .45); }
.move-banner[hidden] { display: none; }
.move-banner [data-left] { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); }
.move-banner .btn-move { flex: none; border: 0; border-radius: 999px; padding: 9px 16px; background: var(--primary); color: var(--on-primary); font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.move-banner .btn-move:disabled { opacity: .6; cursor: default; }
.move-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(11, 13, 18, .82); backdrop-filter: blur(4px); }
.move-overlay[hidden] { display: none; }
.move-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 34px; border-radius: 18px; background: var(--surface); color: var(--text); text-align: center; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.move-card b { font-size: 18px; }
.move-card p { margin: 0; color: var(--muted); font-size: 14px; }
.move-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: mvspin .9s linear infinite; margin-bottom: 6px; }
@keyframes mvspin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .move-banner { flex-direction: column; align-items: stretch; top: 8px; } }

/* Plan a medida (formulario público) */
.form select, .form textarea { padding: 13px 15px; border-radius: 14px; border: 1px solid var(--landing-border); background: var(--field); color: var(--text); font: inherit; font-size: 16px; font-weight: 400; }
.form textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.form select:focus, .form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form .row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.form .row2 label { min-width: 0; }
.form .row2 input, .form select, .form textarea { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 520px) { .form .row2 { grid-template-columns: 1fr; } }
.form .opt { font-weight: 400; color: var(--landing-muted); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.custom-list { margin: 0 0 18px; padding-left: 20px; color: var(--landing-text); font-size: 14.5px; line-height: 1.6; }

/* Selector de idioma */
.lang-switch { display: inline-flex; gap: 2px; font-weight: 600; font-size: 12px; vertical-align: middle; }
.lang-switch a, .lang-switch span { padding: 3px 7px; border-radius: 999px; text-decoration: none; color: var(--landing-muted); }
.lang-switch a:hover { color: var(--text); }
.lang-switch .on { background: var(--primary); color: var(--on-primary); }

/* ---------- Diseño del cliente: logo, portada de la sala de espera y pantalla final ---------- */
.brand .brand-logo { max-height: 48px; max-width: 240px; width: auto; height: auto; object-fit: contain; }
.room-logo { max-height: 56px; max-width: 260px; object-fit: contain; margin-bottom: 4px; }
.tb-logo { max-height: 28px; max-width: 140px; object-fit: contain; margin-right: 6px; }
.wait-cover { width: min(560px, 92vw); max-height: 240px; object-fit: cover; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); }
.center-screen .wait-welcome { max-width: 560px; white-space: pre-line; color: var(--text); font-size: 16px; line-height: 1.5; }
.center-screen .end-message { color: var(--text);  max-width: 560px; white-space: pre-line; font-size: 16px; line-height: 1.5; }
.end-link { text-decoration: none; display: inline-block; }
.center-screen .end-redirect { color: var(--muted); font-size: 14px; }
.theme-light .card { box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(18, 21, 28, .08); }
.theme-light .move-overlay { background: rgba(238, 241, 245, .82); }
/* Lo que va encima del vídeo se lee siempre en claro, también con el diseño claro */
.tile .label .nm, .seat .label .nm, .screen-label, .center-label, .center-full { color: #ECEFF4; }
#endedText:empty { display: none; }
