.family-atlas-frame {
  overflow: hidden;
}

.family-atlas-toolbar {
  justify-content: space-between;
}

.classic-tree-zoom {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.classic-tree-zoom button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(38, 51, 45, .16);
  border-radius: 50%;
  background: #fffdf8;
  color: #4f5e55;
  cursor: pointer;
}

.classic-tree-zoom button:disabled {
  opacity: .32;
  cursor: not-allowed;
}

.classic-tree-zoom > span {
  width: 43px;
  color: #768078;
  font-family: var(--utility);
  font-size: 7px;
  font-weight: 700;
  text-align: center;
}

.classic-tree-stage {
  height: clamp(670px, 75vh, 840px);
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  overflow: hidden;
  background: #f9f7f0;
}

.classic-generation-gutter {
  position: relative;
  z-index: 6;
  overflow: hidden;
  border-right: 1px solid rgba(38, 51, 45, .14);
  background: #efede4;
  box-shadow: 8px 0 18px rgba(45, 57, 49, .05);
}

.classic-generation-gutter span {
  position: absolute;
  right: 13px;
  left: 10px;
  color: #667269;
  font-family: var(--utility);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.35;
  text-align: right;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.classic-tree-viewport {
  position: relative;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a8b1a9 #eceae3;
  scrollbar-width: thin;
  background: #fbfaf5;
}

.classic-tree-viewport:focus-visible {
  outline: 2px solid #526d5b;
  outline-offset: -3px;
}

.classic-tree-scaled {
  position: relative;
}

.classic-tree-canvas {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  transform-origin: top left;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .45), transparent 20% 80%, rgba(255, 255, 255, .35)),
    #f8f6ef;
}

.classic-row-rule {
  position: absolute;
  z-index: 1;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(38, 51, 45, .08);
}

.classic-tree-canvas > svg {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.classic-family-line {
  fill: none;
  stroke: color-mix(in srgb, var(--branch-color) 48%, #68756c);
  stroke-width: 2px;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

.classic-person-card {
  position: absolute;
  z-index: 4;
  width: 170px;
  height: 86px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  overflow: hidden;
  padding: 7px 10px 7px 7px;
  border: 1px solid rgba(38, 51, 45, .22);
  border-top: 3px solid var(--branch-color);
  border-radius: 4px;
  background: #fff;
  color: var(--album-ink);
  text-align: left;
  box-shadow: 0 6px 15px rgba(45, 57, 49, .1);
  cursor: pointer;
}

.classic-person-card .family-portrait {
  width: 58px;
  height: 68px;
  border-radius: 2px;
}

.classic-person-card > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.classic-person-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-family: var(--title);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.015em;
  line-height: 1.02;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.classic-person-card small {
  color: #748078;
  font-family: var(--utility);
  font-size: 6px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.classic-person-card > .person-branch-dots {
  position: absolute;
  right: 6px;
  bottom: 5px;
  flex-direction: row;
  gap: 2px;
}

.classic-person-card > .person-branch-dots i {
  width: 4px;
  height: 4px;
}

.classic-person-card[aria-pressed="true"] {
  border-color: #314b3b;
  box-shadow: 0 0 0 3px rgba(49, 75, 59, .16), 0 8px 20px rgba(45, 57, 49, .14);
}

.classic-start-marker {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #314b3b;
  color: #fff;
  font-family: var(--utility);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: translateX(-50%);
  white-space: nowrap;
}

.classic-tree-note {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--album-rule);
  background: #f3f1e9;
  color: #657168;
  font-family: var(--font-geist-sans), sans-serif;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

@media (hover: hover) and (pointer: fine) {
  .classic-person-card,
  .classic-tree-zoom button {
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
  }

  .classic-person-card:hover {
    z-index: 7;
    border-color: color-mix(in srgb, var(--branch-color) 72%, #58665d);
    transform: translateY(-3px);
    box-shadow: 0 11px 24px rgba(45, 57, 49, .16);
  }

  .classic-tree-zoom button:not(:disabled):hover {
    border-color: #52675a;
    background: #f0f3ed;
  }
}

@media (max-width: 900px) {
  .family-atlas-toolbar {
    align-items: center;
  }

  .classic-tree-stage {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .classic-generation-gutter span {
    right: 9px;
    left: 6px;
    font-size: 6px;
  }
}

@media (max-width: 760px) {
  .family-atlas-toolbar {
    min-height: 104px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .classic-tree-zoom {
    align-self: flex-end;
  }

  .classic-tree-stage {
    height: 620px;
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .classic-generation-gutter span {
    right: 7px;
    left: 4px;
    font-size: 5px;
    letter-spacing: .06em;
  }

  .classic-tree-note {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .classic-person-card,
  .classic-tree-zoom button {
    transition: none;
  }
}
