:root { --bg: #f7f4ee; --card: #fff; --ink: #222; --muted: #6b6257; --line: #ddd3c4; --accent: #8a5a2b; --f: #b04a74; --m: #2f6f9f; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 Georgia, "Times New Roman", serif; background: var(--bg); color: var(--ink); }
header, main, footer { max-width: 1200px; margin: 0 auto; padding: 16px 20px; }
header h1 { margin: 8px 0 0; font-size: 32px; letter-spacing: 1px; }
header p, footer, .muted { color: var(--muted); }
a { color: var(--accent); }
.tree-wrap { overflow-x: auto; padding: 20px 20px 24px; }
.snap { position: absolute; top: 0; width: 1px; height: 1px; scroll-snap-align: center; scroll-initial-target: nearest; }
.tree { position: relative; margin: 0 auto; }
.tree-in { position: absolute; }
.lines { position: absolute; left: 0; top: 0; }
.lines line { stroke: #b9a88f; stroke-width: 2; }
.glabels { position: sticky; left: 0; width: 0; height: 0; z-index: 2; }
.glabel { position: absolute; left: 0; white-space: nowrap; background: var(--bg); padding: 1px 6px; border-radius: 6px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.tree .card { position: absolute; width: 136px; height: 64px; padding: 6px 4px; overflow: hidden; }
.tree .card b { font-size: 13px; line-height: 1.2; }
.tree .card.direct { border-color: #e0b77f; background: #fbf1e2; box-shadow: 0 0 0 2px #e0b77f55; }
.gen { margin: 18px 0; }
.gen h2 { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.couple { display: flex; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid transparent; }
.couple.direct { border-color: #e0b77f; background: #fbf1e2; }
.card { display: block; width: 130px; padding: 8px; text-align: center; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--m); border-radius: 10px; }
.card.f { border-top-color: var(--f); }
.card.living { border-style: dashed; color: var(--muted); border-top-color: var(--line); }
a.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.card b { display: block; font-size: 14px; }
.card span { display: block; font-size: 12px; color: var(--muted); }
section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; margin: 14px 0; }
section h2 { margin: 0 0 8px; font-size: 18px; color: var(--accent); }
dl { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; margin: 0; }
dt { color: var(--muted); }
.fam { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fam h3 { margin: 0 0 4px; font-size: 15px; }
ul { margin: 4px 0; padding-left: 20px; }
@media print { .card { break-inside: avoid; } }
.who { display: flex; align-items: center; gap: 18px; }
.who h1 { margin: 0; }
.avatar { margin: 0; text-align: center; }
.avatar img, .avatar span { display: block; width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--line); background: #eee; }
.avatar span { display: flex; align-items: center; justify-content: center; font-size: 38px; color: #fff; background: var(--m); border-color: #fff; box-shadow: 0 0 0 1px var(--line); }
.avatar.f span { background: var(--f); }
.avatar figcaption { font-size: 11px; color: var(--muted); max-width: 140px; margin: 4px auto 0; }
#tp-pictures .avatar { display: inline-block; margin: 0 0 8px; }
#tp-pictures .avatar img, #tp-pictures .avatar span { width: 220px; height: 220px; border-radius: 12px; }
.tabs { display: flex; flex-wrap: wrap; align-items: flex-end; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs > label { padding: 8px 18px; margin-right: 4px; border: 1px solid var(--line); border-bottom: none; border-radius: 10px 10px 0 0;
  background: #efe8dc; color: var(--muted); cursor: pointer; font-weight: bold; }
.tabs > input:checked + label { background: var(--card); color: var(--accent); box-shadow: 0 1px 0 var(--card); position: relative; z-index: 1; }
.tabs > input:focus-visible + label { outline: 2px solid var(--accent); }
.tabs > .panel { display: none; width: 100%; order: 99; margin: 0; border-radius: 0 12px 12px 12px; }
.tabs.sub { margin-top: 14px; }
.tabs.sub > label { padding: 5px 12px; font-size: 14px; }
.tabs.sub > .panel { background: #fcfaf6; border: 1px solid var(--line); padding: 10px 14px; }
#t-history:checked ~ #tp-history, #t-pictures:checked ~ #tp-pictures, #t-news:checked ~ #tp-news, #t-archives:checked ~ #tp-archives,
#s-growing:checked ~ #sp-growing, #s-family:checked ~ #sp-family, #s-work:checked ~ #sp-work, #s-fun:checked ~ #sp-fun,
#s-hobbies:checked ~ #sp-hobbies, #s-immediate:checked ~ #sp-immediate { display: block; }
.ftree { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 0; }
.trow { display: flex; flex-direction: column; align-items: center; width: 100%; }
.tlabel { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 4px 0; }
.tcards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: stretch; }
.tline { width: 2px; height: 22px; background: var(--line); margin: 4px 0; }
.couple-box { display: flex; gap: 4px; padding: 4px; border: 2px solid #e0b77f; background: #fbf1e2; border-radius: 12px; }
.tc { display: block; width: 140px; padding: 8px; text-align: center; text-decoration: none; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-top: 3px solid var(--m); border-radius: 10px; }
.tc.f { border-top-color: var(--f); }
.tc.me { box-shadow: 0 0 0 2px var(--accent); font-weight: bold; }
.tc.living { border-style: dashed; color: var(--muted); border-top-color: var(--line); }
a.tc:hover { box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.tc b { display: block; font-size: 14px; }
.tc span { display: block; font-size: 12px; color: var(--muted); }
.panel h3 { margin: 10px 0 4px; font-size: 15px; }
@media print { .tabs > .panel { display: block; } .tabs > label { display: none; } }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.map { margin: 0; }
.map iframe { display: block; width: 100%; height: 210px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.map figcaption { font-size: 13px; color: var(--muted); margin-top: 3px; }
.mapnav { max-width: 1200px; margin: 0 auto; padding: 10px 20px 0; font-size: 14px; color: var(--muted); }
.map iframe { border: 3px solid var(--c, var(--line)); }
a.pl { color: inherit; text-decoration: none; border: 2px solid var(--c, var(--line)); border-radius: 4px; padding: 0 3px; }
a.pl:hover { background: color-mix(in srgb, var(--c) 14%, transparent); text-decoration: underline; }
.map figcaption a.pl { border-width: 1px; }
.addresses li { margin: 4px 0; }
.gate { max-width: 640px; margin: 40px auto; text-align: center; }
.gate a.fm-add { display: inline-block; margin: 12px 0; padding: 10px 22px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; }
.fm-add { font-weight: bold; }
.fm-profile-btn { position: fixed; top: 12px; right: 14px; z-index: 40; padding: 7px 16px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: bold; text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.fm-profile-btn:hover, .fm-profile-btn:focus { filter: brightness(1.1); color: #fff; }
@media print { .fm-profile-btn { display: none; } }
.pop { display: none; position: fixed; inset: 0; z-index: 50; }
.pop:target { display: block; }
.pop-bg { position: absolute; inset: 0; background: rgba(34, 34, 34, .55); }
.pop-in { position: absolute; inset: 4vh 4vw; max-width: 900px; margin: 0 auto; background: var(--bg); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.pop-bar { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pop-in iframe { flex: 1; width: 100%; border: 0; }
