/* =====================================================================
   ChamaoVar — estilo do painel
   Identidade: amarelo #FFD21F, vermelho #E2231A (o "REC" da marca), preto.
   Fontes servidas pelo próprio servidor (licença OFL): a CSP só permite
   estilos e fontes de 'self', por isso não usamos o Google Fonts.
   ===================================================================== */

@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url(/static/fontes/big-shoulders-display.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url(/static/fontes/barlow-semi-condensed-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/static/fontes/barlow-semi-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/static/fontes/barlow-semi-condensed-700.woff2) format("woff2"); }

:root {
  --amarelo: #FFD21F;
  --amarelo-suave: #FFF3BF;
  --vermelho: #E2231A;
  --vermelho-suave: #FDE3E1;
  --vermelho-texto: #9B130D;
  --preto: #000;
  --grafite: #141414;
  --grafite-2: #1E1E1E;
  --fundo: #F3F2EE;
  --superficie: #fff;
  --superficie-2: #F3F2EE;  /* campos de formulário */
  --hover: #FCFBF7;
  --texto: #000;
  --suave: #6E6E6E;         /* texto secundário em parágrafos (contraste AA) */
  --cinza: #8A8A8A;         /* rótulos pequenos, cabeçalhos de tabela */
  --borda: #E7E5DF;
  --verde: #1DB954;  /* status online / ativo / conectado */
  --trilho: #EDEBE5;
  --raio: 14px;
  --raio-botao: 8px;
  --lateral-largura: 248px;
  --fonte-titulo: "Big Shoulders Display", "Barlow Semi Condensed", Impact, sans-serif;
  --fonte-texto: "Barlow Semi Condensed", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fonte-texto);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  background: var(--fundo);
  color: var(--texto);
}

a { color: var(--texto); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--vermelho); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.icone { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

:focus-visible { outline: 3px solid var(--preto); outline-offset: 2px; }
.lateral :focus-visible, .topo-movel :focus-visible, .login-marca :focus-visible, .placar :focus-visible { outline-color: var(--amarelo); }

/* ---------- Estrutura: menu lateral + conteúdo ---------- */

body.app { min-height: 100vh; }

.lateral {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--lateral-largura);
  padding: 22px 14px 16px;
  overflow-y: auto;
  background: var(--preto);
  color: #CFCFCF;
}

.marca { display: flex; align-items: center; gap: 10px; padding: 0 8px 26px; color: var(--amarelo); }
.marca:hover { text-decoration: none; }
.marca .simbolo { width: 38px; height: 38px; flex: none; }
.marca-nome {
  font-family: var(--fonte-titulo);
  font-weight: 900;
  font-size: 23px;
  line-height: 0.9;
  letter-spacing: 0.01em;
  color: var(--amarelo);
  white-space: nowrap;
}
.marca-nome b { color: var(--vermelho); font-weight: 900; }

.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--raio-botao);
  color: #CFCFCF;
  font-size: 15.5px;
  font-weight: 600;
}
.menu a .icone { width: 19px; height: 19px; stroke-width: 1.8; }
.menu a:hover { background: var(--grafite-2); color: #fff; text-decoration: none; }
.menu a.ativo { background: var(--amarelo); color: var(--preto); }

.menu-grupo { display: flex; flex-direction: column; gap: 2px; }
.menu-titulo { padding: 20px 12px 8px; color: #8A8A8A; font-size: 12.5px; font-weight: 600; }

.usuario {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 10px 0;
  border-top: 1px solid #262626;
}
.usuario form { margin: 0 0 0 auto; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--amarelo);
  color: var(--preto);
  font-weight: 700;
}
.usuario-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.usuario-info strong { color: #fff; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario-info small { color: var(--cinza); font-size: 12.5px; }

.botao-icone {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--raio-botao);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.botao-icone:hover { background: rgba(0, 0, 0, 0.06); }

.conteudo { margin-left: var(--lateral-largura); }
.topo-movel { display: none; }
.veu { display: none; }

main { max-width: 1440px; margin: 0 auto; padding: 30px 36px 48px; }

/* Celular/tablet: menu lateral vira gaveta aberta pelo botão de menu */
@media (max-width: 900px) {
  .lateral { transform: translateX(-100%); transition: transform 0.2s ease; }
  body.menu-aberto .lateral { transform: none; }
  body.menu-aberto .veu { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.6); }
  .conteudo { margin-left: 0; }
  .topo-movel {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--preto);
    color: #fff;
  }
  .topo-movel .marca { padding: 0; }
  .topo-movel .marca .simbolo { width: 30px; height: 30px; }
  .topo-movel .marca-nome { font-size: 20px; }
  .topo-movel .botao-icone:hover, .lateral .botao-icone:hover { background: rgba(255, 255, 255, 0.1); }
  main { padding: 20px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) { .lateral { transition: none; } }
.lateral .botao-icone { color: var(--cinza); }
.lateral .botao-icone:hover { background: var(--grafite-2); color: #fff; }

/* ---------- Tipografia e cabeçalhos ---------- */

h1, h2, h3 { font-family: var(--fonte-titulo); line-height: 0.95; }
h1 {
  margin: 0 0 4px;
  font-size: 52px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
h2 { margin: 0 0 14px; font-size: 25px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h2 .icone { width: 20px; height: 20px; }
h3 { margin: 24px 0 10px; font-size: 20px; font-weight: 800; }
p { margin: 0 0 12px; }
.suave { color: var(--suave); }
small { font-size: 0.85rem; }
@media (max-width: 720px) { h1 { font-size: 40px; } }

.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; margin-bottom: 24px; }
.cabecalho p { margin: 6px 0 0; }
.filtro-cliente { display: flex; gap: 8px; margin: 0; }
.filtro-cliente select { margin: 0; min-width: 220px; }

.trilha { margin: 0 0 8px; font-size: 0.9rem; color: var(--suave); }
.trilha a { color: var(--suave); font-weight: 600; }
.trilha a:hover { color: var(--texto); }
.trilha + h1 { margin-bottom: 10px; }

/* ---------- Cartões e avisos ---------- */

.cartao, .caixa {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
}
.cartao { padding: 22px; }
.cartao + .cartao, .placar + .cartao, .cartao + .barra-mosaico, .cartao + .caixa, .caixa + .cartao,
.clipes-recentes + .cartao, .mosaico + .cartao, .vazio + .cartao { margin-top: 22px; }
.cartao.perigo { border-color: #F3B4AF; }
.cartao.perigo h2 { color: var(--vermelho-texto); }
.estreito { max-width: 440px; }

.ok, .erro {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
}
.ok { background: var(--amarelo-suave); color: var(--texto); border: 1px solid #F2D95E; }
.erro { background: var(--vermelho-suave); color: var(--vermelho-texto); border: 1px solid #F3B4AF; }
.ok::before, .erro::before { font-weight: 800; }
.ok::before { content: "✓"; }
.erro::before { content: "!"; }
main > .ok, main > .erro { margin-bottom: 20px; }

.vazio { display: grid; place-items: center; gap: 6px; padding: 48px 16px; color: var(--suave); text-align: center; }
.vazio .icone { width: 40px; height: 40px; opacity: 0.6; }

/* ---------- Painel: placar ---------- */

.placar {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  overflow: hidden;
  margin-bottom: 22px;
  background: var(--preto);
  border-radius: var(--raio);
  color: #fff;
}
.placar > div { position: relative; padding: 22px 26px; border-right: 1px solid #262626; }
.placar > div:last-child { border-right: 0; }
.placar .num {
  font-family: var(--fonte-titulo);
  font-weight: 900;
  font-size: 64px;
  line-height: 0.85;
  color: var(--amarelo);
  font-variant-numeric: tabular-nums;
}
.placar .num small { font-size: 34px; color: #8A8A8A; }
.placar .rot { margin-top: 8px; color: #BDBDBD; font-weight: 600; }
.placar .aovivo { background: var(--vermelho); border-right-color: var(--vermelho); }
.placar .aovivo .num { color: #fff; }
.placar .aovivo .num small { color: #FFC2BD; }
.placar .aovivo .rot { color: #FFE3E0; }
.rec { position: absolute; top: 20px; right: 22px; display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: pisca 1.4s infinite; }
@keyframes pisca { 50% { opacity: 0.25; } }

/* ---------- Painel: duas colunas ---------- */

.grade-painel { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.coluna-lateral { display: flex; flex-direction: column; gap: 22px; }
.caixa-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--borda);
}
.caixa-topo h2 { margin: 0; }
input.busca { width: 220px; margin: 0; padding: 9px 12px; }

/* Lista de organizações */
.org {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 26px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--borda);
}
.org:last-of-type { border-bottom: 0; }
.org:hover { background: var(--hover); }
.org[hidden] { display: none; }
.org.inativa .org-nome strong { color: var(--suave); }
.org-nome { display: flex; align-items: center; gap: 14px; min-width: 0; }
.org-nome strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.org-nome small { color: var(--cinza); }
.sigla {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--amarelo);
  font-family: var(--fonte-titulo);
  font-weight: 900;
  font-size: 20px;
  color: var(--preto);
}
.sigla.off { background: var(--trilho); color: #6E6E6E; }
.cams { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.cam {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 8px;
  border: 1px solid var(--borda);
  border-radius: 20px;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
}
.cam i { width: 9px; height: 9px; border-radius: 50%; background: #C9C6BD; }
.cam.on { border-color: #A7E3BC; }
.cam.on i { background: var(--verde); box-shadow: 0 0 0 3px #D3F3DE; }
.clipes-hoje { min-width: 60px; text-align: right; }
.clipes-hoje b { display: block; font-family: var(--fonte-titulo); font-weight: 900; font-size: 28px; line-height: 0.9; }
.clipes-hoje small { color: var(--cinza); font-size: 12.5px; }
.org-acoes { display: flex; gap: 6px; }
.icone-botao {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--borda);
  border-radius: var(--raio-botao);
  background: #fff;
  color: var(--preto);
}
.icone-botao .icone { width: 17px; height: 17px; stroke-width: 1.8; }
a.icone-botao:hover { background: var(--amarelo); border-color: var(--amarelo); text-decoration: none; }
.icone-botao.desabilitado { color: #C9C6BD; cursor: not-allowed; }
.sem-resultado { margin: 0; padding: 18px 22px; }

/* Coluna lateral: últimos lances e armazenamento */
.bloco { padding: 20px 22px; }
.bloco h3 { margin: 0 0 14px; font-size: 22px; }
.ultimo { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--borda); color: var(--texto); }
.bloco h3 + .ultimo { border-top: 0; padding-top: 0; }
.ultimo:hover { text-decoration: none; }
.ultimo:hover strong { text-decoration: underline; text-decoration-color: var(--vermelho); text-decoration-thickness: 2px; }
.ultimo strong { display: block; font-size: 14.5px; }
.ultimo small { color: var(--cinza); font-weight: 500; }
.thumb { position: relative; flex: none; width: 76px; height: 46px; border-radius: 6px; background: linear-gradient(135deg, #2E6B2F, #1B4520); }
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 11px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.disco-num { font-family: var(--fonte-titulo); font-weight: 900; font-size: 40px; line-height: 0.9; }
.disco-num small { font-size: 20px; color: var(--cinza); white-space: nowrap; }
.disco-legenda { margin-top: 4px; color: var(--cinza); font-size: 13px; }
svg.barra { display: block; width: 100%; height: 12px; margin: 12px 0 10px; border-radius: 6px; background: var(--trilho); }
.seg-sistema { fill: var(--preto); background: var(--preto); }
.seg-gravacao { fill: var(--vermelho); background: var(--vermelho); }
.seg-clipes { fill: var(--amarelo); background: var(--amarelo); }
.seg-livre { background: var(--trilho); }
.leg { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.leg div { display: flex; justify-content: space-between; gap: 10px; }
.leg i { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; vertical-align: -1px; }
.bloco .erro { margin: 0 0 10px; font-size: 0.9rem; }

/* Modal */
dialog.modal {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--raio);
  background: var(--superficie);
  color: var(--texto);
}
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog.modal form { padding: 22px 24px 24px; }
.modal-topo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.modal-topo h2 { margin: 0; }
.modal-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Telões */
.telao-org { padding: 18px 22px; border-bottom: 1px solid var(--borda); }
.telao-org:last-child { border-bottom: 0; }
.telao-org .org-nome { margin-bottom: 4px; }
.gerenciar-telao { margin-left: auto; }
.telao-vazio { margin: 8px 0 0 58px; }
.telao-linha {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr) auto;
  gap: 10px 16px;
  align-items: center;
  margin: 10px 0 0 58px;
  padding: 12px 14px;
  background: var(--hover);
  border: 1px solid var(--borda);
  border-radius: 10px;
}
.telao-nome { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.telao-url { overflow-wrap: anywhere; color: var(--suave); }

/* Responsivo do painel */
@media (max-width: 1100px) {
  .grade-painel { grid-template-columns: 1fr; }
  .placar { grid-template-columns: 1fr 1fr; }
  .placar > div:nth-child(2n) { border-right: 0; }
  .placar > div:nth-child(-n + 2) { border-bottom: 1px solid #262626; }
  .placar .aovivo { border-bottom-color: var(--vermelho); }
  .telao-linha { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .org { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .org-nome, .org .cams { grid-column: 1 / -1; }
  .cams { justify-content: flex-start; }
  .clipes-hoje { display: flex; align-items: baseline; gap: 6px; text-align: left; }
  .placar > div { padding: 18px; }
  .placar .num { font-size: 48px; }
  .placar .num small { font-size: 26px; }
  .rec { top: 14px; right: 14px; }
  input.busca { width: 100%; }
  .telao-linha, .telao-vazio { margin-left: 0; }
}

/* ---------- Tabelas ---------- */

.tabela { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 11px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--borda); }
thead th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--cinza); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
tbody th { width: 38%; font-weight: 600; color: var(--suave); }
td a { font-weight: 700; }

/* ---------- Selos de status ---------- */

.selo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--fonte-texto);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  background: var(--superficie);
  color: var(--suave);
  border: 1px solid var(--borda);
  white-space: nowrap;
}
.selo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #C9C6BD; }
/* Online/ativo/conectado: bolinha verde (o vermelho fica para o "REC" e o AO VIVO) */
.selo-ok, .selo-verde { background: #fff; color: var(--texto); border-color: #A7E3BC; }
.selo-ok::before, .selo-verde::before { background: var(--verde); box-shadow: 0 0 0 3px #D3F3DE; }
.selo-off { color: var(--texto); }

.selo-erro { background: var(--vermelho-suave); color: var(--vermelho-texto); border-color: #F3B4AF; }
.selo-erro::before { background: var(--vermelho-texto); }
h1 .suave { font-family: var(--fonte-texto); font-size: 0.9rem; font-weight: 500; text-transform: none; }
main > h1 { margin-bottom: 20px; }

/* ---------- Formulários e botões ---------- */

form label { display: block; margin-bottom: 14px; font-size: 0.9rem; font-weight: 600; color: var(--suave); }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  color: var(--texto);
  background: var(--superficie-2);
  border: 1px solid var(--borda);
  border-radius: var(--raio-botao);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select { min-height: 42px; }
input::placeholder { color: var(--cinza); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--preto);
  box-shadow: 0 0 0 3px var(--amarelo);
}

button, .botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--preto);
  background: var(--amarelo);
  border: 1px solid var(--amarelo);
  border-radius: var(--raio-botao);
  cursor: pointer;
  transition: transform 0.05s, filter 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
button:hover, .botao:hover { filter: brightness(0.95); text-decoration: none; }
button:active, .botao:active { transform: translateY(1px); }
button .icone, .botao .icone { width: 16px; height: 16px; stroke-width: 2.4; }
button.largo { width: 100%; padding: 12px 16px; }
button.secundario, .botao.secundario {
  background: var(--superficie);
  color: var(--texto);
  border: 1px solid var(--borda);
  font-weight: 600;
}
button.secundario:hover, .botao.secundario:hover { border-color: var(--preto); filter: none; }
button.perigo { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
button.link { padding: 0; background: none; border: 0; color: var(--texto); font-weight: 600; text-decoration: underline; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.lateral .botao-icone, .topo-movel .botao-icone, .modal .botao-icone { background: transparent; border: 0; color: inherit; padding: 0; }
.modal .botao-icone:hover { background: var(--fundo); filter: none; }

form.linha { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.linha label { flex: 1 1 200px; margin-bottom: 0; }
form.linha label.check { flex: 0 0 auto; }
form.inline { display: flex; gap: 6px; margin: 0; }
form.inline input { margin: 0; min-width: 140px; padding: 7px 10px; }
form.inline button { padding: 7px 12px; }
label.check { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; color: var(--texto); }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--preto); }
input[type="date"], input[type="number"] { min-width: 0; }
input[type="file"] { background: none; border: 0; padding: 0; }

.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.acoes form { margin: 0; }

/* ---------- Código, URLs e listas ---------- */

code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86em; }
.url { display: flex; gap: 8px; align-items: stretch; margin: 10px 0; }
.url code {
  flex: 1;
  padding: 11px 14px;
  background: var(--superficie-2);
  border: 1px dashed #D4D1C8;
  border-radius: var(--raio-botao);
  overflow-wrap: anywhere;
}
pre.exemplo {
  margin: 10px 0 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.84rem;
  color: #EDEDED;
  background: var(--grafite);
  border-radius: 10px;
}
.lista { margin: 0; padding-left: 20px; line-height: 1.9; }
.tabela-video td:first-child { white-space: nowrap; font-weight: 600; }
.tabela-video td:nth-child(2) { white-space: nowrap; }
.tabela-video td:last-child { color: var(--suave); }
@media (max-width: 700px) { .tabela-video td:nth-child(2) { white-space: normal; } }

/* Configurações › Botões (Arduino) */
.form-arduino { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-arduino .linha-acoes, .form-arduino .campo-camera { grid-column: 1 / -1; }
.campo-camera { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.6fr); gap: 16px; align-items: end; }
.url-camera {
  padding: 10px 12px;
  overflow-wrap: anywhere;
  color: var(--suave);
  background: var(--superficie-2);
  border: 1px dashed #D4D1C8;
  border-radius: var(--raio-botao);
}
@media (max-width: 700px) { .campo-camera { grid-template-columns: 1fr; gap: 6px; } }
.form-arduino label { margin-bottom: 0; }
@media (max-width: 700px) { .form-arduino { grid-template-columns: 1fr; } }
pre.codigo-arduino { max-height: 560px; overflow: auto; white-space: pre; tab-size: 2; }

/* ---------- Mosaico e players ---------- */

.barra-mosaico { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.colunas {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 10px;
}
.colunas > .icone { margin: 0 6px; color: var(--suave); }
.colunas button {
  min-width: 34px;
  padding: 5px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--suave);
  background: transparent;
  border-color: transparent;
  border-radius: 6px;
}
.colunas button:hover { color: var(--texto); filter: none; }
.colunas button.ativo { background: var(--amarelo); color: var(--preto); }

.mosaico { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 14px; }
.mosaico[data-colunas="1"] { grid-template-columns: 1fr; }
.mosaico[data-colunas="2"] { grid-template-columns: repeat(2, 1fr); }
.mosaico[data-colunas="3"] { grid-template-columns: repeat(3, 1fr); }
.mosaico[data-colunas="4"] { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) { .mosaico[data-colunas] { grid-template-columns: 1fr; } }
/* Uma câmera só: ocupa a área, sem exagerar em telas largas */
.mosaico:has(> .tela:only-child) { grid-template-columns: minmax(0, 980px); }
.previa { max-width: 760px; }

.tela {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #1c1c1c 0%, #050505 100%);
  border-radius: 12px;
  cursor: zoom-in;
  isolation: isolate;
}
.tela video { display: block; width: 100%; height: 100%; object-fit: contain; background: transparent; }

.tela .estado {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  color: #D6D6D6;
  font-size: 0.9rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
}
.tela .estado::before {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--amarelo);
  border-radius: 50%;
  animation: girar 0.9s linear infinite;
}
.tela .estado[hidden] { display: none; }
@keyframes girar { to { transform: rotate(360deg); } }

.tela .rotulo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  padding: 28px 14px 10px;
  color: #fff;
  font-size: 0.9rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  pointer-events: none;
}
.tela .local { margin-left: 6px; color: rgba(255, 255, 255, 0.7); font-size: 0.82rem; }
.tela .cliente {
  display: block;
  margin-bottom: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amarelo);
}
.tela .modo {
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
}
.tela .modo:empty { display: none; }

.tela .ao-vivo {
  position: absolute;
  top: 10px;
  left: 10px;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--vermelho);
  border-radius: 6px;
}
.tela .ao-vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulsar 1.4s ease-in-out infinite; }
.tela.tocando .ao-vivo { display: inline-flex; }
@keyframes pulsar { 50% { opacity: 0.25; } }

.tela .tela-cheia {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.15s;
}
.tela:hover .tela-cheia { opacity: 1; }
.tela:fullscreen { border-radius: 0; cursor: zoom-out; }
.tela:fullscreen .tela-cheia { display: none; }

/* Botão "Gerar clipe" sobre a imagem da câmera */
.tela .gatilho {
  position: absolute;
  top: 10px;
  right: 50px;
  gap: 6px;
  padding: 6px 11px;
  font-size: 0.82rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.tela .gatilho .icone { width: 15px; height: 15px; }
.tela .gatilho:disabled { cursor: default; opacity: 0.8; }
.tela .gatilho.falhou { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.tela:fullscreen .gatilho { right: 10px; }

/* Clipes recentes (abaixo do mosaico) */
.clipes-recentes { margin-top: 26px; }
.titulo-secao { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.titulo-secao h2 { margin: 0; }
.titulo-secao p { margin: 4px 0 0; }
.titulo-acoes { display: flex; align-items: center; gap: 14px; }

/* Excluir clipes (admin): menu com "só os de hoje" e "todos" */
details.excluir-clipes { position: relative; }
details.excluir-clipes > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 0.88rem; cursor: pointer; }
details.excluir-clipes > summary::-webkit-details-marker { display: none; }
details.excluir-clipes > summary .icone { width: 15px; height: 15px; }
details.excluir-clipes[open] > summary, details.excluir-clipes > summary:hover { border-color: var(--vermelho); color: var(--vermelho-texto); }
details.excluir-clipes .painel-usuario { position: absolute; right: 0; z-index: 20; min-width: 230px; box-shadow: 0 10px 30px rgb(0 0 0 / 0.18); }
details.excluir-clipes .painel-usuario p { margin: 0; }
details.excluir-clipes form.inline, details.excluir-clipes button { width: 100%; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.clipe-item { overflow: hidden; background: var(--superficie); border: 1px solid var(--borda); border-radius: var(--raio); }
.clipe-item video, .clipe-espera { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.clipe-espera {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  color: #D6D6D6;
  font-size: 0.88rem;
  text-align: center;
  background: radial-gradient(ellipse at center, #1c1c1c 0%, #050505 100%);
}
.clipe-espera small { color: #A8A8A8; }
.clipe-item[data-status="pendente"] .clipe-espera::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--amarelo);
  border-radius: 50%;
  animation: girar 0.9s linear infinite;
}
.clipe-item[data-status="falhou"] .clipe-espera { color: #FFB3AD; font-weight: 600; }
.clipe-info { display: grid; gap: 2px; padding: 10px 12px; font-size: 0.9rem; }
.clipe-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.clipe-topo a { display: inline-flex; color: var(--suave); }
.clipe-topo a:hover { color: var(--texto); }
.clipe-topo .icone { width: 18px; height: 18px; }

video.clipe { display: block; width: 100%; max-width: 980px; aspect-ratio: 16 / 9; margin-bottom: 14px; background: #000; border-radius: 12px; }

/* Tela Clipes (admin): grade de cartões com miniatura */
.cartao.filtros { margin-bottom: 22px; }
.grade-clipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.cartao-clipe {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  color: var(--texto);
}
a.cartao-clipe:hover { text-decoration: none; border-color: var(--preto); }
a.cartao-clipe:hover .miniatura::after { border-left-color: var(--amarelo); }
.miniatura {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2E6B2F, #1B4520);
  color: #fff;
}
.miniatura.pronto::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 20px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}
.miniatura.pendente, .miniatura.falhou { background: radial-gradient(ellipse at center, #1c1c1c 0%, #050505 100%); }
.miniatura.falhou { color: #FFB3AD; }
.miniatura small { font-weight: 700; }
.cartao-clipe-info { display: grid; gap: 2px; padding: 12px 14px; }
.cartao-clipe-info strong { font-size: 15.5px; }
.cartao-clipe-info small { color: var(--cinza); font-weight: 500; }
.cartao-clipe-info small.suave { color: var(--suave); }

/* ---------- Login ---------- */

body.publico { min-height: 100vh; background: var(--preto); }
.login-tela { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-marca {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  color: #CFCFCF;
  background: var(--preto);
}
.login-simbolo { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.login-simbolo .simbolo { width: 72px; height: 72px; flex: none; }
.login-simbolo .marca-nome { font-size: 56px; }
.login-logo {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 26px;
  border-radius: 14px;
  background: var(--amarelo);
}
.login-logo .icone { width: 32px; height: 32px; color: var(--preto); }
.login-marca h1 { margin-bottom: 12px; font-size: 56px; color: var(--amarelo); }
.login-marca p { max-width: 440px; font-size: 1.2rem; color: #CFCFCF; }
.login-marca ul { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.login-marca li { display: flex; align-items: center; gap: 12px; color: #E6E6E6; font-weight: 600; }
.login-marca li .icone {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: var(--raio-botao);
  color: var(--amarelo);
  background: var(--grafite-2);
}
.login-marca a { color: var(--amarelo); }
.login-form { display: grid; place-items: center; padding: 32px 16px; background: var(--preto); }
.login-form .cartao { width: 100%; max-width: 400px; padding: 32px; border-color: var(--superficie); }
.login-form h2 { font-size: 34px; margin-bottom: 6px; }
.login-form .suave { margin-bottom: 22px; }

@media (max-width: 860px) {
  .login-tela { grid-template-columns: 1fr; }
  .login-marca { padding: 40px 24px 28px; }
  .login-simbolo .simbolo { width: 52px; height: 52px; }
  .login-simbolo .marca-nome { font-size: 40px; }
  .login-marca h1 { font-size: 42px; }
  .login-marca ul { display: none; }
  .login-form { align-items: start; padding-top: 0; }
}

/* ---------- Configurações › WhatsApp ---------- */

button.sucesso { background: var(--amarelo); border-color: var(--amarelo); color: var(--preto); }
button.perigo-texto, .botao.perigo-texto { color: var(--vermelho-texto); }
button.perigo-texto:hover, .botao.perigo-texto:hover { border-color: var(--vermelho); color: var(--vermelho-texto); }
.vazio form { margin-top: 8px; }

.whatsapp-conectado { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.whatsapp-conectado > div { display: grid; flex: 1; }
.whatsapp-qr { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.whatsapp-qr img { width: 264px; max-width: 100%; height: auto; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--borda); }
.whatsapp-qr ol { margin: 0 0 12px; padding-left: 20px; line-height: 1.7; }

details.editar > summary { list-style: none; cursor: pointer; }
details.editar > summary::-webkit-details-marker { display: none; }
details.editar > summary .link { color: var(--texto); font-weight: 600; text-decoration: underline; text-decoration-color: var(--amarelo); text-decoration-thickness: 2px; }
details.editar[open] > summary .link { color: var(--suave); }
details.editar[open] { margin-bottom: 16px; }
.campos-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; }
.campos-info > div { display: grid; gap: 4px; padding: 12px 14px; background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 10px; min-width: 0; }
.campos-info small { color: var(--suave); }
.campos-info code { overflow-wrap: anywhere; }
.acoes-historico { display: flex; gap: 8px; flex-wrap: wrap; }
.acoes-historico select { margin: 0; width: auto; padding: 7px 10px; }
.linha-acoes { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- Detalhe da organização: partes numeradas ---------- */

.parte + .parte { margin-top: 36px; }
.parte-titulo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.parte-titulo h2 { margin: 0; font-size: 28px; }
.parte-titulo p { margin: 4px 0 0; }
.parte-num {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-family: var(--fonte-titulo);
  font-size: 22px;
  font-weight: 900;
  color: var(--preto);
  background: var(--amarelo);
}
.parte-link { margin-left: auto; white-space: nowrap; }

.acoes-usuario { display: flex; align-items: flex-start; justify-content: flex-end; gap: 6px; }
.acoes-usuario form.inline button { padding: 7px 12px; }
details.editar-usuario > summary { list-style: none; padding: 7px 12px; }
details.editar-usuario > summary::-webkit-details-marker { display: none; }
details.editar-usuario[open] > summary { border-color: var(--preto); }
.painel-usuario {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: 10px;
}
.painel-usuario form.inline input { min-width: 200px; }
@media (max-width: 700px) {
  .acoes-usuario { flex-direction: column; align-items: stretch; }
  .painel-usuario form.inline { flex-direction: column; }
  .painel-usuario form.inline input { min-width: 0; }
}

/* ---------- Página da organização: compartilhar clipes ---------- */

.compartilhar { display: flex; gap: 6px; flex-wrap: wrap; }
.compartilhar .botao, .compartilhar button { padding: 8px 12px; font-size: 0.88rem; }
.compartilhar .icone { width: 16px; height: 16px; }
.compartilhar [data-compartilhar] { display: none; }
.pode-compartilhar .compartilhar [data-compartilhar] { display: inline-flex; }
.copiado, .compartilhar .copiado { background: var(--amarelo); border-color: var(--amarelo); color: var(--preto); }
/* Nos cartões da galeria: só ícones */
.compartilhar.compacto { margin-top: 8px; }
.compartilhar.compacto .botao, .compartilhar.compacto button { padding: 6px 9px; }
.compartilhar.compacto span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.compartilhar.compacto .copiado span { position: static; width: auto; height: auto; clip-path: none; }
.compartilhar .whatsapp:disabled { cursor: progress; opacity: 0.75; }
/* Ícone compacto mostra o texto enquanto há aviso ("Preparando vídeo…", "Toque de novo…") */
.compartilhar.compacto .com-rotulo span { position: static; width: auto; height: auto; clip-path: none; }
.linha-acoes .botao .icone { width: 16px; height: 16px; }
.clipe-topo a strong { color: var(--texto); }
.clipe-topo a:hover strong { text-decoration: underline; text-decoration-color: var(--vermelho); }
form.linha .botao.secundario { padding: 10px 16px; }

/* Ícone de excluir (lixeira) */
.botao-excluir {
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--vermelho-texto);
  background: var(--superficie);
  border: 1px solid var(--borda);
}
.botao-excluir:hover { background: var(--vermelho-suave); border-color: var(--vermelho); filter: none; }
.botao-excluir .icone { width: 17px; height: 17px; }
.acoes-usuario form.inline .botao-excluir { padding: 0; }

/* ---------- Patrocinadores: prévia e cantos ---------- */

.previa-patrocinio {
  position: relative;
  container-type: inline-size;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, #2a2a2a 0%, #050505 100%);
}
.previa-patrocinio .fundo { width: 100%; height: 100%; object-fit: cover; display: block; }
.previa-vazia { position: absolute; inset: 0; display: grid; place-items: center; color: #D6D6D6; font-size: 0.92rem; }
/* Mesma conta do ffmpeg (patrocinios.ts) para um vídeo 16:9 (altura = 56,25cqw) */
.logo-previa { position: absolute; object-fit: contain; }
/* Logo master do Chama o VAR!: canto superior direito, caixa de N% da largura × 3/4, margem de 2% */
.previa-marca { top: 2cqw; right: 2cqw; object-position: right top; }
.previa-marca.tam-pequeno { width: 10cqw; height: 7.5cqw; }
.previa-marca.tam-medio { width: 14cqw; height: 10.5cqw; }
.previa-marca.tam-grande { width: 18cqw; height: 13.5cqw; }
/* Master: canto superior direito, 16% × 12% */
.previa-master { top: 2cqw; right: 2cqw; width: 16cqw; height: 12cqw; object-position: right top; }
/* Barra: altura 11% do vídeo, espaço 1,5%; slot = min(16%, (94% − espaço × (n + 1)) / n) */
.barra-previa {
  position: absolute;
  bottom: 1.5cqw;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5cqw;
  height: 6.1875cqw;
  padding: 0 1.5cqw;
  --slot: 16cqw;
}
.barra-previa.cor-clara { background: rgb(255 255 255 / 0.82); }
.barra-previa.cor-escura { background: rgb(0 0 0 / 0.6); }
.barra-previa.n-6 { --slot: 13.917cqw; }
.barra-previa.n-7 { --slot: 11.714cqw; }
.barra-previa.n-8 { --slot: 10.0625cqw; }
.barra-previa .slot { position: relative; flex: none; width: var(--slot); height: 4.455cqw; }
/* Posição absoluta: a altura máxima em % fica presa ao espaço do logo (em grade/flex ela era ignorada
   e um logo quase quadrado saía da barra). Centralizado como no clipe. */
.barra-previa .slot img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
/* Equilíbrio visual (patrocinios.ts, fatorAlturaLogo): logos largos ficam mais baixos */
.barra-previa .slot img.esc-30 { max-height: 30%; }
.barra-previa .slot img.esc-35 { max-height: 35%; }
.barra-previa .slot img.esc-40 { max-height: 40%; }
.barra-previa .slot img.esc-45 { max-height: 45%; }
.barra-previa .slot img.esc-50 { max-height: 50%; }
.barra-previa .slot img.esc-55 { max-height: 55%; }
.barra-previa .slot img.esc-60 { max-height: 60%; }
.barra-previa .slot img.esc-65 { max-height: 65%; }
.barra-previa .slot img.esc-70 { max-height: 70%; }
.barra-previa .slot img.esc-75 { max-height: 75%; }
.barra-previa .slot img.esc-80 { max-height: 80%; }
.barra-previa .slot img.esc-85 { max-height: 85%; }
.barra-previa .slot img.esc-90 { max-height: 90%; }
.barra-previa .slot img.esc-95 { max-height: 95%; }

.grade-patrocinio { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 14px; margin-top: 18px; }
.logo-barra { display: grid; gap: 8px; align-content: start; }
.logo-barra.adicionar { place-items: center; min-height: 90px; border: 1px dashed #D4D1C8; border-radius: 10px; }
.logo-barra .linha-acoes { align-items: center; gap: 6px; }
.botao-mover { padding: 6px 10px; }
.botao-mover:disabled { opacity: 0.4; cursor: not-allowed; }
.linha-master { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.linha-master .logo-miniatura { width: 220px; }
.logo-miniatura {
  display: grid;
  place-items: center;
  width: 100%;
  height: 90px;
  padding: 8px;
  border-radius: 10px;
  /* xadrez: mostra a transparência do PNG */
  background: repeating-conic-gradient(var(--superficie-2) 0% 25%, var(--borda) 0% 50%) 50% / 16px 16px;
}
.logo-miniatura { position: relative; }
.logo-miniatura img { position: absolute; inset: 8px; margin: auto; max-width: calc(100% - 16px); max-height: calc(100% - 16px); object-fit: contain; }
.enviar-logo { cursor: pointer; padding: 8px 12px; }
.enviar-logo .icone { width: 16px; height: 16px; }
.enviar-logo.enviando { opacity: 0.6; pointer-events: none; }
.enviar-logo.enviando::after { content: "Enviando…"; }

/* ---------- Organização › Telão (painel; a página da TV usa telao.css) ---------- */

.telao-link { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; margin: 12px 0; }
.qr-telao { flex: 0 0 auto; width: 132px; height: 132px; padding: 8px; background: #fff; border: 1px solid var(--borda); border-radius: 10px; }
.qr-telao img, .qr-telao canvas { width: 100% !important; height: 100% !important; display: block; }
.telao-link-dados { flex: 1 1 320px; min-width: 0; }
.telao-link-dados p { margin: 0 0 4px; }
details.config-telao > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
details.config-telao > summary::-webkit-details-marker { display: none; }
details.config-telao > summary .icone { width: 16px; height: 16px; }
.form-telao { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 14px; }
.form-telao .largo { grid-column: 1 / -1; }
.form-telao label { margin-bottom: 0; }
.form-telao p.suave { margin: -6px 0 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.form-telao fieldset { margin: 0; padding: 10px 14px 4px; border: 1px solid var(--borda); border-radius: 10px; }
.form-telao legend { padding: 0 6px; font-weight: 600; }
.excluir-telao { margin-top: 12px; }
@media (max-width: 700px) { .form-telao { grid-template-columns: 1fr; } }

/* Telão › intervalos */
.campos-intervalo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 8px; }
.campos-intervalo label { margin-bottom: 0; }
.midias-telao { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--borda); }
.midias-telao h3 { display: flex; align-items: center; gap: 8px; }
.midia-item { display: grid; gap: 8px; align-content: start; }
.midia-item.inativa .midia-previa { opacity: 0.45; }
.midia-item .linha-acoes { align-items: center; gap: 6px; }
.midia-item p { margin: 0; font-size: 0.88rem; }
.midia-previa { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: var(--grafite); }
.midia-previa img, .midia-previa video { width: 100%; height: 100%; object-fit: contain; display: block; }
.enviando-midia { opacity: 0.7; pointer-events: none; }
@media (max-width: 700px) { .campos-intervalo { grid-template-columns: 1fr; } }

/* Sem animações para quem pediu menos movimento ("AO VIVO" fica aceso) */
@media (prefers-reduced-motion: reduce) {
  .rec i, .tela .ao-vivo::before { animation: none; }
  .tela .estado::before, .clipe-item[data-status="pendente"] .clipe-espera::before { animation-duration: 2.4s; }
}

/* Organização › Excluir (topo da página) */
.cabecalho-org { align-items: flex-start; }
details.excluir-org { position: relative; }
details.excluir-org > summary { list-style: none; cursor: pointer; }
details.excluir-org > summary::-webkit-details-marker { display: none; }
details.excluir-org[open] > summary, details.excluir-org > summary:hover { border-color: var(--vermelho); }
details.excluir-org .painel-usuario {
  position: absolute;
  right: 0;
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
  padding: 16px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
}
details.excluir-org .painel-usuario p { margin: 0; font-size: 0.92rem; }
details.excluir-org label { margin: 0; color: var(--texto); }
@media (max-width: 720px) { details.excluir-org .painel-usuario { left: 0; right: auto; } }

/* ---------- Vídeos prontos para postar e Melhores da Noite ---------- */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Etiquetas de versão: Original · Moldura · Stories (pronto / na fila / erro) */
.versoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.versao {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 7px;
  border: 1px solid var(--borda);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--texto);
  background: #fff;
  white-space: nowrap;
}
.versao::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--verde); }
.versao.fila::before, .versao.gerando::before { background: #F59E0B; }
.versao.falhou { color: var(--vermelho-texto); border-color: #F3B4AF; }
.versao.falhou::before { background: var(--vermelho); }

/* Página do lance (download do jogador): cartão escuro, pensado para o celular */
.lance {
  max-width: 460px;
  margin: 0 auto;
  padding: 26px 20px 22px;
  background: var(--preto);
  border-radius: 28px;
  color: #fff;
}
.lance-marca { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 18px; }
.lance-marca .simbolo { width: 34px; height: 34px; }
.lance-marca .marca-nome { font-size: 26px; }
.lance-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #111; border-radius: 10px; }
.lance-video.vertical { aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; width: auto; max-width: 100%; }
.lance-titulo { margin: 18px 0 4px; font-size: 34px; color: var(--amarelo); }
.lance-meta { color: #BDBDBD; font-size: 14px; }
.lance-botoes { display: grid; gap: 10px; margin-top: 14px; }
.botao-lance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid #333;
  border-radius: 10px;
  background: var(--preto);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.botao-lance:hover { border-color: var(--amarelo); text-decoration: none; filter: none; }
.botao-lance small { font-weight: 500; font-size: 12px; opacity: 0.8; }
.botao-lance.destaque { background: var(--amarelo); border-color: var(--amarelo); color: var(--preto); }
.botao-lance.preparando { background: var(--grafite-2); border-style: dashed; color: #D6D6D6; cursor: progress; font-weight: 600; }
.botao-lance .icone { width: 17px; height: 17px; }
.girando {
  display: inline-block;
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--amarelo);
  border-radius: 50%;
  animation: girar 0.9s linear infinite;
  vertical-align: -2px;
}
.girando.escuro { border-color: rgba(0, 0, 0, 0.15); border-top-color: var(--preto); }
.lance-rodape { margin: 18px 0 0; color: #8A8A8A; font-size: 13px; text-align: center; }
.lance-rodape strong { color: #fff; }
.lance-extras, .lance-admin { margin-top: 16px; padding-top: 14px; border-top: 1px solid #262626; color: #CFCFCF; font-size: 14px; }
.lance-extras .suave, .lance-admin .suave { color: #8A8A8A; }
.lance-admin .versao { color: var(--texto); }
.lance-extras .botao.secundario, .lance-extras button.secundario, .lance-admin button.secundario {
  background: var(--preto);
  color: #fff;
  border-color: #333;
}
.lance-admin .erro { margin: 8px 0; }
@media (max-width: 520px) { .lance { border-radius: 18px; margin: 0 -6px; } }

/* Destaque do Melhores da Noite */
.destaque-melhores { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.capa-melhores {
  display: grid;
  place-content: center;
  flex: none;
  width: 92px;
  height: 160px;
  border-radius: 10px;
  background: var(--amarelo);
  font-family: var(--fonte-titulo);
  font-weight: 900;
  font-size: 21px;
  line-height: 0.9;
  text-align: center;
  text-transform: uppercase;
}
.capa-melhores b:last-child, .miniatura.melhores b:last-of-type { color: var(--vermelho); }
.destaque-info { flex: 1 1 260px; min-width: 0; }
.destaque-info h2 { font-size: 32px; font-weight: 900; text-transform: uppercase; margin-bottom: 8px; }
.destaque-info p { margin: 0 0 4px; }
.whatsapp-status { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.destaque-acoes { display: grid; gap: 8px; min-width: 170px; }
.destaque-acoes form.inline, .destaque-acoes form.inline button { width: 100%; }
.miniatura.melhores {
  display: grid;
  place-content: center;
  background: var(--amarelo);
  color: var(--preto);
  font-family: var(--fonte-titulo);
  font-weight: 900;
  font-size: 30px;
  line-height: 0.9;
  text-align: center;
  text-transform: uppercase;
}
.miniatura .duracao {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--preto);
  color: #fff;
  font-family: var(--fonte-texto);
  font-size: 12px;
}
.titulo-grade { margin: 26px 0 12px; }
.gerar-melhores { display: flex; gap: 8px; align-items: center; margin: 0; flex-wrap: wrap; }
.gerar-melhores select { width: auto; margin: 0; min-width: 180px; }

/* Configurações › Vídeos */
.rotulo-inline { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--texto); }
.rotulo-inline select { margin: 0; width: auto; min-width: 230px; }
.aviso-escopo { margin-bottom: 16px; }
.form-videos { display: grid; gap: 18px; max-width: 900px; }
.cfg-bloco { padding: 0; overflow: hidden; }
.cfg-topo, .cfg-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--borda);
}
.cfg-topo h2 { margin: 0 0 4px; }
.cfg-topo small, .cfg-linha small { display: block; color: var(--cinza); }
.cfg-linha strong { display: block; }
.cfg-bloco > :last-child { border-bottom: 0; }
.cfg-faixa { display: flex; align-items: center; gap: 14px; flex: 0 1 260px; }
.cfg-faixa input[type="range"] { flex: 1; margin: 0; padding: 0; min-height: 0; background: none; border: 0; accent-color: var(--preto); box-shadow: none; }
.cfg-faixa output { min-width: 42px; font-family: var(--fonte-titulo); font-weight: 900; font-size: 28px; text-align: right; }
input.cfg-curto { width: 140px; margin: 0; text-align: center; }
.cfg-par { display: flex; align-items: center; gap: 10px; }
.cfg-par input { width: 110px; margin: 0; text-align: center; }
.segmentado { display: inline-flex; border: 1px solid var(--borda); border-radius: var(--raio-botao); overflow: hidden; }
.segmentado label { margin: 0; cursor: pointer; }
.segmentado input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmentado span { display: block; padding: 8px 14px; font-weight: 700; color: var(--texto); }
.segmentado input:checked + span { background: var(--preto); color: var(--amarelo); }
.segmentado input:focus-visible + span { outline: 3px solid var(--amarelo); outline-offset: -3px; }
.cfg-barra { display: flex; gap: 0; padding: 14px 20px 18px; font-size: 13px; font-weight: 700; color: #fff; }
.cfg-barra span { padding: 8px 10px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trecho-normal { flex: 3; background: #1F5A23; margin-right: 6px; }
.trecho-replay { flex: 2; background: var(--vermelho); }
.trecho-replay[hidden] { display: none; }
/* Chave liga/desliga */
.chave { position: relative; display: inline-flex; flex: none; margin: 0; cursor: pointer; }
.chave input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chave .trilho { width: 50px; height: 28px; border-radius: 14px; background: #D9D6CE; transition: background 0.15s; position: relative; }
.chave .trilho::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.chave input:checked + .trilho { background: var(--preto); }
.chave input:checked + .trilho::after { background: var(--amarelo); transform: translateX(22px); }
.chave input:focus-visible + .trilho { outline: 3px solid var(--preto); outline-offset: 2px; }
.remover-personalizacao { margin-top: 14px; }
@media (max-width: 720px) {
  .cfg-linha { flex-direction: column; align-items: stretch; }
  .cfg-faixa { flex-basis: auto; }
  .destaque-acoes { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .girando { animation-duration: 2.4s; } .chave .trilho, .chave .trilho::after { transition: none; } }

/* Cartões da galeria: baixar nos formatos prontos para postar */
.formatos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.formato {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--borda);
  border-radius: var(--raio-botao);
  font-size: 13px;
  font-weight: 700;
  color: var(--texto);
  background: #fff;
}
.formato .icone { width: 14px; height: 14px; }
.formato.vertical { background: var(--amarelo); border-color: var(--amarelo); }
a.formato:hover { text-decoration: none; border-color: var(--preto); }
.formato.preparando { color: var(--suave); border-style: dashed; font-weight: 600; }

/* Painel › Servidor (VPS) */
.servidor .medidor { margin-bottom: 14px; }
.medidor-topo { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; }
.medidor-topo b { font-family: var(--fonte-titulo); font-weight: 900; font-size: 26px; line-height: 1; white-space: nowrap; }
.medidor-topo b small { font-family: var(--fonte-texto); font-size: 13px; font-weight: 600; color: var(--cinza); }
.medidor-topo b.alto { color: var(--vermelho-texto); }
.servidor svg.barra { margin: 6px 0 4px; }
.servidor .medidor > small { color: var(--cinza); }
.servidor-dados { padding-top: 12px; border-top: 1px solid var(--borda); }

/* Dicas: para que serve cada tela (faixa no topo) e "Mostrar dicas" no menu quando ocultas */
.ajuda-pagina {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -6px 0 22px;
  padding: 10px 8px 10px 14px;
  background: var(--amarelo-suave);
  border: 1px solid #F2D95E;
  border-radius: 10px;
}
.ajuda-pagina > .icone { width: 19px; height: 19px; margin-top: 2px; }
.ajuda-pagina p { flex: 1; margin: 0; font-weight: 500; }
.ajuda-pagina .botao-icone { flex: none; width: 28px; height: 28px; background: transparent; border: 0; color: var(--suave); }
.ajuda-pagina .botao-icone:hover { background: rgba(0, 0, 0, 0.06); color: var(--texto); filter: none; }
.ajuda-pagina .botao-icone .icone { width: 16px; height: 16px; }
.sem-dicas .ajuda-pagina { display: none; }
.mostrar-dicas {
  display: none;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 9px 12px;
  background: transparent;
  border: 1px dashed #333;
  border-radius: var(--raio-botao);
  color: #8A8A8A;
  font-weight: 600;
}
.mostrar-dicas:hover { color: #fff; border-color: #555; filter: none; }
.sem-dicas .mostrar-dicas { display: flex; }
