body.genealogy {
    --ink: #2e241a;
    --paper: #f7f1e1;
    --card: #fffaf0;
    --line: #d8c9a8;
    --mute: #7a6e60;
    --gold: #e0a21f;
    --rose: #d2507f;
    --blue: #2a8fc0;
    --leaf: #3f7d3a;
    --serif: 'Cormorant Garamond', 'Georgia', serif;
    --sans: 'Ubuntu Sans', sans-serif;
    background: var(--paper);
    color: var(--ink);
}

body.genealogy #content {
    background: transparent;
    box-shadow: none;
    margin-bottom: 0;
    padding-bottom: 0;
    text-align: center;
}

body.genealogy h1 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 3.4rem;
    letter-spacing: 0.04em;
    color: #2f4f26;
}

body.genealogy h1::after {
    width: 160px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--leaf), transparent);
}

body.genealogy #content p {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.5;
    color: #4a3d2f;
    max-width: 54ch;
    margin-left: auto;
    margin-right: auto;
}

body.genealogy #content .oak-stats {
    font-family: var(--sans);
    font-size: 0.9rem;
    color: var(--mute);
}

.oak-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.8rem;
    list-style: none;
    font-size: 0.85rem;
    color: #5c4d3c;
    margin-top: 1.2rem;
}

.oak-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.oak-legend i {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--mute);
    background: var(--gold);
}

.oak-legend .lg-right { background: var(--rose); }
.oak-legend .lg-left { background: var(--blue); }
.oak-legend .lg-nv { background: #b9ae9f; }

.oak {
    position: relative;
    margin-top: 1rem;
}

.oak-stage {
    position: relative;
    height: min(92vh, 1200px);
    min-height: 520px;
    overflow: hidden;
    background: #bcd9ee;
    user-select: none;
}

.oak-stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

.oak-stage canvas:active { cursor: grabbing; }

.oak-pins {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.pin {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transition: opacity 0.2s ease;
}

.pin.off, .pin.away { display: none; }
.pin.hi { z-index: 2; }

.pin .dot {
    position: absolute;
    left: -7px;
    top: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
    pointer-events: auto;
    cursor: pointer;
    transform: scale(var(--s, 1));
    transition: transform 0.15s ease;
}

.pin.s1 .dot { background: var(--rose); }
.pin.s-1 .dot { background: var(--blue); }
.pin.nv .dot { background: #b9ae9f; }
.pin.spine .dot, .pin.kin .dot { left: -8px; top: -8px; width: 16px; height: 16px; }
.pin .dot:hover, .pin.hi .dot { transform: scale(calc(var(--s, 1) * 1.4)); }

.pin .bud {
    display: none;
    position: absolute;
    left: -10px;
    top: -34px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #2f6b2f;
    color: #2f6b2f;
    font: 700 15px/16px var(--sans);
    text-align: center;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
    pointer-events: auto;
    cursor: pointer;
    transform-origin: 50% 34px;
    transform: scale(var(--s, 1));
}

.pin.more .bud { display: block; }
.pin .bud:hover { background: #d9efc4; }

.pin .lab {
    position: absolute;
    left: 14px;
    top: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    padding: 1px 8px 2px;
    white-space: nowrap;
    background: rgba(255, 250, 240, 0.9);
    border-radius: 7px;
    box-shadow: 0 1px 6px rgba(30, 22, 10, 0.35);
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.pin.left .lab { left: auto; right: 14px; align-items: flex-end; }
.pin .lab.hid { opacity: 0; pointer-events: none; }

.b-label { font: 700 15px/18px var(--serif); letter-spacing: 0.02em; color: var(--ink); }
.pin.nv .b-label { font-weight: 600; font-style: italic; color: #5d5246; }
.sp-name { font: italic 600 16px/18px var(--serif); color: #3d2f20; }
.sp-sur { font: 700 16px/19px var(--serif); letter-spacing: 0.14em; color: #241a10; }
.sp-meta { font: 11.5px/15px var(--sans); color: #5c4d3c; }
.sp-link { font: italic 600 14px/18px var(--serif); color: #2f6b2f; text-decoration: underline; text-underline-offset: 3px; }
.sp-link:hover { color: #1c4a1c; }

.oak-pins.focus .pin:not(.hi) { opacity: 0.4; }

.oak-tools {
    position: absolute;
    left: 50%;
    top: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.oak-full {
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 5;
}

html.oak-locked { overflow: hidden; }

.oak-stage.full {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    z-index: 1000;
}

.oak-tools button,
.oak-full {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.4rem 1.2rem;
    white-space: nowrap;
    color: #3d2f20;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(30, 22, 10, 0.3);
    cursor: pointer;
    transition: background 0.2s ease;
}

.oak-tools button:hover,
.oak-full:hover { background: #f1e6c8; }
.oak-tools button:focus-visible,
.oak-full:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }

body.genealogy #oak .oak-hint {
    position: absolute;
    left: 50%;
    bottom: 0.8rem;
    transform: translateX(-50%);
    margin: 0;
    padding: 0.25rem 0.9rem;
    font: 0.8rem/1.4 var(--sans);
    color: #fff;
    background: rgba(30, 24, 16, 0.5);
    border-radius: 14px;
    width: max-content;
    max-width: 92%;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

body.genealogy #oak .oak-hint.gone { opacity: 0; }

.oak-tip {
    position: absolute;
    z-index: 4;
    width: 320px;
    padding: 1.2rem 1.4rem 1.1rem;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(30, 22, 10, 0.4);
    font-family: var(--sans);
    font-size: 0.86rem;
    line-height: 1.55;
    color: #4a3d2f;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.oak-tip.on { opacity: 1; }
.oak-tip strong { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: #241a10; margin-bottom: 0.4rem; }
.oak-tip .t-sosa { color: var(--mute); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 0.2rem; }
.oak-tip .t-bio { color: var(--ink); margin-top: 0.7rem; padding-top: 0.7rem; border-top: 1px solid #e6dcc4; }
.oak-tip .t-status { margin-top: 0.5rem; color: var(--mute); font-size: 0.78rem; font-style: italic; }
