/* Shared source pedigree: compact generation columns, natural names and retained details. */
.profile-pedigree.pedigree-compact:not(.atlas-reading) [data-atlas-canvas]{min-width:0;padding:0;position:relative;transform-origin:0 0}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .pedigree,.profile-pedigree.pedigree-compact:not(.atlas-reading) .pedigree ul,.profile-pedigree.pedigree-compact:not(.atlas-reading) .pedigree li{display:contents;position:static;padding:0;margin:0;border:0}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .pedigree ul[hidden]{display:none}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .pedigree li::before,.profile-pedigree.pedigree-compact:not(.atlas-reading) .pedigree li::after{display:none}
.profile-pedigree.pedigree-compact .tree-node{box-sizing:border-box;min-width:224px;max-width:224px;width:224px;padding:10px 12px;min-height:112px;overflow-wrap:anywhere}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node{position:absolute;display:grid;grid-template-columns:minmax(0,1fr) 44px;column-gap:8px;align-content:start;align-items:center}
.profile-pedigree.pedigree-compact .tree-node>.eyebrow{grid-column:1;font-size:10px;line-height:1.3;letter-spacing:0;margin:0 0 4px}
.profile-pedigree.pedigree-compact .tree-node>.pedigree-node-name,.profile-pedigree.pedigree-compact .tree-node>strong{grid-column:1;font-size:14px;line-height:1.35;font-weight:650;min-width:0}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .historical-node-photo{grid-column:2;grid-row:1 / 3;width:44px;height:44px;object-fit:contain;margin:0}
.profile-pedigree.pedigree-compact .tree-node>.pedigree-photo-cue,.profile-pedigree.pedigree-compact .tree-node>.pedigree-repeat-cue{display:inline-block;font-size:14px;margin:0;grid-column:1;grid-row:3;justify-self:start;line-height:1.3}
.profile-pedigree.pedigree-compact .tree-node>.pedigree-repeat-cue{justify-self:center}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .pedigree-node-details{display:none}
.profile-pedigree.pedigree-compact .tree-node>[data-profile-peek-trigger],.profile-pedigree.pedigree-compact .tree-node>[data-profile-branch]{display:inline-flex;align-items:center;justify-content:center;grid-row:3;grid-column:2;min-height:44px;width:44px;padding:0;margin:0;border:0;border-radius:5px;font-size:22px;background:transparent;color:var(--theme-link);cursor:pointer}
.profile-pedigree.pedigree-compact .tree-node>[data-profile-branch]{grid-column:1;justify-self:end;font-size:19px;border:1px solid var(--theme-border);width:40px}
.profile-pedigree.pedigree-compact .tree-node>[data-profile-peek-trigger]:hover,.profile-pedigree.pedigree-compact .tree-node>[data-profile-branch]:hover{background:var(--theme-soft)}
.profile-pedigree.pedigree-compact .tree-node>[hidden]{display:none}
:root[data-pitvu-theme] .profile-pedigree.pedigree-compact .atlas-connections{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;fill:none;stroke:var(--theme-control);stroke-width:1.2}
:root[data-pitvu-theme] .profile-pedigree.pedigree-compact .atlas-connections path{fill:none;stroke:var(--theme-control);vector-effect:non-scaling-stroke}
:root[data-pitvu-theme] .profile-pedigree.pedigree-compact .atlas-connections path.is-highlight{stroke:var(--theme-link);stroke-width:2}
.profile-pedigree.pedigree-compact.atlas-reading .atlas-connections{display:none}
.profile-pedigree.pedigree-compact.atlas-reading .tree-node{position:static;min-width:0;max-width:none;width:100%;min-height:0}
.profile-pedigree.pedigree-compact.atlas-reading .tree-node>[data-profile-peek-trigger],.profile-pedigree.pedigree-compact.atlas-reading .tree-node>[data-profile-branch]{display:inline-flex;margin-right:6px}
.profile-pedigree.pedigree-compact.atlas-reading .pedigree-node-details{display:block}
.profile-peek .pedigree-node-details{display:block;max-width:100%;overflow-wrap:anywhere}
.profile-peek .tree-node{position:static;width:auto;min-width:0;max-width:none;min-height:0}
.profile-peek .tree-node>.pedigree-node-name{font-size:18px;line-height:1.4}
.profile-peek .historical-node-photo{width:88px;height:70px;object-fit:contain}
.profile-peek .pedigree-node-details p{font-size:13px;line-height:1.5}
.profile-peek .pedigree-node-details ul{padding-left:20px}
.profile-peek .pedigree-node-details li{display:list-item}
.profile-pedigree.pedigree-compact .profile-pedigree-controls{gap:6px}
@media(max-width:700px){.profile-pedigree.pedigree-compact.atlas-ready:not(.atlas-reading) .atlas-viewport{height:520px}.profile-pedigree.pedigree-compact .profile-pedigree-controls .button{flex:0 1 auto}.profile-pedigree.pedigree-compact .pedigree-section-heading{gap:12px}.profile-pedigree.pedigree-compact .pedigree-depth-form{flex-wrap:wrap}}
@media print{.profile-pedigree.pedigree-compact .atlas-connections{display:none!important}.profile-pedigree.pedigree-compact [data-atlas-canvas]{width:auto!important;height:auto!important;transform:none!important}.profile-pedigree.pedigree-compact .pedigree,.profile-pedigree.pedigree-compact .pedigree ul,.profile-pedigree.pedigree-compact .pedigree li{display:block!important}.profile-pedigree.pedigree-compact .tree-node{position:static!important;width:auto;max-width:none;min-width:0}.profile-pedigree.pedigree-compact .pedigree-node-details{display:block!important}}

/* Native focus must not scroll the transformed canvas independently of its pan state. */
@supports(overflow:clip){.profile-pedigree.pedigree-compact.atlas-ready:not(.atlas-reading) .atlas-viewport{overflow:clip}}
/* A thin inset indicator survives the legacy focus policy without changing card geometry. */
:root[data-pitvu-theme] body.pitvu-focus-policy .profile-pedigree.pedigree-compact :is([data-profile-branch],[data-profile-peek-trigger]):focus-visible{background:var(--theme-soft);color:var(--theme-text);border-color:var(--theme-control);box-shadow:inset 0 0 0 1px var(--theme-control);outline:none}

/* Compact mouse/keyboard presentation; coarse pointers retain full touch targets. */
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node{padding:6px 8px;min-height:76px;grid-template-columns:minmax(0,1fr) 32px 28px;column-gap:6px;align-content:center}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>.eyebrow{grid-column:1;grid-row:1;margin:0;font-size:10px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>.pedigree-node-name,.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>strong{grid-column:1;grid-row:2;line-height:1.3;font-size:14px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node:not(:has(>.historical-node-photo))>.pedigree-node-name,.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node:not(:has(>.historical-node-photo))>strong{grid-column:1 / 3}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .historical-node-photo{grid-column:2;grid-row:1;width:32px;height:32px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>.pedigree-photo-cue{grid-column:2;grid-row:2;justify-self:center;align-self:center;font-size:12px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>.pedigree-repeat-cue{grid-column:1;grid-row:1;justify-self:end;align-self:center;font-size:12px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>[data-profile-peek-trigger],.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>[data-profile-branch]{grid-column:3;grid-row:1;min-height:28px;height:28px;width:28px;margin:0;font-size:19px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>[data-profile-branch]{grid-row:2;font-size:16px}
@media(pointer:coarse){
 .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node{grid-template-columns:minmax(0,1fr) 32px 44px;min-height:104px}
 .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>[data-profile-peek-trigger],.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node>[data-profile-branch]{width:44px;min-height:44px;height:44px}
}

.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node:has(>.pedigree-repeat-cue)>.eyebrow{padding-right:16px}

/* Measured generation density: complete content remains in quick view, focus and text mode. */
:root[data-pitvu-theme] .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node[data-density-generation],
:root[data-pitvu-theme] .explorer.explorer-density:not(.is-reading) .explorer-node[data-density-generation]{width:var(--pedigree-node-width);min-width:var(--pedigree-node-width);max-width:var(--pedigree-node-width);min-height:var(--pedigree-node-height);box-sizing:border-box}
:root[data-pitvu-theme] .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node[data-density-generation]>.pedigree-node-name,
:root[data-pitvu-theme] .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node[data-density-generation]>strong,
:root[data-pitvu-theme] .explorer.explorer-density:not(.is-reading) .explorer-node[data-density-generation]>.explorer-name,
:root[data-pitvu-theme] .explorer.explorer-density:not(.is-reading) .explorer-node[data-density-generation]>strong{font-size:var(--pedigree-node-font);line-height:1.3}
:root[data-pitvu-theme] .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote{--pedigree-action-size:24px;padding:2px 4px;grid-template-columns:minmax(0,1fr) var(--pedigree-action-size) var(--pedigree-action-size);gap:3px;align-content:center;position:absolute}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>.eyebrow{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>.historical-node-photo,
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>.pedigree-photo-cue{display:none}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>.pedigree-node-name,
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>strong{display:block;grid-column:1;grid-row:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:24px;align-content:center}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote:not(:has(>[data-profile-branch]))>.pedigree-node-name{grid-column:1 / 3}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote:not(:has(>[data-profile-peek-trigger]))>strong{grid-column:1 / -1}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>[data-profile-peek-trigger]{grid-column:3;grid-row:1;width:var(--pedigree-action-size);height:var(--pedigree-action-size);min-height:var(--pedigree-action-size)}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>[data-profile-branch]{grid-column:2;grid-row:1;width:var(--pedigree-action-size);height:var(--pedigree-action-size);min-height:var(--pedigree-action-size)}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>.pedigree-repeat-cue{position:absolute;left:3px;top:0;font-size:10px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote:has(>.pedigree-repeat-cue)>.pedigree-node-name{padding-left:8px}
.profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote:focus-within>.pedigree-node-name{white-space:normal;overflow:visible;overflow-wrap:anywhere}
@media(pointer:coarse){
 :root[data-pitvu-theme] .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote{--pedigree-action-size:44px;grid-template-columns:minmax(0,1fr) 44px 44px}
 .profile-pedigree.pedigree-compact:not(.atlas-reading) .tree-node.is-density-remote>.pedigree-node-name{min-height:44px}
}
/* The accepted Explorer uses the same measured geometry; native details remain in reading/no-JS mode. */
.explorer.explorer-density:not(.is-reading) .explorer-canvas{position:relative;padding:0;min-width:0}
.explorer.explorer-density:not(.is-reading) .explorer-tree,
.explorer.explorer-density:not(.is-reading) .explorer-tree li,
.explorer.explorer-density:not(.is-reading) .explorer-tree details,
.explorer.explorer-density:not(.is-reading) .explorer-tree ul{display:contents;position:static;margin:0;padding:0;border:0}
.explorer.explorer-density:not(.is-reading) .explorer-tree details:not([open])>ul{display:none}
.explorer.explorer-density:not(.is-reading) .explorer-tree summary{display:none}
.explorer.explorer-density:not(.is-reading) .explorer-node{position:absolute;display:grid;grid-template-columns:minmax(0,1fr) 28px;gap:4px;padding:8px 10px;align-content:center}
.explorer.explorer-density:not(.is-reading) .explorer-node>.eyebrow{grid-column:1;grid-row:1;font-size:10px;line-height:1.2;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.explorer.explorer-density:not(.is-reading) .explorer-node>.explorer-name,
.explorer.explorer-density:not(.is-reading) .explorer-node>strong{grid-column:1;grid-row:2}
.explorer.explorer-density:not(.is-reading) .explorer-node>span:not([data-repeat-label]){display:none}
.explorer.explorer-density:not(.is-reading) .explorer-node>[data-repeat-label]{font-size:11px;grid-column:1;grid-row:3}
.explorer.explorer-density:not(.is-reading) .explorer-node>.branch-link{grid-column:2;grid-row:1;font-size:0;padding:0;min-height:28px;min-width:28px;display:grid;place-items:center}
.explorer.explorer-density:not(.is-reading) .explorer-node>.branch-link::after{content:'↗';font-size:18px}
.explorer .density-branch-toggle{min-width:28px;min-height:28px;border:1px solid var(--theme-control);border-radius:5px;background:var(--theme-surface);color:var(--theme-link);padding:0;font:inherit;cursor:pointer}
.explorer.explorer-density:not(.is-reading) .explorer-node>.density-branch-toggle{grid-column:2;grid-row:2}
.explorer.explorer-density.is-reading .density-branch-toggle{display:none}
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote{--pedigree-action-size:24px;padding:2px 4px;grid-template-columns:minmax(0,1fr) var(--pedigree-action-size) var(--pedigree-action-size)}
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote>.eyebrow,
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote>[data-repeat-label]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote>.explorer-name,
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote>strong{grid-column:1;grid-row:1;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-content:center}
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote>.branch-link{grid-column:3;grid-row:1;min-width:var(--pedigree-action-size);min-height:var(--pedigree-action-size)}
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote>.density-branch-toggle{grid-column:2;grid-row:1;min-width:var(--pedigree-action-size);min-height:var(--pedigree-action-size)}
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote:not(:has(>.density-branch-toggle))>.explorer-name{grid-column:1 / 3}
.explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote:not(:has(>.branch-link))>strong{grid-column:1 / -1}
.explorer.explorer-density:not(.is-reading) .explorer-node:focus-within>.explorer-name{white-space:normal;overflow:visible;overflow-wrap:anywhere}
.explorer.explorer-density:not(.is-reading) .explorer-node:focus-within>span:not([data-repeat-label]){display:block;grid-column:1 / -1}
:root[data-pitvu-theme] .explorer .density-connections{position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:none;stroke:var(--theme-control);stroke-width:1.2;pointer-events:none}
:root[data-pitvu-theme] .explorer .density-connections path{fill:none;stroke:var(--theme-control);vector-effect:non-scaling-stroke}
.explorer.explorer-density.is-reading .density-connections{display:none}
@supports(overflow:clip){.explorer.explorer-density:not(.is-reading) .explorer-viewport{overflow:clip}}
@media(pointer:coarse){
 .explorer.explorer-density:not(.is-reading) .explorer-node{grid-template-columns:minmax(0,1fr) 44px}
 .explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote{--pedigree-action-size:44px;grid-template-columns:minmax(0,1fr) 44px 44px}
 .explorer .density-branch-toggle,.explorer.explorer-density:not(.is-reading) .explorer-node>.branch-link{min-width:44px;min-height:44px}
 .explorer.explorer-density:not(.is-reading) .explorer-node.is-density-remote>.explorer-name{min-height:44px}
}
@media print{
 .explorer.explorer-density .density-connections,.explorer .density-branch-toggle{display:none!important}
 .explorer.explorer-density .explorer-canvas{width:auto!important;height:auto!important;transform:none!important}
 .explorer.explorer-density .explorer-tree,.explorer.explorer-density .explorer-tree li,.explorer.explorer-density .explorer-tree details,.explorer.explorer-density .explorer-tree ul{display:block!important}
 .explorer.explorer-density .explorer-node{position:static!important;width:auto!important;min-width:0!important;max-width:none!important}
 .explorer.explorer-density .explorer-node>:is(span,.eyebrow,.explorer-name,strong){position:static!important;width:auto!important;height:auto!important;overflow:visible!important;white-space:normal!important;clip-path:none!important}
}

/* Printed pedigrees use document flow, not the interactive generation grid. */
@media print {
 :root[data-pitvu-theme] .profile-pedigree.pedigree-compact .tree-node,
 :root[data-pitvu-theme] .explorer.explorer-density .explorer-node {
  display:block!important;position:static!important;width:100%!important;max-width:100%!important;min-width:0!important;
  height:auto!important;min-height:0!important;padding:8px!important;margin:8px 0!important;break-inside:avoid;
 }
 :root[data-pitvu-theme] .profile-pedigree.pedigree-compact .tree-node>:is(.eyebrow,.pedigree-node-name,strong,.pedigree-repeat-cue),
 :root[data-pitvu-theme] .explorer.explorer-density .explorer-node>:is(.eyebrow,.explorer-name,strong,[data-repeat-label]) {
  position:static!important;width:auto!important;height:auto!important;min-height:0!important;max-width:none!important;
  overflow:visible!important;white-space:normal!important;clip-path:none!important;text-overflow:clip!important;
  margin:0 0 4px!important;overflow-wrap:anywhere;
 }
 :root[data-pitvu-theme] .profile-pedigree.pedigree-compact .tree-node>.pedigree-node-details {display:block!important;width:auto!important;max-width:none!important}
 :root[data-pitvu-theme] .explorer.explorer-density .explorer-viewport {height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;contain:none!important}
}

/* A selected one-generation view needs room for two parents, not a deep-tree frame. */
@media screen {
 .profile-pedigree.pedigree-compact.atlas-ready:not(.atlas-reading):not(:fullscreen):has(> .pedigree-completeness[data-depth="1"]) .atlas-viewport {height:320px}
}

/* Two-generation views retain readable node geometry without a deep-tree frame. */
@media screen {
 .profile-pedigree.pedigree-compact.atlas-ready:not(.atlas-reading):not(:fullscreen):has(> .pedigree-completeness[data-depth="2"]) .atlas-viewport {height:420px}
}
@media screen and (max-width:767px) {
 .profile-pedigree.pedigree-compact.atlas-ready:not(.atlas-reading):not(:fullscreen):has(> .pedigree-completeness[data-depth="2"]) .atlas-viewport {height:320px}
}
