.tree-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
}

.tree-container {
    min-width: 640px;
    background: white;
    border-radius: 12px;
    padding: 48px 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Generation row */
.gen-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 72px;
}

.gen-row:last-child {
    margin-bottom: 0;
}

/* Left label */
.gen-label {
    width: 110px;
    min-width: 110px;
    padding-top: 36px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #d1d5db;
}

/* Units in a row */
.gen-units {
    flex: 1;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

/* Couple or single unit */
.family-unit {
    display: flex;
    align-items: flex-start;
}

/* Heart between couple */
.couple-connector {
    padding: 0 8px;
    margin-top: 47px;
    color: #fca5a5;
    font-size: 1rem;
    flex-shrink: 0;
    user-select: none;
}

/* Person card */
.person-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    text-align: center;
    gap: 10px;
    padding: 0 4px;
}

/* Photo circle */
.person-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: #f9fafb;
    border: 3px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.person-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-q {
    font-size: 2.2rem;
    color: #d1d5db;
    font-weight: 300;
    line-height: 1;
    user-select: none;
}

.person-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
}

.person-dates {
    font-size: 0.76rem;
    color: #9ca3af;
    line-height: 1.5;
    margin: 0;
}

/* Deceased */
.person-card.deceased .person-photo {
    border-color: #d1d5db;
    background: #f3f4f6;
}

.person-card.deceased .person-name {
    color: #9ca3af;
}

/* Focal person */
.person-card[data-person="bruce"] .person-photo {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.person-card[data-person="bruce"] .person-name {
    color: #1e40af;
    font-weight: 700;
    font-size: 0.95rem;
}

/* SVG line overlay */
.tree-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}
