/* Isolated light-theme preview. Only existing paint properties change. */
@media screen {
  html[data-pitvu-theme="light"] :is(#source-pedigree, .profile-pedigree-summary) {
    --theme-link: #24594a;
    --theme-border: #cbd5cc;
    background-color: #fff !important;
    border-color: #d2d8ce !important;
  }
  html[data-pitvu-theme="light"] .profile-pedigree-summary .profile-statistics-table thead th {
    background-color: #edf2ed !important;
    color: #294137 !important;
    border-color: #bdcbbf !important;
  }
  html[data-pitvu-theme="light"] .profile-pedigree-summary .profile-statistics-table tbody :is(th, td) {
    border-color: #d8dfd8 !important;
  }
  html[data-pitvu-theme="light"] .profile-pedigree-summary .profile-statistics-table td {
    color: #4c5b53 !important;
  }
  html[data-pitvu-theme="light"] #source-pedigree .pedigree-completeness[data-status="partial"] {
    background-color: #faf6ed !important;
    border-color: #ded3bd !important;
    border-left-color: #8a693b !important;
  }
  html[data-pitvu-theme="light"] #source-pedigree .pedigree-parent-tab[data-lineage="s"] {
    background-color: #e8f1eb;
    border-color: #c4d4c9;
    border-left-color: #477563;
  }
  html[data-pitvu-theme="light"] #source-pedigree .pedigree-parent-tab[data-lineage="d"] {
    background-color: #f5eee1;
    border-color: #ddd1ba;
    border-left-color: #927546;
  }
  html[data-pitvu-theme="light"] #source-pedigree .pedigree-parent-tab[data-lineage="d"] .eyebrow {
    color: #745a32 !important;
  }
  html[data-pitvu-theme="light"] #source-pedigree .atlas-viewport {
    background-color: #edf1eb !important;
    border-color: #c6d1c6 !important;
  }
  html[data-pitvu-theme="light"] #source-pedigree .tree-node.is-known {
    --theme-surface: #fff;
    --theme-soft: #edf2ec;
    --theme-border: #c0cdc2;
  }
  html[data-pitvu-theme="light"] #source-pedigree .atlas-connections path:not(.is-highlight) {
    stroke: #536e60 !important;
  }
  html[data-pitvu-theme="light"] #source-pedigree .atlas-connections path[data-lineage="d"]:not(.is-highlight) {
    stroke: #816b4a !important;
  }
}
/* The relative groups keep the same grid, list positions and hit areas. */
@media screen {
  html[data-pitvu-theme="light"] #profile-relatives {
    background-color: #fff;
    color: #232a28;
  }
  html[data-pitvu-theme="light"] #profile-relatives .historical-relative-groups > section {
    --relative-wash: #edf2ed;
    --relative-rule: #b8c7bd;
    --relative-heading: #294137;
    --relative-count: #536659;
    border-block-start-color: var(--relative-rule);
  }
  html[data-pitvu-theme="light"] #profile-relatives .historical-relative-groups > section[data-relative-line="sire"] {
    --relative-wash: #e8f1eb;
    --relative-rule: #739282;
    --relative-heading: #294b3d;
    --relative-count: #496955;
  }
  html[data-pitvu-theme="light"] #profile-relatives .historical-relative-groups > section[data-relative-line="dam"] {
    --relative-wash: #f5eee1;
    --relative-rule: #a68b61;
    --relative-heading: #56472e;
    --relative-count: #705b39;
  }
  html[data-pitvu-theme="light"] #profile-relatives .historical-relative-groups h3 {
    color: var(--relative-heading);
    background-color: var(--relative-wash);
    box-shadow: 0 0 0 6px var(--relative-wash);
  }
  html[data-pitvu-theme="light"] #profile-relatives h3 .fine {
    color: var(--relative-count);
  }
  html[data-pitvu-theme="light"] #profile-relatives li + li {
    box-shadow: inset 0 1px #dce4dd;
  }
  html[data-pitvu-theme="light"] #profile-relatives li a {
    color: #24594a;
  }
  html[data-pitvu-theme="light"] #profile-relatives li:focus-within {
    background-color: #edf3ee;
  }
  html[data-pitvu-theme="light"] #profile-relatives li a:focus-visible {
    color: #173e31;
    outline-color: #36634f;
  }
  @media (hover: hover) {
    html[data-pitvu-theme="light"] #profile-relatives li:hover {
      background-color: #edf3ee;
    }
    html[data-pitvu-theme="light"] #profile-relatives li a:hover {
      color: #173e31;
    }
  }
}
@media screen {
  html body .compact-atlas-zoom {display:contents}
  html body details.compact-coverage {margin-block:8px 0;padding:0;min-width:0}
  html body main details.pedigree-completeness.compact-coverage,
  html[data-pitvu-theme] #source-pedigree details.pedigree-completeness.compact-coverage[data-status] {
    background:transparent !important;border:0 !important;
    border-top:1px solid var(--theme-border,#cbd5cc) !important;border-radius:0;
    margin:8px 0 0;padding:0
  }
  html body .compact-coverage > summary {
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    min-height:44px;box-sizing:border-box;padding:4px 2px;
    list-style:none;cursor:pointer;color:var(--theme-muted,#536159);
    font-size:.875rem;font-weight:600;text-decoration:none
  }
  html body .compact-coverage > summary::-webkit-details-marker {display:none}
  html body .compact-coverage > summary::after {
    content:"";width:7px;height:7px;border:solid currentColor;border-width:0 1.5px 1.5px 0;
    margin-inline-end:4px;transform:rotate(45deg);flex:none
  }
  html body .compact-coverage[open] > summary::after {transform:rotate(225deg)}
  html body .compact-coverage > summary:is(:hover,:focus-visible) {color:var(--theme-link,#24594a)}
  html body .compact-coverage > summary:focus-visible {outline:2px solid currentColor;outline-offset:1px}
  html body .compact-coverage h4 {margin:12px 0 4px}
  html body [data-profile-statistics] > .compact-coverage {border-top:1px solid var(--theme-border,#cbd5cc)}
  html body [data-branch-coverage].compact-coverage {margin-top:4px}
}
@media screen and (max-width:800px) {
  html body main .historical-profile-header.page-head {padding-block:12px 16px !important;margin-block-start:12px !important}
  html body main .historical-profile-header > .back-link {margin-block:0 !important}
  html body main .historical-profile-header .profile-heading-layout {margin:4px 0 12px !important;gap:10px !important}
  html body main .historical-profile-header .profile-heading-layout .historical-profile-title {margin-block:0 !important}
  html body main .historical-profile-title h1 {margin:0 0 5px !important}
  html body main .historical-profile-title .profile-record-meta {margin:0 0 4px !important}
  html body main .historical-profile-title > .eyebrow {margin:0 0 6px !important}
  html body main .historical-profile-title > .archival-labels {margin-block:0 !important}
  html body main .profile-heading-family .historical-parent-card {min-height:0 !important;padding:8px 12px !important;gap:2px !important}
  html body main .profile-heading-family .historical-parent-card > .eyebrow {margin:0 !important}
  html body main .profile-heading-family .historical-parent-card > a {min-height:44px}
  html body main .profile-pedigree .pedigree-parent-rail {margin-block:8px !important}
  html body main .profile-pedigree [data-atlas-controls]:not([hidden]) {
    display:grid !important;grid-template-columns:minmax(122px,1fr) minmax(0,1fr);
    gap:6px 8px !important;align-items:stretch;margin:8px 0 !important;
  }
  html body main .profile-pedigree [data-atlas-controls] .compact-atlas-zoom {
    display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:stretch;
    min-width:0;background:var(--theme-soft);border-radius:6px;
    box-shadow:inset 0 0 0 1px var(--theme-control,#839187)
  }
  html body main .profile-pedigree [data-atlas-controls] > button:not([hidden]),
  html body main .profile-pedigree [data-atlas-controls] [data-zoom] {
    display:flex;align-items:center;justify-content:center;box-sizing:border-box;
    width:100%;min-width:0 !important;min-height:44px !important;margin:0 !important;
    padding:5px 7px !important;line-height:1.2;text-align:center;white-space:normal;border-radius:6px
  }
  html body main .profile-pedigree [data-atlas-controls] .compact-atlas-zoom [data-zoom] {
    border:0 !important;background:transparent !important;color:var(--theme-link);
    font-size:19px !important;padding:0 !important
  }
  html body main .profile-pedigree [data-atlas-controls] .compact-atlas-zoom output {
    display:grid;place-items:center;font-size:13px;line-height:1;min-width:0;
    font-variant-numeric:tabular-nums;color:var(--theme-text);padding:0
  }
  html[data-pitvu-theme] body main .profile-pedigree [data-atlas-controls] button[data-fit] {
    background:#28594c !important;color:#fff !important;border-color:#28594c !important;
    font-weight:700;gap:6px
  }
  html[data-pitvu-theme="dark"] body main .profile-pedigree [data-atlas-controls] button[data-fit] {
    background:#b6d4c4 !important;color:#18382a !important;border-color:#b6d4c4 !important
  }
  html body .profile-pedigree [data-fit]::before {
    content:"";width:14px;height:14px;flex:none;
    background:linear-gradient(currentColor,currentColor) left top/6px 1.5px,
      linear-gradient(currentColor,currentColor) left top/1.5px 6px,
      linear-gradient(currentColor,currentColor) right top/6px 1.5px,
      linear-gradient(currentColor,currentColor) right top/1.5px 6px,
      linear-gradient(currentColor,currentColor) left bottom/6px 1.5px,
      linear-gradient(currentColor,currentColor) left bottom/1.5px 6px,
      linear-gradient(currentColor,currentColor) right bottom/6px 1.5px,
      linear-gradient(currentColor,currentColor) right bottom/1.5px 6px;
    background-repeat:no-repeat
  }
  html body main .profile-pedigree [data-atlas-controls] button:focus-visible {outline:2px solid var(--theme-link);outline-offset:2px}
}

@media screen { #source-pedigree, #coverage {scroll-margin-top:86px} }
