.wrap-wide { max-width: 980px; }

#tree {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  margin-top: 2rem;
  max-height: 72vh;
  overflow: auto;
  padding: 0.5rem 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.tree-connectors {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}
.tree-line {
  stroke: var(--border);
  stroke-width: 1.5;
}
.tree-row {
  display: flex;
  gap: 1.8rem;
  justify-content: center;
  flex-wrap: nowrap;
  position: relative;
  z-index: 1;
}
.couple-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.spouse-link {
  color: var(--text-muted);
  font-size: 1.1rem;
  position: relative;
  padding-bottom: 2px;
}
.spouse-link.divorced {
  color: #a86b5c;
  border-bottom: 1px dashed #a86b5c;
}
.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  min-width: 110px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.person-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.person-card.gender-f { border-left: 3px solid #b5789a; }
.person-card.gender-m { border-left: 3px solid #5c82a8; }
.person-name {
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 600;
}
.person-years {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.8rem;
  max-width: 420px;
  width: 100%;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.modal h2 { margin: 0 1.5rem 1rem 0; font-size: 1.3rem; }
.modal dl { margin: 0; }
.modal dt { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.8rem; }
.modal dd { margin: 0.15rem 0 0; font-size: 0.95rem; }
