/* =====================================================================
   CRIADOR DE SLIDES PARA PREGAÇÕES: VISUAL
   Prefixo .cs- em tudo, para não misturar com as outras ferramentas.
   Cores vêm do site (estilo.css), então o modo escuro funciona sozinho.
   Sem animações contínuas: só transições curtas nos botões e na barra.
   ===================================================================== */

.cs-app [hidden] { display: none !important; }
.cs-selo { display: inline-flex; gap: .4rem; align-items: center; margin: 0; padding: .2rem .7rem; border-radius: 999px;
  background: var(--dourado-suave); color: var(--dourado); font-weight: 700; font-size: .85rem; }
.cs-app { margin: 1rem 0 1.5rem; }
.cs-mini { font-size: .85rem; color: var(--texto-2); margin: .75rem 0 0; }
.cs-privado { display: flex; gap: .4rem; align-items: flex-start; }
.cs-privado .ico { flex: none; width: 18px; height: 18px; color: var(--sucesso); margin-top: .1rem; }
.cs-sub { font-size: 1rem; margin: 1.25rem 0 .5rem; }

/* ---------- Barra da apresentação ---------- */
.cs-barra { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .75rem; margin-bottom: 1rem; border: 2px solid var(--borda); }
.cs-nome { flex: 1 1 220px; }
.cs-nome input { width: 100%; min-height: 44px; padding: .5rem .75rem; border: 1.5px solid var(--borda); border-radius: var(--raio-p);
  background: var(--superficie); color: var(--texto); font: 700 1.02rem var(--fonte); }
.cs-nome input:focus { outline: none; border-color: var(--primaria); }
.cs-barra-btns { display: flex; flex-wrap: wrap; gap: .4rem; }
.cs-barra-btns .btn { min-height: 44px; }
.cs-cont { opacity: .7; font-weight: 600; }

/* ---------- Duas colunas no computador, uma no celular ---------- */
.cs-editor { display: grid; gap: 1rem; }
.cs-palco, .cs-painel { border: 2px solid var(--borda); min-width: 0; padding: .9rem; }
@media (min-width: 960px) {
  .cs-editor { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .cs-palco { position: sticky; top: calc(var(--topo-h) + 12px); }
}

/* ---------- Prévia ---------- */
.cs-moldura { background: var(--superficie-2); border-radius: var(--raio-p); padding: .5rem; }
.cs-tela { display: block; width: 100%; height: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); background: #0a231e; }
.cs-sem-js { margin: 1rem; text-align: center; }
.cs-acoes { display: grid; grid-template-columns: 1.2fr 1fr; gap: .5rem; margin-top: .75rem; }
.cs-acoes .btn { justify-content: center; min-height: 50px; min-width: 0; padding-inline: .6rem; white-space: nowrap; }
.cs-btn-apresentar { font-size: 1.05rem; }

/* ---------- Fila de miniaturas ---------- */
.cs-tira-topo { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 1rem 0 .4rem; flex-wrap: wrap; }
.cs-tira-topo strong { font-size: .92rem; }
.cs-ops { display: flex; gap: .1rem; }
.cs-ops .btn-ico { width: 44px; height: 44px; font-size: 1rem; }
.cs-ops .btn-ico:disabled { opacity: .35; cursor: default; }
.cs-ops .ico { width: 20px; height: 20px; }
.cs-tira { list-style: none; margin: 0; padding: 4px 2px 8px; display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.cs-tira li { flex: none; scroll-snap-align: start; }
.cs-mini-slide { position: relative; display: block; padding: 0; border: 3px solid transparent; border-radius: 8px; background: none; cursor: pointer; }
.cs-mini-slide canvas { display: block; width: 128px; height: auto; border-radius: 5px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.cs-mini-slide span { position: absolute; left: 4px; bottom: 4px; min-width: 22px; padding: 0 .3rem; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font: 700 .72rem/1.6 var(--fonte); text-align: center; }
.cs-mini-slide[aria-current="true"] { border-color: var(--primaria); }
.cs-mini-slide:focus-visible { outline: 3px solid var(--dourado); outline-offset: 1px; }
@media (min-width: 960px) { .cs-mini-slide canvas { width: 144px; } }
.cs-btn-mais { width: 100%; justify-content: center; min-height: 46px; margin-top: .4rem; }
.cs-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; margin-top: .5rem; }
.cs-tipo { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: center; text-align: left; padding: .55rem .65rem; min-height: 56px;
  border: 1.5px solid var(--borda); border-radius: var(--raio-p); background: var(--superficie); color: var(--texto); font: inherit; cursor: pointer; }
.cs-tipo span { grid-row: span 2; font-size: 1.3rem; }
.cs-tipo small { color: var(--texto-2); font-size: .76rem; line-height: 1.25; }
.cs-tipo:hover { border-color: var(--primaria); }

/* ---------- Abas ---------- */
.cs-abas { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; margin: -.25rem -.25rem 1rem; padding: .25rem; background: var(--superficie-2); border-radius: var(--raio-p); }
.cs-abas [role="tab"] { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 48px; padding: .35rem .2rem;
  border: 0; border-radius: 8px; background: transparent; color: var(--texto-2); font: 600 .9rem/1.1 var(--fonte); cursor: pointer; }
.cs-abas [role="tab"][aria-selected="true"] { background: var(--superficie); color: var(--primaria); box-shadow: var(--sombra); }
.cs-abas [role="tab"]:focus-visible { outline: 3px solid var(--primaria); outline-offset: 1px; }

/* ---------- Conteúdo ---------- */
.cs-tipo-chips { margin-bottom: .9rem; }
.cs-campos { display: grid; gap: .8rem; }
.cs-campos textarea { resize: vertical; min-height: 60px; }
.cs-ref { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
.cs-ref .btn { min-height: 46px; }
.cs-notas { margin-top: 1rem; }
.cs-notas small { font-weight: 500; }
.cs-foto-campo { display: grid; gap: .6rem; }
.cs-foto-campo > .btn { justify-content: center; min-height: 46px; }

/* ---------- Modelo ---------- */
.cs-grupo { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
.cs-grupo legend { font-weight: 700; margin-bottom: .5rem; padding: 0; }
.cs-temas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
@media (min-width: 560px) and (max-width: 959px) { .cs-temas { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cs-tema { display: grid; gap: .15rem; padding: .4rem; text-align: left; border: 2px solid var(--borda); border-radius: var(--raio-p); background: var(--superficie); color: var(--texto); font: inherit; cursor: pointer; }
.cs-tema canvas { width: 100%; height: auto; border-radius: 5px; }
.cs-tema strong { font-size: .88rem; }
.cs-tema small { font-size: .74rem; color: var(--texto-2); line-height: 1.25; }
.cs-tema[aria-checked="true"] { border-color: var(--primaria); background: color-mix(in srgb, var(--primaria) 8%, var(--superficie)); }
.cs-seg { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; padding: .25rem; background: var(--superficie-2); border-radius: var(--raio-p); }
.cs-seg-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 1rem; }
.cs-seg [role="radio"] { min-height: 44px; padding: .3rem; border: 0; border-radius: 8px; background: transparent; color: var(--texto); font: 600 .9rem/1.2 var(--fonte); cursor: pointer; }
.cs-seg [role="radio"] small { display: block; font-weight: 500; font-size: .72rem; color: var(--texto-2); }
.cs-seg [aria-checked="true"] { background: var(--superficie); color: var(--primaria); box-shadow: var(--sombra); }
.cs-faixa { display: grid; gap: .3rem; margin: 0 0 1rem; font-weight: 700; font-size: .92rem; }
.cs-faixa input { width: 100%; accent-color: var(--primaria); }
.cs-check { display: flex; gap: .5rem; align-items: center; margin: .8rem 0 1rem; font-weight: 600; font-size: .92rem; }
.cs-check input { width: 20px; height: 20px; accent-color: var(--primaria); }
.cs-painel .campo { margin-bottom: .2rem; }

/* ---------- Baixar ---------- */
.cs-baixar { display: grid; gap: .5rem; }
.cs-baixar .btn { justify-content: center; min-height: 48px; }
.cs-baixar .btn[aria-busy="true"] { opacity: .6; }
@media (min-width: 480px) { .cs-baixar { grid-template-columns: 1fr 1fr; } .cs-baixar .btn:first-child { grid-column: 1 / -1; } }

/* ---------- Janelas (esboços e minhas apresentações) ---------- */
.cs-dlg { width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px); padding: 1rem; border: 0; border-radius: var(--raio);
  background: var(--superficie); color: var(--texto); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.cs-dlg::backdrop { background: rgba(10, 15, 14, .6); }
.cs-dlg-topo { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.cs-dlg-topo h2 { margin: 0; font-size: 1.2rem; }
.cs-lista-esbocos { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .4rem; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; }
.cs-item { display: grid; gap: .1rem; width: 100%; text-align: left; padding: .65rem .8rem; min-height: 52px; border: 1.5px solid var(--borda);
  border-radius: var(--raio-p); background: var(--superficie); color: var(--texto); font: inherit; cursor: pointer; }
.cs-item small { color: var(--texto-2); font-size: .82rem; }
.cs-item:hover, .cs-item[aria-current="true"] { border-color: var(--primaria); }
.cs-item:disabled { opacity: .6; }
.cs-minha { display: flex; gap: .3rem; align-items: center; }
.cs-minha .btn-ico { flex: none; width: 44px; height: 44px; }
.cs-minha .ico { width: 20px; height: 20px; }
#cs-colar { font: .95rem/1.45 var(--fonte); }

/* =====================================================================
   APRESENTAÇÃO (tela cheia)
   ===================================================================== */
.cs-apresentando, .cs-apresentando body { overflow: hidden; }
.cs-show { position: fixed; inset: 0; z-index: 9999; display: flex; background: #000; color: #fff; cursor: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.cs-show.cs-cursor { cursor: default; }
.cs-show:focus { outline: none; }
.cs-show-palco { flex: 1; min-width: 0; display: grid; place-items: center; }
.cs-show-tela { display: block; }

/* barra de controles: aparece ao tocar ou mexer o mouse e some depois de 3 segundos */
.cs-show-barra { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: .25rem; padding: .3rem;
  border-radius: 999px; background: rgba(20, 20, 20, .86); box-shadow: 0 4px 20px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
.cs-show-barra.cs-ver { opacity: 1; pointer-events: auto; }
.cs-show-barra button { min-width: 44px; min-height: 44px; padding: 0 .7rem; border: 0; border-radius: 999px; background: transparent; color: #fff; font: 600 .95rem var(--fonte); cursor: pointer; }
.cs-show-barra button:hover, .cs-show-barra button[aria-pressed="true"] { background: rgba(255, 255, 255, .16); }
.cs-show-barra span#cs-show-pos { min-width: 64px; text-align: center; font: 700 .95rem var(--fonte); font-variant-numeric: tabular-nums; }
.cs-show-txt { display: none; }
@media (min-width: 720px) { .cs-show-txt { display: inline; } }

/* visão do pregador (Telão + notas) */
.cs-pregador { cursor: default; }
.cs-pregador .cs-show-palco { padding: 16px; }
.cs-pregador .cs-show-barra { opacity: 1; pointer-events: auto; left: calc((100% - min(36vw, 460px)) / 2); }
.cs-show-apres { width: min(36vw, 460px); flex: none; display: flex; flex-direction: column; gap: .5rem; padding: 16px; background: #111; border-left: 1px solid #2a2a2a; overflow: hidden; }
.cs-show-relogios { display: flex; justify-content: space-between; align-items: baseline; font: 800 2.2rem var(--fonte); font-variant-numeric: tabular-nums; }
.cs-show-relogios #cs-hora { font-size: 1.1rem; font-weight: 600; color: #bbb; }
.cs-show-rot { display: flex; align-items: center; gap: .4rem; margin: .4rem 0 0; color: #aaa; font: 700 .78rem var(--fonte); text-transform: uppercase; letter-spacing: .08em; }
.cs-show-prox { width: 100%; height: auto; border-radius: 6px; background: #222; }
.cs-show-notas { flex: 1; overflow-y: auto; white-space: pre-wrap; line-height: 1.45; color: #f2f2f2; padding-right: .3rem; }
.cs-show-letra { margin-left: auto; min-width: 40px; min-height: 34px; border: 1px solid #444; border-radius: 8px; background: #1c1c1c; color: #fff; font: 700 .85rem var(--fonte); cursor: pointer; }
.cs-show-letra + .cs-show-letra { margin-left: 0; }
@media (max-width: 760px) {
  .cs-pregador { flex-direction: column; }
  .cs-show-apres { width: auto; height: 46vh; border-left: 0; border-top: 1px solid #2a2a2a; }
  .cs-pregador .cs-show-barra { left: 50%; bottom: calc(46vh + 10px); }
  .cs-show-relogios { font-size: 1.6rem; }
}

/* janela do telão: só o slide */
.cs-show-telao-cheia { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); min-height: 48px; padding: 0 1.2rem; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: #111; font: 700 1rem var(--fonte); cursor: pointer; }

@media print { .cs-app { display: none; } }
@media (prefers-reduced-motion: reduce) { .cs-show-barra { transition: none; } }
