/* V21.10 — Árvore unificada: mantém as linhas da V21.9 e recupera a leitura dos cards.
   Causa corrigida: o CSS anterior tratava filhos internos do card como se fossem itens diretos do grid,
   então foto/textos/detalhes se comprimiam e pareciam "perdidos" no zoom de pôster. */

body[data-active-view="tree"] #treeView {
  --tree-line: #b98937;
  --tree-line-soft: rgba(185, 137, 55, .30);
  --tree-surface: rgba(255, 249, 235, .90);
  --tree-surface-2: rgba(255, 244, 215, .76);
  --tree-text: #2d1a0d;
  --tree-muted: #6f5638;
  --tree-border: rgba(158, 123, 70, .34);
}

html[data-theme="claro"] body[data-active-view="tree"] #treeView {
  --tree-line: #0e5a8a;
  --tree-line-soft: rgba(14, 90, 138, .22);
  --tree-surface: rgba(255,255,255,.94);
  --tree-surface-2: rgba(245,250,255,.86);
  --tree-text: #10233c;
  --tree-muted: #516780;
  --tree-border: rgba(14, 90, 138, .20);
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView {
  --tree-line: #d2a34a;
  --tree-line-soft: rgba(210, 163, 74, .28);
  --tree-surface: rgba(10, 27, 39, .96);
  --tree-surface-2: rgba(13, 34, 48, .86);
  --tree-text: #fff4dc;
  --tree-muted: rgba(248,234,208,.74);
  --tree-border: rgba(196,149,58,.26);
}

body[data-active-view="tree"] #treeView .tree-panel {
  overflow: hidden !important;
}

body[data-active-view="tree"] #treeView .tree-toolbar,
body[data-active-view="tree"] #treeView .tree-legend {
  position: relative !important;
  z-index: 5 !important;
}

body[data-active-view="tree"] #treeView .tree-legend {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: .65rem !important;
  align-items: center !important;
}

body[data-active-view="tree"] #treeView .tree-legend span {
  display: inline-flex !important;
  align-items: center !important;
  gap: .45rem !important;
  min-height: 34px !important;
  padding: .45rem .75rem !important;
  border-radius: 999px !important;
  background: var(--tree-surface-2) !important;
  border: 1px solid var(--tree-border) !important;
  color: var(--tree-text) !important;
  font-weight: 800 !important;
}

body[data-active-view="tree"] #treeView .tree-legend .ui-icon {
  width: 16px !important;
  height: 16px !important;
  color: var(--tree-line) !important;
}

body[data-active-view="tree"] #treeView .poster-scroll,
body[data-active-view="tree"] #treeView .tree-scroll {
  position: relative !important;
  min-height: 640px !important;
  max-height: calc(100vh - 255px) !important;
  overflow: auto !important;
  padding: 0 !important;
  border: 1px solid var(--tree-border) !important;
  border-radius: 18px !important;
  background: var(--tree-surface) !important;
  cursor: grab !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .poster-scroll,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .tree-scroll {
  background:
    radial-gradient(circle at 18% 10%, rgba(196,149,58,.08), transparent 24rem),
    radial-gradient(circle at 82% 8%, rgba(255,255,255,.045), transparent 18rem),
    linear-gradient(135deg, rgba(6,16,26,.985), rgba(3,10,18,.99)) !important;
}

body[data-active-view="tree"] #treeView .poster-scroll::before,
body[data-active-view="tree"] #treeView .poster-scroll::after,
body[data-active-view="tree"] #treeView .tree-scroll::before,
body[data-active-view="tree"] #treeView .tree-scroll::after {
  display: none !important;
  content: none !important;
}

body[data-active-view="tree"] #treeView .poster-canvas,
body[data-active-view="tree"] #treeView .tree-canvas {
  position: relative !important;
  width: max-content !important;
  min-width: 2480px !important;
  min-height: 1120px !important;
  padding: 2rem !important;
  background: transparent !important;
  transform-origin: top left !important;
}

body[data-active-view="tree"] #treeView .family-poster {
  position: relative !important;
  z-index: 1 !important;
  min-width: 2360px !important;
  min-height: 980px !important;
  padding: 2rem 2rem 2.6rem !important;
  overflow: visible !important;
  border: 1px solid var(--tree-border) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 50% 0%, var(--tree-line-soft), transparent 36rem),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent) !important;
}

body[data-active-view="tree"] #treeView .family-poster > h2 {
  position: relative !important;
  z-index: 4 !important;
  margin: 0 0 2rem !important;
  color: var(--tree-text) !important;
  text-align: center !important;
}

body[data-active-view="tree"] #treeView .poster-watermark {
  opacity: .045 !important;
  z-index: 0 !important;
}

body[data-active-view="tree"] #treeView .family-poster-bridge .bridge-layout {
  position: relative !important;
  z-index: 3 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 1.2rem !important;
}

body[data-active-view="tree"] #treeView .family-poster-bridge .bridge-parents-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14rem !important;
  width: min(1680px, 100%) !important;
  align-items: end !important;
  justify-items: center !important;
  margin: 0 auto !important;
}

body[data-active-view="tree"] #treeView .family-poster-bridge .bridge-parent-side {
  min-width: 760px !important;
  display: flex !important;
  justify-content: center !important;
}

body[data-active-view="tree"] #treeView .family-poster-bridge .bridge-central {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

body[data-active-view="tree"] #treeView .family-unit,
body[data-active-view="tree"] #treeView .couple-row,
body[data-active-view="tree"] #treeView .children-row,
body[data-active-view="tree"] #treeView .child-branch,
body[data-active-view="tree"] #treeView .family-card,
body[data-active-view="tree"] #treeView .marriage-label {
  position: relative !important;
  z-index: 4 !important;
}

/* A partir da V21.9 a linha de pais/filhos é SVG calculado. Estes pseudo-elementos antigos duplicavam e quebravam as conexões. */
body[data-active-view="tree"] #treeView .descendant-line,
body[data-active-view="tree"] #treeView .children-row::before,
body[data-active-view="tree"] #treeView .child-branch::before,
body[data-active-view="tree"] #treeView .child-branch::after {
  display: none !important;
  content: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-active-view="tree"] #treeView .couple-link {
  width: 70px !important;
  min-width: 70px !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, transparent, var(--tree-line), transparent) !important;
  box-shadow: none !important;
  opacity: .95 !important;
}

body[data-active-view="tree"] #treeView .tree-lines-svg {
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  pointer-events: none !important;
  z-index: 2 !important;
  overflow: visible !important;
  color: var(--tree-line) !important;
}

body[data-active-view="tree"] #treeView .tree-svg-line {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 3 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  vector-effect: non-scaling-stroke !important;
  opacity: .92 !important;
  filter: drop-shadow(0 0 3px rgba(0,0,0,.15)) !important;
}

body[data-active-view="tree"] #treeView .tree-child-bar {
  opacity: .82 !important;
}

body[data-active-view="tree"] #treeView .tree-child-drop,
body[data-active-view="tree"] #treeView .tree-trunk-line,
body[data-active-view="tree"] #treeView .tree-single-child-line {
  opacity: .95 !important;
}

body[data-active-view="tree"] #treeView .children-row {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 6.2rem !important;
  padding-top: 4.6rem !important;
}

body[data-active-view="tree"] #treeView .child-branch {
  min-width: 390px !important;
  display: inline-flex !important;
  justify-content: center !important;
  padding-top: 0 !important;
}

body[data-active-view="tree"] #treeView .couple-row {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 1.1rem !important;
}









body[data-active-view="tree"] #treeView .tree-card-profession {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body[data-active-view="tree"] #treeView .marriage-label {
  margin: .55rem auto 0 !important;
  background: var(--tree-surface-2) !important;
  border: 1px solid var(--tree-border) !important;
  color: var(--tree-muted) !important;
  box-shadow: none !important;
}

body[data-active-view="tree"] #treeView .bridge-connector {
  display: none !important;
}

@media (max-width: 900px) {
  body[data-active-view="tree"] #treeView .poster-scroll,
  body[data-active-view="tree"] #treeView .tree-scroll {
    max-height: none !important;
    min-height: 70vh !important;
  }

  body[data-active-view="tree"] #treeView .poster-canvas,
  body[data-active-view="tree"] #treeView .tree-canvas {
    min-width: 1680px !important;
  }
}


/* V21.13 — Cards da árvore mais limpos e sem legenda redundante */
body[data-active-view="tree"] #treeView .tree-legend {
  display: none !important;
}




/* V21.14 — Cards da árvore com layout mais compacto e melhor aproveitamento do espaço */








body[data-active-view="tree"] #treeView .marriage-label {
  margin-top: .4rem !important;
  padding: .3rem .7rem !important;
  font-size: .76rem !important;
}








/* =============================================================================
   FAMÍLIA POR RAMOS — V22
   Seção .mobile-tree-view com .mobile-person-chip, .mobile-person-avatar etc.
   Nunca teve CSS próprio, causando foto sem containment (bug visual).
   ============================================================================= */

/* V22.2 — Separação desktop/mobile:
   No desktop, só o pôster é visível. No mobile, só o modo por ramos.
   renderTree() injeta os dois blocos sempre — o CSS decide qual mostrar. */

body[data-active-view="tree"] #treeView .mobile-tree-view {
  display: none !important;
}

@media (max-width: 900px) {
  body[data-active-view="tree"] #treeView .family-poster {
    display: none !important;
  }
  body[data-active-view="tree"] #treeView .poster-scroll,
  body[data-active-view="tree"] #treeView .tree-scroll {
    display: block !important;
    max-height: none !important;
    min-height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  body[data-active-view="tree"] #treeView .poster-canvas,
  body[data-active-view="tree"] #treeView .tree-canvas {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
  body[data-active-view="tree"] #treeView .mobile-tree-view {
    display: block !important;
    width: min(100%, 720px) !important;
    margin: 0 auto !important;
  }
}

/* container geral */
body[data-active-view="tree"] #treeView .mobile-tree-view {
  margin-top: 2rem;
  padding: 0 1rem 2rem;
}

body[data-active-view="tree"] #treeView .mobile-tree-header {
  margin-bottom: 1.25rem;
}

body[data-active-view="tree"] #treeView .mobile-tree-header h2 {
  margin: 0 0 .3rem;
  font-size: 1.3rem;
  color: var(--text, #10243d);
}

body[data-active-view="tree"] #treeView .mobile-tree-header p {
  margin: 0;
  color: var(--text-muted, #5f7288);
  font-size: .88rem;
}

/* lista de unidades familiares */
body[data-active-view="tree"] #treeView .mobile-family-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* unidade (casal + filhos) */
body[data-active-view="tree"] #treeView .mobile-family-unit {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d7e4ef);
  border-radius: 14px;
  padding: 14px 16px;
}

/* linha do casal */
body[data-active-view="tree"] #treeView .mobile-couple-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

body[data-active-view="tree"] #treeView .mobile-plus {
  color: var(--primary, #0e5a8a);
  font-weight: 900;
  font-size: 1.1rem;
  flex-shrink: 0;
}

body[data-active-view="tree"] #treeView .mobile-marriage-label {
  font-size: .78rem;
  color: var(--text-muted, #5f7288);
  margin: .4rem 0 .7rem;
  font-style: italic;
}

/* bloco de filhos */
body[data-active-view="tree"] #treeView .mobile-children-block {
  margin-top: .75rem;
  border-top: 1px solid var(--border-soft, rgba(14,90,138,.10));
  padding-top: .65rem;
}

body[data-active-view="tree"] #treeView .mobile-children-block > strong {
  font-size: .8rem;
  color: var(--text-muted, #5f7288);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: block;
  margin-bottom: .45rem;
}

body[data-active-view="tree"] #treeView .mobile-children-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

body[data-active-view="tree"] #treeView .mobile-no-children {
  font-size: .83rem;
  color: var(--text-muted, #5f7288);
  margin: 0;
}

/* chip de pessoa (pai/mãe/filho) */
body[data-active-view="tree"] #treeView .mobile-person-chip {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .65rem .45rem .45rem;
  border: 1px solid var(--border, #d7e4ef);
  border-radius: 999px;
  background: var(--surface-card, #fff);
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, border-color 120ms ease;
  max-width: 100%;
}

body[data-active-view="tree"] #treeView .mobile-person-chip:hover {
  background: var(--primary-soft, #e5f3fb);
  border-color: var(--primary, #0e5a8a);
}

body[data-active-view="tree"] #treeView .mobile-parent-chip {
  flex: 1;
  min-width: 0;
}

body[data-active-view="tree"] #treeView .mobile-unknown-parent {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .4rem .65rem;
  border-radius: 999px;
  border: 1px dashed var(--border, #d7e4ef);
  color: var(--text-muted, #5f7288);
  font-size: .82rem;
  flex: 1;
}

/* AVATAR — tamanho fixo contido, sem deixar foto vazar */
body[data-active-view="tree"] #treeView .mobile-person-avatar {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  background: linear-gradient(135deg, var(--primary, #0e5a8a), var(--primary-strong, #0a3f63));
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  flex-shrink: 0;
}

body[data-active-view="tree"] #treeView .mobile-person-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* texto da pessoa no chip */
body[data-active-view="tree"] #treeView .mobile-person-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

body[data-active-view="tree"] #treeView .mobile-person-name {
  font-weight: 700;
  font-size: .86rem;
  color: var(--text, #10243d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-active-view="tree"] #treeView .mobile-person-location {
  font-size: .74rem;
  color: var(--text-muted, #5f7288);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-active-view="tree"] #treeView .mobile-person-generation {
  font-size: .72rem;
  color: var(--text-muted, #5f7288);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-active-view="tree"] #treeView .mobile-person-dates {
  font-size: .70rem;
  color: var(--text-muted, #5f7288);
}

/* tema escuro */
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-family-unit {
  background: var(--surface, #111f30);
  border-color: var(--border, rgba(178,214,238,.18));
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-person-chip {
  background: var(--surface-2, #162a40);
  border-color: var(--border, rgba(178,214,238,.18));
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-person-chip:hover {
  background: var(--primary-soft, rgba(53,182,230,.16));
  border-color: var(--primary, #35b6e6);
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-person-name {
  color: var(--text, #eef7ff);
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-person-location,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-person-generation,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-person-dates {
  color: var(--text-muted, #a9bfd4);
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .mobile-tree-header h2 {
  color: var(--text, #eef7ff);
}

/* =============================================================================
   V22.8 — Família por ramos em retrato: casal empilhado, chips largura total
   Em telas estreitas os 2 chips lado a lado truncavam o texto em 1-2 letras.
   ============================================================================= */
@media (max-width: 560px) {
  body[data-active-view="tree"] #treeView .mobile-couple-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .45rem !important;
  }
  body[data-active-view="tree"] #treeView .mobile-plus {
    align-self: center !important;
    padding: 0 !important;
  }
  body[data-active-view="tree"] #treeView .mobile-parent-chip,
  body[data-active-view="tree"] #treeView .mobile-person-chip,
  body[data-active-view="tree"] #treeView .mobile-unknown-parent {
    width: 100% !important;
    flex: none !important;
    border-radius: 16px !important;
    padding: .55rem .75rem !important;
  }
  body[data-active-view="tree"] #treeView .mobile-person-text {
    min-width: 0 !important;
  }
  body[data-active-view="tree"] #treeView .mobile-person-name,
  body[data-active-view="tree"] #treeView .mobile-person-location,
  body[data-active-view="tree"] #treeView .mobile-person-generation {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}


/* V22.10 — Correção: Árvore no tema escuro sem pergaminho claro
   Motivo: styles.css ainda tinha fallback de pergaminho para #treeView.
   Este bloco fica no final do tree-unified.css para ganhar a cascata. */
html[data-theme="escuro"] #treeView.active-view .tree-panel,
html[data-theme="escuro"] #treeView.active-view .poster-panel,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .tree-panel,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .poster-panel {
  background:
    radial-gradient(circle at 82% -10%, rgba(196,149,58,.11), transparent 28rem),
    linear-gradient(145deg, rgba(8,22,32,.98), rgba(3,10,18,.99)) !important;
  border-color: rgba(196,149,58,.34) !important;
}

html[data-theme="escuro"] #treeView.active-view .tree-scroll,
html[data-theme="escuro"] #treeView.active-view .poster-scroll,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .tree-scroll,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .poster-scroll {
  background:
    radial-gradient(circle at 18% 10%, rgba(196,149,58,.08), transparent 24rem),
    radial-gradient(circle at 82% 8%, rgba(255,255,255,.045), transparent 18rem),
    linear-gradient(135deg, rgba(6,16,26,.985), rgba(3,10,18,.99)) !important;
  border-color: rgba(196,149,58,.32) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.035),
    0 22px 46px rgba(0,0,0,.34) !important;
  scrollbar-color: #d1a34e rgba(6,17,25,.90) !important;
}

html[data-theme="escuro"] #treeView.active-view .tree-scroll::before,
html[data-theme="escuro"] #treeView.active-view .tree-scroll::after,
html[data-theme="escuro"] #treeView.active-view .poster-scroll::before,
html[data-theme="escuro"] #treeView.active-view .poster-scroll::after,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .tree-scroll::before,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .tree-scroll::after,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .poster-scroll::before,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .poster-scroll::after {
  display: none !important;
  content: none !important;
}

html[data-theme="escuro"] #treeView.active-view .poster-canvas,
html[data-theme="escuro"] #treeView.active-view .tree-canvas,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .poster-canvas,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .tree-canvas {
  background: transparent !important;
}

html[data-theme="escuro"] #treeView.active-view .family-poster,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .family-poster {
  background:
    radial-gradient(circle at 50% 0%, rgba(196,149,58,.10), transparent 36rem),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.008)) !important;
  color: #f7ead2 !important;
  border-color: rgba(196,149,58,.28) !important;
}

html[data-theme="escuro"] #treeView.active-view .family-poster > h2,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .family-poster > h2 {
  color: #fff3d8 !important;
}

html[data-theme="escuro"] #treeView.active-view .poster-watermark,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .poster-watermark {
  opacity: .045 !important;
  filter: none !important;
}

/* =============================================================================
   V22.11 — Árvore escura definitiva no modo "Família completa (modo pôster)"
   Remove o pergaminho/cinza herdado de styles.css na visualização por gerações.
   Mantém a leitura premium: fundo escuro, detalhes dourados, cards escuros.
   ============================================================================= */
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-family-poster {
  background:
    radial-gradient(circle at 18% 12%, rgba(210,163,74,.10), transparent 24rem),
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.045), transparent 20rem),
    linear-gradient(135deg, rgba(8,18,29,.985), rgba(4,11,18,.995)) !important;
  border: 1px solid rgba(196,149,58,.28) !important;
  color: #f5e5c6 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 24px 50px rgba(0,0,0,.34) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-poster-header {
  border-bottom: 1px solid rgba(196,149,58,.24) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-poster-header span {
  background: rgba(210,163,74,.14) !important;
  border: 1px solid rgba(210,163,74,.30) !important;
  color: #f0d39b !important;
  box-shadow: none !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-poster-header h2 {
  color: #fff4dc !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.45) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-poster-header p {
  color: rgba(248,234,208,.76) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-row {
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025)) !important;
  border: 1px solid rgba(196,149,58,.20) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-label {
  background:
    radial-gradient(circle at 34% 20%, rgba(255,255,255,.34), transparent 30%),
    linear-gradient(180deg, #e5bf6a, #9a641f) !important;
  border: 1px solid rgba(233,190,101,.36) !important;
  color: #241507 !important;
  box-shadow: 0 12px 26px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.35) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-label strong {
  color: #261607 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,.22) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-label span {
  color: #4d320f !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .placeholder-card.family-card {
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.07), transparent 8rem),
    linear-gradient(180deg, rgba(16,31,46,.98), rgba(8,18,30,.99)) !important;
  border: 1px solid rgba(196,149,58,.30) !important;
  color: #f4e5c7 !important;
  box-shadow: 0 14px 28px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card::before,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .placeholder-card.family-card::before {
  background: linear-gradient(90deg, transparent, rgba(210,163,74,.95), transparent) !important;
  opacity: .95 !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card::after,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .placeholder-card.family-card::after {
  opacity: .04 !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-name,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .family-card-body strong {
  color: #fff4dc !important;
  text-shadow: none !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-location,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .family-card-body span,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .family-card-body small {
  color: rgba(248,234,208,.74) !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-generation,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-dates,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-meta,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-dates-row {
  color: #efd29c !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-profession,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-line {
  color: #e8d7b2 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-profession strong,
html[data-theme="escuro"] body[data-active-view="tree"] #treeView .generation-cards .family-card .tree-card-line strong {
  color: #d6a44c !important;
}

/* V24.1 RC-6.5 — modo completo com conexões reais */
body[data-active-view="tree"] #treeView .family-poster-connected .tree-lines-svg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
body[data-active-view="tree"] #treeView .family-poster-connected .poster-forest-connected,
body[data-active-view="tree"] #treeView .family-poster-connected .orphan-people-section {
  position: relative;
  z-index: 1;
}
