/* Skylev Studio — bancada escura no azul-ardósia da marca; o dourado
   aparece num único sítio: a ação de gerar. A arte é a cor da página. */

:root {
  --bg: #10222C;
  --panel: #16303D;
  --line: #244555;
  --text: #D9E6EC;
  --muted: #7FA2B2;
  --gold: #F4CC0F;
  --cyan: #4DB6D6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html { color-scheme: dark; }

body {
  font-family: "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.wordmark { font-family: Montserrat, sans-serif; letter-spacing: .04em; color: var(--muted); }
.wordmark b { color: var(--text); font-weight: 800; }
.status { font-size: 13px; color: var(--muted); }
.status.ok::before { content: "●  "; color: var(--cyan); }

main { display: grid; grid-template-columns: 340px 1fr; min-height: calc(100vh - 49px); }

/* ---------- brief ---------- */
#brief {
  border-right: 1px solid var(--line);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  align-content: start;
}
label { display: block; font-size: 13px; color: var(--muted); }
.dica { font-weight: 400; }
input, select, textarea {
  width: 100%;
  margin-top: 5px;
  font: inherit; font-size: 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 1px;
}
input[type="range"] { padding: 0; accent-color: var(--gold); }
input[type="file"] { padding: 6px; }
output { color: var(--text); font-weight: 700; float: right; }
#custom-size { display: flex; gap: 10px; }
.meia { flex: 1; }

#go {
  font: inherit; font-weight: 700; font-size: 15px;
  background: var(--gold); color: #10222C;
  border: 0; border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}
#go:disabled { opacity: .45; cursor: wait; }
#progress { font-size: 13px; color: var(--cyan); }

#templates-box h2, #brand-box h2, #newbrand h2, #kb-box h2, #radar-box h2 { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
#kb-box { border-top: 1px solid var(--line); padding-top: 14px; }
#kb-box .dica { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#kb-save {
  font: inherit; font-size: 13px; font-weight: 700;
  margin-top: 8px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
#kb-result { font-size: 12px; color: var(--cyan); margin-top: 6px; }
#radar-box { border-top: 1px solid var(--line); padding-top: 14px; }
#radar-box .dica { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#radar-go {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
#radar-go:disabled { opacity: .5; cursor: wait; }
#radar-out { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
#radar-out > button {
  font: inherit; font-size: 13px; font-weight: 700;
  align-self: flex-start;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
.radar-sug {
  border: 1px solid var(--line); border-radius: 8px;
  padding: .6rem; margin: .5rem 0;
}
.radar-sug strong { color: var(--text); font-size: 13px; }
.radar-sug p { margin: .3rem 0; font-size: 13px; color: var(--muted); }
.radar-sug button {
  font: inherit; font-size: 12px; font-weight: 700;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 6px 10px; cursor: pointer;
}
.linha-marca { display: flex; gap: 8px; }
.linha-marca select { flex: 1; }
#pb-abrir {
  font: inherit; font-size: 15px;
  margin-top: 5px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 0 12px; cursor: pointer;
}
#pb-abrir:hover { border-color: var(--cyan); color: var(--text); }
#newbrand-toggle {
  font: inherit; font-size: 13px; white-space: nowrap;
  margin-top: 5px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 0 12px; cursor: pointer;
}
#newbrand {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
#nb-go {
  font: inherit; font-size: 13px; font-weight: 700;
  align-self: flex-start;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
#nb-go:disabled { opacity: .5; cursor: wait; }
#nb-result { font-size: 12px; color: var(--cyan); }
#brand-box { border-top: 1px solid var(--line); padding-top: 14px; }
#brand-box .dica { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
#brand-go {
  font: inherit; font-size: 13px; font-weight: 700;
  margin-top: 8px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
#brand-go:disabled { opacity: .5; cursor: wait; }
.acts .perigo, #brand-revert { color: #E8A0A0; border-color: var(--line); }
#brand-revert {
  font: inherit; font-size: 12px;
  margin-top: 4px;
  background: none;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 10px; cursor: pointer;
}
#brand-result { font-size: 12px; color: var(--cyan); margin-top: 6px; }
#templates { display: flex; flex-direction: column; gap: 6px; }
#templates button {
  font: inherit; font-size: 13px; text-align: left;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; cursor: pointer;
}

/* ---------- galeria ---------- */
#gallery {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  align-content: start;
}
.vazio { grid-column: 1 / -1; color: var(--muted); padding: 48px 0; text-align: center; line-height: 1.8; }

#galtop {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
}
.galtop-dir { display: flex; align-items: center; gap: 14px; }
#selmode {
  font: inherit; font-size: 13px;
  background: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; cursor: pointer;
}
body.selecting #selmode { border-color: var(--gold); color: var(--gold); }

#folders { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.migalha-atual { font-size: 14px; font-weight: 700; color: var(--text); }
.migalha-volta {
  font: inherit; font-size: 13px;
  background: none; color: var(--cyan);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 10px; cursor: pointer;
}
#nova-pasta {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 5px 12px; cursor: pointer;
}

/* tiles de pasta na grelha, como no Drive */
.folder-tile {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel);
  padding: 22px 16px 18px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  cursor: pointer;
  align-self: start;
}
.folder-tile:hover { border-color: var(--cyan); }
.folder-tile svg { width: 64px; height: 46px; }
.folder-tile .fname { font-size: 14px; font-weight: 700; color: var(--text); word-break: break-all; text-align: center; }
.folder-tile .fcount { font-size: 12px; color: var(--muted); }
/* modo Select: a pasta tambem se marca (para apagar) */
.folder-tile { position: relative; }
.folder-tile .sel-pasta { position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; margin: 0;
  accent-color: var(--gold); cursor: pointer; display: none; }
body.selecting .folder-tile .sel-pasta { display: block; }
body.selecting .folder-tile:has(.sel-pasta:checked) { border-color: var(--gold); }
#selbar button.perigo { color: #ff9b9b; }

.card { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--panel); }
.card .img { display: block; line-height: 0; }
.card img { width: 100%; height: auto; }
.card.erro { padding: 16px; color: var(--muted); font-size: 13px; }

.tira {
  display: flex; gap: 6px;
  padding: 8px 10px 0;
  overflow-x: auto;
}
.tira img {
  height: 84px; width: auto;
  border: 1px solid var(--line); border-radius: 3px;
  cursor: pointer;
  flex: none;
}
.tira img:hover { border-color: var(--cyan); }
.tira img.ativa { border-color: var(--gold); border-width: 2px; }

/* uma so' linha: os botoes repartem a largura do cartao por igual */
.acts { display: flex; flex-wrap: nowrap; gap: 4px; padding: 10px; align-items: stretch; }
.acts button, .acts .abrir, .acts .exportar {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: none; color: var(--cyan);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 0; cursor: pointer;
  text-decoration: none;
  line-height: 0;
}
.acts button svg, .acts .abrir svg, .acts .exportar svg { width: 16px; height: 16px; }
.acts button:hover { border-color: var(--cyan); }
.acts .perigo:hover { border-color: #E8A0A0; }

.ajuste, .slots { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.escopo { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.escopo label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; }
.escopo input { width: auto; margin: 0; accent-color: var(--gold); }
.ajuste button, .slots button {
  font: inherit; font-size: 13px; font-weight: 700;
  align-self: flex-start;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 6px 12px; cursor: pointer;
}
/* busy escurece a arte e trava as acoes, mas deixa o formulario de ajuste
   vivo — e' la' que mora o botao Parar */
.card.busy .img, .card.busy .acts, .card.busy .slots { opacity: .5; pointer-events: none; }

.card { position: relative; }
.sel-box {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  padding: 6px;
  background: rgba(16, 34, 44, .65);
  border-radius: 6px;
  line-height: 0;
  cursor: pointer;
  display: none;               /* so' aparece no modo de selecao */
}
body.selecting .sel-box { display: block; }
body.selecting .card:not(.ghost) .img { cursor: pointer; }
.sel-box input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); cursor: pointer; }
.card.ghost .sel-box { display: none; }

.slides-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 11px; font-weight: 700;
  background: rgba(16, 34, 44, .75); color: var(--text);
  border-radius: 6px; padding: 4px 8px;
}

.card .comp { position: absolute; top: 2.2rem; right: .5rem; border: 0;
  border-radius: 999px; padding: .15rem .55rem; font-size: .75rem;
  cursor: pointer; background: #b45309; color: #fff; }
.card .comp.ok { background: #14532d; }
.card .comp.stale { background: rgba(16, 34, 44, .85); color: var(--cyan); border: 1px solid var(--cyan); }

/* painel de compliance: a lista de avisos vira acao (Fix) em vez de alert */
.comp-painel {
  margin: 0 10px 10px; padding: 10px 12px;
  border: 1px solid #b45309; border-radius: 6px;
  background: rgba(180, 83, 9, .08);
  font-size: 13px; display: flex; flex-direction: column; gap: 8px;
}
.card:has(.comp.ok) .comp-painel { border-color: #14532d; background: rgba(20, 83, 45, .10); }
.card:has(.comp.stale) .comp-painel { border-color: var(--line); background: transparent; }
.comp-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.comp-nota { font-size: 12px; color: var(--muted); }
.comp-nota.ok-txt { color: #7fd39a; }
.comp-sub { margin: 0; font-size: 12px; color: var(--muted); }
.comp-lista { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.comp-lista label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; line-height: 1.35; }
.comp-lista input { width: auto; margin: 3px 0 0; accent-color: var(--gold); flex: none; }
.comp-lista.feito li { color: var(--muted); padding-left: 18px; position: relative; }
.comp-lista.feito li::before { content: "✓"; color: #7fd39a; position: absolute; left: 0; }
.comp-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.comp-acoes button {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; cursor: pointer;
}
.comp-acoes .comp-fix { border-color: var(--gold); background: var(--gold); color: #10222C; }
.comp-painel.a-corrigir .comp-fix { background: var(--panel); color: var(--text); border-color: #E8A0A0; }
.comp-acoes .comp-recheck { border-color: var(--cyan); }
.comp-acoes button:disabled { opacity: .5; cursor: default; }
.comp-antes { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); text-decoration: none; }
.comp-antes img { width: 48px; border-radius: 4px; border: 1px solid var(--line); }
.comp-antes:hover span { color: var(--cyan); }
/* a correr, o painel fica vivo (e' la' que mora o Parar) */
.card.busy .comp-painel { opacity: 1; pointer-events: auto; }
.card.busy .comp { pointer-events: none; }

.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { width: auto; margin-top: 2px; accent-color: var(--gold); }

#lb-prev, #lb-next {
  font: inherit; font-size: 20px; line-height: 1;
  background: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 14px; cursor: pointer;
}
#lb-count { font-size: 13px; color: var(--muted); }

#selbar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border: 1px solid var(--cyan); border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
#selbar button {
  font: inherit; font-size: 13px;
  background: none; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 5px 10px; cursor: pointer;
}
#seldiscard { color: #E8A0A0; font-weight: 700; }

#galeria-brief {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
  text-align: left;
}
#galeria-brief:hover { border-color: var(--cyan); color: var(--text); }

#galeria {
  position: fixed; inset: 0; z-index: 28;
  background: rgba(8, 18, 24, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gal-caixa {
  width: min(920px, 94vw); max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
}
.gal-topo {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.gal-topo button { font: inherit; background: none; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.gal-grelha {
  overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 16px;
}
.gal-cel {
  position: relative; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px; background: var(--panel);
  display: flex; flex-direction: column; gap: 6px;
}
.gal-cel img { width: 100%; height: 110px; object-fit: cover; border-radius: 3px; }
.gal-cel:has(.gal-sel:checked) { border-color: var(--gold); }
.gal-sel { position: absolute; top: 12px; left: 12px; width: 16px; height: 16px; accent-color: var(--gold); }
.gal-nome { font-size: 11px; color: var(--muted); word-break: break-all; }
.gal-del {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; line-height: 1;
  background: rgba(16,34,44,.8); color: #E8A0A0;
  border: 0; border-radius: 5px; padding: 4px 6px; cursor: pointer;
}
.gal-fundo {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--line);
}
.gal-add {
  font-size: 13px; color: var(--muted); cursor: pointer;
  border: 1px dashed var(--line); border-radius: 6px; padding: 7px 12px;
}
.gal-add:hover { color: var(--text); border-color: var(--cyan); }
#gal-usar {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--gold); color: #10222C;
  border: 0; border-radius: 6px; padding: 8px 16px; cursor: pointer;
}

#idbrand-abrir {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
  text-align: left; width: 100%;
  margin-bottom: 8px;
}
#idbrand-abrir:hover { border-color: var(--cyan); color: var(--text); }
#idmodal {
  position: fixed; inset: 0; z-index: 28;
  background: rgba(8, 18, 24, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.id-nota { padding: 10px 18px 0; font-size: 12px; color: var(--muted); }
.id-fundo {
  /* meio claro, meio escuro: julga-se positivo e negativo num relance */
  background: linear-gradient(90deg, #F2F2F2 50%, #10222C 50%);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  height: 110px; padding: 10px;
}
.id-fundo img { max-width: 100%; max-height: 90px; object-fit: contain; }
.id-acts { display: flex; gap: 6px; justify-content: flex-end; }
.id-logo {
  font-size: 12px; line-height: 1;
  background: rgba(16,34,44,.8); color: var(--gold);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 4px 7px; cursor: pointer;
}
.id-cel .gal-del { position: static; }
/* rotulo da variante (papel, tom, nota) — esbatido enquanto for so' um palpite pelo nome */
#id-grelha { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.id-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.id-meta select, .id-meta input { font: inherit; font-size: 11px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px; min-width: 0; }
.id-meta select { flex: 1 1 45%; }
.id-meta input { flex: 1 1 100%; }
.id-sugerido .id-meta select { color: var(--muted); border-style: dashed; }
.id-confirm { font: inherit; font-size: 11px; line-height: 1; background: rgba(16,34,44,.8); color: var(--cyan);
  border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; cursor: pointer; margin-right: auto; }
/* aba Brand: tira das variantes do logo */
.tira-logos { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-cel { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px;
  padding: 6px 4px 4px; border-radius: 8px; border: 1px solid var(--line); box-sizing: border-box;
  background: linear-gradient(90deg, #F2F2F2 50%, #10222C 50%); }
.logo-cel.escuro { background: #10222C; }
.logo-cel.claro { background: #F2F2F2; }
.logo-cel.sugerido { opacity: .6; }
.logo-cel img { max-width: 100%; max-height: 40px; width: auto; height: auto; object-fit: contain; }
.logo-rot { font-size: 9px; text-align: center; line-height: 1.2; max-width: 100%; padding: 0 3px; border-radius: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #E8EEF1; background: rgba(16,34,44,.85); }
.logo-cel.claro .logo-rot { color: #4A5A64; background: rgba(255,255,255,.7); }
.logo-mais { flex-basis: 100%; font-size: 11px; }

#pbmodal {
  position: fixed; inset: 0; z-index: 28;
  background: rgba(8, 18, 24, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
#pbmodal .dica { padding: 10px 18px 0; font-size: 12px; color: var(--muted); }
#pb-text { margin: 10px 18px; width: calc(100% - 36px); font-family: monospace; }
#pb-summary { padding: 0 18px 10px; color: var(--cyan); }
#pb-update, #pb-save {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
#pb-update:disabled { opacity: .5; cursor: wait; }
#pb-save { background: var(--gold); color: #10222C; border: 0; }

#lightbox {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(8, 18, 24, .92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px;
}
#lightbox img {
  max-width: min(92vw, 1080px); max-height: 84vh;
  border: 1px solid var(--line);
}
.lb-acts {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 12px;
}
#lb-download {
  font-size: 14px; font-weight: 700;
  background: var(--gold); color: #10222C;
  border-radius: 8px; padding: 8px 16px;
  text-decoration: none;
}
#lb-close {
  font: inherit; font-size: 16px;
  background: none; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; cursor: pointer;
}

.card.ghost {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  border-style: dashed;
  color: var(--muted); font-size: 13px;
}
.card.ghost .num {
  font-family: Montserrat, sans-serif; font-weight: 800; font-size: 28px;
  color: var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .card.ghost .estado { animation: pulsa 1.6s ease-in-out infinite; }
  @keyframes pulsa { 50% { opacity: .45; } }
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  #brief { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: no-preference) {
  .card { animation: chega .25s ease-out; }
  @keyframes chega { from { opacity: 0; transform: translateY(6px); } }
}

/* handoff: copiar prompt p/ LLM externo + colar JSON */
.handoff { display: flex; gap: .4rem; }
.handoff button { flex: 1; }
#handoff-box textarea { width: 100%; box-sizing: border-box; }
.slots textarea[placeholder^="cola o JSON"] { width: 100%; box-sizing: border-box; }

/* ---------- sidebar em abas: Criar | Marca ---------- */
#abas { display: flex; gap: 6px; }
#abas button {
  flex: 1;
  font: inherit; font-size: 13px; font-weight: 700;
  background: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px; cursor: pointer;
}
#abas button.ativa {
  background: var(--panel); color: var(--text);
  border-color: var(--cyan);
}
.tab { display: flex; flex-direction: column; gap: 14px; }

/* grupos colapsáveis */
details.grupo { border: 1px solid var(--line); border-radius: 8px; }
details.grupo summary {
  cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--muted);
  padding: 10px 12px;
  list-style: none;
  display: flex; align-items: center; gap: 8px;
}
/* a dica passa para a linha de baixo, alinhada com o titulo — lado a lado
   numa sidebar estreita o titulo partia-se numa coluna ("Adjust / the / brand") */
details.grupo summary { flex-wrap: wrap; row-gap: 2px; }
details.grupo summary .dica { flex: 1 1 100%; margin-left: 17px; font-weight: 400; line-height: 1.3; }
#tab-marca details.grupo summary .dica { margin-left: 50px; }   /* seta + gap + icone + margem + gap */
details.grupo summary::before { content: "▸"; transition: transform .15s; }
details.grupo[open] summary::before { transform: rotate(90deg); }
details.grupo summary::-webkit-details-marker { display: none; }
.grupo-resumo { font-weight: 400; font-size: 12px; color: var(--cyan); margin-left: auto; text-align: right; }
details.grupo > *:not(summary) { margin: 0 12px 12px; }
details.grupo > label, details.grupo > button, details.grupo > p { display: block; }
details.grupo > .check { display: flex; }

/* a zona de gerar fica sempre à vista */
#gerar-zona {
  position: sticky; bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin: 0 -4px;
  padding-left: 4px; padding-right: 4px; padding-bottom: 4px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 3;
}

/* botões do handoff no estilo tracejado da casa */
.handoff button, #handoff-apply {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 7px 10px; cursor: pointer;
}
.handoff button:hover, #handoff-apply:hover { border-color: var(--cyan); color: var(--text); }

/* prompts de imagem editáveis (JSON do handoff ou à mão) */
.img-prompt { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.img-prompt-topo { display: flex; gap: 6px; align-items: center; }
.ip-nome { flex: 1; margin-top: 0; }
.ip-size { width: 110px; margin-top: 0; }
.img-prompt-topo button { background: none; border: 0; color: #E8A0A0; cursor: pointer; font-size: 13px; }
.ip-prompt { margin-top: 0; font-size: 13px; }
#img-prompts { display: flex; flex-direction: column; gap: 8px; }
#img-prompt-add {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 7px 12px; cursor: pointer; text-align: left;
}
#img-prompt-add:hover { border-color: var(--cyan); color: var(--text); }

/* ---------- auth gate + settings modal ---------- */
#gate { position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; align-items: center; justify-content: center; }
.gate-caixa { display: flex; flex-direction: column; gap: 12px; width: min(340px, 90vw); }
.gate-caixa .wordmark { font-size: 20px; text-align: center; }
#gate-go { font: inherit; font-weight: 700; background: var(--gold); color: #10222C;
  border: 0; border-radius: 8px; padding: 10px; cursor: pointer; }
#set-abrir { font: inherit; font-size: 16px; background: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; cursor: pointer; }
#set-abrir:hover { color: var(--text); border-color: var(--cyan); }
#settings { position: fixed; inset: 0; z-index: 32; background: rgba(8,18,24,.88);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
/* Settings: sidebar de paginas a esquerda, uma pagina de cada vez a direita */
#settings .gal-caixa { width: min(1040px, 94vw); height: 86vh; }
.set-layout { display: flex; flex: 1; min-height: 0; }
.set-nav { flex: 0 0 190px; display: flex; flex-direction: column; gap: 2px; padding: 12px 10px;
  border-right: 1px solid var(--line); overflow-y: auto; }
.set-nav-item { font: inherit; font-size: 13px; text-align: left; background: none; color: var(--muted);
  border: 1px solid transparent; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.set-nav-item:hover { color: var(--text); }
.set-nav-item.ativo { color: var(--text); background: var(--panel); border-color: var(--line); }
.set-corpo { flex: 1; min-width: 0; padding: 16px 22px 24px; display: flex; flex-direction: column; overflow-y: auto; }
.set-pagina { display: flex; flex-direction: column; gap: 10px; }
.set-corpo h2 { font-size: 15px; margin: 0; }
.set-corpo h3 { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
@media (max-width: 680px) {
  .set-layout { flex-direction: column; }
  .set-nav { flex: none; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav-item { white-space: nowrap; }
  .set-corpo { padding: 14px; }
}
/* Billing & Usage / Storage */
.uso-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.uso-kpi { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.uso-kpi span { font-size: 11px; color: var(--muted); }
.uso-kpi strong { font-size: 18px; }
.uso-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.uso-tab th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.uso-tab td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.uso-tab td:nth-child(2), .uso-tab td:nth-child(4) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.uso-modelo { display: inline-block; font-size: 11px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); margin: 1px 0; }
.uso-barra { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.uso-barra i { display: block; height: 100%; background: var(--cyan); }
.uso-barra i.cheia { background: #ff9b9b; }
.uso .ac-ws, .armazem .set-linha { flex-wrap: wrap; }
.set-linha { display: flex; gap: 8px; align-items: center; }
#set-pw-go, #set-logout { font: inherit; font-size: 13px; font-weight: 700;
  background: var(--panel); color: var(--text); border: 1px solid var(--cyan);
  border-radius: 6px; padding: 7px 12px; cursor: pointer; align-self: flex-start; }
.set-chave { flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chave-nome { flex: 0 0 150px; font-size: 13px; color: var(--text); }
.chave-pill { font-size: 12px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.set-chave.ok .chave-pill { color: #7fd39a; border-color: #2f6b45; background: rgba(20, 83, 45, .15); }
.chave-base-rot { flex: 1 1 120px; min-width: 0; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chave-acoes { margin-left: auto; display: flex; gap: 6px; }
.chave-acoes button, .chave-cancel { font: inherit; font-size: 12px; font-weight: 700;
  background: none; color: var(--muted); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.chave-acoes button:hover, .chave-cancel:hover { color: var(--text); border-color: var(--cyan); }
.chave-remover:hover { color: #E8A0A0 !important; border-color: #E8A0A0 !important; }
.chave-form { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.chave-valor, .chave-base { flex: 1 1 160px; min-width: 0; font: inherit; font-size: 13px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 8px; }
.chave-save { font: inherit; font-size: 12px; font-weight: 700; background: var(--panel);
  color: var(--text); border: 1px solid var(--cyan); border-radius: 6px;
  padding: 6px 10px; cursor: pointer; }
.chave-save:hover { color: var(--gold); }

/* voz + opções de copy */
#copy-cards { display: flex; flex-direction: column; gap: 8px; }
.copy-card {
  font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px;
}
.copy-card:hover { border-color: var(--gold); }
.copy-card .copy-angle { font-size: 11px; color: var(--cyan); text-transform: uppercase; letter-spacing: .05em; }
.copy-card strong { font-size: 14px; }
.copy-card span:not(.copy-angle) { font-size: 12px; color: var(--muted); }
.copy-card em { font-size: 12px; color: var(--gold); font-style: normal; }

/* barra de aprovacao/feedback do copy */
.copy-barra { display: flex; gap: 8px; }
.copy-barra button {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
.copy-barra button:first-child { background: var(--gold); color: #10222C; border: 0; }
.copy-barra button:disabled { opacity: .45; cursor: default; }
.copy-card.escolhida { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.copy-fb { display: flex; flex-direction: column; gap: 6px; }
.copy-fb-linha { display: flex; gap: 8px; }
.copy-fb-linha button {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; cursor: pointer;
}

/* botoes com icone SVG (voz, copy bar, settings) */
#voice-go svg, .copy-barra svg, .copy-fb-linha svg, #set-abrir svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
#set-abrir svg { margin-right: 0; }
#voice-go.gravando, .copy-fb-linha button.gravando { border-color: #E8A0A0; color: #E8A0A0; }
.copy-barra .copy-fecha { border-color: var(--line); color: var(--muted); flex: 0; }

/* arco narrativo nos cartoes de copy de carrossel */
.copy-arco { margin: 4px 0 2px 18px; display: flex; flex-direction: column; gap: 3px; }
.copy-arco li { font-size: 12px; color: var(--muted); }
.copy-arco li::marker { color: var(--cyan); font-weight: 700; }

/* acoes por cartao de copy */
.copy-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.copy-acts { display: flex; gap: 8px; margin-top: 6px; }
.copy-acts button {
  font: inherit; font-size: 12px; font-weight: 700;
  border-radius: 6px; padding: 5px 10px; cursor: pointer;
}
.copy-acts button:first-child { background: var(--gold); color: #10222C; border: 0; }
.copy-acts button:last-child { background: none; color: var(--text); border: 1px solid var(--line); }
.copy-acts button:last-child:hover { border-color: var(--cyan); }
.copy-acts svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; }
.copy-card { cursor: default; }
.copy-nada {
  font: inherit; font-size: 12px; text-align: left;
  background: none; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 7px 10px; cursor: pointer;
}
.copy-nada:hover { color: var(--text); border-color: var(--cyan); }

/* multi-aprovacao de copy */
.copy-card.aprovada { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.copy-card.aprovada .copy-acts button:first-child { background: var(--panel); color: var(--gold); border: 1px solid var(--gold); }
.copy-usa {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--gold); color: #10222C;
  border: 0; border-radius: 8px; padding: 10px; cursor: pointer;
}
.copy-usa svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }

/* cartao de copy a reescrever-se */
.copy-card.carregando { opacity: .75; }
.copy-espera { font-size: 12px; color: var(--cyan); }
@media (prefers-reduced-motion: no-preference) {
  .copy-espera { animation: pulsa 1.6s ease-in-out infinite; }
}

/* busca de fotos CC */
.cc-busca { display: flex; gap: 8px; padding: 12px 18px 0; }
.cc-busca input { margin-top: 0; }
.cc-busca button {
  font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--cyan); border-radius: 6px;
  padding: 7px 12px; cursor: pointer;
}
#ccmodal { position: fixed; inset: 0; z-index: 28;
  background: rgba(8, 18, 24, .88);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
#cc-usar {
  font: inherit; font-size: 13px; font-weight: 700;
  background: var(--gold); color: #10222C;
  border: 0; border-radius: 6px; padding: 8px 16px; cursor: pointer;
}
#cc-buscar {
  font: inherit; font-size: 13px;
  background: var(--panel); color: var(--muted);
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 7px 12px; cursor: pointer; text-align: left;
}
#cc-buscar:hover { border-color: var(--cyan); color: var(--text); }

/* fita de fotos reais no fluxo de aprovacao */
.copy-fotos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.copy-foto {
  flex: none; padding: 0; line-height: 0; cursor: pointer;
  background: none; border: 2px solid var(--line); border-radius: 6px;
  overflow: hidden;
}
.copy-foto img { height: 72px; width: auto; display: block; }
.copy-foto:hover { border-color: var(--cyan); }
.copy-foto.escolhida { border-color: var(--gold); }

/* abort de proposta no ghost */
.card.ghost { position: relative; }
/* ver a montagem: o HTML parcial renderiza-se a escala no proprio ghost */
.card.ghost.montando { display: block; padding: 0; overflow: hidden; border-style: solid; }
.card.ghost.montando .num { display: none; }
.card.ghost iframe.preview {
  position: absolute; top: 0; left: 0; border: 0;
  transform-origin: 0 0; pointer-events: none; background: #fff;
}
.card.ghost.montando .estado {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 6px 10px; font-size: 12px; text-align: center;
  background: rgba(16, 34, 44, .85); color: var(--text);
}
.tira-heroes { display: flex; gap: 6px; padding: 0 10px; justify-content: center; }
.tira-heroes img { width: 64px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.ghost-stop {
  position: absolute; top: 8px; right: 8px;
  font: inherit; font-size: 12px; line-height: 1;
  background: rgba(16, 34, 44, .7); color: #E8A0A0;
  border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; cursor: pointer;
}
.ghost-stop:hover { border-color: #E8A0A0; }
.ghost-stop:disabled { opacity: .5; cursor: default; }

/* shift-click de gama: sem selecao de texto acidental */
body.selecting #gallery .card { user-select: none; }

/* ---------- wizard de criacao: grande, visivel, responsivo ---------- */
#wizard {
  position: fixed; inset: 0; z-index: 30;
  background: var(--bg, #10222C);
  display: flex; flex-direction: column;
}
.wiz-lnk {
  font: inherit; font-size: 13px; font-weight: 700;
  background: none; color: var(--cyan);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; cursor: pointer; margin-top: 10px;
}
.wiz-lnk:hover { border-color: var(--cyan); }
/* ---------- intencao do post (chips) ---------- */
.intent-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.intent-chips button { font: inherit; font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  background: none; color: var(--muted); border: 1px solid var(--line); cursor: pointer; min-height: 40px; }
.intent-chips button:hover { border-color: var(--cyan); color: var(--text); }
.intent-chips button.ativa { background: rgba(245, 197, 24, .14); border-color: var(--gold); color: var(--gold); }
/* ---------- dialogos do Studio (alert/confirm/prompt) ---------- */
#dlg { position: fixed; inset: 0; z-index: 60; background: rgba(8, 18, 24, .72);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
#dlg[hidden] { display: none; }
.dlg-caixa { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--gold); border-radius: 12px; padding: 18px 20px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55); animation: dlg-entra .16s ease-out; }
@keyframes dlg-entra { from { transform: translateY(8px); opacity: 0; } }
.dlg-caixa h3 { margin: 0 0 8px; font-size: 16px; font-family: Montserrat, sans-serif; font-weight: 800; color: var(--text); }
.dlg-caixa p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); white-space: pre-line; }
.dlg-input { width: 100%; margin-top: 12px; font: inherit; font-size: 14px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; box-sizing: border-box; }
.dlg-input:focus { outline: none; border-color: var(--cyan); }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg-btns button { font: inherit; font-size: 13px; font-weight: 700; border-radius: 8px; padding: 9px 16px; cursor: pointer; min-height: 40px; }
.dlg-ok { background: var(--gold); color: #10222C; border: 0; }
.dlg-cancel { background: none; color: var(--text); border: 1px solid var(--line); }
.dlg-cancel:hover { border-color: var(--cyan); }
/* ---------- toasts (avisos que nao param ninguem) ---------- */
#toasts { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 520px; margin: 0 auto;
  background: var(--panel); color: var(--text); border: 1px solid #b45309; border-left: 4px solid #b45309;
  border-radius: 8px; padding: 10px 12px; font-size: 13px; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.toast button { font: inherit; background: none; border: 0; color: var(--muted); cursor: pointer; margin-left: auto; }
/* ---------- editor manual ---------- */
#editor { position: fixed; inset: 0; z-index: 33; background: var(--bg); display: flex; flex-direction: column; }
.ed-topo { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.ed-topo .dica { font-size: 12px; }
.ed-topo button { font: inherit; font-size: 13px; font-weight: 700; border-radius: 6px; padding: 7px 12px; cursor: pointer;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.ed-topo button:hover { border-color: var(--cyan); }
#ed-save { background: var(--gold); color: #10222C; border: 0; }
#ed-save:disabled { opacity: .6; cursor: wait; }
.ed-corpo { flex: 1; display: flex; min-height: 0; }
.ed-palco { flex: 1; overflow: auto; background: #0b1820; padding: 20px; display: flex; justify-content: center; align-items: flex-start; }
.ed-moldura { position: relative; overflow: hidden; flex: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
#ed-frame { border: 0; transform-origin: 0 0; background: #fff; display: block; }
.ed-painel { width: 320px; flex: none; border-left: 1px solid var(--line); background: var(--panel); overflow: auto; padding: 12px 14px; font-size: 13px; }
.ed-painel h3 { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ed-tipo { margin: 0 0 6px; font-family: monospace; font-size: 12px; color: var(--cyan); word-break: break-all; }
.ed-camada { display: flex; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-camada:hover { background: rgba(255, 255, 255, .05); }
.ed-camada.ativa { background: rgba(245, 197, 24, .15); color: var(--gold); }
.ed-camada.oculta { opacity: .45; text-decoration: line-through; }
.ed-camada .tag { font-family: monospace; font-size: 11px; color: var(--cyan); flex: none; }
.ed-camada .nome { overflow: hidden; text-overflow: ellipsis; }
.ed-prop { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.ed-prop label { flex: 0 0 90px; color: var(--muted); font-size: 12px; }
.ed-prop input, .ed-prop select { flex: 1; min-width: 0; font: inherit; font-size: 13px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.ed-prop input[type=range] { padding: 0; accent-color: var(--gold); }
.ed-prop output { flex: 0 0 40px; font-size: 12px; color: var(--muted); text-align: right; }
.ed-dica { margin: 6px 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.ed-prop input[type=file] { padding: 3px; font-size: 12px; }
.ed-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ed-btns button { font: inherit; font-size: 12px; font-weight: 700; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.ed-btns button:hover { border-color: var(--cyan); }
.ed-btns button.perigo:hover { border-color: #E8A0A0; color: #E8A0A0; }
@media (max-width: 800px) {
  .ed-corpo { flex-direction: column; }
  .ed-painel { width: auto; height: 42vh; border-left: 0; border-top: 1px solid var(--line); }
}
/* modais abertos a partir do wizard (galeria, fotos CC, regras, ideia) tem de ficar por cima dele */
#galeria, #ccmodal, #pbmodal, #idmodal { z-index: 34; }
#lightbox { z-index: 36; }
.wiz-topo {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.wiz-topo > strong { font-size: 17px; letter-spacing: .02em; white-space: nowrap; }
#wiz-fechar {
  margin-left: auto; font: inherit; font-size: 15px;
  background: none; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); padding: 7px 12px; cursor: pointer;
}
.wiz-passos {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
}
.wiz-passos button {
  display: flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; white-space: nowrap;
  background: none; border: 0; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
}
.wiz-passos button .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line); font-size: 12px;
}
.wiz-passos button.ativa { color: var(--ink, #F4F7F9); }
.wiz-passos button.ativa .num {
  background: var(--gold); border-color: var(--gold); color: #10222C;
  font-weight: 700;
}
.wiz-passos button.feita .num { border-color: var(--gold); color: var(--gold); }
.wiz-passos button:disabled { opacity: .35; cursor: default; }
.wiz-corpo {
  flex: 1; overflow-y: auto; padding: 26px 22px 40px;
}
.wiz-step {
  max-width: 880px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
}
.wiz-step h2 {
  font-size: 22px; margin: 0 0 4px; letter-spacing: .01em;
}
.wiz-step label { font-size: 14px; }
.wiz-step textarea, .wiz-step input[type="text"], .wiz-step select,
.wiz-step input[type="number"] { font-size: 15px; }
.wiz-linha2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.wiz-fundo {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--panel);
}
.wiz-fundo .wiz-espaco { flex: 1; }
#wiz-back, #wiz-next, .wiz-fundo #go {
  font: inherit; font-size: 16px; font-weight: 700;
  border-radius: 10px; padding: 13px 26px; cursor: pointer;
  min-height: 48px;
}
#wiz-back {
  background: none; border: 1px solid var(--line); color: var(--muted);
}
#wiz-next, .wiz-fundo #go {
  background: var(--gold); color: #10222C; border: 0;
}
.wiz-fundo #go:disabled { opacity: .6; cursor: wait; }
/* wizard ocupado: nada avanca nem recua enquanto a pesquisa/copy/voz correm */
#wiz-back:disabled, #wiz-next:disabled { opacity: .45; cursor: wait; }
#wizard.ocupado .wiz-passos button { pointer-events: none; opacity: .55; }
.wiz-estado { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.wiz-estado .spin { width: 14px; height: 14px; border: 2px solid var(--line);
  border-top-color: var(--gold); border-radius: 50%; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
#cc-buscar.a-sondar span { color: var(--gold); }
#wiz-abrir {
  font: inherit; font-size: 16px; font-weight: 700;
  background: var(--gold); color: #10222C; border: 0;
  border-radius: 10px; padding: 14px; cursor: pointer; width: 100%;
}
#wiz-digest { display: flex; flex-direction: column; gap: 10px; }
.wiz-facto {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
}
.wiz-facto p { margin: 0 0 6px; font-size: 15px; line-height: 1.45; }
.wiz-facto a { color: var(--cyan, #7FD3E0); font-size: 12.5px; }
#wiz-resumo {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 16px; margin-bottom: 8px;
}
.wiz-res-linha {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.wiz-res-linha:last-child { border-bottom: 0; }
.wiz-res-linha span { color: var(--muted); }
.wiz-res-linha b { text-align: right; }
#wizard #copy-cards { margin: 0; }
@media (max-width: 680px) {
  .wiz-topo { padding: 10px 12px; gap: 10px; }
  .wiz-topo > strong { display: none; }
  .wiz-passos button .nome { display: none; }
  .wiz-passos button.ativa .nome { display: inline; }
  .wiz-corpo { padding: 18px 14px 30px; }
  .wiz-linha2 { grid-template-columns: 1fr; }
  .wiz-fundo { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  #wiz-back, #wiz-next, .wiz-fundo #go { flex: 1; padding: 13px 10px; }
  .wiz-fundo { flex-wrap: wrap; }
  /* no telemovel o estado vai numa linha propria por cima dos botoes */
  .wiz-fundo .wiz-espaco { flex: 0 0 100%; order: -1; text-align: center; }
  .wiz-fundo .wiz-espaco:empty, .wiz-fundo .wiz-espaco:has(#wiz-estado[hidden]) { display: none; }
}

/* ---------- etapa 1 visual: cards de canal, formatos, tipo de post ---- */
.wiz-rotulo {
  font-size: 14px; color: var(--muted); font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.wiz-rotulo #pb-abrir {
  font: inherit; font-size: 12px; font-weight: 400;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); padding: 3px 10px; cursor: pointer;
}
#canal-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.canal-card {
  font: inherit; text-align: left; cursor: pointer;
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--muted); transition: border-color .12s;
}
.canal-card svg { width: 26px; height: 26px; color: var(--cyan, #7FD3E0); }
.canal-card strong { color: var(--ink, #F4F7F9); font-size: 14.5px; }
.canal-card span { font-size: 12px; line-height: 1.35; }
.canal-card:hover { border-color: var(--muted); }
.canal-card.ativa { border-color: var(--gold); }
.canal-card.ativa svg { color: var(--gold); }
#fmt-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.fmt-card {
  font: inherit; cursor: pointer;
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px; min-width: 108px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted);
}
.fmt-card strong { color: var(--ink, #F4F7F9); font-size: 13px; }
.fmt-dim { font-size: 11.5px; }
.fmt-forma {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid currentColor; border-radius: 4px;
  color: var(--cyan, #7FD3E0); font-size: 15px;
}
.fmt-livre { border-style: dashed; }
.fmt-card:hover { border-color: var(--muted); }
.fmt-card.ativa { border-color: var(--gold); }
.fmt-card.ativa .fmt-forma { color: var(--gold); }
#tipo-wrap { display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; gap: 0; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; width: fit-content; }
.seg button {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--panel); border: 0; color: var(--muted);
  padding: 12px 22px;
}
.seg button + button { border-left: 1.5px solid var(--line); }
.seg button.ativa { background: var(--gold); color: #10222C; font-weight: 700; }
.seg button.ativa .dica { color: #10222C; opacity: .75; }
#slide-passo { display: flex; align-items: center; gap: 14px; }
#slide-passo button {
  font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 10px; color: var(--ink, #F4F7F9);
  width: 44px; height: 44px;
}
#slide-passo output { font-size: 15px; font-weight: 600; min-width: 74px; text-align: center; }
@media (max-width: 680px) {
  #canal-cards { grid-template-columns: repeat(2, 1fr); }
  .seg { width: 100%; }
  .seg button { flex: 1; }
}

/* olho de ver a senha */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 40px; box-sizing: border-box; }
.pw-olho {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--muted); line-height: 0;
}
.pw-olho svg { width: 18px; height: 18px; }
.pw-olho.ativo { color: var(--gold); }

/* o Edge/Chrome poe um olho NATIVO no password — um olho chega */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }

/* o embrulho do olho esconde-se JUNTO com o input escondido — senao o
   olho do "confirm password" fica orfao a flutuar no modo Sign in */
.pw-wrap:has(input[hidden]) { display: none; }

.gate-link {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 12.5px;
  text-decoration: underline;
}

/* ---------- etapa Images em cards + fita de miniaturas ---------- */
.img-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#gen-cards { grid-template-columns: repeat(4, 1fr); }
.img-cards > .img-card,
#cc-buscar.img-card, #galeria-brief.img-card {
  position: relative; font: inherit; text-align: left; cursor: pointer;
  background: var(--panel); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 5px;
  color: var(--muted); font-size: 13px; transition: border-color .12s;
}
.img-card svg { width: 22px; height: 22px; color: var(--cyan, #7FD3E0); }
.img-card strong { color: var(--ink, #F4F7F9); font-size: 13.5px; }
.img-card span { font-size: 11.5px; line-height: 1.3; }
.img-card:hover { border-color: var(--muted); }
.img-card.ativa { border-color: var(--gold); }
.img-card.ativa svg { color: var(--gold); }
.img-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--gold); color: #10222C;
  font-size: 11px; font-weight: 700; line-height: 1;
  border-radius: 999px; padding: 4px 7px;
}
.tira-fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.tira-cel {
  position: relative; width: 64px; height: 64px;
  border-radius: 8px; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line);
  font-size: 9px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 2px; box-sizing: border-box;
}
.tira-cel img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; }
.tira-cel[data-rot]::after {
  content: attr(data-rot);
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--gold); color: #10222C;
  font-size: 9px; font-weight: 700; text-align: center; padding: 1px 0;
}
.tira-x {
  position: absolute; top: 2px; right: 2px; z-index: 1;
  width: 18px; height: 18px; line-height: 1; font-size: 10px;
  background: rgba(16, 34, 44, .8); color: #fff;
  border: 0; border-radius: 50%; cursor: pointer; padding: 0;
}
@media (max-width: 680px) {
  .img-cards, #gen-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- visao da marca (aba Brand) ---------- */
#brand-visao { display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); }
/* duas linhas: o logo em cima, nome e negocio em baixo a toda a largura
   (lado a lado, numa sidebar estreita, o texto ficava numa coluna de 5 cm) */
#bv-topo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
#bv-logo { height: 56px; min-width: 56px; max-width: 200px; flex: none;
  padding: 6px; box-sizing: border-box;
  border-radius: 10px; background: var(--panel);
  border: 1px solid var(--line); overflow: hidden;
  display: flex; align-items: center; justify-content: center; }
#bv-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; display: block; }
#bv-nome { margin: 0; font-size: 16px; line-height: 1.25; }
#bv-negocio { margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#bv-negocio:hover { -webkit-line-clamp: unset; }
#bv-cores { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.bv-cor { display: flex; flex-direction: column; gap: 4px; align-items: stretch;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.bv-cor-chip { height: 40px; border-radius: 8px; border: 1px solid var(--line); }
.bv-cor-rot { font-size: 10px; color: var(--muted); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bv-fontes { display: flex; flex-direction: column; gap: 10px; }
.bv-fonte { display: flex; flex-direction: column; }
.bv-fonte-nome { font-size: 18px; color: var(--ink, #F4F7F9); line-height: 1.1; }
.bv-fonte-rot { font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
#bv-fotos .tira-cel { width: 48px; height: 48px; }
#bv-fotos-gerir { font-size: 11px; }

/* grupos da aba Brand: icone no summary, mesma linguagem do wizard */
#tab-marca details.grupo summary svg {
  width: 17px; height: 17px; vertical-align: -3px; margin-right: 7px;
  color: var(--cyan, #7FD3E0);
}
#tab-marca details.grupo[open] summary svg { color: var(--gold); }
#newbrand { display: flex; flex-direction: column; gap: 8px;
  padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; }

/* marca no header e guias de ligacao (Settings › Connections) */
.wordmark { display: inline-flex; align-items: center; gap: 8px; }
.marca-logo { width: 28px; height: 28px; display: block; }
.set-guia { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--linha, rgba(0,0,0,.12)); border-radius: 8px; font-size: 13px; }
.set-guia summary { cursor: pointer; font-weight: 600; }
.set-guia ol { margin: 6px 0 2px; padding-left: 20px; }
.set-guia li { margin: 3px 0; }
.set-guia pre { margin: 6px 0 2px; padding: 8px; border-radius: 6px; background: rgba(0,0,0,.06); font-size: 12px; overflow-x: auto; }

/* Settings › Access */
.acesso h3 { font-size: 13px; margin: 12px 0 6px; }
.ac-linha { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 8px 10px; margin: 6px 0; border: 1px solid var(--linha, rgba(0,0,0,.12)); border-radius: 8px; font-size: 13px; }
.ac-pend { border-color: #FFCE3D; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.ac-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.ac-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-acts button { font-size: 12px; padding: 4px 10px; }
.ac-admin { font-size: 11px; color: var(--muted); }
.ac-nova { grid-template-columns: 1fr 1fr auto; align-items: center; }
.ac-nova input { font-size: 12px; }
.ac-ws { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.ac-ws label { color: var(--muted); min-width: 110px; }
.ac-ws input { font-size: 12px; padding: 4px 6px; }
.ac-ws input[type=password] { flex: 1; min-width: 200px; }
.ac-ws input[type=number] { width: 90px; }
.ac-ws button { font-size: 12px; padding: 4px 10px; }

/* header: logo horizontal da Skylev (SVG inline, cor do texto; o ciano do
   simbolo fica); "Studio" a seguir. O quadrado fica so' para favicon/MCP. */
.marca-logo-h { height: 17px; width: auto; display: block; color: var(--text); }
.wordmark { align-items: center; }
.wordmark b { font-size: 14px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
/* Settings: botoes com o mesmo desenho do resto da app (o Copy vinha nu) */
.set-corpo .set-linha input[type=text], .set-corpo .set-linha input[type=password] { flex: 1; min-width: 0; }
.set-corpo .set-linha > button, .set-guia button, .acesso button {
  font: inherit; font-size: 13px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; white-space: nowrap;
}
.set-corpo .set-linha > button:hover, .acesso button:hover { border-color: var(--cyan); }
.set-corpo button.perigo { color: #ff9b9b; }
.acesso button { padding: 5px 10px; font-size: 12px; }
