/* Reuniones · marca de telentic.es: grises claros + amarillo #fdc400 (tokens del tema telenTIC 3D). Todo en claro. */
:root {
  --lienzo: #e7e8eb;
  --superficie: #f4f4f5;
  --campo: #ffffff;
  --borde: rgb(23 24 27 / .14);
  --texto: #17181b;
  --sutil: #474c55;
  --grafito: #2b2d33;
  --amarillo: #fdc400;
  --amarillo-2: #ffd339;
  --tinta-amarillo: #1a1400;
  --peligro: #c0392b;
  --ok: #1f8a4c;
  --error: #c0392b;
  --radio: 14px;
  color-scheme: light;
  font-family: "Albert Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}
h1, h2, h3, .marca b { font-family: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--lienzo); color: var(--texto); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.sutil { color: var(--sutil); font-size: .92em; }
.error { color: var(--error); min-height: 1.2em; margin: .2rem 0; font-size: .92rem; }

.marca { display: flex; align-items: center; gap: .5rem; font-size: .95rem; letter-spacing: .01em; }
.marca .punto { width: 10px; height: 10px; border-radius: 3px; background: var(--amarillo); }

/* ── Entrada ─────────────────────────────────────────────── */
.entrada { min-height: 100%; display: grid; place-items: center; padding: 1.5rem; }
.tarjeta {
  width: min(460px, 100%); background: var(--superficie); border: 1px solid var(--borde);
  border-radius: 20px; padding: 1.6rem; box-shadow: 0 20px 50px rgb(23 24 27 / .12);
}
.tarjeta h1 { font-size: 1.5rem; margin: 1rem 0 .2rem; }
.tarjeta form { display: grid; gap: .9rem; margin-top: 1.1rem; }
.tarjeta label { display: grid; gap: .35rem; font-size: .92rem; }
input, select {
  width: 100%; padding: .7rem .8rem; border-radius: 10px; border: 1px solid var(--borde);
  background: var(--campo); color: var(--texto); outline: none;
}
input:focus, select:focus { border-color: var(--amarillo); box-shadow: 0 0 0 3px rgb(253 196 0 / .35); }
.primario {
  border: 0; border-radius: 10px; padding: .8rem 1rem; font-weight: 600; cursor: pointer;
  background: var(--amarillo); color: var(--tinta-amarillo); transition: background .15s, transform .1s;
}
.primario:hover { background: var(--amarillo-2); }
.primario:active { transform: translateY(1px); }
.primario:disabled { opacity: .6; cursor: progress; }
.primario.pequeno { padding: .45rem .8rem; }

.previa { position: relative; aspect-ratio: 16/9; margin-top: 1rem; border-radius: 14px; overflow: hidden; background: #d5d7dc; }
.previa video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.sin-camara { position: absolute; inset: 0; display: grid; place-items: center; color: var(--sutil); }
.previa-botones { position: absolute; bottom: .7rem; left: 50%; translate: -50% 0; display: flex; gap: .6rem; }

/* ── Micrófono, altavoz y cámara ─────────────────────────── */
.entrada-cuerpo { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: .9rem; margin-top: 1rem; align-items: stretch; }
.entrada-cuerpo .previa { margin-top: 0; aspect-ratio: auto; min-height: 230px; }
.dispositivos { display: grid; gap: .45rem; align-content: start; padding: .8rem .9rem; border-radius: 12px; background: var(--campo); border: 1px solid var(--borde); }
.disp-titulo { margin: 0 0 .1rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sutil); }
.dispositivos label, .bloque-disp { display: grid; gap: .25rem; font-size: .85rem; font-weight: 600; }
.dispositivos select { padding: .45rem .55rem; font-size: .88rem; }
.nivel { height: 8px; border-radius: 999px; background: #dcdde1; overflow: hidden; }
.nivel span { display: block; height: 100%; width: 0; border-radius: inherit; background: #a3a6ad; transition: width .08s linear; }
.nivel span.alto { background: var(--ok); }
.nivel-aviso { margin: 0; font-size: .8rem; line-height: 1.3; color: var(--sutil); }
.nivel-aviso.bien { color: var(--ok); font-weight: 600; }
.nivel-aviso.mal { color: var(--error); }
.fila-altavoz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: end; }
.secundario { border: 1px solid var(--borde); background: var(--campo); border-radius: 10px; padding: .55rem .8rem; cursor: pointer; font-weight: 600; color: var(--texto); }
.secundario:hover { border-color: var(--amarillo); }
.secundario.pequeno { padding: .45rem .65rem; font-size: .85rem; }
.panel-audio .nivel { margin: .1rem 0 .2rem; }
.panel-audio .fila-altavoz { margin: .6rem 0 .6rem; }
.panel-audio .bloque-disp { grid-template-columns: 1fr; margin-bottom: .6rem; }
.panel-audio select { padding: .45rem .55rem; }

/* tarjeta de entrada más ancha para que la configuración vaya al lado del vídeo */
#entrada .tarjeta { width: min(860px, 100%); }
#entrada .tarjeta form { grid-template-columns: 1fr 1fr; align-items: end; }
#entrada .tarjeta form > :is(#e-pw-caja, .error, .primario) { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .entrada-cuerpo { grid-template-columns: 1fr; }
  .entrada-cuerpo .previa { aspect-ratio: 16/9; min-height: 0; }
  #entrada .tarjeta form { grid-template-columns: 1fr; }
}

/* ── Botones redondos ───────────────────────────────────── */
.redondo {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--borde); cursor: pointer;
  background: var(--campo); display: grid; place-items: center; color: var(--sutil);
  box-shadow: 0 2px 6px rgb(23 24 27 / .08); transition: background .15s, color .15s;
}
.redondo:hover { color: var(--texto); border-color: rgb(23 24 27 / .3); }
.redondo.activo { background: var(--amarillo); color: var(--tinta-amarillo); border-color: transparent; }
.redondo.salir { background: var(--peligro); color: #fff; border-color: transparent; }

/* ── Sala ────────────────────────────────────────────────── */
.sala { height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }
.barra-sup { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; }
.sup-der { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px;
  background: var(--campo); border: 1px solid var(--borde); font-size: .85rem; color: var(--sutil);
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #a3a6ad; }
.chip.ok::before { background: var(--ok); }
.chip.prueba::before { background: var(--amarillo); }
.chip.fallo { color: var(--error); border-color: rgb(192 57 43 / .35); }
.chip.fallo::before { background: var(--error); }
.boton-chip, .idioma-chip { }
.boton-chip::before, .idioma-chip::before { display: none; }
.boton-chip { cursor: pointer; }
.boton-ia { background: var(--amarillo); color: var(--tinta-amarillo); border-color: transparent; font-weight: 600; }
.boton-ia:hover { color: var(--tinta-amarillo); background: var(--amarillo-2); }
.boton-ia.apagado { background: var(--campo); color: var(--sutil); border-color: var(--borde); font-weight: 400; }
.boton-chip:hover { color: var(--texto); }
.idioma-chip select { width: auto; padding: .1rem .3rem; border: 0; background: transparent; color: var(--texto); box-shadow: none; }

.centro { display: flex; min-height: 0; min-width: 0; }
.rejilla {
  --cols: 1; display: grid; gap: .6rem; padding: .4rem 1rem; min-height: 0; flex: 1; min-width: 0;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr);
}
.rejilla[data-n="2"] { --cols: 2; }
.rejilla[data-n="3"], .rejilla[data-n="4"] { --cols: 2; }
.rejilla[data-n="5"], .rejilla[data-n="6"] { --cols: 3; }
.rejilla[data-n="7"], .rejilla[data-n="8"], .rejilla[data-n="9"] { --cols: 3; }
/* Una ficha en grande (pantalla compartida o persona fijada) y las demás en columna */
.rejilla.con-foco {
  grid-template-columns: minmax(0, 1fr) repeat(var(--lado-cols, 1), 200px);
  grid-template-rows: repeat(var(--lado-filas, 3), minmax(0, 1fr));
}
.rejilla.con-foco .ficha { min-height: 0; }
.rejilla.con-foco .ficha.foco { grid-column: 1; grid-row: 1 / -1; order: -1; }
.rejilla.con-foco.foco-solo { grid-template-columns: minmax(0, 1fr); }

.ficha {
  position: relative; border-radius: var(--radio); overflow: hidden; background: #d5d7dc;
  border: 3px solid transparent; transition: border-color .2s; min-height: 120px;
}
.ficha.hablando { border-color: var(--amarillo); }
/* Semáforo de turnos (lo calcula el traductor): rojo habla, ámbar aún se traduce, verde libre */
.centro { position: relative; }
.semaforo {
  position: absolute; top: .55rem; left: 50%; translate: -50% 0; z-index: 5; max-width: calc(100% - 2rem);
  display: flex; align-items: center; gap: .6rem; padding: .35rem .85rem .35rem .45rem;
  border-radius: 999px; background: rgb(255 255 255 / .96); border: 1px solid var(--borde, #d9dbe0);
  box-shadow: 0 4px 18px rgb(20 22 28 / .12); font-weight: 600; font-size: .95rem; pointer-events: none;
}
.semaforo #semaforo-texto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.semaforo .luces { display: flex; gap: .25rem; padding: .25rem .35rem; border-radius: 999px; background: #2b2e35; flex: none; }
.semaforo .luces i { width: 13px; height: 13px; border-radius: 50%; opacity: .22; transition: opacity .15s, box-shadow .15s; }
.semaforo .l-rojo { background: #e5483f; }
.semaforo .l-ambar { background: #f5a300; }
.semaforo .l-verde { background: #2fbf6b; }
.semaforo.rojo .l-rojo, .semaforo.ambar .l-ambar, .semaforo.verde .l-verde { opacity: 1; box-shadow: 0 0 9px currentColor; }
.semaforo.rojo .l-rojo { color: #e5483f; }
.semaforo.ambar .l-ambar { color: #f5a300; animation: latido 1s ease-in-out infinite; }
.semaforo.verde .l-verde { color: #2fbf6b; }
.semaforo.rojo { border-color: rgb(229 72 63 / .45); }
.semaforo.ambar { border-color: rgb(245 163 0 / .55); }
.semaforo.verde { border-color: rgb(47 191 107 / .45); }
@keyframes latido { 50% { opacity: .45; } }
.ficha.sem-habla { border-color: #e5483f; }
.ficha.sem-traduce { border-color: #f5a300; }
.ficha .sem-marca { position: absolute; top: .5rem; left: .5rem; padding: .15rem .5rem; border-radius: 8px; font-size: .78rem; font-weight: 600; background: #f5a300; color: #2b2e35; }
@media (max-width: 700px) {
  .semaforo { top: .3rem; font-size: .82rem; gap: .4rem; padding: .25rem .6rem .25rem .3rem; }
  .semaforo .luces i { width: 10px; height: 10px; }
  .ficha .sem-marca { font-size: .7rem; }
}
.ficha video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ficha.pantalla video { object-fit: contain; background: #fff; }
.ficha { cursor: pointer; }
.ficha .marcas { position: absolute; top: .5rem; right: .5rem; display: flex; gap: .3rem; }
.ficha .marca-f { padding: .15rem .45rem; border-radius: 8px; background: rgb(255 255 255 / .92); font-size: .95rem; line-height: 1.3; }
.ficha .marca-f.mala { color: var(--error); font-size: .78rem; font-weight: 600; }
.ficha .vuela { position: absolute; left: 50%; bottom: 18%; font-size: 2.6rem; translate: -50% 0; animation: vuela 2.4s ease-out forwards; pointer-events: none; }
@keyframes vuela { 0% { opacity: 0; transform: translateY(20px) scale(.6); } 15% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-90px) scale(1); } }
.ficha video.espejo { transform: scaleX(-1); }
.avatar {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.8rem; font-weight: 700;
  background: var(--grafito); color: var(--amarillo); font-family: "Bricolage Grotesque", system-ui, sans-serif;
}
.ficha:not(.sin-video) .avatar { display: none; }
.pie {
  position: absolute; left: .5rem; bottom: .5rem; display: flex; align-items: center; gap: .4rem;
  padding: .25rem .55rem; border-radius: 8px; background: rgb(255 255 255 / .9); color: var(--texto); font-size: .85rem;
}
.mic-off { color: var(--error); display: inline-grid; }
.mic-off svg { width: 16px; height: 16px; }

/* Los subtítulos van encima del vídeo: caja oscura para que se lean sobre cualquier imagen */
.subtitulos {
  position: fixed; left: 50%; bottom: 100px; translate: -50% 0; width: min(900px, calc(100% - 2rem));
  display: grid; gap: .3rem; pointer-events: none;
}
.subtitulos p {
  margin: 0; padding: .45rem .8rem; border-radius: 10px; background: rgb(23 24 27 / .82); color: #fff;
  font-size: 1.05rem; line-height: 1.35; text-align: center;
}
.subtitulos b { color: var(--amarillo); font-weight: 600; }

.barra-inf { display: flex; justify-content: center; gap: .7rem; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); }

.panel-audio {
  position: fixed; right: 1rem; bottom: 86px; width: 300px; padding: 1rem; border-radius: var(--radio);
  background: var(--campo); border: 1px solid var(--borde); box-shadow: 0 12px 40px rgb(23 24 27 / .18);
}
.panel-audio h3 { margin: 0 0 .6rem; font-size: 1rem; }
.panel-audio label { display: grid; grid-template-columns: 1fr auto; gap: .3rem; margin-bottom: .8rem; font-size: .9rem; }
.panel-audio input { grid-column: 1 / -1; padding: 0; accent-color: var(--amarillo); box-shadow: none; }

.aviso {
  position: fixed; top: 64px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: .8rem;
  padding: .6rem .9rem; border-radius: 12px; background: #fff6d6; border: 1px solid #f0d27a;
}
.tostada {
  position: fixed; top: 72px; left: 50%; translate: -50% -20px; opacity: 0; pointer-events: none;
  padding: .6rem 1rem; border-radius: 12px; background: var(--campo); border: 1px solid var(--borde);
  box-shadow: 0 8px 24px rgb(23 24 27 / .14);
  transition: opacity .25s, translate .25s; max-width: calc(100% - 2rem); text-align: center;
}
.tostada.visible { opacity: 1; translate: -50% 0; }
.tostada.fallo { border-color: rgb(192 57 43 / .4); color: var(--error); }

@media (max-width: 700px) {
  .lateral { position: fixed; inset: 0; width: auto !important; margin: 0 !important; border-radius: 0 !important; z-index: 5; }
  .barra-inf { gap: .35rem !important; padding-inline: .4rem !important; }
  .redondo { width: clamp(32px, 9.2vw, 40px) !important; height: clamp(32px, 9.2vw, 40px) !important; }
  .reloj { margin-left: auto; }
  /* los chips de arriba, en una sola fila que se desliza con el dedo (antes ocupaban 4 filas) */
  .barra-sup { gap: .45rem !important; padding: .5rem .6rem !important; }
  .sup-der { flex-wrap: nowrap !important; justify-content: flex-start !important; overflow-x: auto; scrollbar-width: none; }
  .sup-der::-webkit-scrollbar { display: none; }
  .sup-der > * { flex: none; }
  .barra-inf { flex-wrap: nowrap; }
  .subtitulos { bottom: 76px !important; }
  .subtitulos p { font-size: .95rem !important; }
  .barra-sup { flex-direction: column; align-items: stretch; }
  .redondo { width: 44px; height: 44px; }
  .panel-audio { left: 1rem; right: 1rem; width: auto; }
}

/* ── Panel lateral: personas, chat y transcripción ───────── */
.reloj { font-variant-numeric: tabular-nums; color: var(--sutil); font-size: .85rem; padding: .15rem .5rem; border-radius: 999px; background: var(--campo); border: 1px solid var(--borde); }
.lateral {
  width: 340px; margin: .4rem 1rem .4rem 0; display: flex; flex-direction: column; min-height: 0;
  background: var(--campo); border: 1px solid var(--borde); border-radius: var(--radio);
}
.pestanas { display: flex; gap: .2rem; padding: .5rem .5rem 0; border-bottom: 1px solid var(--borde); }
.pestanas button { border: 0; background: none; padding: .5rem .6rem; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--sutil); border-bottom: 3px solid transparent; }
.pestanas button.activa { color: var(--texto); border-bottom-color: var(--amarillo); }
.pestanas .cerrar { margin-left: auto; font-weight: 400; }
.pagina { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: .7rem; gap: .5rem; }
.nota { margin: 0; font-size: .82rem; }
.globo { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--peligro); color: #fff; font-size: .7rem; font-weight: 700; }
.redondo { position: relative; }
.redondo .globo { position: absolute; top: -4px; right: -4px; }
.lista-personas { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: .3rem; align-content: start; }
.lista-personas li { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border-radius: 10px; font-size: .92rem; }
.lista-personas li:hover { background: var(--superficie); }
.lista-personas .quien { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-personas .idi { color: var(--sutil); font-size: .82rem; }
.lista-personas .mic-off svg { width: 16px; height: 16px; }
.mensajes, .acta { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: .5rem; align-content: start; overflow-wrap: anywhere; }
.mensajes p, .acta p { margin: 0; padding: .45rem .6rem; border-radius: 10px; background: var(--superficie); font-size: .92rem; line-height: 1.35; }
.mensajes p.mio { background: #fff3c4; }
.mensajes b, .acta b { display: block; font-size: .78rem; color: var(--sutil); font-weight: 600; margin-bottom: .1rem; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: .4rem; }
.chat-form input { padding: .5rem .6rem; }
.con-menu { position: relative; display: inline-grid; }
.reacciones { position: absolute; bottom: 58px; left: 50%; translate: -50% 0; display: flex; gap: .2rem; padding: .35rem; border-radius: 999px; background: var(--campo); border: 1px solid var(--borde); box-shadow: 0 8px 24px rgb(23 24 27 / .16); z-index: 4; }
.reacciones button { border: 0; background: none; font-size: 1.5rem; line-height: 1; padding: .25rem .3rem; border-radius: 50%; cursor: pointer; }
.reacciones button:hover { background: var(--superficie); }
.lateral:not([hidden]) ~ .subtitulos, .sala.con-lateral .subtitulos { left: calc(50% - 178px); width: min(900px, calc(100% - 356px - 2rem)); }
@media (max-width: 700px) { .sala.con-lateral .subtitulos { left: 50%; width: calc(100% - 2rem); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .ficha .vuela { animation-duration: .01s; } }

/* Reunión creada sin IA: todo lo que tiene que ver con la traducción desaparece (no solo se
   desactiva). Va con !important porque varios de estos elementos fijan su propio display. */
body.sin-ia .solo-ia { display: none !important; }

/* ── Rejilla en el móvil ──────────────────────────────────────────────────────
   Las fichas siempre caben enteras y nunca se montan unas sobre otras:
   · de pie: 1 o 2 personas, una debajo de otra; de 3 a 6, en dos columnas que llenan la
     pantalla; con más, dos columnas y se desliza con el dedo.
   · tumbado: todas en una o dos filas.
   · con pantalla compartida o alguien fijado: esa ficha grande arriba y las demás en
     miniatura debajo (de pie) o a la derecha (tumbado). */
@media (max-width: 700px) {
  .rejilla { padding: .3rem .5rem; gap: .4rem; overflow-y: auto; grid-auto-rows: minmax(0, 1fr); }
  .rejilla .ficha { min-height: 0; }
  .rejilla:not(.con-foco) { --cols: 2; }
  .rejilla:not(.con-foco)[data-n="1"], .rejilla:not(.con-foco)[data-n="2"] { --cols: 1; }
  .rejilla:not(.con-foco):not([data-n="1"]):not([data-n="2"]):not([data-n="3"]):not([data-n="4"]):not([data-n="5"]):not([data-n="6"]) { grid-auto-rows: 150px; }
  /* con 3 o 5, la última ficha ocupa las dos columnas en vez de dejar un hueco */
  .rejilla:not(.con-foco)[data-n="3"] .ficha:last-child, .rejilla:not(.con-foco)[data-n="5"] .ficha:last-child { grid-column: 1 / -1; }

  .rejilla.con-foco {
    grid-template-columns: repeat(var(--tira-cols, 3), minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) repeat(var(--tira-filas, 1), 84px);
  }
  .rejilla.con-foco.foco-solo { grid-template-rows: minmax(0, 1fr); }
  .rejilla.con-foco .ficha.foco { grid-column: 1 / -1; grid-row: 1; }
  .rejilla.con-foco .ficha:not(.foco) .avatar { scale: .55; }
  .rejilla.con-foco .ficha:not(.foco) .pie { font-size: .68rem; padding: .08rem .3rem; left: .2rem; bottom: .2rem; max-width: calc(100% - .4rem); }
}
/* Móvil tumbado (poca altura) */
@media (max-height: 500px) and (orientation: landscape) {
  .barra-sup { padding-block: .3rem !important; }
  .barra-inf { padding-block: .3rem !important; }
  .rejilla { padding: .2rem .5rem; gap: .4rem; overflow-y: auto; grid-auto-rows: minmax(0, 1fr); }
  .rejilla .ficha { min-height: 0; }
  .rejilla:not(.con-foco) { --cols: 4; grid-auto-rows: 130px; }
  .rejilla:not(.con-foco)[data-n="1"] { --cols: 1; grid-auto-rows: minmax(0, 1fr); }
  .rejilla:not(.con-foco)[data-n="2"] { --cols: 2; grid-auto-rows: minmax(0, 1fr); }
  .rejilla:not(.con-foco)[data-n="3"] { --cols: 3; grid-auto-rows: minmax(0, 1fr); }
  .rejilla:not(.con-foco)[data-n="4"] { --cols: 4; grid-auto-rows: minmax(0, 1fr); }
  .rejilla:not(.con-foco)[data-n="5"], .rejilla:not(.con-foco)[data-n="6"] { --cols: 3; grid-auto-rows: minmax(0, 1fr); }
  .rejilla:not(.con-foco) .ficha:last-child { grid-column: auto; }
  .rejilla.con-foco {
    grid-template-columns: minmax(0, 1fr) repeat(var(--tumbado-cols, 1), 118px);
    grid-template-rows: repeat(var(--tumbado-filas, 2), minmax(0, 1fr));
  }
  .rejilla.con-foco.foco-solo { grid-template-columns: minmax(0, 1fr); }
  .rejilla.con-foco .ficha.foco { grid-column: 1; grid-row: 1 / -1; }
  .rejilla.con-foco .ficha:not(.foco) .avatar { scale: .5; }
  .rejilla.con-foco .ficha:not(.foco) .pie { font-size: .68rem; padding: .08rem .3rem; left: .2rem; bottom: .2rem; max-width: calc(100% - .4rem); }
}
}

/* El nombre nunca se sale de su ficha: si no cabe, se corta con puntos suspensivos */
.pie { max-width: calc(100% - 1rem); }
.pie .nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Sala de espera ───────────────────────────────────────────────────────── */
.espera { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: 12px; background: var(--campo); border: 1px solid var(--borde); margin-top: .6rem; font-size: .92rem; }
.espera > div { flex: 1; min-width: 0; }
.girando { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--borde); border-top-color: var(--amarillo); animation: gira 1s linear infinite; }
@keyframes gira { to { rotate: 360deg; } }
/* Para el anfitrión: quién está llamando a la puerta. Encima de todo, para que no se le pase */
.peticiones {
  position: fixed; top: 4.2rem; right: 1rem; z-index: 20; width: min(340px, calc(100vw - 2rem));
  background: var(--panel, #fff); border: 2px solid var(--amarillo); border-radius: 14px; padding: .8rem;
  box-shadow: 0 12px 34px rgb(0 0 0 / .22); max-height: 60dvh; overflow-y: auto;
}
.peticiones-cab { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.peticiones ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.peticiones li { display: grid; gap: .45rem; padding: .55rem .6rem; border-radius: 10px; background: var(--campo); }
.peticiones li span { overflow-wrap: anywhere; }
.peticiones li div { display: flex; gap: .4rem; }
.peticiones li button { flex: 1; }
@media (max-width: 700px) { .peticiones { top: 5.6rem; right: .5rem; left: .5rem; width: auto; } }
/* Que el semáforo no tape la parte de arriba de los vídeos */
.centro:has(> .semaforo:not([hidden])) .rejilla { padding-top: 3.1rem; }
@media (max-width: 700px) { .centro:has(> .semaforo:not([hidden])) .rejilla { padding-top: 2.3rem; } }
/* Los avisos van por encima del semáforo y, si está visible, justo debajo de él */
.tostada { z-index: 30; }
body:has(#semaforo:not([hidden])) .tostada { top: 112px; }
@media (max-width: 700px) { body:has(#semaforo:not([hidden])) .tostada { top: 128px; } }
