/* Identidade GMASYSTEM Tecnologia: laranja → rosa → roxo sobre preto */
:root {
  --fundo: #0e0e11;
  --painel: #17171c;
  --painel-2: #1f1f26;
  --borda: #2c2c36;
  --texto: #f4f4f6;
  --texto-2: #a9a9b6;
  --laranja: #f7841e;
  --rosa: #d81b7f;
  --roxo: #7a1fa2;
  --gradiente: linear-gradient(90deg, var(--laranja), var(--rosa) 55%, var(--roxo));
  --verde: #2ecc71;
  --vermelho: #ff4d5e;
  --raio: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: #ff7ac0; }
.oculto { display: none !important; }

/* ---------- botões e campos ---------- */
button, .botao {
  font: inherit; cursor: pointer; border: 1px solid var(--borda);
  background: var(--painel-2); color: var(--texto);
  padding: 8px 14px; border-radius: 9px; transition: filter .15s, background .15s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover { filter: brightness(1.2); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primario { background: var(--gradiente); border: 0; font-weight: 600; }
.perigo { background: #3a1520; border-color: #6b2333; color: #ffb3bd; }
.sucesso { background: #133524; border-color: #1f6b43; color: #a6f3c6; }
.ativo { background: var(--rosa); border-color: var(--rosa); }
.pequeno { padding: 4px 9px; font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--borda); background: #0b0b0e; color: var(--texto);
}
input:focus { outline: 2px solid var(--rosa); outline-offset: 1px; }
label { display: block; margin: 12px 0 5px; color: var(--texto-2); font-size: 13px; }

/* ---------- cartão central (login, entrada) ---------- */
.centro { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.cartao {
  width: 100%; max-width: 420px; background: var(--painel);
  border: 1px solid var(--borda); border-radius: 18px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.cartao .logo-grande { display: block; width: 130px; height: 130px; margin: 0 auto 10px; border-radius: 50%; }
.cartao h1 { text-align: center; font-size: 20px; margin: 6px 0 2px; }
.cartao p.sub { text-align: center; color: var(--texto-2); margin: 0 0 14px; }
.cartao .primario { width: 100%; justify-content: center; margin-top: 18px; padding: 12px; }
.erro { background: #3a1520; color: #ffb3bd; border: 1px solid #6b2333; padding: 9px 12px; border-radius: 9px; margin-top: 12px; }
.faixa-gradiente { height: 4px; background: var(--gradiente); border-radius: 4px; margin: 14px 0; }

/* ---------- topo ---------- */
.topo {
  display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  background: var(--painel); border-bottom: 1px solid var(--borda);
}
.topo img { width: 42px; height: 42px; border-radius: 50%; }
.topo .titulo { font-weight: 700; font-size: 16px; }
.topo .titulo small { display: block; font-weight: 400; color: var(--texto-2); font-size: 12px; }
.topo .espaco { flex: 1; }
.selo {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  background: var(--painel-2); border: 1px solid var(--borda); font-size: 13px;
}
.selo.gravando { background: #4a0f1a; border-color: var(--vermelho); color: #ffd0d6; }
.selo.gravando::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--vermelho); animation: piscar 1s infinite; }
@keyframes piscar { 50% { opacity: .2; } }

/* ---------- painel de salas ---------- */
.conteudo { max-width: 1100px; margin: 0 auto; padding: 24px; }
.grade-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 12px; align-items: end; }
.grade-form .campo-largo { grid-column: span 3; }
input[type=datetime-local] { color-scheme: dark; }
.grade-form label { margin-top: 0; }
.bloco { background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px; margin-bottom: 20px; }
.bloco h2 { margin: 0 0 14px; font-size: 17px; }
.sala-item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px;
  border: 1px solid var(--borda); border-radius: 10px; margin-top: 10px; background: var(--painel-2);
}
.sala-item .nome { font-weight: 600; }
.sala-item .meta { color: var(--texto-2); font-size: 13px; margin-top: 3px; }
.sala-item .acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.link-convite { display: flex; gap: 8px; margin-top: 8px; }
.link-convite input { font-size: 12px; padding: 6px 9px; }

/* ---------- live ---------- */
.live { display: grid; grid-template-columns: 1fr 360px; }
/* a live ocupa exatamente a janela (computador e celular): cabeçalho em cima, o resto é do
   vídeo e do painel — sem altura definida, os vídeos cresciam até o tamanho da câmera */
#etapa-live, body#pagina-admin { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
#etapa-live > .topo, body#pagina-admin > .topo { flex: none; }
#etapa-live > .live, body#pagina-admin > .live { flex: 1; min-height: 0; }
.palco { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.videos {
  flex: 1; display: grid; gap: 10px; padding: 12px; min-height: 0; overflow: auto;
  position: relative;
  /* colunas/linhas calculadas pela GradeVideos para tudo caber na tela, em qualquer aparelho */
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  grid-template-rows: repeat(var(--linhas, 1), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}
/* muita gente: os blocos ficariam minúsculos, então a grade rola */
.videos.rolagem { grid-template-rows: none; grid-auto-rows: 120px; }

/* destaque com a tela deitada: vídeo principal à esquerda, os outros numa coluna à direita */
.videos.com-destaque.deitado {
  grid-template-columns: minmax(0, 1fr) repeat(var(--cols-lado, 1), clamp(110px, 22%, 280px));
  grid-template-rows: repeat(var(--linhas, 1), minmax(0, 1fr));
}
.videos.com-destaque.deitado .bloco-video.destaque { grid-column: 1; grid-row: 1 / -1; }
/* destaque com a tela em pé: principal em cima, os outros embaixo */
.videos.com-destaque:not(.deitado) {
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  grid-template-rows: minmax(0, 3fr) repeat(var(--linhas, 1), minmax(0, 1fr));
}
.videos.com-destaque:not(.deitado) .bloco-video.destaque { grid-column: 1 / -1; grid-row: 1; }
.videos.com-destaque.rolagem { grid-template-rows: minmax(60%, 1fr); grid-auto-rows: 100px; }
.bloco-video {
  position: relative; background: #000; border-radius: var(--raio); overflow: hidden;
  border: 1px solid var(--borda); user-select: none; -webkit-user-select: none;
}
.bloco-video video { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
/* rodapé do bloco: nome + (admin) botões de mutar / desligar câmera ao lado */
.rodape-bloco {
  position: absolute; left: 8px; bottom: 8px; right: 8px; z-index: 16;
  display: flex; align-items: center; gap: 5px; pointer-events: none;
}
.bloco-video .rotulo {
  background: rgba(0,0,0,.65); padding: 3px 9px; border-radius: 6px; font-size: 13px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-bloco {
  display: none; pointer-events: auto; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  align-items: center; justify-content: center; flex: none;
  background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.2); color: #fff;
}
.btn-bloco svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-bloco:hover { background: var(--vermelho); border-color: var(--vermelho); filter: none; }
.bloco-video.mic-ligado .btn-bloco-mic, .bloco-video.cam-ligada .btn-bloco-cam { display: inline-flex; }
.bloco-video.espelho video { transform: scaleX(-1); }
/* convidado na sala sem câmera: bloco com a inicial do nome */
.bloco-video .avatar { display: none; }
.bloco-video.sem-video, .bloco-video.camera-off { background: var(--painel-2); }
/* câmera desligada: o vídeo fica escondido (o som continua) e aparece a inicial */
.bloco-video.sem-video video, .bloco-video.camera-off video { display: none; }
.bloco-video.sem-video .avatar, .bloco-video.camera-off .avatar {
  display: grid; place-items: center; position: absolute; inset: 0; margin: auto;
  width: min(38%, 96px); aspect-ratio: 1; border-radius: 50%; background: var(--gradiente);
  color: #fff; font-size: clamp(20px, 5vw, 38px); font-weight: 700;
}
.vazio { display: grid; place-items: center; color: var(--texto-2); text-align: center; grid-column: 1 / -1; }
.vazio img { width: 110px; opacity: .8; border-radius: 50%; }

.controles {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 12px;
  background: var(--painel); border-top: 1px solid var(--borda);
}

.lateral { background: var(--painel); border-left: 1px solid var(--borda); display: flex; flex-direction: column; min-height: 0; }
.abas { display: flex; border-bottom: 1px solid var(--borda); }
.abas button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 11px 4px; font-size: 13px; color: var(--texto-2); }
.abas button.sel { color: var(--texto); box-shadow: inset 0 -3px 0 var(--rosa); }
.abas .fechar-lateral { flex: none; padding: 9px 12px; border-right: 1px solid var(--borda); }
.abas .fechar-lateral:hover { color: var(--texto); }
.abas .titulo-chat { cursor: default; font-weight: 600; }
.icone-seta { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* seta para reabrir o painel/chat escondido (canto superior direito do vídeo) */
.abrir-lateral {
  position: absolute; top: 10px; right: 10px; z-index: 25; padding: 7px 9px;
  background: rgba(15,15,20,.72); border-color: rgba(255,255,255,.12); backdrop-filter: blur(4px);
}
.abrir-lateral .contador { background: var(--rosa); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; }
body.com-lateral .abrir-lateral { display: none; }
#btn-painel .contador { background: var(--rosa); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 6px; }
#btn-painel.ativo .contador { background: #fff; color: var(--rosa); }
button.bloqueado { opacity: .55; }
.abas .contador { background: var(--rosa); color: #fff; border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 3px; }
.aba { flex: 1; overflow: auto; padding: 12px; min-height: 0; }
.aba-cabecalho { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--texto-2); font-size: 13px; }

.pessoa {
  display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 9px;
  border: 1px solid var(--borda); margin-bottom: 7px; background: var(--painel-2);
}
.pessoa { flex-wrap: wrap; }
.pessoa .info { flex: 1 1 150px; min-width: 0; }
.pessoa .info b { display: block; overflow-wrap: anywhere; }
.pessoa .info small { color: var(--texto-2); font-size: 12px; }
.pessoa .botoes { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: #2c2c36; margin-left: 4px; }
.tag.mao { background: #5a3a00; color: #ffd27a; }
.tag.falar { background: #133524; color: #a6f3c6; }
.tag.alerta { background: #4a0f1a; color: #ffd0d6; }

.alerta-item { border-left: 3px solid var(--vermelho); background: var(--painel-2); padding: 8px 10px; border-radius: 6px; margin-bottom: 7px; font-size: 13px; }
.alerta-item small { color: var(--texto-2); }

.chat { display: flex; flex-direction: column; height: 100%; }
.chat-msgs { flex: 1; overflow: auto; min-height: 0; }
.chat-msg { margin-bottom: 8px; font-size: 14px; word-wrap: break-word; }
.chat-msg b { color: #ff9ad0; }
.chat-msg.adm b { color: var(--laranja); }
.chat-msg small { color: var(--texto-2); font-size: 11px; margin-left: 4px; }
.chat-form { display: flex; gap: 6px; padding-top: 8px; }
.chat-form.com-emoji { position: relative; }
.chat-form input { flex: 1; min-width: 0; }
.btn-emoji { padding: 6px 9px; font-size: 18px; line-height: 1; flex: none; }
.emoji-grade {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 50;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 220px; overflow: auto;
  background: var(--painel-2); border: 1px solid var(--borda); border-radius: 10px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.emoji-grade .emoji { background: none; border: 0; padding: 4px 0; font-size: 20px; line-height: 1.2; border-radius: 6px; }
.emoji-grade .emoji:hover { background: #2c2c36; filter: none; }
.bloco-titulo { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bloco-titulo h2 { margin: 0; }
.bloco-titulo + * { margin-top: 14px; }

.gravacao-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--borda); border-radius: 9px; margin-bottom: 7px; font-size: 13px; }

.aviso-topo { background: #2b1f00; color: #ffd27a; border-bottom: 1px solid #5a3a00; padding: 8px 16px; font-size: 13px; text-align: center; }

.toast {
  position: fixed; right: 18px; bottom: 18px; background: var(--painel-2); border: 1px solid var(--borda);
  border-left: 4px solid var(--rosa); padding: 12px 16px; border-radius: 10px; max-width: 360px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); z-index: 1000;
}

/* ---------- mão levantada ---------- */
.selo-mao {
  display: none; position: absolute; top: 8px; left: 8px; z-index: 15; align-items: center; gap: 6px;
  background: linear-gradient(90deg, #f7841e, #ffb13b); color: #2a1600; font-weight: 700; font-size: 13px;
  padding: 4px 10px 4px 6px; border-radius: 99px; box-shadow: 0 4px 14px rgba(0,0,0,.45);
}
.selo-mao .mao-emoji { font-size: 22px; line-height: 1; display: inline-block; transform-origin: 70% 90%; animation: acenar 1.2s ease-in-out infinite; }
@keyframes acenar { 0%, 60%, 100% { transform: rotate(0); } 15%, 45% { transform: rotate(16deg); } 30% { transform: rotate(-10deg); } }
.bloco-video.mao-levantada { border-color: var(--laranja); box-shadow: 0 0 0 2px var(--laranja); }
.bloco-video.mao-levantada .selo-mao { display: inline-flex; }
/* bloco pequeno (celular / miniatura): só o emoji */
@media (max-width: 900px) { .selo-mao > span:last-child { display: none; } .selo-mao { padding: 4px 7px; } }
.toast.mao { border-left-color: var(--laranja); font-weight: 600; font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .selo-mao .mao-emoji { animation: none; } }

/* ---------- tela cheia ---------- */
.live:fullscreen { height: 100%; width: 100%; background: var(--fundo); }
.live:-webkit-full-screen { height: 100%; width: 100%; background: var(--fundo); }
/* iPhone: a live cobre a tela inteira (o Safari não tem tela cheia de página) */
.live.tela-cheia-css {
  position: fixed; inset: 0; z-index: 55; height: 100vh; height: 100dvh; width: 100vw;
  background: var(--fundo);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.em-tela-cheia { overflow: hidden; }
.icone-tela-cheia { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.live:fullscreen .toast, .live:-webkit-full-screen .toast { z-index: 1000; }

/* ---------- popup de confirmação ---------- */
.dialogo {
  border: 0; padding: 0; background: transparent; color: var(--texto);
  width: min(92vw, 420px); max-width: none;
}
.dialogo::backdrop { background: rgba(5,5,8,.7); backdrop-filter: blur(3px); }
.dialogo[open] { animation: dialogo-entrar .16s ease-out; }
@keyframes dialogo-entrar { from { opacity: 0; transform: translateY(8px) scale(.97); } }
.dialogo-caixa {
  background: var(--painel); border: 1px solid var(--borda); border-radius: 16px;
  padding: 26px 22px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  position: relative; overflow: hidden;
}
.dialogo-caixa::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--gradiente); }
.dialogo.perigo .dialogo-caixa::before { background: var(--vermelho); }
.dialogo-icone {
  width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center;
  font-size: 24px; font-weight: 700; background: #2a1d33; color: #e7b6ff;
}
.dialogo.perigo .dialogo-icone { background: #4a0f1a; color: var(--vermelho); }
.dialogo-titulo { margin: 0 0 8px; font-size: 18px; }
.dialogo-texto { margin: 0 0 20px; color: var(--texto-2); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.dialogo-botoes { display: flex; gap: 10px; justify-content: center; }
.dialogo-botoes button { flex: 1; max-width: 170px; padding: 10px 14px; justify-content: center; }
.perigo-forte { background: var(--vermelho); border-color: var(--vermelho); color: #fff; font-weight: 600; }

/* ---------- proteção da live (participante) ---------- */
.marca-dagua {
  position: absolute; z-index: 20; pointer-events: none; user-select: none; -webkit-user-select: none;
  color: rgba(255,255,255,.16); font-size: 11px; font-weight: 600; white-space: nowrap;
  text-shadow: 0 0 2px rgba(0,0,0,.5);
}
.protegido { filter: blur(28px) brightness(.35) !important; }
.cortina {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; text-align: center;
  background: rgba(10,10,14,.92); padding: 20px; font-size: 16px;
}
.espera-anim { width: 54px; height: 54px; border-radius: 50%; margin: 18px auto; border: 4px solid var(--borda); border-top-color: var(--rosa); animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

@media print { body { display: none !important; } }

/* computador: painel lateral pode ser escondido */
@media (min-width: 901px) {
  body:not(.com-lateral) .live { grid-template-columns: 1fr; }
  body:not(.com-lateral) .lateral { display: none; }
}

@media (max-width: 900px) {
  .grade-form { grid-template-columns: 1fr; }
  .grade-form .campo-largo { grid-column: auto; }
  .tabela-rel { font-size: 13px; }

  /* live no celular: ocupa exatamente a tela — vídeo e controles; o chat abre como gaveta */
  #etapa-live, body#pagina-admin { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  .topo { padding: 8px 12px; gap: 10px; flex-wrap: wrap; flex: none; }
  .topo img { width: 34px; height: 34px; }
  .topo .titulo { font-size: 15px; }
  .link-convite { margin-top: 0; width: 100%; }
  .link-convite input { flex: 1; min-width: 0; }
  .live { display: flex; flex-direction: column; flex: 1; min-height: 0; height: auto; }
  .palco { flex: 1; min-height: 0; }
  .videos { flex: 1; min-height: 0; padding: 8px; gap: 8px; }
  .videos.rolagem { grid-auto-rows: 100px; }
  .controles { padding: 8px; gap: 6px; }
  .controles button { padding: 8px 11px; font-size: 14px; }
  /* celular: o painel (chat) vira uma gaveta por cima do vídeo, aberta pelo botão */
  .lateral {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(88vw, 380px); z-index: 60;
    transform: translateX(105%); transition: transform .25s ease, visibility .25s; visibility: hidden;
    border-left: 1px solid var(--borda); box-shadow: -12px 0 30px rgba(0,0,0,.55);
  }
  body.com-lateral .lateral { transform: none; visibility: visible; }
  .aba { padding: 8px 10px; }
  .abas { overflow-x: auto; }
  .abas button { flex: none; padding: 11px 12px; }
  .rodape-bloco { left: 6px; bottom: 6px; right: 6px; gap: 4px; }
  .bloco-video .rotulo { font-size: 12px; padding: 2px 7px; }
  .btn-bloco { width: 26px; height: 26px; }
  .bloco-video.sem-video .avatar, .bloco-video.camera-off .avatar { inset: 0 0 24px 0; width: min(42%, 64px); font-size: 22px; }
  .chat-form input { font-size: 16px; } /* evita o zoom automático do iPhone ao digitar */
  .toast { left: 10px; right: 10px; top: 10px; bottom: auto; max-width: none; }
}

/* celular deitado em tela cheia: chat AO LADO do vídeo (estilo Twitch), não por cima */
@media (max-width: 900px) and (orientation: landscape) {
  .live:fullscreen, .live.tela-cheia-css { display: grid; grid-template-columns: 1fr; }
  .live:-webkit-full-screen { display: grid; grid-template-columns: 1fr; }
  body.com-lateral .live:fullscreen, body.com-lateral .live.tela-cheia-css { grid-template-columns: 1fr min(38vw, 320px); }
  body.com-lateral .live:-webkit-full-screen { grid-template-columns: 1fr min(38vw, 320px); }
  .live:fullscreen .lateral, .live.tela-cheia-css .lateral {
    position: static; width: auto; transform: none; box-shadow: none; transition: none; min-height: 0;
  }
  .live:-webkit-full-screen .lateral { position: static; width: auto; transform: none; box-shadow: none; transition: none; min-height: 0; }
  body:not(.com-lateral) .live:fullscreen .lateral, body:not(.com-lateral) .live.tela-cheia-css .lateral { display: none; }
  body:not(.com-lateral) .live:-webkit-full-screen .lateral { display: none; }
  .live:fullscreen .palco, .live.tela-cheia-css .palco { min-height: 0; height: 100%; }
  .live:-webkit-full-screen .palco { min-height: 0; height: 100%; }
}

/* ---------- live agendada ---------- */
.agenda-meta { display: inline-block; margin-top: 4px; font-size: 13px; color: var(--texto-2); }
.agenda-meta.futura { color: #ffd27a; font-weight: 600; }
.agenda-info { margin: 4px 0 14px; text-align: center; }
.agenda-quando {
  display: flex; gap: 12px; align-items: center; justify-content: center; text-align: left;
  background: var(--painel-2); border: 1px solid var(--borda); border-radius: var(--raio); padding: 10px 14px;
}
.agenda-icone { font-size: 26px; }
.agenda-data { display: block; }
.agenda-falta { display: block; color: #ffd27a; font-size: 13px; margin-top: 2px; }
.mensagem-espera {
  margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--rosa); background: #1b1220;
  border-radius: 0 9px 9px 0; text-align: left; white-space: pre-line; word-wrap: break-word;
}

/* ---------- moderação do chat (admin) ---------- */
.rotulo-inline { margin: 0; white-space: nowrap; }
.aba-cabecalho select { width: auto; padding: 5px 8px; font-size: 13px; }
.chat-acoes { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.chat-acao {
  padding: 1px 6px; font-size: 11px; border-radius: 6px; background: transparent; color: var(--texto-2);
}
.chat-acao:hover { background: #3a1520; border-color: #6b2333; color: #ffb3bd; filter: none; }
@media (hover: hover) {
  .chat-acoes { opacity: 0; transition: opacity .15s; }
  .chat-msg:hover .chat-acoes, .chat-acoes:focus-within { opacity: 1; }
}
.chat-msg.apagada > div { text-decoration: line-through; color: var(--texto-2); }

/* ---------- relatório ---------- */
.cartoes-rel { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cartao-rel {
  background: var(--painel-2); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.cartao-rel b { font-size: 26px; line-height: 1.1; background: var(--gradiente); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cartao-rel span { color: var(--texto); font-size: 13px; }
.cartao-rel small { color: var(--texto-2); font-size: 12px; }
.tabela-rolagem { overflow-x: auto; }
.tabela-rel { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela-rel th, .tabela-rel td { padding: 8px 10px; border-bottom: 1px solid var(--borda); text-align: left; white-space: nowrap; }
.tabela-rel th { color: var(--texto-2); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.tabela-rel tbody tr:hover { background: var(--painel-2); }
.tabela-rel .tag { margin-left: 0; }
.chat-rel { max-height: 480px; overflow: auto; }

/* ---------- quem está falando ---------- */
.bloco-video.falando { outline: 3px solid var(--verde); outline-offset: -3px; }
.bloco-video.falando .rotulo::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px;
  background: var(--verde); box-shadow: 0 0 0 3px rgba(46, 204, 113, .3); vertical-align: 1px;
  animation: pulsar-fala .9s ease-in-out infinite;
}
@keyframes pulsar-fala { 50% { box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); } }
@media (prefers-reduced-motion: reduce) { .bloco-video.falando .rotulo::before { animation: none; } }

/* ---------- fixar / destacar vídeo ---------- */
.bloco-video .btn-fixar {
  display: inline-flex; position: absolute; bottom: 8px; right: 8px; z-index: 16;
  opacity: 0; transition: opacity .15s;
}
.bloco-video:hover .btn-fixar, .bloco-video .btn-fixar:focus-visible, .bloco-video.fixado .btn-fixar { opacity: 1; }
@media (hover: none) { .bloco-video .btn-fixar { opacity: .75; } }
.bloco-video .btn-fixar:hover { background: var(--rosa); border-color: var(--rosa); }
.bloco-video.fixado .btn-fixar { background: var(--rosa); border-color: var(--rosa); color: #fff; }
.bloco-video.fixado .btn-fixar svg { fill: currentColor; }

/* ---------- queda de conexão ---------- */
.faixa-queda {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1001; text-align: center; padding: 8px 12px;
  background: #5a3a00; color: #ffd27a; font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.bloco-video .rodape-bloco { right: 44px; } /* espaço para o botão de fixar */


/* ---------- celular/tablet: teclado aberto no chat ---------- */
@media (pointer: coarse) {
  .chat-form input { font-size: 16px; } /* sem zoom automático do iPhone (era o que deslocava a tela) */
}
body.digitando .lateral {
  position: fixed; left: 0; right: 0; width: auto; bottom: auto;
  top: var(--vv-topo, 0px); height: var(--vv-altura, 100%);
  transform: none; visibility: visible; display: flex; z-index: 1200;
  border-left: 0; box-shadow: none;
}
body.digitando .lateral .fechar-lateral { display: none; }

/* ---------- celular deitado (tela larga mas baixa) ---------- */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) and (min-width: 901px) {
  #etapa-live, body#pagina-admin { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
  .topo { padding: 4px 10px; gap: 8px; flex: none; }
  .topo img { width: 28px; height: 28px; }
  .topo .titulo { font-size: 14px; }
  .topo .titulo small { display: none; }
  .topo .selo { padding: 2px 8px; font-size: 12px; }
  .link-convite input { display: none; } /* o botão "Copiar link" continua */
  .live { flex: 1; min-height: 0; height: auto; grid-template-columns: 1fr min(36vw, 320px); }
  .videos { padding: 6px; gap: 6px; }
  .controles { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 6px 8px; gap: 6px; }
  .controles button { flex: none; padding: 6px 10px; font-size: 13px; }
  .abas button { padding: 8px 10px; }
  .toast { left: 10px; right: 10px; top: 8px; bottom: auto; max-width: none; }
}
body.digitando .chat-form { padding-bottom: 6px; }

/* ---------- instalar o app ---------- */
.instalar-app { width: 100%; justify-content: center; margin-top: 10px; background: transparent; }
.passos-instalar { margin: 6px 0 4px; padding-left: 22px; text-align: left; line-height: 1.5; }
.passos-instalar li { margin-bottom: 8px; }

/* ---------- download automático da gravação ---------- */
.aviso-download {
  margin-bottom: 16px; padding: 12px 16px; border-radius: var(--raio); font-weight: 600;
  background: #1b1220; border: 1px solid var(--borda); border-left: 4px solid var(--rosa);
}

/* ---------- lives com tempo limitado ---------- */
.selo.tempo { font-variant-numeric: tabular-nums; }
.selo.tempo.acabando { background: #4a0f1a; border-color: #6b2333; color: #ffd0d6; }
.aviso-limite {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; font-size: 14px;
  background: var(--painel-2); border: 1px solid var(--borda); color: var(--texto-2);
}
.acoes-link { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
