.family-tree--showcase {
  overflow-x: auto;
  overflow-y: visible;
  padding: 8px 0 20px;
  min-height: 180px;
}

.tree-showcase {
  display: grid;
  gap: 16px;
}

.tree-showcase__hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
  align-items: start;
}

.tree-showcase__eyebrow {
  color: #177659;
  font-weight: 800;
  margin-bottom: 8px;
}

.tree-showcase__titleblock h1 {
  margin: 0 0 8px;
  font-size: 42px;
  line-height: 1.05;
}

.tree-showcase__titleblock p {
  max-width: 720px;
}

.tree-showcase__controls {
  display: grid;
  gap: 12px;
}

.tree-showcase__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tree-showcase__tips {
  padding: 0 4px;
}

.tree-stage {
  overflow: hidden;
}

.tree-stage__status {
  margin-bottom: 10px;
  color: var(--muted);
}

.ft-tree {
  min-width: min-content;
  padding: 10px 6px 20px;
}

.ft-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 230px;
}

.ft-node.is-root {
  margin: 0 auto;
}

.ft-children {
  display: none;
  width: 100%;
  position: relative;
  padding-top: 28px;
}

.ft-node.is-open > .ft-children {
  display: block;
}

.ft-children-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  position: relative;
}

.ft-children-row::before {
  content: '';
  position: absolute;
  top: -18px;
  left: 50%;
  width: 2px;
  height: 18px;
  background: #d7deea;
  transform: translateX(-50%);
}

.ft-child-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.ft-child-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -2px;
  width: 2px;
  height: 20px;
  background: #d7deea;
  transform: translateX(-50%);
}

.ft-children-row.has-many::after {
  content: '';
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 2px;
  background: #d7deea;
}

.ft-card {
  position: relative;
  width: 232px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #dde5ef;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.ft-card--root {
  width: 520px;
}

.ft-card--person,
.ft-card--couple {
  border-top: 4px solid var(--ft-accent, #2563eb);
}

.ft-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 10px;
  background: linear-gradient(180deg, rgba(248,250,252,.95), rgba(255,255,255,1));
}

.ft-card__top--root {
  padding: 18px;
}

.ft-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 52px;
  border: 2px solid #eef2f7;
  background: #e5e7eb;
}

.ft-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #334155;
}

.ft-persons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ft-person {
  flex: 1;
  min-width: 0;
}

.ft-person__name {
  display: block;
  color: #0f172a;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.25;
}

.ft-person__name:hover { text-decoration: underline; }

.ft-person__meta {
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
}

.ft-couple-link {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff7ed;
  color: #92400e;
  border: 1px solid #fed7aa;
  font-size: 16px;
  font-weight: 800;
  flex: 0 0 32px;
}

.ft-card__body {
  padding: 0 14px 14px;
}

.ft-card__title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 4px;
}

.ft-card__subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.ft-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ft-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.ft-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.ft-card__actions a {
  color: #1d4ed8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.ft-card__actions a:hover { text-decoration: underline; }

.ft-toggle {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #d8dee8;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}

.ft-toggle[disabled] {
  cursor: default;
  opacity: .6;
}

.ft-card__note {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  background: #fef3c7;
  color: #92400e;
}

.ft-level-0 { --ft-accent: #d4a72c; }
.ft-level-1:nth-of-type(5n+1) { --ft-accent: #71b989; }
.ft-level-1:nth-of-type(5n+2) { --ft-accent: #8ab8e8; }
.ft-level-1:nth-of-type(5n+3) { --ft-accent: #efb6a3; }
.ft-level-1:nth-of-type(5n+4) { --ft-accent: #f0c66d; }
.ft-level-1:nth-of-type(5n+5) { --ft-accent: #bea4ee; }
.ft-level-2:nth-of-type(4n+1) { --ft-accent: #8fd0a4; }
.ft-level-2:nth-of-type(4n+2) { --ft-accent: #abd2f4; }
.ft-level-2:nth-of-type(4n+3) { --ft-accent: #f3c5b6; }
.ft-level-2:nth-of-type(4n+4) { --ft-accent: #d0bff4; }
.ft-level-3, .ft-level-4, .ft-level-5, .ft-level-6 { --ft-accent: #d9dee7; }

.ft-empty {
  padding: 18px;
  border-radius: 14px;
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 1000px) {
  .tree-showcase__hero {
    grid-template-columns: 1fr;
  }

  .ft-card--root {
    width: 420px;
  }
}

@media (max-width: 700px) {
  .tree-showcase__titleblock h1 {
    font-size: 34px;
  }

  .tree-showcase__buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .ft-card {
    width: 210px;
  }

  .ft-card--root {
    width: 320px;
  }

  .ft-card__top,
  .ft-card__top--root {
    padding: 14px;
  }

  .ft-persons {
    gap: 8px;
  }

  .ft-avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .ft-children-row {
    gap: 16px;
  }

  .ft-children-row.has-many::after {
    left: 22px;
    right: 22px;
  }
}

/* v37 interaction upgrades */
.family-tree-viewport{overflow:auto;min-height:200px;touch-action:pan-x pan-y}.family-tree--showcase{transform-origin:top center;transition:transform .16s ease}.ft-card__actions button.ft-focus-branch{min-height:0;padding:0;background:transparent;color:#1d4ed8;border:0;font-size:12px;font-weight:700}.ft-card__actions button.ft-focus-branch:hover{background:transparent;text-decoration:underline}.ft-node.is-focused{margin:0 auto}.ft-tree.is-focus-mode>.ft-node{min-width:100%}.tree-stage.is-dragging{cursor:grabbing}.family-tree-viewport{cursor:grab}.tree-stage:fullscreen{background:#f8f6f1;padding:18px}.tree-stage:fullscreen .family-tree-viewport{height:calc(100vh - 100px)}
.ft-person{display:flex;align-items:center;gap:9px}.ft-person>div{min-width:0}.ft-person__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
