/* JF Club: design system (portal, painel e login).
   Linguagem: superfícies neutras, bordas de 1px, números grandes em fonte tabular, azul da JF só como acento.
   Os nomes antigos das variáveis (--ink, --linha, --chip, --t1…) continuam valendo para os estilos de cada página. */

:root {
  --azul: #0039F3;
  --azul-2: #4A30C2;
  --degrade: linear-gradient(135deg, #4A30C2, #0039F3);

  --page: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --card: #ffffff;
  --chip: rgba(0, 0, 0, 0.045);
  --hover: rgba(0, 0, 0, 0.035);
  --ink: #0a0a0a;
  --ink-2: #3a3a3a;
  --muted: #6b6b6b;
  --linha: rgba(0, 0, 0, 0.085);
  --linha-forte: rgba(0, 0, 0, 0.16);
  --acento: #0039F3;
  --acento-suave: rgba(0, 57, 243, 0.08);
  --bom: #0a8a4a;
  --bom-suave: rgba(10, 138, 74, 0.09);
  --ruim: #d92d20;
  --ruim-suave: rgba(217, 45, 32, 0.08);
  --aviso: #b25e09;
  --aviso-suave: rgba(178, 94, 9, 0.09);
  --btn-bg: #0a0a0a;
  --btn-fg: #ffffff;
  --sombra: 0 1px 2px rgba(0, 0, 0, 0.04);
  --sombra-alta: 0 16px 48px -12px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --pontos: rgba(0, 0, 0, 0.07);
  --raio: 12px;
  --raio-p: 8px;
  --f-titulo: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --f-texto: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --t1: 30px; --t2: 20px; --t3: 14px; --t4: 13px; --t5: 12px;
  --sidebar: 248px;
  --topo: 56px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --page: #000000;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --card: #0a0a0a;
  --chip: rgba(255, 255, 255, 0.06);
  --hover: rgba(255, 255, 255, 0.04);
  --ink: #f5f5f5;
  --ink-2: #c2c2c2;
  --muted: #919191;
  --linha: rgba(255, 255, 255, 0.09);
  --linha-forte: rgba(255, 255, 255, 0.18);
  --acento: #4d7cff;
  --acento-suave: rgba(77, 124, 255, 0.12);
  --bom: #3ecf8e;
  --bom-suave: rgba(62, 207, 142, 0.1);
  --ruim: #ff6166;
  --ruim-suave: rgba(255, 97, 102, 0.1);
  --aviso: #f5a524;
  --aviso-suave: rgba(245, 165, 36, 0.1);
  --btn-bg: #ededed;
  --btn-fg: #0a0a0a;
  --sombra: none;
  --sombra-alta: 0 24px 64px -16px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
  --pontos: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

/* ── base ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-texto); font-size: var(--t3); font-weight: 450; line-height: 1.5; color: var(--ink); background: var(--page);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--f-titulo); margin: 0 0 12px; letter-spacing: -0.02em; font-weight: 600; line-height: 1.25; }
h1 { font-size: 28px; letter-spacing: -0.035em; }
h2 { font-size: var(--t2); }
h3 { font-size: 15px; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
a { color: var(--ink); text-decoration-color: var(--linha-forte); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code { font-family: var(--f-mono); font-size: .92em; background: var(--chip); border-radius: 5px; padding: 1px 5px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
::selection { background: var(--acento); color: #fff; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--linha-forte) transparent; }

/* ── casca: sidebar + topo ────────────────────────────────────────── */
body.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  display: flex; flex-direction: column; background: var(--page); border-right: 1px solid var(--linha);
  transition: width .2s ease, transform .25s ease;
}
.principal { margin-left: var(--sidebar); min-width: 0; transition: margin-left .2s ease; }
.marca { display: flex; align-items: center; gap: 10px; height: var(--topo); padding: 0 16px; flex: 0 0 auto; text-decoration: none; color: var(--ink); }
.marca .selo { width: 26px; height: 26px; border-radius: 7px; background: var(--degrade); display: grid; place-items: center; flex: 0 0 26px; box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 4px 14px -4px rgba(0,57,243,.6); }
.marca .selo img { width: 15px; height: 15px; object-fit: contain; }
.marca .nome { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; }
.sb-topo { display: flex; align-items: center; height: var(--topo); padding: 0 10px 0 0; flex: 0 0 auto; }
.sb-topo .marca { flex: 1; min-width: 0; }
.sb-topo .ico-btn { color: var(--muted); }
.marca .tipo { font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--linha); border-radius: 5px; padding: 1px 6px; margin-left: auto; white-space: nowrap; }

nav.abas { flex: 1; overflow-y: auto; padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
nav.abas .grupo { font-family: var(--f-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 16px 10px 6px; white-space: nowrap; }
nav.abas .grupo:first-child { padding-top: 6px; }
nav.abas a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 7px;
  color: var(--ink-2); text-decoration: none; font-size: var(--t3); font-weight: 500; white-space: nowrap;
  transition: background .12s, color .12s;
}
nav.abas a svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.9; }
nav.abas a:hover { background: var(--hover); color: var(--ink); }
nav.abas a.ativa { background: var(--chip); color: var(--ink); font-weight: 500; }
nav.abas a.ativa svg { color: var(--acento); opacity: 1; }
nav.abas a.ativa::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--acento); }
nav.abas a .badge { margin-left: auto; }
nav.abas a:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--linha-forte); }

.sb-pe { border-top: 1px solid var(--linha); padding: 10px; flex: 0 0 auto; position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #fff; background: var(--degrade); letter-spacing: 0; }
.avatar.g { width: 40px; height: 40px; flex-basis: 40px; font-size: 15px; }
/* botão da conta (abre o menu) */
.conta-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.conta-btn:hover, .conta-btn[aria-expanded="true"] { background: var(--hover); border-color: var(--linha); }
.conta-btn .q-txt { flex: 1; min-width: 0; line-height: 1.3; }
.q-nome { font-size: var(--t3); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.q-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conta-btn .tres { color: var(--muted); flex: 0 0 auto; display: grid; }
.conta-btn .tres svg { width: 16px; height: 16px; }
/* menu da conta */
.conta-menu {
  position: absolute; left: 10px; bottom: calc(100% - 4px); z-index: 40; width: 300px; max-width: calc(100vw - 20px);
  background: var(--surface); border: 1px solid var(--linha); border-radius: 14px; box-shadow: var(--sombra-alta); padding: 6px;
  opacity: 0; transform: translateY(6px) scale(.98); transform-origin: bottom left; pointer-events: none; transition: opacity .14s, transform .14s;
}
.conta-menu.aberto { opacity: 1; transform: none; pointer-events: auto; }
.conta-menu .cm-cab { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; }
.conta-menu .cm-cab .q-txt { min-width: 0; }
.conta-menu .cm-cab .q-nome { font-size: 15px; font-weight: 600; }
.conta-menu .cm-cab .q-sub { font-size: 12.5px; color: var(--ink-2); }
.papel { display: inline-block; margin-top: 6px; font: 600 10.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acento); background: var(--acento-suave); border: 1px solid color-mix(in srgb, var(--acento) 30%, transparent); border-radius: 6px; padding: 1px 7px; }
.conta-menu hr { border: 0; border-top: 1px solid var(--linha); margin: 6px -6px; }
.cm-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 var(--t3) var(--f-texto); cursor: pointer; text-align: left; text-decoration: none; }
.cm-item:hover { background: var(--hover); }
.cm-item svg { width: 16px; height: 16px; color: var(--ink-2); flex: 0 0 16px; }
.cm-item .fim { margin-left: auto; }
.cm-linha { cursor: default; }
.cm-linha:hover { background: none; }
.tema-txt { display: inline-flex; padding: 2px; border: 1px solid var(--linha); border-radius: 8px; background: var(--surface-2); gap: 2px; }
.tema-txt button { height: 26px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: 500 12.5px var(--f-texto); cursor: pointer; }
.tema-txt button:hover { color: var(--ink); }
.tema-txt button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--linha), 0 1px 2px rgba(0,0,0,.08); }

/* seletor de tema (segmentado) */
.tema-seg { display: inline-flex; padding: 2px; border: 1px solid var(--linha); border-radius: 999px; background: var(--surface); gap: 2px; }
.tema-seg button { width: 28px; height: 24px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; }
.tema-seg button svg { width: 14px; height: 14px; }
.tema-seg button:hover { color: var(--ink); }
.tema-seg button[aria-pressed="true"] { background: var(--chip); color: var(--ink); box-shadow: 0 0 0 1px var(--linha) inset; }

.topo {
  position: sticky; top: 0; z-index: 20; height: var(--topo); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--page) 80%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--linha);
}
.topo .trilha { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--t3); }
.topo .trilha .de { color: var(--muted); white-space: nowrap; }
.topo .trilha .sep { color: var(--linha-forte); }
.topo .trilha .aqui { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo .espaco { flex: 1; }
.ico-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: 0 0 32px; padding: 0; }
.ico-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--linha); }
.ico-btn svg { width: 16px; height: 16px; }
.busca-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 10px; min-width: 220px; border-radius: 8px;
  border: 1px solid var(--linha); background: var(--surface); color: var(--muted); font: var(--t4) var(--f-texto); cursor: pointer;
}
.busca-btn:hover { border-color: var(--linha-forte); color: var(--ink-2); }
.busca-btn svg { width: 14px; height: 14px; }
.busca-btn .kbd { margin-left: auto; }
.kbd { font-family: var(--f-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--linha); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; line-height: 18px; background: var(--surface-2); }
.so-mobile { display: none !important; }

/* recolhida (desktop) */
@media (min-width: 901px) {
  body.recolhida { --sidebar: 64px; }
  body.recolhida .marca .nome, body.recolhida nav.abas .grupo,
  body.recolhida nav.abas a span:not(.badge), body.recolhida .conta-btn .q-txt, body.recolhida .conta-btn .tres { display: none; }
  body.recolhida nav.abas .grupo { display: block; height: 10px; padding: 0; font-size: 0; }
  body.recolhida nav.abas a { justify-content: center; padding: 0; }
  body.recolhida nav.abas a .badge { position: absolute; top: 3px; right: 5px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  /* recolhida: mostra o selo; passando o mouse, vira o botão de abrir */
  body.recolhida .sb-topo { padding: 0; justify-content: center; }
  body.recolhida .sb-topo .marca { flex: 0 0 auto; padding: 0; justify-content: center; }
  body.recolhida .sb-topo [data-recolher] { display: none; }
  body.recolhida .sb-topo:hover .marca { display: none; }
  body.recolhida .sb-topo:hover [data-recolher] { display: grid; }
  body.recolhida .conta-btn { justify-content: center; padding: 6px 0; }
}

.fundo-menu { display: none; }

main { max-width: 1240px; margin: 0 auto; padding: 32px 32px 64px; }
.secao { display: none; }
.secao.ativa { display: block; animation: entrar .25s ease both; }
/* aba do editor de página: ocupa a área de conteúdo inteira */
main:has(#s-pagina.ativa) { max-width: none; }
main:has(#s-pagina.ativa .ed) { padding: 16px 20px 20px; height: calc(100dvh - var(--topo)); display: flex; flex-direction: column; }
#s-pagina.ativa:has(.ed) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#s-pagina.ativa:has(.ed) > #pg-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#s-pagina.ativa .ed { flex: 1; height: auto; min-height: 520px; }
@keyframes entrar { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* cabeçalho de seção (.barra no painel, .cab no portal) */
.barra, .cab { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 20px; }
.barra h2, .cab h2 { margin: 0 auto 0 0; font-size: 24px; letter-spacing: -0.03em; }
.barra .sel, .cab .sel { width: auto; min-width: 170px; }
.rotulo-grupo, .secao > h3 { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 500; margin: 28px 0 10px; }
.rotulo-grupo:first-child { margin-top: 0; }

/* ── cartões de número (painel unido, divisórias de 1px) ──────────── */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; margin-bottom: 20px;
  border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; box-shadow: var(--sombra);
  /* sobra da última linha: hachura discreta, sem buraco vazio */
  background: repeating-linear-gradient(-45deg, transparent 0 6px, var(--linha) 6px 7px), var(--surface-2);
}
.cards:empty { display: none; }
.card {
  position: relative; padding: 18px 20px 20px; background: var(--surface); min-width: 0;
  box-shadow: 1px 0 0 var(--linha), 0 1px 0 var(--linha);
}
.card .rot { font-family: var(--f-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .val { font-family: var(--f-titulo); font-size: var(--t1); font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; margin-top: 10px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { font-size: var(--t5); color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.card .val.neg { color: var(--ruim); }
.card.destaque { background: radial-gradient(120% 140% at 0% 0%, var(--acento-suave), transparent 60%), var(--surface); }
.card.destaque::after { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: var(--degrade); }
.card.destaque .val { color: var(--ink); }
.card.destaque .rot { color: var(--acento); }
.card.clicavel { cursor: pointer; transition: background .12s; }
.card.clicavel:hover { background: var(--surface-2); }

/* bloco (painel com borda) */
.bloco { background: var(--surface); border: 1px solid var(--linha); border-radius: var(--raio); padding: 20px; margin-bottom: 20px; box-shadow: var(--sombra); min-width: 0; }
.bloco > h2, .bloco > h3 { font-size: 15px; letter-spacing: -0.01em; margin-bottom: 14px; }
.bloco.tabela-wrap { padding: 0; }
.bloco > .tabela-wrap { margin: 0 -20px; }
.bloco > .tabela-wrap:last-child, .bloco > .tabela-wrap:has(+ .totais:last-child) { margin-bottom: -20px; }
.bloco > .tabela-wrap:first-child { margin-top: -20px; }
.bloco > h2 + .tabela-wrap, .bloco > h3 + .tabela-wrap { border-top: 1px solid var(--linha); }
.bloco > .totais { margin: 20px 0 0; padding-top: 12px; border-top: 1px solid var(--linha); }
.bloco.tabela-wrap > .vazio, .bloco > .tabela-wrap > .vazio { margin: 0; }

/* ── tabelas ──────────────────────────────────────────────────────── */
.tabela-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tabela { width: 100%; border-collapse: collapse; font-size: var(--t4); }
.tabela th {
  text-align: left; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 500;
  padding: 10px 12px; border-bottom: 1px solid var(--linha); white-space: nowrap; background: var(--surface-2);
}
.tabela td { padding: 11px 12px; border-bottom: 1px solid var(--linha); vertical-align: middle; }
/* uma linha por célula; texto longo corta com reticências (o ui.js põe o texto inteiro no title) */
.tabela td { white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.tabela td:has(input, select, textarea, .sel, button, .copiar) { overflow: visible; max-width: none; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela td.dir, .tabela th.dir { text-align: right; font-variant-numeric: tabular-nums; }
.tabela th:first-child, .tabela td:first-child { padding-left: 20px; }
.tabela th:last-child, .tabela td:last-child { padding-right: 20px; }
.tabela td.dir { font-family: var(--f-mono); font-size: 12px; letter-spacing: -0.01em; }
.tabela tbody tr { transition: background .1s; }
.tabela tbody tr:hover td { background: var(--hover); }
.tabela tr.clicavel { cursor: pointer; }
.vazio { padding: 40px 20px; text-align: center; color: var(--muted); font-size: var(--t4); }
.vazio::before { content: ''; display: block; width: 36px; height: 36px; margin: 0 auto 12px; border-radius: 10px; border: 1px dashed var(--linha-forte);
  background: repeating-linear-gradient(135deg, transparent 0 5px, var(--chip) 5px 6px); }

/* ── chips e badges ───────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--chip); color: var(--ink-2); white-space: nowrap; border: 1px solid transparent; vertical-align: middle; }
.chip.bom, .chip.ruim, .chip.aviso, .chip.azul { border-color: transparent; }
.chip.bom { background: var(--bom-suave); color: var(--bom); }
.chip.ruim { background: var(--ruim-suave); color: var(--ruim); }
.chip.aviso { background: var(--aviso-suave); color: var(--aviso); }
.chip.azul { background: var(--acento-suave); color: var(--acento); font-family: var(--f-mono); font-size: 11.5px; }
.chip.bom::before, .chip.ruim::before, .chip.aviso::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--acento); color: #fff; font: 600 11px/18px var(--f-mono); text-align: center; }
.valor-pos { color: var(--bom); }
.valor-neg { color: var(--ruim); }

/* ── botões ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--raio-p);
  border: 1px solid transparent; background: var(--btn-bg); color: var(--btn-fg); font: 500 var(--t3) var(--f-texto); letter-spacing: -0.005em;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none; transition: background .12s, border-color .12s, opacity .12s, transform .06s;
}
.btn:hover { opacity: .88; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn svg { width: 15px; height: 15px; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--linha-forte); }
.btn.sec:hover { opacity: 1; background: var(--surface-2); }
.btn.perigo { background: var(--ruim); color: #fff; }
.btn.azul { background: var(--azul); color: #fff; }
.btn.peq { height: 28px; padding: 0 10px; font-size: var(--t4); border-radius: 7px; }
.btn.fantasma { background: none; color: var(--ink-2); }
.btn.fantasma:hover { background: var(--hover); color: var(--ink); opacity: 1; }
.btn.largo { width: 100%; height: 40px; }
.btn.carregando { position: relative; color: transparent !important; pointer-events: none; }
.btn.carregando::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--btn-fg); border-right-color: transparent; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ── campos ───────────────────────────────────────────────────────── */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.campo label { font-size: var(--t4); font-weight: 500; color: var(--ink-2); }
input, select, textarea {
  font: var(--t3) var(--f-texto); height: 38px; padding: 0 12px; border-radius: var(--raio-p); border: 1px solid var(--linha-forte);
  background: var(--surface); color: var(--ink); width: 100%; transition: border-color .12s, box-shadow .12s; -webkit-appearance: none; appearance: none;
}
textarea { height: auto; min-height: 90px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
input[type=number] { font-family: var(--f-mono); -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type=search] { padding-left: 34px; background: var(--surface) no-repeat 11px 50% / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.barra input[type=search], .cab input[type=search] { width: 260px; height: 34px; }
.linha-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.linha-form > * { flex: 1; min-width: 140px; }
.linha-form > .btn { flex: 0 0 auto; }

/* checkbox vira interruptor */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; margin: 0; display: inline-block; box-sizing: border-box;
  width: 34px; min-width: 34px; height: 20px; flex: 0 0 34px; padding: 0; border-radius: 999px; border: 0; background: var(--linha-forte); position: relative; cursor: pointer; vertical-align: middle;
  transition: background .15s;
}
input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
input[type=checkbox]::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
input[type=checkbox]:checked { background: var(--acento); }
input[type=checkbox]:checked::after { transform: translateX(14px); }
input[type=checkbox]:focus { box-shadow: 0 0 0 3px var(--acento-suave); }
label.chk, label.check, .check { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t4); font-weight: 500; color: var(--ink-2); cursor: pointer; user-select: none; }

/* select próprio (ui.js troca o <select> nativo por este) */
.sel { position: relative; display: inline-block; width: 100%; min-width: 0; }
.sel > select { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%; }
.sel-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 10px 0 12px; border-radius: var(--raio-p);
  border: 1px solid var(--linha-forte); background: var(--surface); color: var(--ink); font: var(--t3) var(--f-texto); cursor: pointer; text-align: left;
}
.barra .sel-btn, .cab .sel-btn, .tabela .sel-btn { height: 34px; font-size: var(--t4); }
.sel-btn:hover { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.sel-btn:focus-visible, .sel.aberto .sel-btn { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.sel-btn .sel-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn svg { width: 14px; height: 14px; color: var(--muted); flex: 0 0 14px; }
.sel-btn:disabled { opacity: .5; cursor: default; }
.sel-menu {
  position: fixed; z-index: 200; min-width: 180px; max-height: 300px; overflow-y: auto; padding: 4px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--linha); box-shadow: var(--sombra-alta); animation: surgir .12s ease both;
}
.sel-menu .op { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: var(--t4) var(--f-texto); text-align: left; cursor: pointer; }
.sel-menu .op .chk-ico { width: 14px; height: 14px; margin-left: auto; color: var(--acento); visibility: hidden; flex: 0 0 14px; }
.sel-menu .op[aria-selected="true"] { font-weight: 500; }
.sel-menu .op[aria-selected="true"] .chk-ico { visibility: visible; }
.sel-menu .op.foco { background: var(--hover); }
.sel-menu .op:disabled { color: var(--muted); cursor: default; }
@keyframes surgir { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── link copiável ────────────────────────────────────────────────── */
.copiar {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--linha); border-radius: var(--raio-p); padding: 10px 12px;
  font-family: var(--f-mono); font-size: 12.5px; cursor: pointer; word-break: break-all; transition: border-color .12s;
}
.copiar:hover { border-color: var(--linha-forte); }
.copiar::after { content: ''; flex: 0 0 15px; width: 15px; height: 15px; margin-left: auto; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='12' height='12' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E") center / contain no-repeat; }
.copiar .ok { color: var(--bom); font: 500 var(--t5) var(--f-texto); opacity: 0; transition: opacity .2s; white-space: nowrap; margin-left: auto; }
.copiar .ok + * { margin-left: 0; }
.copiar.copiado { border-color: var(--bom); }
.copiar.copiado .ok { opacity: 1; }
.copiar.copiado::after { display: none; }

/* ── modal ────────────────────────────────────────────────────────── */
.modal-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: aparecer .15s ease both; }
:root[data-theme="dark"] .modal-fundo { background: rgba(0,0,0,.7); }
.modal-fundo.aberto { display: flex; }
.modal { background: var(--surface); border-radius: 14px; padding: 24px; width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; box-shadow: var(--sombra-alta); animation: surgir .18s ease both; }
.modal > h2 { font-size: 18px; letter-spacing: -0.02em; margin-bottom: 16px; }
.modal .acoes { display: flex; justify-content: flex-end; gap: 8px; margin: 24px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--linha); background: var(--surface-2); border-radius: 0 0 14px 14px; position: sticky; bottom: -24px; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

/* ── aviso (toast) ────────────────────────────────────────────────── */
#aviso {
  position: fixed; right: 20px; bottom: 20px; z-index: 300; max-width: min(420px, calc(100vw - 40px)); display: none;
  padding: 12px 16px 12px 38px; border-radius: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--linha);
  box-shadow: var(--sombra-alta); font-size: var(--t4); font-weight: 500; animation: surgir .18s ease both;
}
#aviso::before { content: ''; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--bom);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='12'/%3E%3C/svg%3E"); }
#aviso.erro { border-color: color-mix(in srgb, var(--ruim) 40%, transparent); }
#aviso.erro::before { background: var(--ruim); }

/* ── árvore ───────────────────────────────────────────────────────── */
.arvore { list-style: none; padding-left: 0; margin: 0; }
.arvore ul { list-style: none; padding-left: 20px; margin: 0 0 0 11px; border-left: 1px solid var(--linha); }
.arvore .no { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; flex-wrap: wrap; position: relative; transition: background .1s; }
.arvore ul > li > .no::before { content: ''; position: absolute; left: -20px; top: 50%; width: 14px; border-top: 1px solid var(--linha); }
.arvore .no:hover { background: var(--hover); }
.arvore .no .nome { font-weight: 500; }
.arvore .no .meta { margin-left: auto; display: flex; gap: 16px; font-size: var(--t4); color: var(--ink-2); font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: 12px; }

/* ── login e cadastro ─────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 520px) 1fr; background: var(--page); }
.auth-lado { display: flex; flex-direction: column; padding: 28px 40px; min-height: 100vh; }
.auth-lado .auth-topo { display: flex; align-items: center; justify-content: space-between; }
.auth-lado .auth-meio { flex: 1; display: flex; align-items: center; }
.auth-form { width: 100%; max-width: 360px; margin: 0 auto; padding: 40px 0; }
.auth-form h1 { font-size: 30px; letter-spacing: -0.04em; margin-bottom: 8px; }
.auth-form .sub { color: var(--ink-2); font-size: var(--t3); margin: 0 0 28px; }
.auth-pe { font-size: var(--t5); color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-pe .mono { font-family: var(--f-mono); }

.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.otp input { height: 52px; padding: 0; text-align: center; font: 600 22px var(--f-mono); caret-color: var(--acento); }
.otp input.cheio { border-color: var(--linha-forte); background: var(--surface-2); }
.otp.erro input { border-color: var(--ruim); animation: tremer .3s; }
@keyframes tremer { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.link-btn { background: none; border: 0; padding: 0; color: var(--ink-2); font: 500 var(--t4) var(--f-texto); cursor: pointer; }
.link-btn:hover:not(:disabled) { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:disabled { cursor: default; color: var(--muted); }
.msg { min-height: 20px; margin: 16px 0 0; font-size: var(--t4); color: var(--ink-2); }
.msg.erro { color: var(--ruim); }
.msg.ok { color: var(--bom); }

/* lado visual: rede em órbita */
.auth-visual { position: relative; overflow: hidden; border-left: 1px solid var(--linha); background: var(--surface-2); isolation: isolate; }
:root[data-theme="dark"] .auth-visual { background: #050505; }
.auth-visual::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--linha) 1px, transparent 1px), linear-gradient(90deg, var(--linha) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 75%); }
.auth-visual::after { content: ''; position: absolute; width: 640px; height: 640px; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: -1;
  background: radial-gradient(circle, rgba(0,57,243,.22), rgba(74,48,194,.08) 40%, transparent 65%); filter: blur(10px); }
.auth-visual .rede { position: absolute; left: 50%; top: 42%; width: min(620px, 90%); transform: translate(-50%, -50%); }
.auth-visual .rede .anel { fill: none; stroke: var(--linha-forte); stroke-dasharray: 2 6; }
.auth-visual .rede .aresta { stroke: var(--linha-forte); stroke-width: 1; }
.auth-visual .rede .pulso { stroke: url(#grad-pulso); stroke-width: 1.6; stroke-dasharray: 14 200; stroke-linecap: round; animation: pulsar 3.2s linear infinite; }
.auth-visual .rede .n1 { fill: var(--surface); stroke: var(--acento); stroke-width: 1.5; }
.auth-visual .rede .n2 { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.2; }
.auth-visual .rede .n3 { fill: var(--ink-2); }
.auth-visual .rede .raiz { fill: url(#grad-raiz); }
.auth-visual .rede .rot-anel { font: 500 10px var(--f-mono); letter-spacing: .1em; fill: var(--muted); }
.auth-visual .rede .gira { transform-origin: 300px 300px; animation: orbita 120s linear infinite; }
@keyframes pulsar { from { stroke-dashoffset: 214; } to { stroke-dashoffset: 0; } }
@keyframes orbita { to { transform: rotate(360deg); } }
.auth-visual .legenda-auth { position: absolute; left: 48px; right: 48px; bottom: 44px; }
.auth-visual .legenda-auth h2 { font-size: 34px; letter-spacing: -0.045em; line-height: 1.1; max-width: 520px; margin-bottom: 18px; font-weight: 600; }
.auth-visual .legenda-auth h2 em { font-style: normal; background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .auth-visual .legenda-auth h2 em { background: linear-gradient(135deg, #8b7bff, #4d7cff); -webkit-background-clip: text; background-clip: text; }
.auth-visual .fatos { display: flex; gap: 0; border: 1px solid var(--linha); border-radius: 10px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); max-width: 560px; }
.auth-visual .fatos div { flex: 1; padding: 12px 16px; border-left: 1px solid var(--linha); }
.auth-visual .fatos div:first-child { border-left: 0; }
.auth-visual .fatos b { display: block; font: 600 18px var(--f-titulo); letter-spacing: -0.03em; }
.auth-visual .fatos span { font: 500 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .auth-visual .rede .pulso, .auth-visual .rede .gira { animation: none; } }

.convite { display: flex; align-items: center; gap: 12px; border: 1px solid var(--linha); background: var(--surface); border-radius: 10px; padding: 12px 14px; margin-bottom: 22px; }
.convite .rot { font: 500 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.convite .quem { font-weight: 600; font-size: var(--t3); }

/* ── paleta de comandos (⌘K) ──────────────────────────────────────── */
.paleta-fundo { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; animation: aparecer .12s ease both; }
.paleta { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px; box-shadow: var(--sombra-alta); overflow: hidden; animation: surgir .15s ease both; }
.paleta input { height: 52px; border: 0; border-bottom: 1px solid var(--linha); border-radius: 0; padding: 0 18px 0 44px; font-size: 15px; box-shadow: none !important; background-position: 18px 50%; background-size: 16px; }
.paleta .itens { max-height: 340px; overflow-y: auto; padding: 6px; }
.paleta .gr { font: 500 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 10px 12px 4px; }
.paleta .it { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: var(--t3) var(--f-texto); cursor: pointer; text-align: left; }
.paleta .it svg { width: 16px; height: 16px; color: var(--muted); }
.paleta .it.foco { background: var(--chip); }
.paleta .it.foco svg { color: var(--acento); }
.paleta .it .kbd { margin-left: auto; }
.paleta .nada { padding: 24px; text-align: center; color: var(--muted); font-size: var(--t4); }
.paleta .rodape { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--linha); font-size: 11px; color: var(--muted); background: var(--surface-2); }

/* cadastro: tudo centralizado, a rede de fundo */
.auth-centro { position: relative; min-height: 100vh; display: flex; flex-direction: column; padding: 28px 40px; background: var(--page); isolation: isolate; overflow: hidden; }
.auth-centro .auth-visual { display: block; position: absolute; inset: 0; z-index: -1; border-left: 0; }
.auth-centro .auth-visual .rede, .auth-centro .auth-visual::after { top: 50%; }
.auth-centro .auth-visual .rede { width: min(980px, 130vw); opacity: .45; }
.auth-centro .auth-visual::after { width: 900px; height: 900px; }
.auth-centro .auth-topo { display: flex; align-items: center; justify-content: space-between; }
.auth-centro .auth-meio { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 0; }
.auth-cartao { max-width: 420px; padding: 32px; border: 1px solid var(--linha); border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 24px 60px rgba(0,0,0,.18); }
.auth-cartao .msg:empty { display: none; }
.auth-centro .legenda-auth { text-align: center; max-width: 560px; width: 100%; }
.auth-centro .legenda-auth h2 { font-size: 30px; letter-spacing: -0.045em; line-height: 1.1; margin-bottom: 16px; font-weight: 600; }
.auth-centro .legenda-auth h2 em { font-style: normal; background: var(--degrade); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .auth-centro .legenda-auth h2 em { background: linear-gradient(135deg, #8b7bff, #4d7cff); -webkit-background-clip: text; background-clip: text; }
.auth-centro .fatos { display: flex; border: 1px solid var(--linha); border-radius: 10px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); text-align: left; }
.auth-centro .fatos div { flex: 1; padding: 12px 16px; border-left: 1px solid var(--linha); }
.auth-centro .fatos div:first-child { border-left: 0; }
.auth-centro .fatos b { display: block; font: 600 18px var(--f-titulo); letter-spacing: -0.03em; }
.auth-centro .fatos span { font: 500 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 640px) {
  .auth-centro { padding: 20px; }
  .auth-cartao { padding: 24px 20px; }
  .auth-centro .fatos { flex-direction: column; }
  .auth-centro .fatos div { border-left: 0; border-top: 1px solid var(--linha); }
  .auth-centro .fatos div:first-child { border-top: 0; }
}

/* ── responsivo ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-lado { padding: 24px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: 280px; box-shadow: var(--sombra-alta); --sidebar: 280px; }
  body.menu-aberto .sidebar { transform: none; }
  body.menu-aberto .fundo-menu { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.45); animation: aparecer .15s ease both; }
  .principal { margin-left: 0; }
  body.recolhida { --sidebar: 248px; }
  .so-mobile { display: grid !important; }
  .so-desktop { display: none !important; }
  .topo { padding: 0 12px; }
  .busca-btn { min-width: 0; width: 32px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .busca-btn .busca-txt, .busca-btn .kbd { display: none; }
  main { padding: 20px 16px 48px; }
  .barra h2, .cab h2 { font-size: 21px; flex: 1 1 100%; }
}
@media (max-width: 700px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 14px 14px 16px; }
  .card .val { font-size: 22px; }
  .barra .sel, .cab .sel { flex: 1 1 140px; min-width: 0; }
  .barra .espaco, .cab .espaco { display: none; }
  .barra input[type=search], .cab input[type=search] { width: 100%; flex: 1 1 100%; }
  .bloco { padding: 16px; }
  .bloco > .tabela-wrap { margin: 0 -16px; }
  .bloco > .tabela-wrap:last-child { margin-bottom: -16px; }
  .bloco > .tabela-wrap:first-child { margin-top: -16px; }
  /* tabela vira lista de cartões (ui.js põe o rótulo de cada coluna em data-rot) */
  table.tabela.empilha thead { display: none; }
  table.tabela.empilha, table.tabela.empilha tbody, table.tabela.empilha tr, table.tabela.empilha td { display: block; width: 100%; }
  table.tabela.empilha tr { padding: 12px 16px; border-bottom: 1px solid var(--linha); }
  table.tabela.empilha tbody tr:last-child { border-bottom: 0; }
  table.tabela.empilha td { white-space: normal; max-width: none; overflow: visible; }
  table.tabela.empilha td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; min-height: 28px; }
  table.tabela.empilha td.dir { text-align: right; }
  table.tabela.empilha td::before { content: attr(data-rot); font: 500 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); text-align: left; flex: 0 0 auto; }
  table.tabela.empilha td:not([data-rot])::before, table.tabela.empilha td[data-rot=""]::before { display: none; }
  table.tabela.empilha td:not([data-rot]), table.tabela.empilha td[data-rot=""] { justify-content: flex-end; }
  table.tabela.empilha tbody tr:hover td { background: none; }
  .modal-fundo { align-items: flex-end; padding: 0; }
  .modal { max-width: none !important; border-radius: 16px 16px 0 0; max-height: 92vh; padding: 20px; }
  .modal .acoes { margin: 20px -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  #aviso { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .arvore ul { padding-left: 12px; margin-left: 6px; }
  .arvore ul > li > .no::before { left: -12px; width: 8px; }
  .auth-form h1 { font-size: 26px; }
}

/* ===== editor da página de ativação (editor.js) ===== */
.ed { display: flex; flex-direction: column; border: 1px solid var(--linha); border-radius: var(--raio); background: var(--surface); overflow: hidden; height: calc(100vh - 150px); min-height: 560px; }
.ed-barra { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--linha); flex-wrap: wrap; }
.ed-barra .btn { display: inline-flex; align-items: center; gap: 6px; }
.ed-barra .btn svg { width: 14px; height: 14px; }
.ed-tit { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ed-tit b { font-size: var(--t3); font-weight: 600; white-space: nowrap; }
.ed-chip { font: 500 11px var(--f-mono); letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--linha); white-space: nowrap; }
.ed-chip.ok { color: var(--bom); background: var(--bom-suave); border-color: transparent; }
.ed-esp { flex: 1; }
.ed-voltar { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px 0 4px; margin-left: -6px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: inherit; font-size: var(--t4); cursor: pointer; white-space: nowrap; }
.ed-voltar:hover { background: var(--surface-2); color: var(--ink); }
.ed-voltar svg { width: 16px; height: 16px; }
.ed-sep { width: 1px; height: 18px; background: var(--linha); }

/* galeria de templates */
.tpl { display: grid; gap: 20px; }
.tpl-cab { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tpl-cab h2 { margin: 0 0 4px; }
.tpl-cab p { margin: 0; max-width: 720px; font-size: var(--t4); }
.tpl-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tpl-card { display: flex; flex-direction: column; border: 1px solid var(--linha); border-radius: var(--raio); background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.tpl-card:hover { border-color: var(--linha-forte); box-shadow: var(--sombra); }
.tpl-card.destaque { border-color: var(--acento); box-shadow: 0 0 0 1px var(--acento); }
.tpl-capa { display: block; padding: 0; border: 0; background: none; cursor: pointer; width: 100%; }
.tpl-capa:disabled { cursor: default; }
.tpl-capa:focus-visible { outline: 2px solid var(--acento); outline-offset: -2px; }
.tpl-mini { position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--linha); }
.tpl-mini iframe { position: absolute; top: 0; left: 0; width: 520px; height: 650px; border: 0; transform-origin: 0 0; pointer-events: none; }
.tpl-info { display: flex; flex-direction: column; gap: 8px; padding: 14px; flex: 1; }
.tpl-nome { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpl-nome b { font-size: var(--t3); font-weight: 600; }
.tpl-desc { margin: 0; font-size: var(--t4); color: var(--muted); line-height: 1.45; }
.tpl-acoes { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.tpl-pop { width: 230px; padding: 6px; }
.tpl-pop-op { width: 100%; padding: 8px 10px; }
.tpl-pop-op.perigo b { color: var(--ruim, #dc2626); }
.ed-chip.neutro { color: var(--ink-2); }
.ed-status { font-size: var(--t5); color: var(--muted); white-space: nowrap; }
.ed-status.sujo { color: var(--ink-2); }
.ed-status.sujo::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; margin-right: 6px; vertical-align: 1px; }
.ed-grupo { display: flex; gap: 2px; }
.ed-ico { width: 30px; height: 30px; border-radius: 7px; border: 0; background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; padding: 0; flex: 0 0 30px; }
.ed-ico svg { width: 16px; height: 16px; }
.ed-ico:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.ed-ico:disabled { opacity: .35; cursor: default; }
.ed-ico.perigo:hover:not(:disabled) { color: var(--ruim); background: var(--ruim-suave); }
.ed-seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--linha); gap: 2px; }
.ed-seg button { height: 26px; min-width: 30px; padding: 0 9px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 500 var(--t5) var(--f-sans, inherit); cursor: pointer; display: grid; place-items: center; }
.ed-seg button svg { width: 15px; height: 15px; }
.ed-seg button.ativo { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--linha); }
.ed-seg button:disabled { cursor: default; }
.ed-seg-l { display: flex; width: 100%; }
.ed-seg-l button { flex: 1; }

.ed-corpo { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; }
.ed-esq, .ed-dir { overflow-y: auto; background: var(--surface); }
.ed-esq { border-right: 1px solid var(--linha); padding: 10px 8px 16px; }
.ed-dir { border-left: 1px solid var(--linha); }
.ed-sec-tit { font: 500 10.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 6px; }
.ed-lista { display: grid; gap: 2px; }
.ed-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink); text-align: left; cursor: pointer; position: relative; font: inherit; }
.ed-item:hover { background: var(--surface-2); }
.ed-item.sel { background: var(--acento-suave); border-color: color-mix(in srgb, var(--acento) 35%, transparent); }
.ed-item.arr { opacity: .4; }
.ed-item.antes::before, .ed-item.depois::after { content: ''; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--acento); border-radius: 2px; }
.ed-item.antes::before { top: -2px; } .ed-item.depois::after { bottom: -2px; }
.ed-grip { color: var(--muted); cursor: grab; display: grid; place-items: center; margin-left: -4px; opacity: .55; }
.ed-grip svg { width: 14px; height: 14px; }
.ed-item:hover .ed-grip { opacity: 1; }
.ed-item-ico { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--linha); color: var(--ink-2); }
.ed-item-ico svg { width: 14px; height: 14px; }
.ed-item-ico.g { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; }
.ed-item-ico.g svg { width: 17px; height: 17px; }
.ed-item-txt { display: grid; min-width: 0; line-height: 1.25; }
.ed-item-txt b { font-size: var(--t4); font-weight: 550; }
.ed-item-txt small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-cad { margin-left: auto; color: var(--muted); display: grid; }
.ed-cad svg { width: 13px; height: 13px; }
.ed-item-pg { margin-bottom: 2px; }
.ed-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; height: 36px; border-radius: 8px; border: 1px dashed var(--linha-forte); background: none; color: var(--ink-2); font: 500 var(--t4) inherit; font-family: inherit; cursor: pointer; }
.ed-add svg { width: 15px; height: 15px; }
.ed-add:hover:not(:disabled) { border-color: var(--acento); color: var(--acento); background: var(--acento-suave); }
.ed-add:disabled { opacity: .45; cursor: default; }
.ed-add.peq { height: 30px; margin-top: 4px; }

.ed-palco { min-width: 0; overflow: auto; display: flex; justify-content: center; padding: 18px; background-color: var(--surface-2);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.ed-tela { width: 100%; height: 100%; min-height: 480px; border-radius: 10px; overflow: hidden; box-shadow: var(--sombra-alta); background: #fff; transition: width .25s ease; flex: 0 0 auto; }
.ed-tela.cel { width: 390px; border-radius: 28px; border: 8px solid #111; box-shadow: 0 0 0 1px #2a2a2a, var(--sombra-alta); }
.ed-frame { width: 100%; height: 100%; border: 0; display: block; }

.ed-insp-cab { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px; border-bottom: 1px solid var(--linha); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.ed-insp-cab > div:nth-child(2) { display: grid; min-width: 0; line-height: 1.3; flex: 1; }
.ed-insp-cab b { font-size: var(--t3); font-weight: 600; }
.ed-insp-cab small { font-size: 11.5px; color: var(--muted); }
.ed-acoes { display: flex; gap: 0; }
.ed-insp-corpo { padding: 4px 14px 24px; }
.ed-grupo-c { padding: 14px 0; border-bottom: 1px solid var(--linha); display: grid; gap: 12px; }
.ed-grupo-c:last-child { border-bottom: 0; }
.ed-g-tit { font: 500 10.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ed-campo { display: grid; gap: 6px; }
.ed-rot { font-size: var(--t4); font-weight: 500; color: var(--ink-2); }
.ed-ajuda { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.ed-campo input[type=text], .ed-campo textarea, .ed-campo select { width: 100%; }
.ed-campo textarea { resize: vertical; min-height: 60px; font: inherit; font-size: var(--t4); line-height: 1.5; }
.ed-cor { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed-cor-in { display: flex; align-items: center; gap: 6px; }
.ed-amostra { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; border: 1px solid var(--linha-forte); flex: 0 0 30px; position: relative; }
.ed-amostra input[type=color] { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); border: 0; padding: 0; cursor: pointer; background: none; }
.ed-hex { width: 86px !important; height: 30px; font: 500 12px var(--f-mono) !important; text-transform: lowercase; }
.ed-faixa { display: grid; gap: 4px; }
.ed-faixa-cab { display: flex; align-items: center; justify-content: space-between; }
.ed-faixa-n { display: inline-flex; align-items: center; gap: 4px; }
.ed-faixa-n small { font-size: 11px; color: var(--muted); }
.ed-num { width: 58px !important; height: 26px !important; padding: 0 6px !important; text-align: right; font: 500 12px var(--f-mono) !important; }
.ed-faixa input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer; }
.ed-faixa input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--linha-forte); }
.ed-faixa input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--linha-forte); }
.ed-faixa input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--acento); }
.ed-faixa input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--acento); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.ed-faixa input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--acento); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.ed-faixa input[type=range]:focus-visible { outline: none; }
.ed-faixa input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--acento-suave); }
.ed-alterna { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.ed-itens { display: grid; gap: 6px; }
.ed-it-l { display: flex; gap: 4px; align-items: center; }
.ed-it-l input { flex: 1; min-width: 0; }
.ed-faq-it { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--linha); border-radius: 9px; background: var(--surface-2); }
.ed-drop { border: 1.5px dashed var(--linha-forte); border-radius: 10px; min-height: 110px; display: grid; place-items: center; cursor: pointer; overflow: hidden; background: var(--surface-2); transition: border-color .12s, background .12s; }
.ed-drop:hover, .ed-drop.sobre, .ed-drop:focus-visible { border-color: var(--acento); background: var(--acento-suave); outline: none; }
.ed-drop.tem { border-style: solid; background-image: linear-gradient(45deg, var(--linha) 25%, transparent 25%, transparent 75%, var(--linha) 75%), linear-gradient(45deg, var(--linha) 25%, transparent 25%, transparent 75%, var(--linha) 75%); background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.ed-drop img { max-width: 100%; max-height: 160px; display: block; }
.ed-drop.carregando { opacity: .6; pointer-events: none; }
.ed-drop-vazio { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 14px; color: var(--muted); }
.ed-drop-vazio svg { width: 22px; height: 22px; }
.ed-drop-vazio b { font-size: var(--t4); color: var(--ink-2); font-weight: 550; }
.ed-drop-vazio small { font-size: 11.5px; }
.ed-link { background: none; border: 0; padding: 0; color: var(--ruim); font: 500 var(--t5) inherit; font-family: inherit; cursor: pointer; justify-self: start; }
.ed-nota { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 2px; padding: 10px 12px; border-radius: 9px; background: var(--acento-suave); color: var(--ink-2); font-size: var(--t5); line-height: 1.5; }
.ed-nota svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; color: var(--acento); }
.ed-paletas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ed-paleta { display: grid; gap: 5px; padding: 0; border: 0; background: none; cursor: pointer; font: 500 11.5px inherit; font-family: inherit; color: var(--ink-2); text-align: center; }
.ed-pal-am { height: 46px; border-radius: 9px; border: 1px solid var(--linha); display: flex; align-items: flex-end; justify-content: center; gap: 4px; padding-bottom: 8px; transition: transform .12s, box-shadow .12s; }
.ed-pal-am i { width: 14px; height: 6px; border-radius: 3px; }
.ed-paleta:hover:not(:disabled) .ed-pal-am { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--acento); }

.ed-pop { position: fixed; z-index: 1000; width: 380px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--linha); border-radius: 12px; box-shadow: var(--sombra-alta); padding: 8px; }
.ed-pop-tit { font: 500 10.5px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 8px; }
.ed-pop-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ed-pop-op { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.ed-pop-op:hover, .ed-pop-op:focus-visible { background: var(--surface-2); outline: none; }
.ed-pop-op > span:last-child { display: grid; line-height: 1.3; min-width: 0; }
.ed-pop-op b { font-size: var(--t4); font-weight: 550; }
.ed-pop-op small { font-size: 11px; color: var(--muted); }
.ed-ro .ed-grip { display: none; }
.so-desktop-inline { display: inline; }

@media (max-width: 1100px) {
  .ed-corpo { grid-template-columns: 210px minmax(0, 1fr) 270px; }
}
@media (max-width: 900px) {
  main:has(#s-pagina.ativa .ed) { height: auto; display: block; padding: 16px; }
  #s-pagina.ativa .ed { flex: none; }
  .ed { height: auto; }
  .ed-corpo { grid-template-columns: 1fr; }
  .ed-esq { border-right: 0; border-bottom: 1px solid var(--linha); max-height: 260px; }
  .ed-palco { height: 70vh; padding: 10px; }
  .ed-dir { border-left: 0; border-top: 1px solid var(--linha); }
  .ed-tela.cel { width: 100%; max-width: 390px; }
  .so-desktop-inline { display: none; }
  .ed-status { display: none; }
}

/* ver como parceiro (admin no portal) */
.faixa-como { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 18px; border-radius: 10px; background: #f59e0b1f; border: 1px solid #f59e0b55; color: var(--ink); font-size: var(--t4); }
.faixa-como b { font-weight: 600; }
.faixa-como .espaco { flex: 1; }

/* texto formatado (título e texto da página de ativação) */
.ed-rico-w { border: 1px solid var(--linha-forte); border-radius: 10px; overflow: hidden; }
.ed-rico-w:focus-within { border-color: var(--azul, #0039f3); box-shadow: 0 0 0 3px color-mix(in srgb, var(--azul, #0039f3) 22%, transparent); }
.ed-rico-barra { display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface-2); border-bottom: 1px solid var(--linha); }
.ed-rico-b { position: relative; height: 28px; min-width: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--ink); font: 500 13px/1 var(--f-sans, inherit); cursor: pointer; display: grid; place-items: center; }
.ed-rico-b:hover { background: var(--surface); }
.ed-rico-b.ativo { background: var(--surface); box-shadow: 0 0 0 1px var(--linha-forte); }
.ed-rico-b b { font-weight: 800; } .ed-rico-b i { font-family: Georgia, serif; font-size: 14px; }
.ed-rico-sep { width: 1px; height: 18px; background: var(--linha); margin: 0 4px; }
.ed-rico-dest, .ed-rico-cor-a, .ed-rico-semcor { width: 16px; height: 16px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(127,127,127,.45); }
.ed-rico-cor-a { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444); }
.ed-rico-semcor { background: linear-gradient(135deg, transparent 45%, #ef4444 45% 55%, transparent 55%); }
.ed-rico-cor input[type=color] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.ed-rico-limpa { font-size: 12px; text-decoration: line-through; color: var(--muted); }
.ed-rico { min-height: 64px; max-height: 260px; overflow: auto; padding: 10px 12px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; outline: none; cursor: text; }
.ed-rico.tit { font-size: 19px; line-height: 1.2; letter-spacing: -0.01em; }
.ed-rico-conta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ed-ajuda.alerta { color: #f59e0b; }

/* ===== rede: árvore visual e métricas (rede.js), no admin e no portal ===== */
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--linha); border-radius: 9px; background: var(--surface); gap: 2px; }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: 500 var(--t4) var(--f-texto, inherit); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: var(--chip); color: var(--ink); box-shadow: 0 0 0 1px var(--linha) inset; }
.rd-busca { position: relative; }
.rd-busca input { width: 280px; }
.rd-resultados { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: max(100%, 340px); max-height: 340px; overflow: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--linha); border-radius: 10px; box-shadow: 0 16px 40px -18px rgba(0,0,0,.35); }
.rd-res { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.rd-res:hover, .rd-res:focus { background: var(--hover); outline: none; }
.rd-res .muted { margin-left: auto; font-size: var(--t5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.rd-resultados .vazio { padding: 12px; }

.rd-palco { position: relative; height: calc(100dvh - 190px); min-height: 440px; overflow: hidden; border: 1px solid var(--linha); border-radius: 14px; cursor: grab; touch-action: none;
  background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 0) 0 0 / 22px 22px, var(--surface-2); }
.rd-palco.arrastando { cursor: grabbing; }
.rd-mundo { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.rd-linhas { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.rd-linhas path { fill: none; stroke: color-mix(in srgb, var(--acento) 45%, var(--linha-forte)); stroke-width: 1.5; }
.rd-linhas path.fraca { stroke: var(--linha-forte); stroke-dasharray: 4 4; }
.rd-ctrl { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.rd-ctrl .btn { box-shadow: 0 4px 14px -8px rgba(0,0,0,.3); }

.rd-no { position: absolute; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 11px; border: 1px solid var(--linha); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 20px -16px rgba(0,0,0,.35); cursor: pointer; transition: border-color .15s, box-shadow .15s, opacity .15s; user-select: none; }
.rd-no:hover { border-color: var(--linha-forte); box-shadow: 0 10px 26px -16px rgba(0,0,0,.45); }
.rd-no:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--acento-suave); border-color: var(--acento); }
.rd-no.eh-raiz { border-color: color-mix(in srgb, var(--acento) 40%, var(--linha)); background: radial-gradient(120% 140% at 0% 0%, var(--acento-suave), transparent 60%), var(--surface); }
.rd-no.sel { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave), 0 10px 26px -16px rgba(0,0,0,.45); }
.rd-no.achado { border-color: var(--aviso); box-shadow: 0 0 0 3px var(--aviso-suave); }
.rd-no.apagado { opacity: .38; }
.rd-av { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 600 12px var(--f-mono); color: #fff;
  background: linear-gradient(145deg, #4a30c2, #0039f3); }
.rd-av.n2 { background: linear-gradient(145deg, #6b5bd6, #4d7cff); }
.rd-av.n3 { background: linear-gradient(145deg, #8f86e0, #8aa6ff); }
.rd-av.raiz img { width: 18px; height: 18px; object-fit: contain; }
.rd-av.grande { width: 48px; height: 48px; border-radius: 13px; font-size: 15px; }
.rd-av.grande.raiz img { width: 24px; height: 24px; }
.rd-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rd-info b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.rd-dot.ativo { background: var(--bom); } .rd-dot.aguardando { background: var(--aviso); } .rd-dot.bloqueado { background: var(--ruim); }
.rd-num { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.rd-num b { font: 600 18px var(--f-mono); font-variant-numeric: tabular-nums; }
.rd-num span { font: 500 9.5px var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.rd-tog { position: absolute; transform: translate(-50%, -50%); min-width: 24px; height: 20px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--linha-forte);
  background: var(--surface); color: var(--ink-2); font: 600 10.5px var(--f-mono); cursor: pointer; z-index: 2; }
.rd-tog:hover { border-color: var(--acento); color: var(--acento); }
.rd-tog.aberto { color: var(--muted); }

.rd-trilha { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--t4); color: var(--muted); margin-bottom: 14px; }
.rd-trilha a { color: var(--ink-2); text-decoration: none; } .rd-trilha a:hover { color: var(--acento); }
.rd-trilha b { color: var(--ink); font-weight: 500; }
.rd-cab { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.rd-cab-txt { min-width: 0; flex: 1; }
.rd-cab-txt h3 { font-size: 22px; letter-spacing: -0.03em; margin: 0 0 6px; }
.rd-cab-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--t5); }
.rd-cab-meta .rd-sub { font-size: var(--t5); }
.rd-cab-meta .mono { font-family: var(--f-mono); }
.rd-cab-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.rd-comissao { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rd-comissao .rot { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-right: 4px; }
.rd-comissao .chip b { font-family: var(--f-mono); font-weight: 600; margin-left: 2px; }
.rd-tit { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 22px 0 10px; }
.card.neg .val { color: var(--ruim); }
.card.aviso .val { color: var(--aviso); }
.rd-graf-bloco { margin-top: 22px; }
.rd-graf-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rd-graf-cab .legenda { display: flex; gap: 14px; font-size: var(--t5); color: var(--ink-2); margin: 0; }
.rd-graf-cab .legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-proprias { background: var(--acento); } .lg-rede { background: color-mix(in srgb, var(--acento) 35%, var(--surface)); }
.rd-graf { display: block; width: 100%; height: auto; }
.rd-graf text { fill: var(--muted); font: 500 10px var(--f-mono); }
.rd-graf line.grade { stroke: var(--linha); stroke-dasharray: 3 4; } .rd-graf line.base { stroke: var(--linha-forte); }
.rd-graf rect.proprias { fill: var(--acento); } .rd-graf rect.rede { fill: color-mix(in srgb, var(--acento) 35%, var(--surface)); }
.rd-graf rect.faixa { fill: transparent; } .rd-graf rect.faixa:hover { fill: color-mix(in srgb, var(--ink) 5%, transparent); }

.rd-convite { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.rd-convite-txt { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.rd-convite-txt .muted { font-size: var(--t5); }
.rd-convite-url { flex: 1; min-width: 280px; display: flex; gap: 8px; align-items: center; }
.rd-convite-url > :first-child { flex: 1; min-width: 0; }
@media (max-width: 800px) {
  .rd-busca, .rd-busca input { width: 100%; }
  .rd-palco { height: calc(100dvh - 240px); min-height: 380px; }
}
.cards.rd-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1180px) { .cards.rd-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards.rd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rd-com-cel { font-size: var(--t5); line-height: 1.5; white-space: nowrap; } .rd-com-cel b { font-family: var(--f-mono); font-weight: 600; }

/* ── calendário de período (ui.js: escolherDatas) ─────────────────── */
.dp-fundo { position: fixed; inset: 0; z-index: 210; }
.dp {
  position: fixed; z-index: 211; display: flex; border-radius: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--linha); box-shadow: var(--sombra-alta); animation: surgir .14s ease both;
}
.dp-atalhos { display: flex; flex-direction: column; gap: 2px; padding: 10px; width: 152px; border-right: 1px solid var(--linha); background: var(--surface-2); }
.dp-atalho { border: 0; background: none; color: var(--ink-2); font: var(--t4) var(--f-texto); text-align: left; padding: 7px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.dp-atalho:hover { background: var(--hover); color: var(--ink); }
.dp-atalho.ativo { background: var(--acento-suave); color: var(--acento); font-weight: 500; }
.dp-corpo { padding: 14px 16px 12px; display: flex; flex-direction: column; }
.dp-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dp-titulos { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 24px; }
.dp-titulo { text-align: center; font: 600 var(--t4) var(--f-texto); color: var(--ink); }
.dp-nav { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--linha); background: var(--surface); color: var(--ink-2); border-radius: 7px; cursor: pointer; }
.dp-nav:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.dp-nav:disabled { opacity: .35; cursor: default; }
.dp-nav svg { width: 15px; height: 15px; }
.dp-meses { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 24px; }
.dp-sem, .dp-grade { display: grid; grid-template-columns: repeat(7, 36px); }
.dp-sem span { height: 26px; display: grid; place-items: center; font: 500 11px var(--f-mono, monospace); color: var(--muted); }
.dp-grade { row-gap: 2px; }
.dp-dia {
  position: relative; height: 34px; border: 0; background: none; color: var(--ink); font: 500 var(--t4) var(--f-texto);
  font-variant-numeric: tabular-nums; cursor: pointer; border-radius: 8px; z-index: 0;
}
.dp-dia::before { content: ''; position: absolute; inset: 0; border-radius: 8px; z-index: -1; }
.dp-dia:hover:not(:disabled)::before { background: var(--hover); }
.dp-dia:disabled { color: var(--muted); opacity: .4; cursor: default; }
.dp-dia.hoje::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--acento); }
.dp-dia.no-int { border-radius: 0; background: var(--acento-suave); }
.dp-dia.no-int.previa { background: color-mix(in srgb, var(--acento) 6%, transparent); }
.dp-dia.ini { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.dp-dia.fim { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.dp-dia.ini::before, .dp-dia.fim::before { background: var(--acento) !important; }
.dp-dia.ini, .dp-dia.fim { color: #fff; }
.dp-dia.ini.hoje::after, .dp-dia.fim.hoje::after { background: #fff; }
.dp-grade .dp-dia:nth-child(7n+1).no-int { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.dp-grade .dp-dia:nth-child(7n).no-int { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.dp-dia:focus-visible { outline: 2px solid var(--acento); outline-offset: -2px; }
.dp-rodape { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--linha); }
.dp-resumo { flex: 1; min-width: 0; font: var(--t4) var(--f-texto); color: var(--muted); }
.dp-resumo b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.dp-botoes { display: flex; gap: 6px; }
@media (max-width: 639px) {
  .dp-fundo { background: rgba(0,0,0,.4); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
  .dp.dp-folha { left: 0; right: 0; bottom: 0; top: auto; flex-direction: column; border-radius: 16px 16px 0 0; animation: subir .2s ease both; padding-bottom: env(safe-area-inset-bottom); }
  .dp-folha .dp-atalhos { flex-direction: row; width: auto; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--linha); padding: 10px 12px; scrollbar-width: none; }
  .dp-folha .dp-atalho { border: 1px solid var(--linha); border-radius: 999px; background: var(--surface); padding: 6px 12px; }
  .dp-folha .dp-corpo { padding: 12px 16px; }
  .dp-folha .dp-sem, .dp-folha .dp-grade { grid-template-columns: repeat(7, 1fr); }
  .dp-folha .dp-dia { height: 40px; }
}
@keyframes subir { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
