:root{--bg: #f6f7f9;--panel: #ffffff;--ink: #1c2430;--muted: #66707c;--line: #e2e6ec;--line-strong: #cfd6df;--accent: #2f6df0;--accent-soft: #e8f0fe;--a-color: #1f8a5b;--a-soft: #e4f4ec;--b-color: #b4531a;--b-soft: #fbeee2;--danger: #c23b3b;--radius: 8px;--shadow: 0 1px 2px rgba(20,30,45,.06), 0 2px 8px rgba(20,30,45,.05);--mono: ui-monospace, SFMono-Regular, Menlo, monospace}@media (prefers-color-scheme: dark){:root{--bg: #12151b;--panel: #1a1f27;--ink: #e7ebf1;--muted: #97a1ae;--line: #2a313c;--line-strong: #39414e;--accent: #6ea0ff;--accent-soft: #1e2a44;--a-color: #4cc38a;--a-soft: #15241c;--b-color: #e08a52;--b-soft: #2a1d13}}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.45 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}kbd{font:11px var(--mono);background:var(--panel);border:1px solid var(--line-strong);border-bottom-width:2px;border-radius:4px;padding:1px 5px;color:var(--ink)}.app{display:flex;flex-direction:column;height:100vh}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 18px;background:var(--panel);border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:12px}.logo{font-size:26px}.topbar h1{font-size:16px;margin:0;letter-spacing:-.01em}.sub{margin:0;font-size:12px;color:var(--muted)}.badge.sample{margin-left:8px;background:#f5b301;color:#3a2c00;font-weight:700;font-size:10px;padding:1px 6px;border-radius:4px;letter-spacing:.04em}.controls{display:flex;align-items:center;gap:14px}.viewswitch{display:inline-flex;border:1px solid var(--line-strong);border-radius:var(--radius);overflow:hidden}.viewswitch button{border:0;background:var(--panel);color:var(--muted);padding:6px 14px}.viewswitch button.on{background:var(--accent);color:#fff}.toggle{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted);-webkit-user-select:none;user-select:none}.helpbtn{width:28px;height:28px;border-radius:50%;border:1px solid var(--line-strong);background:var(--panel);color:var(--muted);font-weight:700}.help-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0a0e1473;display:flex;align-items:center;justify-content:center;z-index:50}.help-card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:20px 24px;box-shadow:var(--shadow);max-width:420px}.help-card h3{margin:0 0 12px}.help-card ul{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:8px;font-size:13px}.help-card kbd{margin-right:2px}.abbar{display:flex;align-items:stretch;gap:10px;padding:10px 18px;background:var(--panel);border-bottom:1px solid var(--line)}.slot{flex:1;display:flex;align-items:center;gap:10px;border:1px dashed var(--line-strong);border-radius:var(--radius);padding:8px 12px;min-height:44px}.slot.filled{border-style:solid}.slot:nth-child(1).filled{border-color:var(--a-color);background:var(--a-soft)}.slot:nth-child(3).filled{border-color:var(--b-color);background:var(--b-soft)}.slot-label{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.slot-body{display:inline-flex;align-items:center;gap:8px;font-weight:600}.slot-pick{border:0;background:transparent;color:var(--accent)}.slot-pick:disabled{color:var(--muted);cursor:default}.linklike{border:0;background:transparent;color:var(--ink);font-weight:600;padding:0;text-decoration:underline;text-underline-offset:2px}.x{border:0;background:transparent;color:var(--danger);font-size:16px;line-height:1;padding:0 2px}.swap{align-self:center;border:1px solid var(--line-strong);background:var(--panel);border-radius:50%;width:34px;height:34px;font-size:16px}.relcard{margin:12px 18px 0;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px 16px}.relcard.cat-unrelated{opacity:.9}.relcard-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.rel-headline{display:flex;flex-direction:column;gap:3px}.rel-people{font-size:12px;color:var(--muted)}.rel-label{font-size:22px;font-weight:700;letter-spacing:-.01em}.rel-multi{font-size:11px;color:var(--accent);font-weight:600}.relcard-actions{display:flex;gap:8px}.relcard-actions button{border:1px solid var(--line-strong);background:var(--panel);color:var(--ink);border-radius:6px;padding:6px 10px}.ca-note{margin:10px 2px 0;font-size:12px;color:var(--muted)}.branches{display:flex;gap:48px;justify-content:center;margin-top:14px}.branch-line+.branch-line{border-top:1px dashed var(--line);margin-top:14px;padding-top:6px}.line-label{text-align:center;font-size:12px;color:var(--muted);margin-top:8px}.branch{display:flex;flex-direction:column;align-items:center}.edge{width:2px;height:16px;background:var(--line-strong)}.pnode{border:1px solid var(--line-strong);background:var(--panel);border-radius:8px;padding:6px 12px;display:flex;flex-direction:column;align-items:center;min-width:120px;color:var(--ink)}.pnode-name{font-weight:600}.pnode-years{font-size:11px;color:var(--muted)}.pnode.ancestor{border-color:var(--accent);background:var(--accent-soft)}.pnode.a{border-color:var(--a-color);background:var(--a-soft)}.pnode.b{border-color:var(--b-color);background:var(--b-soft)}.chain{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:14px}.chain-rel{font-size:12px;color:var(--muted);font-style:italic}.main{display:flex;flex:1;min-height:0;padding:12px 18px 18px;gap:16px}.left{width:340px;flex:none;display:flex;flex-direction:column;min-height:0}.right{flex:1;min-height:0;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.search{display:flex;flex-direction:column;min-height:0;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.search-input{border:0;border-bottom:1px solid var(--line);padding:12px 14px;font-size:16px;background:transparent;color:var(--ink);outline:none}.search-input:focus{box-shadow:inset 0 -2px 0 var(--accent)}.results{overflow:auto;flex:1}.result{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;text-align:left;border:0;background:transparent;border-bottom:1px solid var(--line);padding:8px 14px;color:var(--ink)}.result.active{background:var(--accent-soft)}.result.selected{box-shadow:inset 3px 0 0 var(--accent)}.r-name b{font-weight:700}.r-meta{display:flex;gap:10px;font-size:12px;color:var(--muted)}.r-parents{font-style:italic}.noresults,.results-count{padding:10px 14px;font-size:12px;color:var(--muted)}.results-count{border-top:1px solid var(--line)}.profile{padding:18px 20px}.profile-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;border-bottom:1px solid var(--line);padding-bottom:14px}.profile-head h2{margin:0 0 6px;font-size:22px}.maiden{color:var(--muted);font-weight:400;font-size:16px}.vitals{display:flex;gap:6px;flex-wrap:wrap}.tag{font-size:11px;background:var(--bg);border:1px solid var(--line);border-radius:20px;padding:2px 9px;color:var(--muted)}.tag.alive{color:var(--a-color)}.tag.dead{color:var(--muted)}.tag.sex-M{color:#2f6df0}.tag.sex-F{color:#b4531a}.profile-actions{display:flex;gap:8px;flex-wrap:wrap}.profile-actions button{border:1px solid var(--line-strong);background:var(--panel);color:var(--ink);border-radius:6px;padding:6px 12px}.factgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px 20px;margin:14px 0}.fact{display:flex;gap:10px;font-size:13px}.fact .k{color:var(--muted);min-width:44px}.fact .v.mono{font-family:var(--mono);font-size:12px}.section{margin-top:16px}.section h3{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);margin:0 0 8px}.chips{display:flex;flex-wrap:wrap;gap:8px}.chip{border:1px solid var(--line-strong);background:var(--panel);border-radius:20px;padding:5px 12px;color:var(--ink);display:inline-flex;gap:8px;align-items:baseline}@media (hover: hover){.chip:hover{border-color:var(--accent)}}.chip-years{font-size:11px;color:var(--muted)}.muted{color:var(--muted);font-size:13px}.empty{padding:40px;color:var(--muted);max-width:560px}.empty .hint{font-size:13px;margin-top:12px}.empty kbd{margin:0 1px}.treewrap{display:flex;flex-direction:column;height:100%}.tree-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid var(--line)}.tt-focal{font-size:13px;color:var(--muted)}.tt-controls{display:flex;align-items:center;gap:12px}.tt-controls label{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}.tt-controls>button{border:1px solid var(--line-strong);background:var(--panel);color:var(--ink);border-radius:6px;padding:5px 10px}.stepper{display:inline-flex;align-items:center;border:1px solid var(--line-strong);border-radius:6px;overflow:hidden}.stepper button{border:0;background:var(--panel);color:var(--ink);width:24px;height:24px;line-height:1}.stepper button:disabled{color:var(--muted)}.stepval{width:20px;text-align:center;font-variant-numeric:tabular-nums}.tree-hint{margin:6px 16px;font-size:12px;color:var(--muted)}.treesvg{flex:1;width:100%;height:100%;cursor:grab;touch-action:none;background:radial-gradient(circle at 1px 1px,var(--line) 1px,transparent 0) 0 0 / 26px 26px}.treesvg:active{cursor:grabbing}.link{fill:none;stroke:var(--line-strong);stroke-width:1.5}.link.hi{stroke:var(--accent);stroke-width:3}.marr{stroke:var(--line-strong);stroke-width:1.5;stroke-dasharray:3 3}.tnode{cursor:pointer}.tnode rect{fill:var(--panel);stroke:var(--line-strong);stroke-width:1.5}@media (hover: hover){.tnode:hover rect{stroke:var(--accent)}}.tn-name{font-size:12.5px;font-weight:600;fill:var(--ink)}.tn-years{font-size:10.5px;fill:var(--muted)}.tnode.focal rect{stroke:var(--accent);stroke-width:2.5;fill:var(--accent-soft)}.tnode.hi rect{stroke:var(--accent)}.tnode.is-a rect{stroke:var(--a-color);stroke-width:2.5;fill:var(--a-soft)}.tnode.is-b rect{stroke:var(--b-color);stroke-width:2.5;fill:var(--b-soft)}.tnode.spouse rect{stroke-dasharray:4 3}@media (hover: none) and (pointer: coarse){.helpbtn,.kbd-hints,kbd{display:none}}@media (max-width: 900px){html,body,#root{height:auto}body{overflow-x:hidden}.app{height:auto;min-height:100vh;min-height:100dvh}.topbar{order:0}.abbar{order:1}.main{order:2}.relcard{order:3}.topbar{flex-wrap:wrap;gap:10px 12px;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top));padding-left:calc(14px + env(safe-area-inset-left));padding-right:calc(14px + env(safe-area-inset-right))}.logo{font-size:22px}.controls{gap:10px 12px;flex-wrap:wrap;width:100%}.viewswitch button{padding:8px 16px;min-height:44px}.abbar{position:sticky;top:0;z-index:20;gap:8px;padding:8px 12px;padding-left:calc(12px + env(safe-area-inset-left));padding-right:calc(12px + env(safe-area-inset-right));box-shadow:0 2px 8px #0a0e141a}.slot{min-width:0;flex-direction:column;align-items:stretch;gap:3px;padding:6px 10px;min-height:48px;justify-content:center}.slot-body{justify-content:space-between}.slot-body .linklike{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slot-pick{text-align:left;min-height:24px}.swap{width:44px;height:44px;flex:none}.main{flex:none;flex-direction:column;padding:12px;gap:12px;padding-bottom:calc(24px + env(safe-area-inset-bottom))}.left{width:auto}.right{overflow:visible}.results{max-height:55vh}.result{min-height:48px;justify-content:center}.relcard{margin:0 12px}.relcard-head{flex-wrap:wrap}.relcard-actions{width:100%}.relcard-actions button{flex:1;min-height:44px}.rel-label{font-size:20px}.rel-people{word-break:break-word}.branches{gap:20px;overflow-x:auto;padding-bottom:6px;justify-content:flex-start}.branch-lines{min-width:0}.pnode{min-width:104px;padding:8px 12px}.chain{gap:8px}.profile{padding:16px 14px}.profile-head{flex-direction:column}.profile-head h2{font-size:20px}.profile-actions{width:100%}.profile-actions button{flex:1;min-height:44px}.chip{min-height:44px;align-items:center;padding:8px 14px}.treewrap{height:72vh;height:72dvh}.tree-toolbar{flex-wrap:wrap;gap:8px 10px;padding:10px 12px}.tt-focal{width:100%}.tt-controls{flex-wrap:wrap;gap:8px 10px;width:100%}.tt-controls>button{min-height:44px;padding:8px 14px;flex:1}.tt-controls>button.primary{border-color:var(--accent);background:var(--accent);color:#fff;font-weight:600}.tt-controls label{font-size:13px}.stepper button{width:44px;height:44px;font-size:18px}.stepval{width:26px}.tree-hint{margin:6px 12px}}
