/* Layout: three horizontal record lanes (Bible / Book of Mormon / World) on one shared year axis, detail column at right; selecting an item draws its parallels across lanes. */
:root{
  --bg:#f3f4f1; --surface:#ffffff; --ink:#1d2321; --muted:#5f6a66; --rule:#d9ddd8;
  --bible:#6f7a2a; --bible-soft:#e6e9cf;
  --bom:#9a5b2e; --bom-soft:#f1dfcf;
  --world:#3d5a78; --world-soft:#d9e3ee;
  --family:#7a3f63; --family-soft:#f0dde8;
  --earth:#6d5a3f;
  --l-whitesides:#3a7f9e; --l-rosevear:#7f8f22; --l-hall:#b0503d; --l-matthews:#b8861f;
  --accent:#9a5b2e; --empty:#c9cec9; --line:#9a5b2e;
  --f-display:"Cardo", "Iowan Old Style", Georgia, serif;
  --f-body:"IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono:"IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#141816; --surface:#1c211f; --ink:#e6e9e4; --muted:#9aa49f; --rule:#2f3633;
  --bible:#b9c36a; --bible-soft:#2c3119;
  --bom:#d69a68; --bom-soft:#3a2a1d;
  --world:#8fb0d3; --world-soft:#1f2c3a;
  --family:#d99cc0; --family-soft:#38212f;
  --earth:#c9b08a;
  --l-whitesides:#72b6d4; --l-rosevear:#b9c85c; --l-hall:#e28a76; --l-matthews:#e6bb58;
  --accent:#d69a68; --empty:#3a423e; --line:#d69a68; color-scheme:dark;}}
:root[data-theme="dark"]{
  --bg:#141816; --surface:#1c211f; --ink:#e6e9e4; --muted:#9aa49f; --rule:#2f3633;
  --bible:#b9c36a; --bible-soft:#2c3119;
  --bom:#d69a68; --bom-soft:#3a2a1d;
  --world:#8fb0d3; --world-soft:#1f2c3a;
  --family:#d99cc0; --family-soft:#38212f;
  --earth:#c9b08a;
  --l-whitesides:#72b6d4; --l-rosevear:#b9c85c; --l-hall:#e28a76; --l-matthews:#e6bb58;
  --accent:#d69a68; --empty:#3a423e; --line:#d69a68; color-scheme:dark;}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:14px;line-height:1.5}
html,body{height:100%}
.wrap{padding-inline:12px;padding-block:8px;height:100%;display:flex;flex-direction:column;gap:8px}
header{display:flex;flex-wrap:wrap;align-items:center;flex:none;justify-content:space-between;gap:12px 24px}
h1{font-family:var(--f-display);font-weight:700;font-size:1.45rem;line-height:1.1;margin:0;letter-spacing:.01em;text-wrap:balance}
.sub{color:var(--muted);margin:4px 0 0;max-width:62ch}
.controls{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.controls .lbl{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-right:4px}
button{font:inherit;font-size:.85rem;color:var(--ink);background:var(--surface);border:1px solid var(--rule);border-radius:6px;padding:5px 10px;cursor:pointer}
button:hover{border-color:var(--muted)}
button:focus-visible,.item:focus-visible,.tick:focus-visible,.chap:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.main{flex:1;min-height:0;display:flex;flex-direction:column}
.stage{background:var(--surface);border:1px solid var(--rule);border-radius:10px;min-width:0;position:relative;flex:1;min-height:0;display:flex;flex-direction:column}
.deep,.legend{flex:none}
.treeview{flex:1;min-height:0;display:flex;flex-direction:column}
.treehead{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;padding:8px 12px;border-bottom:1px solid var(--rule)}
.treehead strong{font-family:var(--f-display);font-size:1.15rem}
.treehead .note{font-size:.8rem;color:var(--muted)}
.treehead #treeBack{margin-left:auto}
.tkeys{display:flex;flex-wrap:wrap;gap:4px 12px;font-size:.8rem}
.tkeys i{display:inline-block;width:10px;height:10px;border-radius:2px;margin-right:5px;vertical-align:-1px}
.treescroll{flex:1;min-height:0;overflow:auto}
#treesvg{display:block}
.treeaxis{position:sticky;top:0;z-index:2;height:24px;background:var(--surface);border-bottom:1px solid var(--rule);font-family:var(--f-mono);font-size:.72rem;color:var(--muted)}
.treeaxis span{position:absolute;top:5px;transform:translateX(-50%)}
#treesvg .tg{stroke:var(--rule);stroke-width:1;opacity:.5} #treesvg .tg.major{opacity:1}
#treesvg .lk{stroke:var(--ink);stroke-width:1.3;opacity:.55}
#treesvg .pd{fill:var(--ink);opacity:.65}
#treesvg .node{cursor:pointer}
#treesvg .node rect.box{fill:color-mix(in srgb,var(--c) 22%,var(--surface));stroke:var(--c);stroke-width:1}
#treesvg .node.undated rect.box{fill:var(--surface);stroke-dasharray:4 3}
#treesvg .node.open rect.box{stroke-dasharray:6 3}
#treesvg .node.living rect.box{fill:color-mix(in srgb,var(--c) 32%,var(--surface))}
#treesvg .node:hover rect.box,#treesvg .node:focus rect.box{stroke-width:2.2}
#treesvg .node:focus{outline:none}
#treesvg .me rect.box{stroke:var(--ink);stroke-width:2}
#treesvg .nm{font-family:var(--f-body);font-size:12px;font-weight:600;fill:var(--ink)}
#treesvg .node.undated .nm{font-weight:500;fill:var(--muted)}
#treesvg .yr{font-family:var(--f-mono);font-size:10.5px;fill:var(--muted)}
.scroller{flex:1;min-height:0;overflow:auto;position:relative}
.canvas{position:relative}
.axis{position:absolute;top:0;left:0;height:30px;border-bottom:1px solid var(--rule);font-family:var(--f-mono);font-size:.72rem;color:var(--muted)}
.axis span{position:absolute;top:8px;transform:translateX(-50%);white-space:nowrap}
.grid{position:absolute;top:30px;bottom:0;width:1px;background:var(--rule);opacity:.6}
.zero{background:var(--accent);opacity:.35}
.lane{position:relative;border-bottom:1px solid var(--rule)}
.lane:last-child{border-bottom:0}
.lanelabel{position:sticky;left:0;z-index:3;display:inline-flex;gap:8px;align-items:center;padding:6px 10px;font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;font-weight:600;background:var(--surface);border-right:1px solid var(--rule);border-bottom:1px solid var(--rule);border-bottom-right-radius:6px}
.lanelabel i{width:9px;height:9px;border-radius:2px;display:inline-block}
.item{position:absolute;height:24px;display:flex;align-items:center;gap:6px;cursor:pointer;white-space:nowrap;font-size:.8rem;z-index:2;background:none;border:0;padding:0;color:var(--ink)}
.item .bar{position:absolute;left:0;top:0;bottom:0;border-radius:4px}
.item .txt{position:relative;padding:0 7px;line-height:24px}
.item.ev .dot{width:10px;height:10px;border-radius:50%;flex:none;margin-left:-5px}
.item.ev .txt{padding-left:0}
.L-bible .bar{background:var(--bible-soft);border:1px solid color-mix(in srgb,var(--bible) 45%,transparent)}
.L-bible .dot{background:var(--bible)}
.L-bom .bar{background:var(--bom-soft);border:1px solid color-mix(in srgb,var(--bom) 45%,transparent)}
.L-bom .dot{background:var(--bom)}
.L-world .bar{background:var(--world-soft);border:1px solid color-mix(in srgb,var(--world) 45%,transparent)}
.L-world .dot{background:var(--world)}
.L-family .bar{background:var(--family-soft);border:1px solid color-mix(in srgb,var(--family) 45%,transparent)}
.L-family .dot{background:var(--family)}
.k-family{color:var(--family)}
.item.compact{height:18px;font-size:.74rem;overflow:hidden}
.item.compact.tree{overflow:visible}
.item.compact.tree .bar{background:color-mix(in srgb,var(--c) 22%,var(--surface));border:1px solid var(--c)}
.item.compact.tree .txt{font-weight:600;overflow:visible;max-width:none;white-space:nowrap}
.item.compact.tree .yrs{position:absolute;right:6px;top:0;line-height:18px;font-family:var(--f-mono);font-size:.66rem;color:var(--muted)}
.item.compact.tree.unk .bar{background:var(--surface);border-style:dashed}
.item.compact.tree.unk .txt{font-weight:500;color:var(--muted)}
.item.compact.tree.living .bar{background:color-mix(in srgb,var(--c) 34%,var(--surface))}
.item.compact.tree.me .bar{border:2px solid var(--ink)}
.item.sumrow{height:18px;font-size:.72rem;z-index:2;justify-content:flex-end}
.item.sumrow .txt{padding-right:8px}
.item.sumrow .bar{background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--c) 18%,var(--surface)) 0 6px,var(--surface) 6px 9px);border:1px dashed var(--c);border-radius:4px}
.item.sumrow .txt{color:var(--ink);font-weight:500;line-height:18px;white-space:nowrap}
.item.sumrow:hover .bar{border-style:solid}
.item.sumrow.deep .bar{background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--c) 10%,var(--surface)) 0 3px,var(--surface) 3px 7px)}
.gens #famCollapseAll,.gens #famFurthest{margin-left:8px}
.item.compact.tree.flash .bar{outline:3px solid var(--accent);outline-offset:2px}
.lanetoggle{font:inherit;font-size:inherit;letter-spacing:inherit;text-transform:inherit;font-weight:inherit;color:inherit;background:none;border:0;padding:0;margin-left:4px;cursor:pointer;display:inline-flex;gap:6px;align-items:center}
.lanetoggle:hover{text-decoration:underline}
.gens{display:inline-flex;align-items:center;gap:3px;margin-left:12px;text-transform:none;letter-spacing:0;font-weight:500;color:var(--muted)}
.gens button{font-size:.72rem;padding:1px 7px;border-radius:4px}
.gens span{margin-left:4px;font-size:.72rem}
.lanetoggle .chev{display:inline-block;transition:transform .15s}
.lanetoggle[aria-expanded="true"] .chev{transform:rotate(90deg)}
svg.tree{position:absolute;inset:0;pointer-events:none;z-index:1;overflow:visible}
svg.ancband{position:absolute;left:0;z-index:2;cursor:pointer;overflow:visible}
svg.ancband rect{fill:var(--family);opacity:.55}
svg.ancband rect:hover{opacity:.95}
svg.ancband line{stroke:var(--rule)}
.bandcap{position:absolute;z-index:2;font-size:.72rem;color:var(--muted);background:none;border:0;padding:0;cursor:pointer;white-space:nowrap}
.bandrow{display:flex;flex-direction:column;gap:2px;padding:8px 10px;border:1px solid var(--rule);border-radius:6px}
.bandcap:hover{color:var(--ink);text-decoration:underline}
svg.tree line{stroke:var(--family);stroke-width:1.5;opacity:.75}
svg.tree line.g{stroke-dasharray:3 3;opacity:.6}
svg.tree circle{fill:var(--family)} svg.tree circle.g{fill:none;stroke:var(--family);stroke-width:1.5}
svg.tree circle.c{fill:var(--surface);stroke:var(--family);stroke-width:2}
.item.compact.unk .bar{background:none;border:1px dashed var(--family)}
.item.compact.unk .txt{color:var(--muted)}
.item.compact.open .bar{border-right-style:dashed;-webkit-mask-image:linear-gradient(90deg,#000 70%,transparent);mask-image:linear-gradient(90deg,#000 70%,transparent)}
.item.compact.living .bar{border-right-style:dashed}
.item.compact.desc .bar{background:color-mix(in srgb,var(--family) 30%,var(--surface))}
.item.compact .txt{line-height:18px;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.anc{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;text-align:left;width:100%;padding:7px 10px}
.anc .an{font-weight:600}.anc .ay{font-family:var(--f-mono);font-size:.76rem;color:var(--muted)}
.anc .life{grid-column:1/-1;height:4px;background:var(--rule);border-radius:2px;position:relative}
.anc .life i{position:absolute;top:0;bottom:0;background:var(--family);border-radius:2px}
.item.sel .bar{outline:2px solid var(--accent)}
.item.sel .txt{font-weight:600}
.item.rel .txt{font-weight:600}
.item.rel .bar{border-color:var(--accent)}
.dim .item:not(.sel):not(.rel){opacity:.4}
.ticks{position:absolute;left:0;right:0;height:22px}
.tick{position:absolute;top:4px;width:3px;height:14px;border-radius:1px;background:var(--bom);cursor:pointer;border:0;padding:0}
.tick.empty{background:var(--empty)}
.tick.sel{background:var(--ink);height:18px;top:2px}
.tickcap{position:absolute;left:10px;top:-14px;font-size:.66rem;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
svg.links{position:absolute;inset:0;pointer-events:none;z-index:1;overflow:visible}
svg.links path{fill:none;stroke:var(--line);stroke-width:1.5;stroke-dasharray:4 3;opacity:.85}
svg.links circle{fill:var(--line)}
.deep{border-bottom:1px solid var(--rule);padding:10px 12px 6px;display:flex;flex-direction:column;gap:6px}
.deephead{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
.deephead .kicker{color:var(--earth)}
.deephead .ctl{display:flex;flex-wrap:wrap;gap:4px}
.deephead button{font-size:.76rem;padding:3px 8px}
#deepsvg{display:block;width:100%;height:auto;overflow:visible}
#deepsvg text{font-family:var(--f-body);font-size:12px;fill:var(--ink)}
#deepsvg .lbl,#closesvg .lbl{paint-order:stroke;stroke:var(--surface);stroke-width:4px;stroke-linejoin:round}
#deepsvg .leaders line,#closesvg .leaders line{stroke:var(--muted);stroke-width:1;opacity:.45}
#deepsvg .band text{fill:var(--bg);font-weight:600;font-size:10px;letter-spacing:.06em;text-transform:uppercase}
#deepsvg .ev{cursor:pointer}
#deepsvg .ev circle{fill:var(--earth)}
#deepsvg .ev line{stroke:var(--earth);stroke-width:1;opacity:.5}
#deepsvg .ev.sel circle{fill:var(--accent);r:5}
#deepsvg .h-bible circle{fill:var(--bible)} #deepsvg .h-bom circle{fill:var(--bom)} #deepsvg .h-world circle{fill:var(--world)} #deepsvg .h-family circle{fill:var(--family)}
#deepsvg{cursor:crosshair}
#deepsvg .ev.sel text{font-weight:600}
#deepsvg .us circle{fill:var(--accent)}
#deepsvg .us text{fill:var(--accent);font-weight:600}
#deepsvg .ax{font-family:var(--f-mono);font-size:10.5px;fill:var(--muted)}
.k-earth{color:var(--earth)}
.dd{flex:1;min-height:0;overflow:auto;padding:24px 24px 28px;display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:28px;align-content:start}
@media (max-width:760px){.dd{grid-template-columns:minmax(0,1fr);padding:18px 16px}}
.ddclose{grid-column:1/-1;border:1px solid var(--rule);border-radius:10px;padding:10px 12px 4px;min-width:0}
.ddrange{font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;color:var(--earth);font-weight:600;margin-bottom:6px}
#closesvg{display:block;width:100%;height:auto;overflow:visible}
#closesvg text{font-family:var(--f-body);font-size:12px;fill:var(--ink)}
#closesvg .band text{fill:var(--bg);font-weight:600;font-size:10px;letter-spacing:.06em;text-transform:uppercase}
#closesvg .ev{cursor:pointer}
#closesvg .ev circle{fill:var(--earth)}
#closesvg .ev line{stroke:var(--earth);stroke-width:1;opacity:.5}
#closesvg .ev.sel circle{fill:var(--accent);r:6}
#closesvg .ev.sel text{font-weight:600;fill:var(--accent)}
#closesvg .us circle{fill:var(--accent)} #closesvg .us text{fill:var(--accent);font-weight:600}
#closesvg .ax{font-family:var(--f-mono);font-size:10px;fill:var(--muted)}
.ddmain{display:flex;flex-direction:column;gap:12px;min-width:0}
.ddmain h2{font-family:var(--f-display);font-size:clamp(1.8rem,3.4vw,2.8rem);line-height:1.08;margin:0;text-wrap:balance}
.ddwhen{font-family:var(--f-mono);font-size:1rem;color:var(--earth)}
.ddmain p{margin:0;max-width:62ch;font-size:1.02rem}
.ddmain .note{font-size:.84rem}
.ddnav{display:flex;flex-wrap:wrap;gap:8px}
.ddside{display:flex;flex-direction:column;gap:10px;min-width:0}
.ddside .plist button{padding:7px 10px}
.ddback{align-self:flex-start}
.legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.78rem;color:var(--muted);padding:10px 12px;border-top:1px solid var(--rule)}
.legend b{color:var(--ink);font-weight:600}
.sw{display:inline-block;width:10px;height:10px;border-radius:2px;vertical-align:-1px;margin-right:5px}
.modal{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:calc(16px + env(safe-area-inset-top,0px)) 16px calc(16px + env(safe-area-inset-bottom,0px));background:color-mix(in srgb,var(--ink) 28%,transparent)}
.card{position:relative;background:var(--surface);border:1px solid var(--rule);border-radius:12px;width:min(560px,100%);max-height:min(82vh,760px);display:flex;flex-direction:column;box-shadow:0 18px 50px color-mix(in srgb,var(--ink) 25%,transparent)}
.card .x{position:absolute;top:10px;right:10px;width:32px;height:32px;padding:0;font-size:1.2rem;line-height:1;border-radius:50%}
aside{padding:22px 22px 20px;display:flex;flex-direction:column;gap:12px;min-width:0;overflow-y:auto}
aside > .kicker{padding-right:40px}
@media (prefers-reduced-motion:no-preference){.modal:not([hidden]) .card{animation:pop .16s ease-out}@keyframes pop{from{transform:translateY(8px);opacity:.6}to{transform:none;opacity:1}}}
.kicker{font-size:.7rem;letter-spacing:.1em;text-transform:uppercase;font-weight:600}
.k-bible{color:var(--bible)} .k-bom{color:var(--bom)} .k-world{color:var(--world)}
aside h2{font-family:var(--f-display);font-size:1.55rem;line-height:1.15;margin:0;text-wrap:balance}
.when{font-family:var(--f-mono);font-size:.8rem;color:var(--muted)}
aside p{margin:0;max-width:65ch}
.refs{font-size:.82rem;color:var(--muted)}
.refs b{color:var(--ink);font-weight:500}
h3{font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:6px 0 0;font-weight:600}
.plist{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none}
.plist button{text-align:left;width:100%;display:flex;flex-direction:column;gap:2px;padding:8px 10px}
.plist .pt{font-weight:600}
.plist .pn{color:var(--muted);font-size:.8rem}
.chaps{display:flex;flex-direction:column;gap:0;margin:0;padding:0;list-style:none;border-top:1px solid var(--rule)}
.chap{display:grid;grid-template-columns:3.4rem minmax(0,1fr);gap:8px;padding:8px 2px;border-bottom:1px solid var(--rule);cursor:pointer;background:none;border-left:0;border-right:0;border-top:0;border-radius:0;text-align:left;width:100%}
.chap .cn{font-family:var(--f-mono);font-size:.78rem;color:var(--bom)}
.chap .cs{font-size:.84rem}
.chap.none .cs{color:var(--muted);font-style:italic}
.chap.sel{background:var(--bom-soft)}
.meter{height:6px;background:var(--empty);border-radius:3px;overflow:hidden}
.meter i{display:block;height:100%;background:var(--bom)}
.note{font-size:.78rem;color:var(--muted)}
footer{display:none}
@media (prefers-reduced-motion:no-preference){.scroller{scroll-behavior:smooth}}
h1 a.home{display:block;font-family:var(--f-body);font-size:.8rem;font-weight:500;letter-spacing:.02em;color:var(--muted);text-decoration:none;margin:0 0 4px}h1 a.home:hover{color:var(--ink)}
