:root {
  color-scheme: light;
  --ink: #282033;
  --muted: #655c71;
  --plum: #352342;
  --accent: #664184;
  --accent-dark: #593575;
  --lavender: #f1eaf6;
  --border: #e9e2ed;
  --line: #bdaacc;
  --paper: #fff;
  --page: #f6f3f8;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, nav:focus-visible {
  outline: 3px solid #965cb7;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p, figure { margin: 0; }
.skip { position: fixed; top: -80px; left: 12px; padding: 12px; background: white; z-index: 10; }
.skip:focus { top: 12px; }

.masthead { background: var(--plum); color: #fff; }
.masthead-inner {
  max-width: 1440px;
  padding: 0 clamp(18px, 4vw, 60px);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 23px;
}
.brand {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 1.42rem var(--serif);
  white-space: nowrap;
}
.brand-mark { position: relative; width: 33px; height: 33px; border: 1px solid #7d688b; border-radius: 9px; color: #f3d9ff; }
.brand-mark i, .brand-mark b, .brand-mark em { position: absolute; display: block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.brand-mark i { left: 13px; top: 7px; }
.brand-mark b { left: 7px; bottom: 7px; }
.brand-mark em { right: 7px; bottom: 7px; }
.brand-mark::before { content: ''; position: absolute; top: 10px; height: 8px; width: 1px; left: 15px; background: currentColor; }
.brand-mark::after { content: ''; position: absolute; top: 16px; left: 9px; width: 13px; height: 5px; border: 1px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.masthead-caption { color: #e0d3e7; border-left: 1px solid #705d7d; padding-left: 23px; font-size: .87rem; }
.header-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  margin-left: auto;
  border: 1px solid #806b8e;
  background: transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .875rem;
}
.header-search:hover { background: #513963; }
.magnifier { position: relative; display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 1.7px solid currentColor; flex: none; }
.magnifier::after { content: ''; position: absolute; width: 6px; height: 1.6px; background: currentColor; right: -5px; bottom: -2px; transform: rotate(45deg); border-radius: 4px; }

.workspace {
  max-width: 1440px;
  padding: 28px clamp(18px, 4vw, 60px) 50px;
  margin: auto;
  display: grid;
  align-items: start;
  grid-template-columns: minmax(255px, 308px) minmax(0, 1fr);
  gap: 25px;
}
.surface { background: var(--paper); border: 1px solid var(--border); border-radius: 17px; box-shadow: 0 4px 16px #37234407; }
.catalog { position: sticky; top: 20px; overflow: hidden; }
.catalog-head { padding: 20px 16px 0; }
.catalog-title { display: flex; align-items: center; gap: 10px; padding: 0 3px; margin-bottom: 17px; }
.catalog-title h2 { font: 1.68rem var(--serif); }
.total { color: var(--accent-dark); background: var(--lavender); border-radius: 20px; padding: 4px 9px; font-size: .82rem; font-weight: 650; }
.total:empty { display: none; }
.search-box { display: flex; align-items: center; gap: 12px; position: relative; border: 1px solid #e5dce9; background: #faf8fb; border-radius: 9px; color: var(--muted); padding: 0 10px 0 13px; }
.search-box:focus-within { border-color: #895fa4; outline: 2px solid #eadcf4; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; padding: 11px 0; color: var(--ink); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box button { flex: none; width: 26px; height: 29px; padding: 0; border: 0; border-radius: 5px; color: var(--accent-dark); background: transparent; font-size: 1.25rem; }
.search-box button:hover { background: var(--lavender); }
.catalog-label { display: flex; align-items: center; justify-content: space-between; padding: 17px 4px 11px; font-size: .79rem; color: var(--muted); }
#people { max-height: max(260px, calc(100dvh - 300px)); overflow: auto; overscroll-behavior: contain; padding: 4px 9px 11px; border-top: 1px solid var(--border); scrollbar-color: #d5c7df transparent; }
.person-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
}
.person-link:hover { background: #f8f4fa; }
.person-link[aria-current] { border-color: #e6d6ef; background: var(--lavender); color: var(--accent-dark); }
.person-link .person-name { font-size: .9rem; font-weight: 630; }
.person-name, .period { display: block; overflow-wrap: anywhere; }
.period { font-size: .81rem; color: var(--muted); margin-top: 3px; }
.avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 50%; overflow: hidden; background: #efe6f4; color: var(--accent-dark); font-size: .73rem; font-weight: 700; flex: none; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.empty-results { padding: 16px 10px 22px; font-size: .9rem; line-height: 1.5; color: var(--muted); }

.profile { min-width: 0; scroll-margin-top: 12px; display: grid; gap: 20px; outline: none; }
.profile:focus-visible { outline: 3px solid #965cb7; outline-offset: 5px; border-radius: 17px; }
.message, .copy-section { padding: 26px; }
.hero {
  display: grid;
  grid-template-columns: 152px minmax(0, 1fr);
  align-items: center;
  gap: 27px;
  padding: 25px;
  background: radial-gradient(ellipse at 98% 8%, #f4edf8 1%, #fff0 52%), var(--paper);
}
.portrait { display: grid; position: relative; padding: 0; overflow: hidden; border: 1px solid #e0d3e8; border-radius: 13px; background: #f2ebf6; aspect-ratio: 152/165; }
.portrait .avatar { width: 100%; height: 100%; border-radius: 0; font: 2.6rem var(--serif); }
.portrait img { object-position: center 33%; }
.portrait-badge { position: absolute; left: 8px; bottom: 8px; background: #2c1d35eb; color: #fff; padding: 4px 8px; border-radius: 6px; font-size: .76rem; font-weight: 600; }
.hero h1:focus-visible { outline: 2px solid #965cb7; outline-offset: 5px; border-radius: 4px; }
.hero h1 { font: clamp(1.9rem, 3.2vw, 3rem)/1.03 var(--serif); letter-spacing: -.035em; max-width: 19ch; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 17px 0 0; }
.facts div { border-left: 2px solid #dacbe4; padding-left: 9px; }
.facts dt { font-size: .78rem; color: var(--muted); }
.facts dd { font-size: .9rem; margin: 3px 0 0; font-weight: 600; }
.hero-note { margin-top: 15px; color: var(--muted); font-size: .9rem; }

.tree { overflow: hidden; }
.section-head { padding: 22px 24px 17px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 15px; }
.section-head h2, .copy-section h2 { font: 1.65rem var(--serif); }
.section-head > span { color: var(--muted); font-size: .84rem; }
.chart-scroll { margin: 0 16px 16px; overflow: auto; border: 1px solid #eee6f3; border-radius: 12px; background: #faf7fc; scrollbar-color: #d5c7df transparent; }
.chart-scroll:focus-visible { outline: 3px solid #965cb7; outline-offset: 2px; }
.chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  min-width: 100%;
  padding: 21px 13px;
  background-image: radial-gradient(#e7dcea 1px, transparent 1px);
  background-size: 13px 13px;
}
.branch-level { display: flex; align-items: stretch; justify-content: center; position: relative; }
.branch-item { position: relative; width: clamp(134px, 15vw, 210px); padding-inline: 5px; }
.branch-level > .branch-item::before, .branch-level > .branch-item::after { content: ''; position: absolute; width: 50%; height: 10px; border-color: var(--line); border-style: solid; border-width: 0; }
.branch-level.children .branch-item { padding-bottom: 10px; }
.branch-level.children .branch-item::before { left: 0; bottom: 0; border-bottom-width: 1px; border-right-width: 1px; }
.branch-level.children .branch-item::after { right: 0; bottom: 0; border-bottom-width: 1px; }
.branch-level.parents .branch-item { padding-top: 10px; }
.branch-level.parents .branch-item::before { left: 0; top: 0; border-top-width: 1px; border-right-width: 1px; }
.branch-level.parents .branch-item::after { right: 0; top: 0; border-top-width: 1px; }
.branch-level .branch-item:first-child::before { border-bottom-width: 0; border-top-width: 0; }
.branch-level .branch-item:last-child::after { border: 0; }
.stem { height: 15px; width: 1px; background: var(--line); }
.node {
  display: flex;
  min-height: 74px;
  height: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid #e7ddeb;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 4px #3523420b;
}
a.node:hover { border-color: #a880bf; background: #fcfaff; }
.node .avatar { width: 33px; height: 33px; }
.node .person-name { font-size: .86rem; font-weight: 650; line-height: 1.25; }
.node-role { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 4px; }
.center-node { width: clamp(150px, 18vw, 222px); background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.center-node .node-role { color: #f0e4f8; }
.and-more { padding: 0 17px 17px; }
.rel-group { border-top: 1px solid var(--border); padding: 15px 4px 0; }
.rel-group + .rel-group { margin-top: 14px; }
.rel-group h3 { font-size: .92rem; margin: 0 3px 9px; }
.rel-items { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.rel-items .node { min-height: 62px; }
.secondary { color: var(--muted); font-size: .87rem; line-height: 1.5; }
.copy-section h2 { margin-bottom: 13px; }
.copy-section p { line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-section ul { margin: 0; padding-left: 20px; }
.copy-section li + li { margin-top: 10px; }
.copy-section small { color: var(--muted); white-space: pre-wrap; }

dialog { width: min(760px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); background: #fdfbfe; color: var(--ink); border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
dialog::backdrop { background: #21162ac4; }
.gallery-top, .gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gallery-top h2 { font: 1.45rem var(--serif); }
.gallery-close, .gallery-controls button { border: 1px solid #e3d7e9; color: var(--accent-dark); background: #f5edf9; border-radius: 7px; padding: 7px 9px; }
.gallery-close { font-size: 1.4rem; width: 38px; padding: 2px; }
.gallery-controls button:disabled { opacity: .45; cursor: default; }
.gallery-controls button:not(:disabled):hover, .gallery-close:hover { background: #eadcf1; }
dialog figure { margin: 12px 0; }
dialog img { display: block; width: 100%; height: min(58dvh, 540px); object-fit: contain; border-radius: 9px; background: #eee7f0; }
dialog figcaption { padding: 10px 3px 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
#photo-position { font-size: .85rem; color: var(--muted); }

@media (max-width: 950px) {
  .workspace { grid-template-columns: 235px minmax(0, 1fr); gap: 15px; }
  .hero { grid-template-columns: 125px minmax(0, 1fr); gap: 18px; padding: 20px; }
}
@media (max-width: 730px) {
  .masthead-inner { min-height: 65px; }
  .masthead-caption { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); padding-top: 14px; }
  .catalog { position: static; }
  #people { max-height: 186px; }
}
@media (max-width: 470px) {
  .brand { font-size: 1.14rem; gap: 7px; }
  .header-search { font-size: .78rem; padding: 7px 8px; gap: 8px; }
  .header-search .magnifier { display: none; }
  .workspace { padding-inline: 11px; }
  .masthead-inner { padding-inline: 13px; gap: 8px; }
  .hero { grid-template-columns: 86px minmax(0, 1fr); gap: 13px; padding: 13px; align-items: start; }
  .hero h1 { font-size: 1.62rem; }
  .facts { margin-top: 12px; }
  .hero .portrait { margin-top: 2px; }
  .section-head, .copy-section { padding-inline: 14px; }
  .chart-scroll { margin-inline: 8px; }
  .chart { padding-inline: 6px; }
  .branch-item { width: 137px; }
  .node { padding-inline: 6px; gap: 6px; }
  .node .avatar { width: 27px; height: 27px; }
  .node .person-name { font-size: .82rem; }
}

.header-controls { display: flex; gap: 9px; align-items: center; margin-left: auto; }
.header-controls .header-search { margin: 0; white-space: nowrap; text-decoration: none; }
#tree-view { background: #f2e8fa; color: var(--plum); font-weight: 650; border-color: transparent; }
#tree-view:hover { background: #fff; }
#tree-view.tree-mode { background: transparent; border-color: #806b8e; color: #fff; }
#tree-view.tree-mode:hover { background: #513963; }

.overview { min-width: 0; padding: 23px 16px 16px; }
.overview-head { display: flex; gap: 7px 16px; flex-wrap: wrap; align-items: baseline; padding: 0 7px; }
.overview h1 { font: 2.1rem/1.16 var(--serif); }
.overview h1:focus-visible, .overview-viewport:focus-visible { outline: 2px solid #965cb7; outline-offset: 3px; }
.overview-tools, .overview-legend, .overview-zoom { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.overview-tools { margin: 14px 6px 10px; }
.overview-button {
  padding: 7px 10px;
  color: var(--accent-dark);
  background: #faf7fc;
  border: 1px solid #e0d2e8;
  border-radius: 7px;
  font-size: .875rem;
  min-height: 36px;
}
.overview-button:hover:not(:disabled) { background: var(--lavender); }
.overview-button:disabled { opacity: .55; cursor: default; }
.overview-zoom .overview-button { min-width: 36px; font-size: 1.05rem; padding: 4px; }
.overview-scale { min-width: 53px; text-align: center; font-size: .86rem; font-variant-numeric: tabular-nums; }
.overview-legend { column-gap: 16px; margin: 0 6px 10px; font-size: .8rem; color: var(--muted); }
.overview-key { display: inline-flex; align-items: center; gap: 6px; }
.overview-key::before { content: ''; width: 18px; border-top: 2px solid #59545b; }
.overview-key.marriage::before { border-top: 2px solid #5d4b68; }
.overview-key.divorce::before { border-top: 2px dotted #a34860; }
.overview-key.sibling::before { border-top: 2px dashed #4b6b85; }
.overview-viewport, .light-branch-viewport { touch-action: pan-x pan-y; }

.overview-viewport {
  overflow: auto;
  isolation: isolate;
  overscroll-behavior: contain;
  height: clamp(360px, 66dvh, 870px);
  border: 1px solid #eee6f3;
  border-radius: 11px;
  background: #f6f3f7;
  scrollbar-color: #cbb9d7 transparent;
  cursor: grab;
}
.overview-viewport.dragging, .overview-viewport.dragging .overview-node { cursor: grabbing; user-select: none; }
.overview-frame { position: relative; overflow: hidden; }
.overview-scene { position: absolute; top: 0; left: 0; transform-origin: top left; }
.overview-band { position: absolute; left: 0; width: 100%; background: #fff; pointer-events: none; }
.overview-band.shaded { background: #fcf4e6; }
.overview-edges { position: absolute; inset: 0; pointer-events: none; }
.overview-node {
  position: absolute;
  min-height: 0;
  gap: 6px;
  padding: 5px 6px;
  cursor: pointer;
}
.tree-card-name-line { display: block; }
.overview-node .tree-card-name { font-size: .8rem; line-height: 1.12; }
.overview-node .avatar { width: 31px; height: 46px; border-radius: 5px; }
.overview-node[data-sex="M"] { background: #e4f3fb; border-color: #8facbf; }
.overview-node[data-sex="F"] { background: #fff0cf; border-color: #c4aa72; }
.overview-node[data-sex="M"]:hover { background: #d1eaf8; border-color: #537f9c; }
.overview-node[data-sex="F"]:hover { background: #fce5b6; border-color: #947a43; }
.overview-node.overview-selected, .overview-node.overview-selected:hover {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.overview-node-text { display: grid; min-width: 0; gap: 1px; }
.tree-card-dates, .tree-card-role, .tree-card-place {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: .67rem;
  line-height: 1.14;
}
.tree-card-dates { font-size: .625rem; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.tree-card-role {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 650;
}
.overview-selected :is(.tree-card-dates, .tree-card-role, .tree-card-place) { color: #f5eaf9; }
.mourning-ribbon {
  position: absolute;
  inset: 0 auto auto 0;
  width: 23px;
  height: 23px;
  background: linear-gradient(135deg, transparent 28%, #161616 28% 42%, #fff 42% 46%, #161616 46% 53%, transparent 53%);
  border-start-start-radius: inherit;
  pointer-events: none;
}
.overview-block-label {
  position: absolute;
  transform: translateX(-50%);
  padding: 4px 9px;
  white-space: nowrap;
  border-radius: 6px;
  background: #f3ebf8;
  color: var(--accent-dark);
  font-size: .84rem;
  font-weight: 600;
  pointer-events: none;
}

@media (max-width: 1010px) {
  .masthead-caption { display: none; }
}
@media (max-width: 560px) {
  #find-person { display: none; }
  .overview { padding: 16px 8px 8px; }
  .overview-viewport { height: 58dvh; min-height: 330px; }
}

.tree-page { display: flex; flex-direction: column; height: 100dvh; }
.tree-page .masthead { flex: none; }
.tree-page .masthead-inner { max-width: none; padding-inline: clamp(13px, 2vw, 30px); }
.workspace.tree-wide {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  max-width: none;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 16px clamp(7px, 1.4vw, 22px) 10px;
}
.tree-wide .profile, .tree-wide .overview { display: flex; flex: 1; flex-direction: column; }
.tree-wide .catalog { display: none; }
.tree-wide .overview-viewport { flex: 1; height: 0; min-height: 270px; }
.overview-fit-tip { display: none; }
.is-fitted .overview-fit-tip { display: inline; }
.is-fitted .overview-node {
  background: #e9def0;
  border-color: #a58bb6;
  box-shadow: none;
}
.is-fitted .overview-node[data-sex="M"] { background: #bce1f5; border-color: #8facbf; }
.is-fitted .overview-node[data-sex="F"] { background: #f6d893; border-color: #c4aa72; }
.is-fitted .overview-node:hover, .is-fitted .overview-node:focus-visible { background: #c4a9d7; border-color: #664184; }
.is-fitted .overview-node.overview-selected { background: #593575; border-color: #593575; }
.is-fitted .overview-node .avatar, .is-fitted .overview-node-text { opacity: 0; }
.is-fitted .overview-hovered::after,
.overview-hovered.overview-name-clipped::after {
  content: attr(data-name);
  position: absolute;
  z-index: 1;
  inset: auto auto 100% 50%;
  transform: translateX(-50%);
  transform-origin: bottom center;
  width: max-content;
  max-width: min(270px, 75vw);
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 12px #1521392e;
  pointer-events: none;
  font: 650 .82rem/1.25 var(--sans);
}
.is-fitted .overview-hovered::after { transform: translateX(-50%) var(--label-scale); }
.is-fitted .overview-block-label { visibility: hidden; }
#close-catalog { display: none; }
.tree-wide.tree-search-open .catalog {
  display: block;
  position: fixed;
  z-index: 6;
  top: 76px;
  right: clamp(8px, 2vw, 30px);
  width: min(340px, calc(100vw - 16px));
  box-shadow: 0 10px 42px #30213c47;
}
.tree-search-open #close-catalog {
  display: block;
  margin-left: auto;
  background: var(--lavender);
  border: 0;
  border-radius: 6px;
  color: var(--accent-dark);
  width: 34px;
  height: 34px;
  font-size: 1.3rem;
}
.tree-search-open #people { max-height: min(450px, calc(100dvh - 257px)); }

.person-drawer {
  position: fixed;
  z-index: 12;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(430px, 100vw);
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid var(--border);
  background: var(--page);
  color: var(--ink);
  box-shadow: -12px 0 40px #30213c29;
}
.person-drawer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 650;
}
#close-person-drawer {
  color: var(--accent-dark);
  background: var(--lavender);
  border: 0;
  border-radius: 9px;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  line-height: 1;
}
.person-drawer-content { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px; }
.person-drawer-content > * + * { margin-top: 12px; }
.person-drawer .hero {
  grid-template-columns: clamp(64px, 24vw, 100px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 16px;
  background: var(--paper);
  text-align: start;
}
.person-drawer .hero h2 { font: 700 1.38rem/1.12 var(--serif); overflow-wrap: anywhere; }
.drawer-kinship { margin-top: 6px; color: var(--accent-dark); font-size: .86rem; font-weight: 650; overflow-wrap: anywhere; }
.drawer-rebuild { display: block; padding: 12px 16px; border: 1px solid var(--border); border-radius: 11px; background: var(--lavender); color: var(--accent-dark); font-weight: 650; text-align: center; text-decoration: none; }
.drawer-rebuild:hover { filter: brightness(.97); }
.drawer-kinship-details summary { cursor: pointer; font-weight: 650; }
.drawer-kinship-details ul { margin-top: 10px; font-size: .88rem; }
.person-drawer .portrait { width: 100%; }
.person-drawer .portrait-badge { left: 4px; bottom: 4px; padding: 3px 5px; }
.person-drawer .facts { margin-top: 12px; overflow-wrap: anywhere; }
.person-drawer .copy-section { padding: 16px; overflow-wrap: anywhere; }
.person-drawer .copy-section h2 { font-size: 1.22rem; }
.drawer-relatives { padding: 16px; }
.drawer-relatives h2 { margin-bottom: 12px; font: 700 1.22rem/1.2 var(--serif); }
.drawer-relatives .rel-group { padding-inline: 0; }
.drawer-relatives .rel-group h3 { color: var(--muted); margin-inline: 0; }
.drawer-relatives .rel-items { grid-template-columns: 1fr; }
.drawer-relatives .node { min-height: 52px; border-color: var(--border); }
.drawer-relatives a.node:hover { background: var(--lavender); border-color: var(--line); }

.overview-node.overview-hovered, .light-person.light-person-hovered {
  outline: 2px solid #11b8ff;
  outline-offset: 0;
  box-shadow: 0 0 5px #b5f7ff, 0 0 19px #0798ffe0, 0 0 33px #427cfd66;
  z-index: 2;
}

@media (max-width: 560px) {
  .tree-page #find-person { display: inline-flex; padding-inline: 10px; min-width: 34px; }
  .tree-page #find-person .magnifier { display: inline-block; }
  .tree-page #find-person span { display: none; }
}


html.tree-fullscreen-open, html.tree-fullscreen-open body {
  overflow: hidden;
}
.tree-fullscreen-open :is(.masthead, .light-title, .skip) {
  visibility: hidden;
}
.overview.tree-fullscreen, .light-branch.tree-fullscreen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  z-index: 11;
  margin: 0;
  padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: var(--paper);
  border: 0;
  border-radius: 0;
}
.overview.tree-fullscreen .overview-head { display: none; }
.overview.tree-fullscreen .overview-tools { margin: 4px 6px 6px; }
.overview.tree-fullscreen .overview-legend { margin-bottom: 5px; }
.tree-fullscreen :is(.overview-viewport, .light-branch-viewport) {
  flex: 1;
  height: 0;
  min-height: 0;
}
.tree-fullscreen > .light-zoom { flex: none; margin: 6px auto 0; }

.archive-gate { width: min(460px, calc(100% - 32px)); margin: 10vh auto 24px; padding: clamp(18px, 5vw, 34px); }
.archive-gate h1, .archive-manager h2 { margin-bottom: 16px; }
.archive-form { display: grid; gap: 10px; margin-block: 10px; }
.archive-form label { display: grid; gap: 5px; font-size: .9rem; }
.archive-form input, .archive-form textarea, .archive-form select, .archive-manager input, .archive-manager textarea {
  box-sizing: border-box; width: 100%; padding: 9px; border: 1px solid var(--border);
  background: var(--paper); color: var(--ink); border-radius: 8px; font: inherit;
}
.archive-form textarea, .archive-manager textarea { resize: vertical; }
.archive-form button, .archive-manager button {
  width: fit-content; border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px;
  background: var(--lavender); color: var(--accent-dark); font: inherit;
}
.archive-manager button { margin: 4px; }
.archive-feedback:empty { display: none; }
.archive-section article, .archive-manager article { border-bottom: 1px solid var(--border); padding: 8px 0; }
.archive-manager { width: min(760px, calc(100% - 22px)); max-height: 90dvh; padding: 20px; color: var(--ink); background: var(--paper); }
.archive-manager::backdrop { background: #10182885; }
.archive-manager h3 { margin: 14px 0 5px; }
.archive-manager p { overflow-wrap: anywhere; white-space: pre-wrap; }
.archive-header-button { color: inherit; }
.light-design .archive-header-button:hover { background: var(--lavender); }
.header-controls { flex-wrap: wrap; }

.event-scans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin-top: 16px;
}
.event-scans figure { margin: 0; min-width: 0; }
.event-scans img { display: block; width: 100%; max-height: 480px; object-fit: contain; background: #fff; }
.event-scans span { display: block; margin-top: 8px; }
