/* Iridescent Edge: a white field of names in generation bands; colour only in the spectral fringe and the active violet.
   Deliberately single-theme (cloud white): the world is the light. */
@font-face { font-family: "Albert Sans"; font-style: italic; font-weight: 300; font-display: swap; src: url("fonts/albert-sans-300-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 200; font-display: swap; src: url("fonts/albert-sans-200.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/albert-sans-300.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/albert-sans-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ground: #FAFBFC;
  --band: #F2F4F7;
  --ink: #1F2630;
  --body: #3E4652;
  --slate: #4A5361;
  --muted: #5F6875;
  --hair: #D5DAE1;
  --mint: #9FE3C9;
  --rose: #F4A9C0;
  --violet: #9D8CF2;
  --violet-ink: #5B47D6;
  --danger: #B4233F;
  --spec: linear-gradient(90deg, var(--mint), var(--rose), var(--violet));
  --font: "Albert Sans", "Segoe UI", system-ui, sans-serif;
  --drawer: min(640px, 100vw);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ground); color: var(--slate); font: 300 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in oklab, var(--violet) 28%, white); color: var(--ink); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--hair) transparent; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
h1, h2 { margin: 0; font-weight: 200; text-wrap: balance; }
.label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 400; }

.link { color: var(--slate); border-bottom: 1px solid #C2C8D0; padding-bottom: 2px; transition: color .2s, border-color .2s; }
.link:hover { color: var(--ink); border-color: var(--slate); }
.link.on { color: var(--violet-ink); border-bottom: 1.5px solid var(--violet); font-weight: 400; }
.link.danger { color: var(--danger); border-color: #EBC3CC; }

/* ---------- stage ---------- */
.stage {
  min-height: 100vh; display: flex; flex-direction: column;
  padding-inline: max(24px, 5.5vw); transition: padding-right .55s var(--ease);
}
body.record-open .stage { padding-right: calc(var(--drawer) + 40px); }

.topbar { display: grid; grid-template-columns: 1fr minmax(240px, 440px) 1fr; align-items: end; gap: 32px; padding-block: 36px 24px; }
.brand { font-size: 15px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink); font-weight: 400; }
.brand-name { letter-spacing: inherit; text-transform: inherit; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.brand-name:hover { border-bottom-color: var(--violet); color: var(--violet-ink); }
.brand input { font: inherit; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); width: min(260px, 100%); border: 0; border-bottom: 1.5px solid var(--violet); background: transparent; outline: none; padding: 0 0 3px; box-shadow: 0 6px 10px -8px rgba(157,140,242,.6); }
.brand small { display: block; letter-spacing: .02em; text-transform: none; font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 300; }
.search { position: relative; }
.search label { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 400; }
.search input { width: 100%; border: 0; border-bottom: 1px solid var(--slate); background: transparent; font-size: 20px; color: var(--ink); padding: 4px 0 8px; outline: none; }
.search input:focus { border-bottom-color: var(--violet); box-shadow: 0 8px 12px -10px rgba(157,140,242,.7); }
.search input::placeholder { color: var(--muted); }
#results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; margin: 0; padding: 8px 0; list-style: none;
  background: var(--ground); max-height: 360px; overflow-y: auto;
  box-shadow: 0 2px 4px rgba(31,38,48,.04), 0 16px 40px -12px rgba(31,38,48,.18);
}
#results li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 16px; cursor: pointer; color: var(--ink); }
#results li small { color: var(--muted); font-size: 13px; }
#results li[aria-selected="true"], #results li:hover { background: var(--band); }
#results .none { color: var(--muted); cursor: default; }
.top-actions { white-space: nowrap; display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: flex-end; font-size: 14px; padding-bottom: 10px; }

/* ---------- trail: where you have been ---------- */
.trail { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; font-size: 14px; color: var(--muted); padding-block: 0 8px; }
.trail .back { color: var(--violet-ink); border-bottom: 1.5px solid var(--violet); font-weight: 400; margin-right: 12px; }
.trail .path { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: baseline; }
.trail .path button { color: var(--slate); border-bottom: 1px solid transparent; }
.trail .path button:hover { color: var(--ink); border-color: var(--slate); }
.trail .path .sep { margin-inline: 10px; color: #A3AAB4; }
.trail .path [aria-current] { color: var(--ink); font-weight: 400; cursor: default; }
.trail .home-link { margin-left: auto; }

/* ---------- tree ---------- */
.tree { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; padding-block: 8px 24px; }
.links { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.links .rel { fill: none; stroke: var(--slate); stroke-width: 1; opacity: .45; stroke-linejoin: miter; shape-rendering: crispEdges; }
.links .rel.spouse { opacity: .6; }
.band { display: grid; grid-template-columns: 150px 1fr; align-items: center; padding-block: 22px; position: relative; }
.band.shaded::before { content: ""; position: absolute; inset: 0 calc(-1 * max(24px, 5.5vw)); background: var(--band); opacity: .55; z-index: -1; }
.band.shaded .gen { background: #F6F7F9; } /* band tint composited over the ground */
/* whole-family view: every generation, scrolls sideways when wide */
.tree.overview { justify-content: flex-start; }
.viewport { position: relative; overflow: hidden; cursor: grab; touch-action: pan-y; }
.viewport.dragging { cursor: grabbing; user-select: none; }
.canvas { position: relative; display: inline-block; min-width: 100%; transform-origin: 0 0; transition: transform .25s var(--ease); }
.viewport.dragging .canvas { transition: none; }
.tree.overview .band { width: max-content; min-width: 100%; padding-block: 18px; }
.tree.overview .row { flex-wrap: nowrap; gap: 18px 36px; }
.tree.overview .person .nm { font-size: 19px; }
.tree.overview .person.is-focus .nm { color: var(--violet-ink); font-weight: 400; }
.overview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-bottom: 8px; }
.zoom { display: flex; align-items: center; gap: 6px; flex: none; }
.zoom button { min-width: 36px; height: 32px; padding: 0 10px; border: 1px solid var(--hair); border-radius: 999px; color: var(--slate); font-size: 16px; line-height: 1; background: var(--ground); transition: color .2s, border-color .2s; }
.zoom button.fit { font-size: 13px; }
.zoom button:hover { color: var(--violet-ink); border-color: var(--violet); }
.zoom .pct { min-width: 44px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.overview-head h1 { font-size: 32px; color: var(--ink); }
.overview-head p { margin: 0; font-size: 14px; color: var(--muted); }
.backup-note { margin: 0 0 6px; font-size: 13px; color: var(--body); }
.import-box { display: grid; gap: 18px; margin-top: 24px; font-size: 15px; color: var(--body); }
.import-box ul { margin: 0; padding-left: 18px; line-height: 1.7; }
.import-box .errs { color: var(--danger); font-size: 14px; max-height: 320px; overflow-y: auto; }
.import-box .ok { color: var(--violet-ink); }
.import-box .row-btns { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: baseline; font-size: 15px; }
.removed-note { margin: 0 0 6px; font-size: 13px; color: var(--body); }
.archived-list { display: grid; gap: 4px; margin-top: 28px; }
.archived-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.archived-row .who { font-size: 19px; color: var(--ink); }
.archived-row .who small { display: block; font-size: 13px; color: var(--muted); }
.archived-row .acts { display: flex; gap: 22px; font-size: 14px; }
.person .root-tag, .root-mark { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--violet-ink); font-weight: 400; }
.focus .root-mark { margin-top: 8px; }
.whisper .undo { margin-left: 12px; color: var(--violet-ink); border-bottom: 1.5px solid var(--violet); font-weight: 400; }
.band.home::after {
  content: ""; position: absolute; inset: -40px 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 34% 60% at 52% 42%, rgba(244,169,192,.16), rgba(157,140,242,.08) 50%, rgba(250,251,252,0) 78%);
}
.gen { position: relative; z-index: 1; justify-self: start; padding-right: 10px; background: var(--ground); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.gen b { display: block; font-weight: 200; font-size: 30px; letter-spacing: 0; color: #6E7684; margin-bottom: 2px; }
.row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 20px clamp(32px, 4vw, 72px); }
.cluster { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 20px clamp(28px, 3vw, 56px); }

.person { position: relative; display: grid; gap: 4px; color: var(--ink); white-space: nowrap; padding-bottom: 10px; }
.person .nm { font-size: 28px; font-weight: 300; line-height: 1.1; transition: color .2s; }
.band.far .person .nm { font-size: 22px; }
.person .meta { font-size: 13px; color: var(--muted); letter-spacing: .01em; }
.person::after {
  content: ""; position: absolute; left: 0; right: calc((1 - var(--k)) * 45%); bottom: 0; height: calc(1px + var(--k) * 3px); border-radius: 2px;
  background: var(--spec); opacity: calc(.08 + var(--k) * var(--k) * .92); transition: opacity .3s, filter .3s;
  box-shadow: 0 1px calc(var(--k) * 10px) rgba(157,140,242,calc(var(--k) * .45));
}
.person:hover .nm { color: var(--violet-ink); }
.person:hover::after { opacity: 1; filter: drop-shadow(0 0 4px rgba(157,140,242,.6)); }
.person.forming .nm { color: var(--muted); }
.person.forming::after { background: none; border-bottom: 1px dashed #BCC2CB; height: 0; opacity: 1; }
.person .tag { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.person.deceased .nm::after { content: " †"; font-size: .6em; color: var(--muted); vertical-align: super; }
.ghost { color: var(--muted); font-size: 18px; border-bottom: 1px dashed #BCC2CB; padding-bottom: 6px; }
.ghost:hover { color: var(--violet-ink); border-color: var(--violet); }

/* the selected person */
.band.home { --h1: clamp(44px, 5.2vw, 78px); }
.band.home .row > .cluster { padding-top: calc(var(--h1) * .5 - 18px); }
.couple { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 20px clamp(28px, 3vw, 56px); }
.couple > .cluster { padding-top: calc(var(--h1) * .5 - 18px); flex-wrap: nowrap; }
.focus { display: grid; justify-items: start; gap: 0; max-width: 560px; }
.focus .only-narrow { display: none; }
.focus h1 { font-size: var(--h1); line-height: 1; letter-spacing: -.01em; color: var(--ink); }
.focus h1 i { font-style: normal; font-size: .3em; color: var(--muted); font-weight: 300; margin-left: 14px; vertical-align: middle; }
.focus .arc { width: 0; min-width: 100%; height: 34px; margin-top: 6px; overflow: visible; }
.focus .arc path { fill: none; stroke: url(#spec); }
.focus .arc .glow { stroke-width: 10; filter: url(#glow); opacity: calc(.15 + var(--k) * .6); }
.focus .arc .line { stroke-width: calc(1px + var(--k) * 2px); stroke-dasharray: 1; stroke-dashoffset: 0; animation: draw 1.1s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 1; } }
.summary { margin-top: 10px; display: grid; gap: 2px; font-size: 17px; line-height: 1.7; color: var(--body); }
.summary .k { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-right: 10px; font-weight: 400; }
.miss { font-style: italic; color: #6B7482; border-bottom: 1px dashed var(--rose); }
.actions { display: flex; flex-wrap: wrap; gap: 14px 30px; margin-top: 16px; font-size: 15px; align-items: baseline; }
.add-menu { display: inline-flex; gap: 18px; font-size: 14px; color: var(--muted); }

.empty { margin: auto; max-width: 520px; text-align: left; }
.empty h1 { font-size: 56px; color: var(--ink); }
.empty p { color: var(--muted); }

.foot { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding-block: 16px 36px; }
.sample { margin: 0 0 6px; font-size: 13px; color: var(--body); }
.notes { display: grid; gap: 4px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); max-width: 420px; line-height: 1.6; }
.legend { width: 280px; font-size: 12px; color: var(--muted); letter-spacing: .02em; flex: none; }
.legend .bar { height: 3px; border-radius: 2px; background: linear-gradient(90deg, #E4E7EB, var(--mint) 35%, var(--rose) 65%, var(--violet)); margin: 8px 0 6px; }
.legend .ends { display: flex; justify-content: space-between; }

/* ---------- record: rolls out from the right ---------- */
.record {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--drawer); z-index: 30; overflow-y: auto;
  background: var(--ground); padding: 40px 56px 64px;
  border-left: 1px solid var(--hair);
  box-shadow: -24px 0 48px -36px rgba(31,38,48,.25);
  animation: roll .6s var(--ease) both;
}
@keyframes roll { from { clip-path: inset(0 0 0 100%); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.record.closing { animation: unroll .35s ease-in both; }
@keyframes unroll { to { clip-path: inset(0 0 0 100%); opacity: .4; } }
.record .top { display: flex; justify-content: flex-end; font-size: 14px; }
.head { display: flex; gap: 26px; align-items: center; margin-top: 20px; }
.photo {
  width: 108px; height: 108px; border-radius: 50%; flex: none; display: grid; place-items: center; text-align: center;
  font-size: 13px; color: var(--muted); line-height: 1.3; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #fff 0 55%, rgba(244,169,192,.1) 72%, transparent 74%);
}
.photo::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 2px; z-index: 1; pointer-events: none;
  background: conic-gradient(var(--mint), var(--rose), var(--violet), var(--mint));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: calc(.25 + var(--k) * .6);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo span { border-bottom: 1px dashed var(--rose); }
.photo:hover span { color: var(--violet-ink); }
.record h2 { font-size: clamp(36px, 4vw, 52px); line-height: 1.05; color: var(--ink); overflow-wrap: anywhere; }
.record h2 i { font-style: normal; font-size: .4em; color: var(--muted); margin-left: 10px; font-weight: 300; }
.fringe { height: 3px; width: 100%; max-width: 360px; margin-top: 14px; border-radius: 2px; background: var(--spec); opacity: calc(.2 + var(--k) * .8); box-shadow: 0 2px 14px rgba(157,140,242,.4); }
.sub { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.sub b { font-weight: 400; color: var(--violet-ink); }

.sections { display: grid; grid-template-columns: 1fr; gap: 32px; margin-top: 36px; }
.sec > .label { display: block; margin-bottom: 8px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.fields.one { grid-template-columns: 1fr; }
.fields.one .field { grid-template-columns: 104px 1fr; gap: 12px; align-items: baseline; }
.field { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; align-content: start; font-size: 17px; color: var(--body); min-width: 0; }
.field .k { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.val { justify-self: start; max-width: 100%; overflow-wrap: anywhere; border-bottom: 1px solid transparent; transition: border-color .2s, color .2s; }
.val:hover { border-bottom-color: var(--violet); color: var(--ink); }
.val.miss:hover { color: var(--violet-ink); }
.field input, .field select, .new input {
  width: 100%; min-width: 0; border: 0; border-bottom: 1.5px solid var(--violet); background: transparent; font-size: 17px; color: var(--ink);
  padding: 0 0 4px; outline: none; border-radius: 0; box-shadow: 0 6px 10px -8px rgba(157,140,242,.6);
}
.field .help { font-size: 12px; color: var(--muted); }
.field .help.err { color: var(--danger); }
.field.custom-edit { grid-column: 1 / -1; grid-template-columns: 1fr 1.4fr auto; gap: 16px; align-items: end; }
.field.custom-edit .help { grid-column: 1 / -1; }
.x { color: var(--muted); font-size: 13px; }
.x:hover { color: var(--danger); }
.add { font-size: 14px; color: var(--slate); border-bottom: 1px solid #C2C8D0; padding-bottom: 1px; justify-self: start; }
.add:hover { color: var(--violet-ink); border-color: var(--violet); }
.add:disabled, .link:disabled { opacity: .45; cursor: not-allowed; }
.add:disabled:hover, .link:disabled:hover { color: var(--slate); border-color: #C2C8D0; }
.hint-inline { font-size: 13px; color: var(--muted); font-style: italic; }
.new select { width: 100%; border: 0; border-bottom: 1.5px solid var(--violet); background: transparent; font: 300 17px var(--font); color: var(--ink); padding: 0 0 4px; outline: none; }
.rel-link { color: var(--ink); border-bottom: 1px solid #C2C8D0; }
.rel-link:hover { color: var(--violet-ink); border-color: var(--violet); }
.rec-foot { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px 28px; font-size: 14px; align-items: baseline; }
.confirm { margin-top: 20px; font-size: 15px; color: var(--body); display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--hair); }
.confirm div { display: flex; gap: 28px; font-size: 14px; }

.new { display: grid; gap: 20px; margin-top: 32px; max-width: 420px; }
.new label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.new .row-btns { display: flex; gap: 28px; align-items: baseline; font-size: 15px; }
.new .err { color: var(--danger); font-size: 13px; margin: 0; }

.whisper {
  position: fixed; left: max(24px, 5.5vw); bottom: 24px; z-index: 40; font-size: 13px; color: var(--violet-ink);
  background: var(--ground); padding: 6px 14px 6px 12px; border-radius: 999px; box-shadow: 0 4px 16px -6px rgba(31,38,48,.2); animation: fade 3s ease both;
}
body.record-open .whisper { left: auto; right: 56px; }
.whisper::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); margin-right: 8px; vertical-align: middle; }
@keyframes fade { 0% { opacity: 0; transform: translateY(4px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.whisper.long { animation-duration: 7s; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* the tree compresses while a record is rolled out */
body.record-open .topbar { grid-template-columns: 1fr auto; row-gap: 20px; }
body.record-open .search { grid-column: 1 / -1; grid-row: 2; }
body.record-open .top-actions { padding-bottom: 0; }
body.record-open .band { grid-template-columns: 96px 1fr; }
body.record-open .gen b { font-size: 22px; }
body.record-open .row { gap: 18px 32px; }
body.record-open .cluster { gap: 18px 28px; }
body.record-open .person .nm { font-size: 21px; }
body.record-open .band.far .person .nm { font-size: 18px; }
body.record-open .band.home { --h1: clamp(32px, 3vw, 44px); }
body.record-open .focus h1 i, body.record-open .focus .summary, body.record-open .hint { display: none; }

/* ---------- nested family layout on a zoomable canvas ---------- */
.tree { --h1: clamp(44px, 5.2vw, 78px); justify-content: flex-start; }
body.record-open .tree { --h1: clamp(32px, 3vw, 44px); }
.tree-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-bottom: 8px; }
.view-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.view-opts .opt-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin: 0 4px 0 10px; }
.view-opts .opt-label:first-child { margin-left: 0; }
.seg { padding: 5px 12px; border: 1px solid var(--hair); border-radius: 999px; color: var(--slate); background: var(--ground); transition: color .2s, border-color .2s; }
.seg:hover { color: var(--violet-ink); border-color: var(--violet); }
.seg.on { color: var(--violet-ink); border-color: var(--violet); font-weight: 400; box-shadow: 0 0 0 2px color-mix(in oklab, var(--violet) 18%, transparent); }
.fold-chip { align-self: center; font-size: 13px; color: var(--muted); border: 1px dashed #BCC2CB; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.fold-chip:hover { color: var(--violet-ink); border-color: var(--violet); }
.tree-area { display: grid; grid-template-columns: 120px minmax(0, 1fr); }
.gen-gutter { position: relative; }
.gen-label { position: absolute; left: calc(-1 * max(24px, 5.5vw)); right: 0; display: flex; align-items: center; padding-left: max(24px, 5.5vw); }
.gen-label.shaded { background: #F6F7F9; }
.gen-label span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.gen-label b { display: block; font-weight: 200; font-size: 26px; letter-spacing: 0; color: #6E7684; }
.layout { position: relative; display: flex; flex-direction: column; align-items: center; padding: 28px 24px 40px; width: max-content; min-width: 100%; }
.forest { display: flex; align-items: flex-start; justify-content: center; gap: 0 56px; }
.grand-row { display: flex; justify-content: center; gap: 0 96px; }
.unit { display: flex; flex-direction: column; align-items: center; }
.couple { display: flex; flex-wrap: nowrap; align-items: flex-start; justify-content: center; gap: 0 32px; padding: 0 20px 48px; }
.couple > .cluster { padding-top: 0; }
.couple > .focus + .person { margin-top: calc(var(--h1) * .5 - 18px); }
.kids { display: flex; align-items: flex-start; justify-content: center; }
.links .band-bg { fill: var(--band); opacity: .55; }
.focus .only-narrow { display: none !important; }
.tree.overview .person .nm { font-size: 19px; }

/* ---------- table view: the same people as rows ---------- */
.tree.table-view { justify-content: flex-start; }
#table-q { border: 0; border-bottom: 1px solid var(--slate); background: transparent; font-size: 16px; color: var(--ink); padding: 4px 0 6px; outline: none; width: min(260px, 100%); }
#table-q:focus { border-bottom-color: var(--violet); }
.table-wrap { position: relative; overflow-x: auto; } /* relative: keeps the sr-only header label inside the scroll box */
.people-table .rel-link { white-space: nowrap; }
.people-table { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: 14px; color: var(--body); }
.people-table th { background: var(--ground); text-align: left; font-weight: 400; border-bottom: 1px solid var(--slate); white-space: nowrap; }
.people-table th button { display: block; width: 100%; padding: 10px 12px 8px 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.people-table th button:hover, .people-table th[aria-sort="ascending"] button, .people-table th[aria-sort="descending"] button { color: var(--violet-ink); }
.people-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair); vertical-align: baseline; }
.people-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.people-table td[data-col="name"] small { color: var(--muted); }
.people-table tbody tr:hover { background: var(--band); }
.people-table tr.is-focus { background: color-mix(in oklab, var(--violet) 10%, white); }
.row-name { font-size: 16px; color: var(--ink); border-bottom: 1px solid transparent; }
.row-name:hover { color: var(--violet-ink); border-bottom-color: var(--violet); }
.people-table tr.deceased .row-name::after { content: " \2020"; font-size: .7em; color: var(--muted); vertical-align: super; }
.known { display: inline-block; width: 56px; height: 3px; border-radius: 2px; background: var(--spec); clip-path: inset(0 calc((1 - var(--k)) * 100%) 0 0); opacity: calc(.35 + var(--k) * .65); vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
  /* header: brand and links on one row, search below */
  .topbar { grid-template-columns: 1fr auto; row-gap: 20px; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .top-actions { padding-bottom: 0; }
  body.record-open .stage { padding-right: max(24px, 5.5vw); }
  .record { box-shadow: -24px 0 64px -24px rgba(31,38,48,.3); }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; }
  .top-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; flex-wrap: wrap; gap: 10px 22px; padding-bottom: 0; }
  .search { grid-column: 1 / -1; grid-row: 3; }
  .band { grid-template-columns: 1fr; gap: 10px; }
  .gen b { display: inline; font-size: 18px; margin-right: 8px; }
  .person .nm { font-size: 22px; }
  .tree { --h1: 40px; }
  .tree-area { grid-template-columns: minmax(0, 1fr); }
  .gen-gutter { display: none; }
  .foot { flex-direction: column; align-items: start; }
  .record { padding: 28px 24px 48px; }
  .fields { grid-template-columns: 1fr; }
  .field { grid-template-columns: 96px 1fr; }
  .search input { font-size: 17px; }
  .overview-head { flex-wrap: wrap; }
  .overview-head h1 { font-size: 28px; }
  /* table becomes a stack of cards; the headers stay as sort chips */
  .people-table { min-width: 0; }
  .people-table thead tr { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; }
  .people-table th { display: block; border: 0; }
  .people-table th:last-child { display: none; }
  .people-table th button { padding: 5px 10px; border: 1px solid var(--hair); border-radius: 999px; letter-spacing: .08em; }
  .people-table tbody tr:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .people-table td { display: block; padding: 0; border: 0; min-width: 0; white-space: normal; }
  .people-table td:empty { display: none; }
  .people-table td::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .people-table td[data-col="name"] { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
  .people-table td[data-col="name"]::before, .people-table td[data-col="act"]::before { content: none; }
  .people-table td[data-col="parents"], .people-table td[data-col="spouses"] { grid-column: 1 / -1; }
  .people-table td[data-col="act"] { grid-column: 1 / -1; font-size: 13px; }
}
