#whole-tree{margin:24px 0 34px;padding:18px;border:1px solid #d5cdbd;border-radius:18px;background:#f5f2eb}#whole-tree h2{font-size:clamp(24px,4vw,36px);margin:0 0 6px}.whole-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:16px 0}.whole-tools button,.whole-tools input{font:inherit;min-height:48px;border:1px solid #b7aa91;border-radius:9px;background:white;padding:10px 15px;color:#30291f}.whole-tools button{cursor:pointer;font-weight:700}.whole-tools button.primary{background:#403725;color:white}.whole-tools label{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.whole-tools input{width:260px;max-width:100%}.whole-tools output{min-width:52px;font-variant-numeric:tabular-nums}.whole-stage{position:relative;width:100%;height:70vh;min-height:400px;max-height:900px;overflow:hidden;background:#fcfbf8;border:1px solid #c8bea9;border-radius:12px;touch-action:none;cursor:grab;overscroll-behavior:contain}.whole-stage:active{cursor:grabbing}.whole-stage svg{display:block;width:100%;height:100%;max-width:none;overflow:hidden;user-select:none}.whole-stage:focus-visible{outline:3px solid #8e6d36;outline-offset:3px}.whole-stage .overview-group{fill:#f1ede4;stroke:#d3c7b0;stroke-width:2}.whole-stage .overview-group-label{font:bold 25px Georgia,serif;fill:#51432e}.whole-stage .overview-edge{fill:none;stroke:#8b7755;stroke-width:2.5;opacity:.65}.whole-stage .overview-edge.uncertain{stroke-dasharray:8 6}.whole-stage .overview-edge.spouse{stroke:#ad8253;stroke-width:3}.overview-person{height:100%;box-sizing:border-box;border:2px solid #b6a789;border-radius:10px;background:white;padding:8px 10px;display:flex;flex-direction:column;justify-content:center;gap:3px;color:#2e2921;text-decoration:none;font:15px system-ui,sans-serif;overflow:hidden}.overview-person:hover,.overview-person:focus-visible{background:#fff9e9;border-color:#79591e;outline:3px solid #b89047;outline-offset:-3px}.overview-person strong{font-size:19px;line-height:1.18;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.overview-person .overview-years{font-size:14px;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.overview-person small{color:#76674e;font-size:12px}.whole-legend{font-size:14px;color:#6d604d}.whole-stage.expanded{position:fixed;inset:10px;width:auto;height:auto;max-height:none;z-index:11000;box-shadow:0 0 0 20px #fcfbf8}.whole-fullscreen-close{position:absolute;right:12px;top:12px;z-index:2;min-height:48px;padding:12px 20px;background:white;border:1px solid #776442;border-radius:8px;font:700 16px system-ui}.whole-status{font-weight:650;min-height:24px}.whole-accessible-list{margin-top:18px}.whole-accessible-list ul{columns:3}.whole-accessible-list li{break-inside:avoid;margin-bottom:8px}@media(max-width:760px){#whole-tree{padding:12px;margin:18px 0}.whole-tools{gap:8px}.whole-tools label{width:100%}.whole-tools input{flex:1;min-width:0}.whole-stage{height:65vh;min-height:360px}.whole-accessible-list ul{columns:1}.whole-tools button{padding:10px 12px}}

.whole-large-tools{position:absolute;right:12px;top:12px;z-index:2;display:flex;gap:8px;flex-wrap:wrap;max-width:calc(100% - 24px)}.whole-large-tools[hidden]{display:none}.whole-large-tools button{min-height:48px;padding:10px 16px;background:white;border:1px solid #776442;border-radius:8px;font:700 16px system-ui}

.overview-person.tree-spouse,.path-person.tree-spouse{background:#e5d1b4;border-color:#ae916b}.overview-person.tree-spouse:hover,.overview-person.tree-spouse:focus-visible,.path-person.tree-spouse:hover,.path-person.tree-spouse:focus-visible{background:#dcc29f;border-color:#79591e}.tree-color-key{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}.tree-color-key i{display:inline-block;width:22px;height:18px;border:1px solid #ae916b;border-radius:4px}.blood-swatch{background:#fff}.spouse-swatch{background:#e5d1b4}

#whole-scale,#whole-large-scale{display:inline-flex;align-items:center;justify-content:center;min-width:100px;min-height:48px;padding:8px 12px;border:1px solid #776442;border-radius:8px;background:#fff;color:#30291f;font:700 18px system-ui;font-variant-numeric:tabular-nums}

.overview-person.selected-person{border:4px solid #815913;background:#fff0bb;box-shadow:inset 0 0 0 2px white}

.overview-profile{display:flex;flex:1;min-height:0;flex-direction:column;gap:2px;color:inherit;text-decoration:none;overflow:hidden}.overview-profile strong{font-size:18px;-webkit-line-clamp:2}.overview-profile .overview-years{font-size:13px;-webkit-line-clamp:1}.overview-family-action{display:flex;align-items:center;justify-content:center;flex:0 0 44px;min-height:44px;border:1px solid #89765b;border-radius:5px;background:#f5efe3;color:#382b1b;text-decoration:none;font:700 13px system-ui}.overview-family-action:focus-visible{outline:3px solid #815913}

.overview-edge{vector-effect:non-scaling-stroke}.overview-edge.muted-edge{opacity:.09}.family-edge-halo{fill:none;stroke:#fcfbf8;stroke-width:10;vector-effect:non-scaling-stroke;pointer-events:none}.family-edge{fill:none;stroke:#1261a0;stroke-width:4;vector-effect:non-scaling-stroke;pointer-events:none}.family-edge.spouse{stroke:#a6580b}.family-edge.uncertain{stroke-dasharray:9 5}.overview-person.related-person{border:3px solid #1261a0;background:#eaf4ff}.overview-person.related-person.tree-spouse{background:#f8e2c5;border-color:#a6580b}.family-focused .overview-person:not(.related-person){opacity:.42}.family-focused .overview-person:not(.related-person):hover,.family-focused .overview-person:not(.related-person):focus-within{opacity:1}.overview-person.selected-person{border:4px solid #815913;background:#fff0bb}

.overview-person.related-person.selected-person{border:4px solid #815913;background:#fff0bb;box-shadow:inset 0 0 0 2px white}

/* One main tree and controls that remain usable on small screens. */
.whole-tools select{font:inherit;max-width:100%;min-height:44px;padding:8px}.whole-tools label{min-width:0}.tree-reading-help{margin:12px 0}.tree-reading-help summary{cursor:pointer;font-weight:600;min-height:44px;display:flex;align-items:center}@media(max-width:760px){.whole-tools label,.whole-tools input,.whole-tools select{width:100%;box-sizing:border-box}.whole-tools{gap:8px}.whole-stage{height:65vh;min-height:380px}.whole-tools button{min-height:44px}}

.family-branch-select{display:block;width:100%;max-width:540px;min-height:48px;margin-top:8px;padding:10px;font:inherit;border:1px solid #89765b;border-radius:7px;background:#fff;color:#28231b}

#whole-tree[hidden],#tree-extras[hidden],#tree-reel[hidden],#tree-help[hidden]{display:none!important}

#person-choice[hidden]{display:none!important}.tree-more-options>summary{cursor:pointer;min-height:48px;display:flex;align-items:center;font-weight:700;background:#fff;border:1px solid #b7aa91;border-radius:8px;padding:0 12px;margin:14px 0}.tree-more-options>summary::after{content:"＋";margin-left:auto}.tree-more-options[open]>summary::after{content:"−"}#tree-extras h2 small{font-size:.65em;font-weight:400}

#entry-family-controls[hidden],#entry-generation-controls[hidden],#entry-name-controls[hidden],#family-branch-view[hidden]{display:none!important}[id^="entry-by-"][aria-pressed="true"]{box-shadow:inset 0 0 0 3px #493e29}

.overview-family-action{flex-basis:27px;min-height:27px;font-size:12px}.overview-expand-action{flex:0 0 28px;min-height:28px;line-height:1.1;padding:4px;border:1px solid #89765b;border-radius:4px;background:#fff;color:#382b1b;font:700 12px system-ui;cursor:pointer}.whole-relationship-evidence{margin:14px 0}.whole-relationship-evidence>summary{cursor:pointer;min-height:44px;padding:12px;font-weight:700;border:1px solid #b7aa91;border-radius:8px}

.overview-actions{display:flex;gap:5px;flex:0 0 44px;min-height:44px}.overview-actions .overview-family-action,.overview-actions .overview-expand-action{flex:1;min-height:44px;min-width:0;font-size:12px;padding:4px}

/* Bottom controls provide one-tap movement on touchscreens. */
.whole-pan-tools{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:3;display:flex;gap:8px;max-width:calc(100% - 16px);padding:8px;border:1px solid #b7aa91;border-radius:12px;background:#faf8f3f5;box-shadow:0 2px 12px #0002;touch-action:manipulation}
.whole-pan-tools button{min-width:62px;min-height:56px;padding:10px 12px;border:1px solid #776442;border-radius:8px;background:white;color:#30291f;font:700 17px system-ui;cursor:pointer;touch-action:manipulation}
.whole-pan-tools button:active{background:#e5dac4}.whole-pan-tools button:focus-visible{outline:3px solid #815913}
.whole-stage,.whole-stage svg,.whole-stage foreignObject{-webkit-touch-callout:none;touch-action:none;user-select:none;-webkit-user-select:none}
@media(max-width:400px){.whole-pan-tools{gap:5px;padding:6px}.whole-pan-tools button{min-width:58px;padding:8px;font-size:16px}}

.silverstein-lineage .overview-person{padding:7px;gap:3px}.silverstein-lineage .overview-profile strong{font-size:18px;-webkit-line-clamp:3}.silverstein-lineage .overview-profile small{display:none}.silverstein-lineage .overview-years{font-size:12px}.silverstein-lineage .overview-actions{flex-basis:36px;min-height:36px}.silverstein-lineage .overview-actions a,.silverstein-lineage .overview-actions button{font-size:11px;min-height:36px}

/* Relationship colors stay fixed when the focused family changes. */
.overview-person,.overview-person.related-person{background:#fff;border-color:#b6a789}
.overview-person.tree-blood,.overview-person.tree-blood.related-person{background:#eaf4ff;border-color:#1261a0}
.overview-person.tree-spouse,.overview-person.tree-spouse.related-person{background:#e5d1b4;border-color:#ae916b}
.overview-person.selected-person,.overview-person.related-person.selected-person,.overview-person.tree-blood.selected-person,.overview-person.tree-spouse.selected-person{background:#fff0bb;border:4px solid #815913;box-shadow:inset 0 0 0 2px white}
.blood-swatch{background:#eaf4ff}.selected-swatch{background:#fff0bb}

/* Version 194: married blood relatives retain both relationship colors. */
.overview-person.tree-spouse,.overview-person.tree-spouse.related-person{background:#e8ddf5;border-color:#82659e}
.overview-person.tree-blood-married,.overview-person.tree-blood-married.related-person{background:linear-gradient(to right,#eaf4ff 0%,#eaf4ff 50%,#e8ddf5 50%,#e8ddf5 100%);border-color:#1261a0}
.overview-person.selected-person,.overview-person.related-person.selected-person,.overview-person.tree-blood-married.selected-person{background:#fff0bb;border:4px solid #815913;box-shadow:inset 0 0 0 2px white}
.spouse-swatch{background:#e8ddf5}.married-swatch{background:linear-gradient(to right,#eaf4ff 50%,#e8ddf5 50%)}

/* Keep controls in their own rows, outside the SVG drawing area. */
.whole-stage{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.whole-stage svg{grid-row:2;min-height:0;width:100%;height:100%}
.whole-large-tools{grid-row:1;position:static;justify-self:end;margin:8px;max-width:calc(100% - 16px)}
.whole-pan-tools{grid-row:3;position:static;bottom:auto;left:auto;transform:none;justify-self:center;margin:8px;flex-wrap:wrap;justify-content:center;box-shadow:none}
.tree-visible-color-key{display:flex;gap:10px 18px;align-items:center;flex-wrap:wrap;padding:12px;margin:12px 0;border:1px solid #b7aa91;border-radius:8px;background:#fff;font:15px/1.4 system-ui;color:#30291f}
.tree-visible-color-key span{display:inline-flex;gap:7px;align-items:center}.tree-visible-color-key i{display:inline-block;flex:0 0 26px;width:26px;height:22px;border:1px solid #89765b;border-radius:4px}.other-swatch{background:#fff}

/* Movement controls follow tree zoom, with a readable minimum size. */
.whole-pan-tools{gap:calc(8px * var(--tree-control-scale,1));padding:calc(8px * var(--tree-control-scale,1));margin:calc(8px * var(--tree-control-scale,1))}
.whole-pan-tools button{min-width:max(44px,calc(62px * var(--tree-control-scale,1)));min-height:max(40px,calc(56px * var(--tree-control-scale,1)));padding:calc(10px * var(--tree-control-scale,1)) calc(12px * var(--tree-control-scale,1));font-size:max(14px,calc(17px * var(--tree-control-scale,1)))}
.whole-stage.expanded .whole-large-tools button{min-height:max(40px,calc(48px * var(--tree-control-scale,1)));padding:calc(10px * var(--tree-control-scale,1)) calc(16px * var(--tree-control-scale,1));font-size:max(14px,calc(16px * var(--tree-control-scale,1)))}

/* Keep page shortcuts in document flow, away from family boxes. */
.family-tree-page .page-tools{position:static;inset:auto;justify-content:center;flex-wrap:wrap;margin:18px auto;max-width:calc(100% - 24px);width:fit-content;box-shadow:none;z-index:auto}
#whole-tree{scroll-margin-top:16px}

.tree-switch-button,.whole-stage.expanded .whole-large-tools .tree-switch-button{min-height:48px;padding:12px 18px;font:700 17px system-ui;border:2px solid #403725;background:#fff3d9;color:#30291f}
.tree-switch-dialog{width:min(540px,calc(100% - 24px));max-height:calc(100dvh - 32px);overflow:visible;box-sizing:border-box;border:2px solid #89765b;border-radius:14px;padding:24px;background:#fcfbf8;color:#30291f}
.tree-switch-dialog::backdrop{background:#0008}.tree-switch-dialog h2{margin-top:0}.tree-switch-dialog label{display:block;margin:16px 0 8px;font:700 18px system-ui}.tree-switch-dialog input,.tree-switch-dialog select{display:block;box-sizing:border-box;width:100%;min-height:50px;padding:10px;font:17px system-ui;border:1px solid #89765b;border-radius:6px}.tree-switch-dialog .name-combobox{display:block;width:100%}.tree-switch-dialog .name-suggestions{max-height:200px}.tree-switch-actions{display:flex;justify-content:flex-end;margin-top:20px}.tree-switch-actions button{min-height:48px;padding:10px 20px;font:700 17px system-ui}.tree-switch-dialog p{line-height:1.5}

/* Use more vertical room for the family drawing. Larger view retains full-screen sizing. */
.whole-stage:not(.expanded){height:82vh;max-height:1100px}

.tree-generation-control{display:inline-flex;align-items:center;gap:8px;font:700 16px system-ui;color:#30291f}.tree-generation-control input,.whole-tools .tree-generation-control input{width:76px;min-height:48px;padding:8px;font:18px system-ui;border:1px solid #89765b;border-radius:6px;background:#fff}.whole-large-tools .tree-generation-control{background:#fcfbf8;padding:4px;border-radius:6px}
.whole-stage:not(.expanded),.whole-stage:not(.expanded) svg,.whole-stage:not(.expanded) foreignObject{touch-action:pan-y;overscroll-behavior:auto}

.tree-person-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px;margin:12px 0;border:1px solid #b7aa91;border-radius:8px;background:#fff}.tree-person-actions label,.tree-action-label{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font:700 17px system-ui}.tree-person-actions select,.tree-action-label select{max-width:100%;width:300px;min-height:48px;padding:8px;font:17px system-ui;border:1px solid #89765b;border-radius:6px;background:#fff}.tree-person-actions button,.whole-stage.expanded .whole-large-tools button[id*="-action-"]{min-height:48px;padding:10px 16px;border:2px solid #403725;border-radius:7px;font:700 17px system-ui;background:#fff3d9;color:#30291f}.tree-action-label{background:#fcfbf8}.tree-action-label select{width:240px}
