/* Organogramas — Grupo ICF
   Identidade do Grupo ICF (a mesma do Portal de Reembolso):
   azul-marinho #112942, verde #01c38e (sempre com texto azul-marinho por cima), fontes Geologica e Inter. */
:root {
  --brand: #112942;
  --brand-950: #0b1d30;
  --brand-600: #1b4268;
  --brand-soft: #e8eef5;
  --accent: #01c38e;
  --accent-hover: #00b080;
  --accent-ink: #112942;
  --accent-soft: #e2f7f0;
  --accent-strong: #007a57;
  --display: Geologica, "Helvetica Neue", Arial, sans-serif;

  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e7ee;
  --border-strong: #cfd7e2;
  --text: #132233;
  --text-2: #4b5868;
  --text-3: #7a8696;
  --focus: #007a57;
  --sel: #2f6fed;

  --amber: #8a5300; --amber-bg: #fff3dc;
  --green: #18794e; --green-bg: #e3f5ec;
  --red: #c4291c; --red-bg: #fde9e7;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .18);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; min-height: 0; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--brand); }
h1 { font-family: var(--display); font-size: 1.6rem; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 1.08rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--brand-soft); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); font-size: .86rem; }
.boot { display: grid; place-items: center; min-height: 50vh; color: var(--text-3); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { flex-shrink: 0; }

/* ---------- Faixa de ambiente (homologação) ---------- */
.faixa-ambiente {
  background: repeating-linear-gradient(-45deg, #ffd65c, #ffd65c 14px, #ffcf40 14px, #ffcf40 28px);
  color: #3d2b00; font-size: .8rem; text-align: center; padding: 3px 12px; letter-spacing: .01em;
}

/* ---------- Topo ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff; box-shadow: inset 0 -3px 0 var(--accent); flex-shrink: 0; }
.topbar-inner { margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 20px; min-height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-weight: 700; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; }
.brand-sep { width: 1px; height: 24px; background: rgba(255,255,255,.25); }
.brand-text { font-family: var(--display); font-weight: 500; font-size: 1.02rem; letter-spacing: .01em; }
.topbar-meio { flex: 1; min-width: 0; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: rgba(255,255,255,.82); padding: 7px 12px; border-radius: 7px; font-weight: 550; font-size: .9rem; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); border-radius: 7px 7px 2px 2px; }
.quem { display: flex; align-items: center; gap: 10px; font-size: .86rem; white-space: nowrap; }
.chip-user { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.9); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .72rem; }
.btn.btn-topo { background: transparent; color: rgba(255,255,255,.88); border-color: rgba(255,255,255,.25); min-height: 32px; padding: 0 12px; }
.btn.btn-topo:hover, .btn.btn-topo.ativo { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #b9c4d2; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primario:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-perigo { background: var(--red); border-color: var(--red); color: #fff; }
.btn-perigo:hover { background: #a82317; border-color: #a82317; }
.btn-perigo-suave { color: var(--red); }
.btn-perigo-suave:hover { background: var(--red-bg); border-color: #f2b8b1; }
.btn-peq { min-height: 32px; padding: 0 11px; font-size: .84rem; gap: 6px; }
.btn-peq svg { width: 16px; height: 16px; }
.btn-sutil { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-largo { width: 100%; }
.btn-icone {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; flex-shrink: 0;
}
.btn-icone:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

.campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.campo > span { font-size: .84rem; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=password], input[type=search], input:not([type]), select, textarea {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(1, 195, 142, .2); }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text-2); margin-bottom: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent-strong); }
.form-erro, .modal-erro { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 9px 12px; font-size: .88rem; margin-bottom: 12px; }
.aviso-erro { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 12px 14px; }

/* ---------- Páginas simples ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 28px 20px 56px; }
.container.estreito { max-width: 760px; }
.cartao { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.cabecalho-pagina { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.cabecalho-pagina p { margin-top: 4px; }
.voltar { display: inline-flex; align-items: center; gap: 4px; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }

.entrar { display: grid; place-items: center; padding: 48px 16px; min-height: calc(100vh - 120px); }
.entrar-cartao { width: 100%; max-width: 400px; padding: 30px 28px; }
.entrar-cartao h1 { margin: 14px 0 6px; }
.entrar-cartao > p { margin-bottom: 22px; }
.entrar-marca img { display: block; }

.grade-orgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.org { position: relative; transition: box-shadow .15s, border-color .15s, transform .15s; }
.org:hover { border-color: var(--border-strong); box-shadow: 0 6px 18px rgba(16,24,40,.08); transform: translateY(-1px); }
.org-link { display: block; padding: 16px 18px 18px; color: inherit; }
.org-link:hover { text-decoration: none; }
.org-miniatura { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; margin-bottom: 14px; padding: 4px 0; }
.org h2 { margin-bottom: 4px; padding-right: 26px; }
.org-mais { position: absolute; right: 8px; bottom: 54px; }
.org .subtle + .subtle { margin-top: 2px; }
.vazio { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 36px; text-align: center; }
.vazio p + p { margin-top: 6px; }
.rodape-lista { margin-top: 28px; }
.rodape-lista a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: .88rem; }
.secao { padding: 20px 22px; margin-bottom: 18px; }
.secao h2 { margin-bottom: 14px; }
.secao-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.secao-topo h2 { margin: 0; }
.form-linha { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-linha .campo { flex: 1; min-width: 180px; margin: 0; }
.lista-simples { display: flex; flex-direction: column; }
.linha-simples { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.linha-simples:last-child { border-bottom: 0; }
.linha-simples.inativo { opacity: .55; }
.credencial { display: grid; gap: 10px; margin-top: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; }
.credencial span { display: block; font-size: .8rem; color: var(--text-3); }
.credencial code { font-size: 1rem; }

.opcoes-inicio { border: 0; padding: 0; margin: 0 0 12px; }
.opcoes-inicio legend { font-size: .84rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.opcao { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; cursor: pointer; }
.opcao:has(input:checked) { border-color: var(--accent-strong); background: var(--accent-soft); }
.opcao input { margin-top: 3px; accent-color: var(--accent-strong); }
.opcao strong { display: block; font-size: .92rem; }
.opcao small { display: block; color: var(--text-2); font-size: .83rem; }
.previa-import { margin-top: 6px; font-weight: 600; color: var(--accent-strong); }
.avisos { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: .88rem; max-height: 300px; overflow: auto; }
.avisos li + li { margin-top: 4px; }

/* ---------- Janelas, menus e avisos ---------- */
.modal-fundo { position: fixed; inset: 0; background: rgba(11, 29, 48, .45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: aparecer .12s ease-out; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: subir .16s ease-out; }
.modal-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 6px 22px; }
.modal-corpo { padding: 8px 22px 6px; overflow: auto; }
.modal-corpo > p + p { margin-top: 8px; }
.modal-erro { margin: 4px 22px 0; }
.modal-botoes { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; flex-wrap: wrap; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(8px) scale(.99); } }

.menu {
  position: fixed; z-index: 120; background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: calc(100vh - 16px); overflow: auto; animation: aparecer .08s ease-out;
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: transparent;
  border-radius: 7px; font: inherit; font-size: .88rem; color: var(--text); text-align: left; cursor: pointer;
}
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--brand-soft); outline: none; }
.menu-item:disabled { color: var(--text-3); cursor: default; }
.menu-item.perigo { color: var(--red); }
.menu-item.perigo:hover:not(:disabled) { background: var(--red-bg); }
.menu-ic { width: 18px; display: grid; place-items: center; color: var(--text-3); }
.menu-item.perigo .menu-ic { color: inherit; }
.menu-ic svg { width: 16px; height: 16px; }
.menu-rot { flex: 1; }
.menu-item kbd { font: inherit; font-size: .75rem; color: var(--text-3); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-titulo { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 7px 10px 4px; }
.menu .cores { padding: 2px 8px 6px; }

.toasts { position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .9rem; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .3s; max-width: min(520px, calc(100vw - 32px)); }
.toast-ok { box-shadow: inset 4px 0 0 var(--accent), var(--shadow-lg); }
.toast-erro { background: var(--red); }
.toast-info { background: #2b3542; }
.toast.saindo { opacity: 0; transform: translateY(6px); }

/* ---------- Cores (amostras) ---------- */
.cores-grupo + .cores-grupo { margin-top: 8px; }
.cores-rotulo { display: block; font-size: .74rem; color: var(--text-3); margin-bottom: 4px; }
.cores-linha { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.cor-amostra {
  aspect-ratio: 1; min-width: 26px; border-radius: 7px; border: 1px solid rgba(17, 41, 66, .16); background: var(--f); color: var(--t);
  cursor: pointer; position: relative; display: grid; place-items: center; font: 700 .7rem Inter, sans-serif; padding: 0;
}
.cor-amostra::after { content: ""; position: absolute; left: 3px; right: 3px; top: 3px; height: 3px; border-radius: 2px; background: var(--d); }
.cor-amostra:hover { transform: scale(1.08); box-shadow: 0 2px 6px rgba(16,24,40,.18); }
.cor-amostra.atual { outline: 2px solid var(--sel); outline-offset: 1px; }
.cores-acoes { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.cor-personal { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cor-campos { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 180px; }
.cor-campos label { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.cor-campos input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 7px; background: #fff; cursor: pointer; }
.cor-previa { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.pintar-pergunta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pintar-pergunta svg { background: var(--surface-2); border-radius: 10px; padding: 6px; border: 1px solid var(--border); }
.pintar-pergunta p { flex: 1; min-width: 200px; }

/* ---------- Editor ---------- */
body[data-tela=editor] { height: 100vh; overflow: hidden; }
body[data-tela=editor] .topbar-inner { min-height: 50px; }
body[data-tela=editor] .brand-logo { height: 24px; }
.editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }

.ed-barra {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--surface); border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: thin; flex-shrink: 0;
}
.ed-nome {
  font: 650 1rem var(--display) !important; color: var(--brand) !important; border-color: transparent !important; background: transparent !important;
  padding: 6px 8px !important; width: auto !important; max-width: 320px;
}
.ed-nome:hover { border-color: var(--border) !important; }
.ed-nome:focus { border-color: var(--accent-strong) !important; background: #fff !important; }
.ed-status { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--text-3); white-space: nowrap; min-width: 66px; }
.ed-status svg { width: 15px; height: 15px; }
.ed-status[data-estado=salvo] { color: var(--accent-strong); }
.ed-status[data-estado=erro] { color: var(--red); font-weight: 600; }
.ed-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex-shrink: 0; }
.ed-flex { flex: 1; }
.btn-barra { min-height: 34px; padding: 0 11px; font-size: .85rem; }
.btn-barra svg { width: 17px; height: 17px; }
.ed-modo { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; flex-shrink: 0; }
.ed-modo button { width: 32px; height: 28px; border: 0; background: transparent; border-radius: 7px; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.ed-modo button[aria-pressed=true] { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.ed-modo svg { width: 16px; height: 16px; }
.ed-busca { position: relative; display: flex; align-items: center; flex-shrink: 0; margin-left: 4px; }
.ed-busca svg { position: absolute; left: 9px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.ed-busca input { width: 210px; padding: 6px 60px 6px 32px; font-size: .86rem; min-height: 34px; }
.ed-busca-cont { position: absolute; right: 10px; font-size: .75rem; color: var(--text-3); pointer-events: none; }

.ed-corpo { flex: 1; display: flex; min-height: 0; }
.ed-tela { --tela: #f4f6f9; position: relative; flex: 1; min-width: 0; overflow: hidden; background-color: var(--tela);
  background-image: radial-gradient(rgba(17, 41, 66, .09) 1px, transparent 1px); background-size: 22px 22px; }
.ed-tela.tela-escura { background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); }
.ed-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; font-family: Inter, system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; outline: none; }
.ed-tela[data-modo=mover] .ed-svg { cursor: grab; }
.ed-tela.arrastando-tela .ed-svg { cursor: grabbing; }
.ed-tela.arrastando-card .ed-svg { cursor: grabbing; }

.ed-linhas path { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.card { cursor: pointer; }
.card text { text-anchor: middle; }
.card .iniciais { font-size: 19px; font-weight: 700; }
.card .sombra { fill: rgba(16, 24, 40, .07); }
.card .corpo { stroke-width: 1; transition: stroke .12s; }
.card:hover .corpo { stroke: var(--accent-strong); stroke-width: 1.5; }
.card .contorno { fill: none; stroke: var(--sel); stroke-width: 2.5; opacity: 0; }
.card.sel .contorno { opacity: 1; }
.card.achado .contorno { opacity: 1; stroke: #f0a400; stroke-width: 3; stroke-dasharray: 6 4; }
.card.sel.achado .contorno { stroke: var(--sel); stroke-dasharray: none; }
.card.arrastado { opacity: .35; }
.vazio-txt { opacity: .75; }

.plus { cursor: pointer; }
.plus-ligacao { stroke: var(--accent-strong); fill: none; opacity: .55; }
.plus-area { fill: transparent; }
.plus-bola { fill: var(--accent); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(16, 24, 40, .25)); transition: transform .1s; }
.plus-sinal { stroke: var(--accent-ink); stroke-width: 2.2; stroke-linecap: round; }
.plus:hover .plus-bola { fill: var(--accent-hover); transform: scale(1.15); }
.plus:hover .plus-ligacao { opacity: 1; }
.ind-filho { fill: rgba(1, 195, 142, .1); stroke: var(--accent); stroke-width: 3; stroke-dasharray: 7 5; }
.ind-par { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }

.ed-laco { position: absolute; border: 1.5px solid var(--sel); background: rgba(47, 111, 237, .08); border-radius: 3px; pointer-events: none; }
.ed-fantasma {
  position: absolute; pointer-events: none; background: var(--brand); color: #fff; padding: 7px 12px; border-radius: 9px; font-size: .84rem; font-weight: 600;
  box-shadow: var(--shadow-lg); max-width: 280px; z-index: 5;
}
.ed-fantasma small { display: block; font-weight: 400; color: #b7f0dd; font-size: .78rem; }

.ed-aviso-secao {
  position: absolute; top: 10px; left: 12px; z-index: 4; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--accent); box-shadow: var(--shadow); border-radius: 10px;
  padding: 5px 6px 5px 11px; font-size: .84rem; color: var(--text-2); max-width: calc(100% - 24px); white-space: nowrap;
}
.ed-aviso-secao > span { overflow: hidden; text-overflow: ellipsis; }
.ed-aviso-secao > svg { color: var(--accent-strong); width: 16px; height: 16px; }
.ed-aviso-secao strong { color: var(--brand); }

.ed-vazio { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; pointer-events: none; padding: 20px; }
.ed-vazio > * { pointer-events: auto; }
.tela-escura .ed-vazio p { color: #dfe7f0; }
.ed-plus-grande {
  width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; margin-bottom: 14px;
  display: grid; place-items: center; box-shadow: 0 10px 28px rgba(1, 195, 142, .35); transition: transform .15s, box-shadow .15s;
}
.ed-plus-grande svg { width: 42px; height: 42px; stroke-width: 2.4; }
.ed-plus-grande:hover { transform: scale(1.06); box-shadow: 0 14px 34px rgba(1, 195, 142, .45); }
.ed-vazio-caixa { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; align-items: center; }

.ed-selecao {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; border-radius: 11px; padding: 6px 6px 6px 14px; box-shadow: var(--shadow-lg); font-size: .88rem; white-space: nowrap;
}
.ed-selecao .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.ed-selecao .btn:hover { background: rgba(255,255,255,.2); }
.ed-selecao .btn-icone { color: rgba(255,255,255,.8); width: 30px; height: 30px; }
.ed-selecao .btn-icone:hover { background: rgba(255,255,255,.15); color: #fff; }

.ed-zoom {
  position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 2px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; box-shadow: var(--shadow); z-index: 4;
}
.ed-zoom .btn-icone { width: 30px; height: 30px; }
.ed-zoom-valor { font: 600 .8rem Inter, sans-serif; color: var(--text-2); background: transparent; border: 0; min-width: 48px; height: 30px; border-radius: 7px; cursor: pointer; }
.ed-zoom-valor:hover { background: var(--brand-soft); }
.ed-dica { position: absolute; left: 14px; bottom: 16px; font-size: .78rem; color: var(--text-3); pointer-events: none; max-width: calc(100% - 260px); }
.tela-escura .ed-dica { color: #8ea3b8; }
.ed-dica b { color: var(--accent-strong); }

.ed-painel { width: 310px; flex-shrink: 0; background: var(--surface); border-left: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.painel-topo { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 4px 18px; }
.painel-corpo { padding: 8px 18px 20px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-bottom: 16px; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; border-radius: 7px; padding: 6px; font: 600 .85rem Inter, sans-serif; color: var(--text-2); cursor: pointer; }
.seg button svg { width: 16px; height: 16px; }
.seg button[aria-pressed=true] { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.painel-foto { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.painel-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.25rem; flex-shrink: 0; overflow: hidden; border: 3px solid transparent; }
.painel-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #fff; }
.painel-foto-botoes { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.painel-bloco { margin: 4px 0 16px; }
.rotulo { display: block; font-size: .84rem; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.painel-add { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.painel-rodape { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.painel-rodape .btn { justify-content: flex-start; }
.ed-painel .subtle { line-height: 1.45; }

.ed-guias { display: flex; align-items: stretch; background: #e9edf2; border-top: 1px solid var(--border-strong); min-height: 38px; flex-shrink: 0; padding: 0 6px; }
.guias-lista { display: flex; overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.guia {
  display: flex; align-items: center; gap: 6px; padding: 0 16px; border: 0; border-right: 1px solid var(--border-strong); background: transparent;
  font: 550 .86rem Inter, sans-serif; color: var(--text-2); cursor: pointer; white-space: nowrap; position: relative; max-width: 220px;
}
.guia span { overflow: hidden; text-overflow: ellipsis; }
.guia svg { width: 14px; height: 14px; color: var(--accent-strong); }
.guia:hover { background: rgba(255,255,255,.6); color: var(--brand); }
.guia.ativa { background: #fff; color: var(--brand); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); margin-top: -1px; }
.guia-publicada { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }
.guia-nova { border: 0; background: transparent; width: 38px; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.guia-nova:hover { background: rgba(255,255,255,.6); color: var(--brand); }

/* ---------- PDF, histórico e lote ---------- */
.pdf-dialogo section + section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.pdf-dialogo h3 { margin-bottom: 12px; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pdf-acoes, .link-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.link-caixa { display: flex; gap: 8px; margin-bottom: 10px; }
.link-caixa input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; background: var(--surface-2); }
.link-acoes { margin-top: 12px; }
[data-link] > .muted { margin-bottom: 12px; }
.hist-salvar { display: flex; gap: 8px; align-items: flex-end; }
.hist-salvar .campo { flex: 1; margin-bottom: 0; }
.hist-salvar + .subtle { margin: 8px 0 12px; }
.hist-lista { max-height: 340px; overflow: auto; border-top: 1px solid var(--border); }
.lote-lista ul { list-style: none; padding: 0; margin: 8px 0 0; max-height: 280px; overflow: auto; }
.lote-lista li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: .87rem; border-bottom: 1px solid var(--border); }
.lote-lista li svg { width: 16px; height: 16px; margin-top: 2px; }
.lote-lista li.ok svg { color: var(--accent-strong); }
.lote-lista li.sem { color: var(--text-3); }
.lote-lista li.sem svg { color: var(--amber); }
.lista-cards { font-family: Inter, sans-serif !important; font-size: .88rem !important; }

/* ---------- Telas pequenas ---------- */
@media (max-width: 1320px) {
  .ed-barra .btn-secundario span { display: none; }
  .ed-barra .btn-secundario { padding: 0 9px; }
  .ed-busca input { width: 150px; }
}
@media (max-width: 900px) {
  .ed-barra .btn-barra span { display: none; }
  .ed-busca input { width: 150px; }
  .ed-dica { display: none; }
  .ed-painel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 8; box-shadow: var(--shadow-lg); }
  .ed-corpo { position: relative; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 12px; gap: 10px; }
  .brand-sep, .brand-text, .quem-nome { display: none; }
  .container { padding: 20px 16px 48px; }
  .grade-2 { grid-template-columns: 1fr; }
  .ed-painel { width: 100%; }
}
body[data-tela=editor] main { display: flex; flex-direction: column; }
body[data-tela=editor] .editor { flex: 1; height: auto; }
