/* One unframed, four-generation profile canvas. Keep the old card and family-line palette. */
#source-pedigree[data-profile-four] {
    min-width: 0;
    margin-block: .75rem 1.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
:root[data-pitvu-theme] [data-profile-four].atlas-ready:not(.atlas-reading) .atlas-viewport {
    height: clamp(390px, 70svh, 745px);
    min-height: 0 !important;
    max-height: none !important;
    position: relative;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}
[data-profile-four] .atlas-viewport.is-dragging { cursor: grabbing; }
[data-profile-four] [data-atlas-canvas] { transform-origin: 0 0; }
:root[data-pitvu-theme] [data-profile-four][data-parent-pair-view].profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node[data-density-generation] {
    --card-size: 214px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(24px, auto);
    gap: 4px 7px;
    width: var(--card-size) !important;
    min-width: var(--card-size) !important;
    max-width: var(--card-size) !important;
    min-height: 57px !important;
    padding: 8px 34px 9px 10px;
    border-radius: 8px;
    line-height: 1.2;
}
:root[data-pitvu-theme] [data-profile-four].pedigree-compact .tree-node[data-density-generation].atlas-pair-root {
    --card-size: 224px;
}
:root[data-pitvu-theme] [data-profile-four].pedigree-compact .tree-node > .eyebrow {
    grid-row: 1;
    grid-column: 1;
    margin: 0;
    padding: 0 !important;
    font-size: 10px;
    line-height: 1.2;
}
:root[data-pitvu-theme] [data-profile-four].pedigree-compact .pedigree-card-persona {
    grid-row: 2;
    grid-column: 1;
    min-width: 0;
    align-content: center;
    align-items: center;
    line-height: 1.18;
}
:root[data-pitvu-theme] [data-profile-four].pedigree-compact .pedigree-card-persona > .pedigree-node-name,
:root[data-pitvu-theme] [data-profile-four].pedigree-compact .pedigree-card-persona > strong {
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
:root[data-pitvu-theme] [data-profile-four].pedigree-compact .pedigree-card-persona > strong {
    color: var(--theme-muted);
    font-size: 13px;
    font-weight: 550;
}
:root[data-pitvu-theme] [data-profile-four].pedigree-compact .tree-node .pedigree-card-meta { display: none; }
:root[data-pitvu-theme] [data-profile-four][data-parent-pair-view].profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node > .historical-node-photo {
    grid-column: 2;
    grid-row: 1 / 3;
    width: 52px !important;
    height: 52px !important;
    padding: 1px;
    border-radius: 4px;
    object-fit: contain;
}
:root[data-pitvu-theme] [data-profile-four][data-parent-pair-view].profile-pedigree .tree-node > :is([data-profile-branch],[data-pv-expand]) {
    position: absolute !important;
    inset: auto 3px 3px auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px !important;
    min-height: 28px !important;
    width: 28px !important;
    height: 28px !important;
    margin: 0;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 5px;
    background: var(--theme-soft);
    color: var(--theme-link);
    font-size: 18px !important;
    line-height: 1;
    cursor: pointer;
}
:root[data-pitvu-theme] [data-profile-four][data-parent-pair-view] .tree-node > [data-profile-peek-trigger] {
    width: 27px !important;
    min-width: 27px !important;
    height: 24px !important;
    min-height: 24px !important;
}
[data-profile-four] .tree-node > button[hidden] { display: none !important; }
:root[data-pitvu-theme] [data-profile-four] .tree-node > .pedigree-repeat-cue {
    right: 31px;
    top: 3px;
    height: 14px;
    font-size: 12px;
}
:root[data-pitvu-theme] [data-profile-four] .tree-node > .pedigree-photo-cue {
    right: 37px;
    top: auto;
    bottom: 4px;
}
@media (max-width: 700px) {
    :root[data-pitvu-theme] [data-profile-four].atlas-ready:not(.atlas-reading) .atlas-viewport { height: clamp(330px, 70svh, 580px); }
}
@media print {
    [data-profile-four].atlas-ready .atlas-viewport { height: auto !important; overflow: visible !important; }
}
/* Fixed four-column opening spread. The outer columns use the same width as the inner ones. */
#source-pedigree[data-profile-four].pedigree-compact .tree-node[data-density-generation] {
    width: var(--profile-atlas-card-width) !important;
    min-width: var(--profile-atlas-card-width) !important;
    max-width: var(--profile-atlas-card-width) !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    padding: 5px 31px 6px 8px !important;
    gap: 2px 6px !important;
    min-height: 48px !important;
}
#source-pedigree[data-profile-four].pedigree-compact .tree-node[data-density-generation] > .historical-node-photo {
    width: 40px !important;
    height: 40px !important;
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
}
#source-pedigree[data-profile-four] .tree-node .pedigree-card-persona {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
}
#source-pedigree[data-profile-four] .pedigree-card-persona > .pedigree-node-name,
#source-pedigree[data-profile-four] .pedigree-card-persona > strong {
    width: auto;
    flex: 0 1 auto;
    line-height: 1.12;
}
#source-pedigree[data-profile-four] .tree-node .archival-labels { display: inline-flex; flex-wrap: wrap; gap: 2px; }
#source-pedigree[data-profile-four] .tree-node .archival-label { padding: 0 2px; min-height: 0; line-height: 1.2; font-size: 9px; }
#source-pedigree[data-profile-four].pedigree-compact .tree-node[data-generation="4"],
#source-pedigree[data-profile-four].pedigree-compact .tree-node:is([data-generation="5"],[data-generation="6"],[data-generation="7"],[data-generation="8"]) {
    grid-template-rows: auto !important;
    min-height: 31px !important;
    padding-block: 2px !important;
}
#source-pedigree[data-profile-four].pedigree-compact .tree-node:not([data-generation="1"],[data-generation="2"],[data-generation="3"]) > .eyebrow {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}
#source-pedigree[data-profile-four].pedigree-compact .tree-node:not([data-generation="1"],[data-generation="2"],[data-generation="3"]) > .pedigree-card-persona {
    grid-row: 1 !important;
}
#source-pedigree[data-profile-four].pedigree-compact .tree-node:not([data-generation="1"],[data-generation="2"],[data-generation="3"]) > .historical-node-photo {
    grid-row: 1 !important;
    width: 29px !important;
    height: 29px !important;
}
#source-pedigree[data-profile-four].pedigree-compact .tree-node:not([data-generation="1"],[data-generation="2"],[data-generation="3"]) > [data-profile-peek-trigger] {
    top: 0 !important;
    left: auto !important;
    right: 2px !important;
    min-height: 16px !important;
    height: 16px !important;
}
#source-pedigree[data-profile-four].pedigree-compact .tree-node:not([data-generation="1"],[data-generation="2"],[data-generation="3"]):has([data-pv-expand]) {
    padding-right: 55px !important;
}
#source-pedigree[data-profile-four].pedigree-compact .tree-node:has([data-pv-expand]) > [data-profile-peek-trigger] {
    right: 32px !important;
}
#source-pedigree[data-profile-four] { position: relative; }
[data-profile-four] .profile-atlas-home {
    position: absolute;
    z-index: 3;
    top: 6px;
    right: 6px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border-radius: 7px;
    color: var(--theme-link);
    border: 1px solid var(--theme-border);
    background: var(--theme-surface);
    cursor: pointer;
}
[data-profile-four] .profile-atlas-home[hidden] { display: none; }
/* Keep the archival attribution cue attached to its photo as rows resize. */
#source-pedigree[data-profile-four] .tree-node[data-density-generation] > .pedigree-photo-cue {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    align-self: end !important;
    justify-self: end !important;
    position: relative !important;
    inset: auto !important;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid;
    place-items: center;
    border: 1px solid var(--theme-border);
    border-radius: 3px;
    background: var(--theme-surface);
    color: var(--theme-muted);
    line-height: 1;
    font-size: 10px !important;
    z-index: 1;
}
#source-pedigree[data-profile-four] .tree-node:not([data-generation="1"],[data-generation="2"],[data-generation="3"]) > .pedigree-photo-cue {
    grid-row: 1 !important;
}
#source-pedigree[data-profile-four] .tree-node[data-density-generation] > .pedigree-photo-cue {
    align-self: center !important;
    justify-self: start !important;
    transform: translateY(-12px);
    pointer-events: auto;
}
#source-pedigree[data-profile-four] .tree-node:not([data-generation="1"],[data-generation="2"],[data-generation="3"]) > .pedigree-photo-cue {
    transform: translateY(-7px);
}
