:root {
  --papel: #ffffff;
  --grade: #ececec;
  --tinta: #0a0a0a;
  --cinza: #6b6b6b;
  --claro: #9a9a9a;
  --linha: #d9d9d9;
  --suave: #f4f4f4;
  --ciano: #4fe3ff;
  --erro: #b3261e;
  --atencao: #b45309;
  --serifa: 'Figtree', 'Inter', system-ui, sans-serif; /* títulos em sans, mais fáceis de ler (pedido do Vitor) */
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  color: var(--tinta);
  font: 15px/1.5 var(--sans);
  background-color: var(--papel);
  background-image: linear-gradient(var(--grade) 1px, transparent 1px), linear-gradient(90deg, var(--grade) 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
}
body.no-editor { overflow: hidden; }

h1, h2 { font-family: var(--serifa); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 22px; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---------- telas comuns (entrada, lista, equipe) ---------- */

.topo {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 0 auto; padding: 20px 16px;
}
.marca { font-family: var(--serifa); font-size: 20px; font-weight: 600; text-decoration: none; }
.topo nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topo nav a { text-decoration: none; }
.topo nav a:hover { text-decoration: underline; }

.pagina { max-width: 1120px; margin: 0 auto; padding: 12px 16px 80px; }
.estreita { max-width: 440px; margin: 8vh auto 0; }
.cabecalho { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; }
.sub { color: var(--cinza); margin-top: 8px; }

.cartao { background: var(--papel); border: 1.5px solid var(--tinta); border-radius: 14px; padding: 24px; }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px var(--sans); color: var(--papel); background: var(--tinta);
  border: 1.5px solid var(--tinta); border-radius: 999px; padding: 11px 20px;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, box-shadow .12s ease;
}
.botao:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ciano); }
.botao:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.botao.claro { color: var(--tinta); background: var(--papel); }
.botao.texto { background: none; border: none; color: var(--tinta); padding: 0; font-weight: 500; box-shadow: none; }
.botao.perigo { color: var(--papel); background: var(--erro); border-color: var(--erro); }
.botao.pequeno { padding: 7px 14px; font-size: 13px; }
:focus-visible { outline: 3px solid var(--ciano); outline-offset: 2px; }

label, .rotulo { display: block; font-weight: 600; font-size: 13px; margin: 18px 0 6px; }
input[type=text], input[type=password], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--tinta); background: var(--papel);
  border: 1.5px solid var(--linha); border-radius: 10px; padding: 10px 12px;
}
input:focus, select:focus, textarea:focus { border-color: var(--tinta); outline: none; }
.aviso { color: var(--erro); font-size: 14px; margin-top: 14px; min-height: 1em; }
.rodape-form { margin-top: 22px; display: flex; gap: 10px; align-items: center; }

.cartoes { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cartoes li { position: relative; }
.cartoes a {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  background: var(--papel); border: 1.5px solid var(--linha); border-radius: 14px; padding: 20px;
  text-decoration: none; transition: border-color .12s ease, transform .12s ease;
}
.cartoes a:hover { border-color: var(--tinta); transform: translateY(-1px); }
.cartoes h2 { font-size: 17px; font-weight: 600; }
.cartoes small { color: var(--cinza); font-size: 13px; }
.cartoes .menu { position: absolute; top: 12px; right: 12px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.cartoes li:hover .menu, .cartoes li:focus-within .menu { opacity: 1; }
.icone-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: none; border-radius: 8px; background: transparent; color: var(--cinza); cursor: pointer;
}
.icone-btn:hover { background: var(--suave); color: var(--tinta); }
.icone-btn.perigo:hover { color: var(--erro); }
.icone-btn svg { width: 16px; height: 16px; }

.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th, .tabela td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--linha); }
.tabela th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--cinza); }

dialog { border: 1.5px solid var(--tinta); border-radius: 14px; padding: 24px; max-width: 480px; width: calc(100% - 32px); font: inherit; color: var(--tinta); }
dialog::backdrop { background: rgba(10, 10, 10, .4); }
dialog h2 { margin-bottom: 8px; }
dialog .rodape-form { justify-content: flex-end; }
dialog.video { max-width: 900px; padding: 0; overflow: hidden; background: #000; }
dialog.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.atalhos { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; margin-top: 12px; }
kbd { font: 12px var(--sans); background: var(--suave); border: 1px solid var(--linha); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }

/* ---------- editor (medidas copiadas do MindMeister, tema "meister") ---------- */

.editor {
  position: fixed; inset: 0; overflow: hidden; outline: none; touch-action: none; cursor: grab; background-color: var(--papel);
  font-family: 'Figtree', 'Segoe UI', Helvetica, Arial, sans-serif;
}
.editor:active { cursor: grabbing; }
.editor.fundo-quadriculado { background-image: linear-gradient(var(--grade) 1px, transparent 1px), linear-gradient(90deg, var(--grade) 1px, transparent 1px); background-size: 28px 28px; }
.editor.fundo-pontilhado { background-image: radial-gradient(#cfcfcf 1.2px, transparent 1.2px); background-size: 28px 28px; }
.editor.fundo-liso { background-image: none; }

.plano { position: absolute; left: 0; top: 0; transform-origin: 0 0; opacity: 0; transition: opacity .2s; }
.plano.pronto { opacity: 1; }
.plano svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }

/* `width: max-content`: o plano não tem largura, então sem isso a caixa encolheria a zero e quebraria letra a letra.
   Caixa = texto + 0.7em de respiro em volta (19px → 13.3px; raiz 26px → 18.2px), cantos de 0.7em. */
.no {
  position: absolute; width: max-content; user-select: none; -webkit-user-select: none; cursor: grab;
  line-height: 1.25; padding: .7em; border-radius: .7em; text-align: left;
  transition: box-shadow .1s, opacity .1s;
}
.no:active { cursor: grabbing; }
.no.raiz { text-align: center; }
.no.arrastado { opacity: .35; }
.no.editando { cursor: text; }
.no-conteudo { display: flex; align-items: flex-start; gap: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.no.raiz .no-conteudo { justify-content: center; }
.no-conteudo .vazio { font-style: italic; opacity: .5; }
.no img.no-imagem { display: block; max-height: 160px; max-width: 100%; border-radius: 8px; margin-bottom: 6px; }
.no .no-video { position: relative; display: block; width: 100%; border: 0; padding: 0; margin-bottom: 6px; border-radius: 8px; overflow: hidden; background: var(--tinta); cursor: pointer; }
.no .no-video img { display: block; width: 100%; max-height: 160px; object-fit: cover; opacity: .9; }
.no .no-video .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.no .no-video .play span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--tinta); }
.no .no-video .play svg { width: 16px; height: 16px; margin-left: 2px; }
.no-icone { display: inline-flex; margin-top: .15em; opacity: .7; flex-shrink: 0; }
.no-icone:hover { opacity: 1; }
.no-icone svg { width: 1em; height: 1em; }

/* Texto em edição: o espelho invisível dá o tamanho, a textarea fica por cima. */
.no .campo { display: grid; min-width: 2ch; }
.no .campo > * { grid-area: 1 / 1; }
.no .campo .espelho { visibility: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.no .campo textarea {
  width: 100%; height: 100%; margin: 0; padding: 0; border: 0; resize: none; overflow: hidden;
  background: transparent; color: inherit; font: inherit; line-height: inherit; outline: none;
  white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 0;
}

/* Bolinha de abrir/fechar: 20px, contorno de 3.5px na cor do ramo, branca por dentro (cheia quando o ramo está fechado). */
.no-toggle, .no-mais {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  border-radius: 50%; cursor: pointer; padding: 0; transition: transform .1s;
}
.no-toggle { width: 20px; height: 20px; border: 3.5px solid currentColor; font: 700 10px/1 var(--sans); color: #fff; }
.no-toggle:hover, .no-mais:hover { transform: translateY(-50%) scale(1.15); }
.no-mais { width: 24px; height: 24px; border: 0; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.no-mais svg { width: 16px; height: 16px; stroke-width: 3; }

.fantasma {
  position: fixed; z-index: 50; pointer-events: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--papel); border: 1.5px solid var(--tinta); border-radius: 10px; padding: 6px 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.fantasma small { color: var(--cinza); margin-left: 6px; }

/* Camada de interface por cima do mapa; só os cartões recebem clique. */
.interface { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.interface > * { pointer-events: auto; }
.barra {
  position: absolute; display: flex; align-items: center; gap: 2px;
  background: var(--papel); border-radius: 12px; padding: 6px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 10px rgba(0,0,0,.1);
  font-family: 'Figtree', var(--sans);
}
.barra.topo-esq { top: 16px; left: 16px; max-width: min(460px, calc(100% - 32px)); }
.barra.topo-dir { top: 16px; right: 16px; }
.barra.rodape-dir { bottom: 16px; right: 16px; }
.barra .titulo {
  flex: 1 1 160px; min-width: 0; height: 32px; border: 0; border-radius: 8px; background: transparent;
  padding: 0 8px; font: 600 15px var(--sans); color: var(--tinta);
}
.barra .titulo:hover, .barra .titulo:focus { background: var(--suave); outline: none; }
.barra .status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--cinza); padding: 0 6px; white-space: nowrap; }
.barra .status.pendente { color: var(--atencao); }
.barra .status.erro { color: var(--erro); }
.barra .status button { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-size: 12px; }
.barra .sep { width: 1px; height: 20px; background: var(--linha); margin: 0 2px; }
.barra .zoom { height: 32px; min-width: 48px; border: 0; background: transparent; border-radius: 8px; font-size: 12px; color: var(--cinza); cursor: pointer; }
.barra .zoom:hover { background: var(--suave); }
.barra select { width: auto; padding: 4px 8px; border: 0; background: transparent; font-size: 12px; color: var(--cinza); cursor: pointer; }
.barra .icone-btn.ativo { background: var(--tinta); color: var(--papel); }
.barra .icone-btn:disabled { opacity: .35; cursor: not-allowed; background: transparent; }
.barra a.icone-btn { text-decoration: none; }
.barra .link-voltar { text-decoration: none; }

.painel-area { position: absolute; top: 72px; right: 16px; bottom: 72px; width: 272px; display: flex; pointer-events: none; }
.painel {
  pointer-events: auto; width: 100%; max-height: 100%; overflow-y: auto;
  background: var(--papel); border-radius: 12px; padding: 14px; font-size: 13px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 2px 10px rgba(0,0,0,.1);
  display: flex; flex-direction: column; gap: 14px;
}
.painel section .rotulo { margin: 0 0 6px; font-size: 12px; color: var(--cinza); }
.painel .dica { color: var(--claro); font-size: 12px; margin-top: 6px; }
.cores { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cores button, .cores label {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--linha); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; position: relative; overflow: hidden; transition: transform .1s;
}
.cores button:hover, .cores label:hover { transform: scale(1.12); }
.cores .marcado { box-shadow: 0 0 0 2px var(--papel), 0 0 0 4px var(--tinta); }
.cores button svg { width: 13px; height: 13px; color: var(--cinza); }
.cores input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.linha-opcoes { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.linha-opcoes .num { min-width: 42px; text-align: center; font-size: 12px; color: var(--cinza); }
.linha-opcoes .espaco { flex: 1; }
.painel .icone-btn { border: 1.5px solid var(--linha); color: var(--tinta); }
.painel .icone-btn.ativo { background: var(--tinta); color: var(--papel); border-color: var(--tinta); }
.painel label { margin: 8px 0 4px; font-weight: 500; font-size: 12px; color: var(--cinza); }
.painel input, .painel textarea { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.painel .acoes-no { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--linha); padding-top: 12px; }
.painel .acoes-no .perigo-texto { margin-left: auto; color: var(--erro); }

.dica-rodape {
  pointer-events: none; position: absolute; bottom: 22px; left: 16px;
  font-size: 12px; color: var(--cinza); white-space: nowrap;
  background: rgba(255,255,255,.85); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(4px);
}

@media (max-width: 700px) {
  .barra .status, .barra select, .barra .sep { display: none; }
  .barra.topo-esq { max-width: calc(100% - 120px); }
  .painel-area { top: auto; left: 12px; right: 12px; bottom: 64px; width: auto; max-height: 50%; }
  .dica-rodape { display: none; }
}
