#family .family-tree {
  --tree-space: 1rem;
  margin: 2rem 0;
  padding: clamp(0.75rem, 3%, 1.5rem);
  background: #f3f5f2;
  border: 1px solid #d5ddd7;
}
.tree-parents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--tree-space); }
.node-efim { --person-accent: #9c4037; }
.node-tatjana { --person-accent: #33685b; }
.node-zinaida { --person-accent: #2b636f; }
.tree-node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.125rem;
  min-height: 7.5rem;
  min-width: 0;
  padding: 0.875rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d5ddd7;
  border-top: 3px solid var(--person-accent);
  border-radius: 4px;
  font-size: 0.9375rem;
  line-height: 1.35;
  text-decoration: none;
}
.tree-node:hover { border-color: var(--person-accent); color: var(--ink); }
.tree-node:hover strong { text-decoration: underline; text-underline-offset: 0.2em; }
.tree-node strong { font: 1.625rem/1.25 Georgia, serif; }
.tree-role, .profile-heading > span { color: var(--person-accent); font-size: 0.875rem; font-weight: 700; }
.tree-node.node-zinaida { width: min(100%, 19rem); margin-inline: auto; }
.tree-alias { margin-top: 0.25rem; color: #4f5c56; }
.tree-connector { position: relative; height: 2rem; color: #75887e; }
.tree-connector::before {
  content: '';
  position: absolute;
  left: calc(25% - var(--tree-space) / 4);
  right: calc(25% - var(--tree-space) / 4);
  top: 0;
  height: 50%;
  border: solid currentColor;
  border-width: 0 1px 1px;
}
.tree-connector span { position: absolute; left: 50%; top: 50%; bottom: 0; border-left: 1px solid currentColor; }
.family-tree figcaption { margin-top: 1rem; color: #46534d; font-size: 0.875rem; line-height: 1.55; }
#people .person-profile {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1.75rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
}
#people .person-profile:target .profile-heading { border-left-color: var(--person-accent); }
.profile-heading { min-width: 0; align-self: start; padding-left: 0.875rem; border-left: 3px solid #d5ddd7; }
.profile-heading h3 { margin: 0.25rem 0; font: 1.75rem/1.23 Georgia, serif; overflow-wrap: anywhere; }
.chapter .profile-heading p { margin: 0; font-size: 0.9375rem; color: #4f5c56; }
.profile-record { max-width: 44rem; min-width: 0; }
.profile-record h4 { margin: 0 0 0.375rem; font-size: 0.9375rem; color: var(--person-accent); }
.chapter .profile-record p, .chapter .archive-update p { font-size: 1rem; line-height: 1.65; margin: 0 0 0.9375rem; }
.profile-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem 1.125rem; }
.profile-links a, .profile-doc { font-size: 0.9375rem; color: #205d61; }
.profile-doc { display: inline-flex; gap: 0.5rem; align-items: center; min-height: 2.75rem; padding: 0.35rem 0.65rem; border: 1px solid #9fbbb5; border-radius: 4px; background: white; text-align: left; }
.profile-doc:hover { background: #edf4f0; }
.profile-doc svg { width: 1rem; flex-shrink: 0; }
.archive-update { border-top: 2px solid #33685b; padding: 1.25rem 0 0; margin-top: 1.25rem; max-width: 47rem; }
.archive-update h3 { margin: 0.25rem 0 0.75rem; font: 1.5rem/1.3 Georgia, serif; }
.archive-date { color: #33685b; font-size: 0.875rem; }

@media (max-width: 950px) {
  .masthead nav a.family-nav { display: inline; }
  .masthead nav a[href="#calendar"] { display: none; }
}
@media (max-width: 680px) {
  html { scroll-padding-top: 138px; }
  .masthead nav a[href="#geography"] { display: none; }
  .masthead nav a[href="#sources"] { display: none; }
  .masthead nav a[href="#documents"] { display: inline; }
  .masthead .brand span:last-child { white-space: nowrap; }
  #people .person-profile { grid-template-columns: minmax(0, 1fr); gap: 0.875rem; }
  #family .family-tree { --tree-space: 0.6rem; }
  .tree-node { padding: 0.65rem; overflow-wrap: anywhere; }
  .tree-node strong { font-size: 1.375rem; }
}
@media (max-width: 370px) {
  .masthead nav a[href="#documents"] { display: none; }
}
@media print {
  .family-tree, .person-profile { break-inside: avoid; }
}
