/* HM2: native history components, scoped to the two trees and atlas context. */
[data-hm2-tree]{width:92%;max-width:none;margin:2rem auto;box-sizing:border-box;--hm2-red:#771d28;--hm2-ink:#302a27;--hm2-gold:#a87a36;--hm2-line:#d7cab7;--hm2-bg:#faf7f1;color:var(--hm2-ink);background:#fffcf7;border:1px solid var(--hm2-line);border-radius:20px;overflow:hidden;scroll-margin-top:1rem}
[data-hm2-tree] .history-tree-head-239{padding:1.6rem 2rem;background:linear-gradient(110deg,#f5eee2,#fffaf4);color:#302a27}
[data-hm2-tree] .history-tree-toolbar-239{display:flex;flex-wrap:wrap;gap:.45rem;margin:1rem 0 0}
[data-hm2-tree] button,[data-hm2-tree] input,[data-hm2-tree] select,.hm2-atlas-family button,.hm2-atlas-family select{font:inherit;box-sizing:border-box}
[data-hm2-tree] button:focus-visible,[data-hm2-tree] a:focus-visible,[data-hm2-tree] input:focus-visible,.hm2-reader-dialog :focus-visible,.community-picker-hm2 :focus-visible{outline:3px solid #b88333;outline-offset:3px}
[data-hm2-tree] button{cursor:pointer}
[data-hm2-tree] button:disabled{opacity:.45;cursor:default}
.hm2-controls{display:flex;gap:1rem;justify-content:space-between;padding:1.2rem 1.5rem .5rem;align-items:center;flex-wrap:wrap}
.hm2-search-wrap{position:relative;flex:1 1 280px;max-width:520px}
.hm2-search{width:100%;border:1px solid #cabca6;border-radius:9px;background:white;color:#302a27;padding:.8rem 2.5rem .8rem .9rem;min-height:46px}
.hm2-clear{position:absolute;right:4px;top:5px;border:0;background:transparent;color:#655849;font-size:1.5rem!important;width:36px;height:36px}
.hm2-views{display:flex;gap:4px;flex-wrap:wrap;background:#eee7dc;border-radius:10px;padding:4px}
.hm2-views button{border:0;background:transparent;color:#4d4034;border-radius:7px;padding:.7rem .9rem;min-height:42px}
.hm2-views button[aria-pressed=true]{background:#771d28;color:white;box-shadow:0 2px 4px #0002}
.hm2-rail{display:flex;align-items:center;gap:1rem;padding:.6rem 1.5rem;border-bottom:1px solid #ded4c3}
.hm2-step{border:1px solid #d2c1a5;background:#fff;color:#771d28;border-radius:50%;height:42px;width:42px;flex:0 0 42px}
.hm2-range-box{flex:1;min-width:0;display:grid;grid-template-rows:24px 28px auto;align-items:center}
.hm2-track{display:flex;width:100%;height:24px;align-items:center;justify-content:space-between;background:linear-gradient(#b69b73,#b69b73) center/100% 2px no-repeat}
.hm2-tick{width:12px;height:12px;min-width:4px;padding:0;border-radius:50%;border:2px solid #b69b73;background:#fff;flex-shrink:1}
.hm2-tick[aria-current=true]{background:#771d28;border-color:#771d28;width:17px;height:17px}
.hm2-range{width:100%!important;max-width:none!important;margin:0;accent-color:#771d28;display:block}
.hm2-count{font-size:.78rem;color:#715f4d;text-align:center}
.hm2-workspace{display:grid;grid-template-columns:minmax(210px,25%) minmax(0,1fr);align-items:start}
.hm2-navigation{background:#f5f0e7;border-right:1px solid #ddd0bc;min-width:0;padding:.6rem}
.hm2-index{max-height:650px;overflow-y:auto;overscroll-behavior:contain;display:grid;gap:5px;scrollbar-width:thin;padding:.3rem}
.hm2-status{font-size:.75rem;color:#655747;margin:.3rem .6rem}
.hm2-node{display:grid!important;gap:.25rem;width:100%;text-align:left;border:1px solid transparent;background:transparent;border-radius:9px;color:#423b34;padding:.8rem .9rem;position:relative!important;inset:auto!important;transform:none!important}
.hm2-node[hidden]{display:none!important}
.hm2-node>span{font-size:.73rem;line-height:1.35;color:#766854;letter-spacing:.015em}
.hm2-node>strong{font-size:.94rem;line-height:1.4;font-weight:650}
.hm2-node[aria-pressed=true]{background:#fff;border-color:#a57537;box-shadow:0 2px 7px #5f451514}
.hm2-node[aria-pressed=true]:before{content:'';position:absolute;left:-1px;top:10px;bottom:10px;width:4px;border-radius:3px;background:#771d28}
.hm2-panel{min-width:0;padding:1.5rem 2rem 2rem;background:#fffcf8}
.hm2-detail-head{display:flex;align-items:center;gap:1rem;margin:0 0 1rem;background:none!important;color:#302a27!important;position:static!important}
.hm2-detail-head h3{font-size:clamp(1.4rem,2vw,2rem);line-height:1.17;margin:.3rem 0;max-width:none}
.hm2-portrait{border-radius:50%;object-fit:cover;width:68px;height:68px;flex:0 0 68px;border:2px solid #c8a56b;background:#e8ddc8}
.hm2-eyebrow{color:#805c2b;font-size:.76rem;letter-spacing:.07em;text-transform:uppercase;margin:0}
.hm2-lead{font-size:1.06rem;line-height:1.75;color:#3e352d;max-width:80ch}
.hm2-detail-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem 1.5rem;margin:1.3rem 0}
.hm2-detail-fields h4,.hm2-references h4{margin:0 0 .4rem;font-size:.84rem;color:#771d28;letter-spacing:.02em}
.hm2-detail-fields p{margin:0;font-size:.91rem;line-height:1.6;overflow-wrap:anywhere}
.hm2-mapline{font-size:.88rem;line-height:1.6;padding:.8rem 1rem;border-left:3px solid #a87a36;background:#f5eedf;border-radius:0 8px 8px 0}
.hm2-atlas-button{background:#771d28;color:white!important;padding:.75rem 1rem;display:inline-flex!important;margin:.3rem 0 .7rem!important;text-decoration:none!important;border-radius:8px;border:1px solid #771d28!important}
.hm2-muted{display:block;font-size:.78rem;line-height:1.6;color:#706456}
.hm2-source-links{display:flex;flex-wrap:wrap;gap:.45rem;margin:.6rem 0}
.hm2-source-link{display:inline-block;max-width:100%;font-size:.88rem;border:1px solid #d9cbb6;border-radius:6px;background:#fff;padding:.42rem .65rem;color:#70212b;line-height:1.4;margin:.25rem .25rem .25rem 0;text-decoration:none;overflow-wrap:anywhere}
.hm2-source-link:hover{background:#f2e6d5;border-color:#b48e58}
.hm2-references{border-top:1px solid #e8dece;padding-top:1rem;margin-top:1.3rem}
.hm2-witnesses,.hm2-more{margin:.8rem 0;padding:.65rem 0;border-top:1px solid #e8dece;font-size:.9rem}
.hm2-witnesses summary,.hm2-more summary{cursor:pointer;color:#6c4b31}
.hm2-share{border:1px solid #c9b797;border-radius:7px;padding:.5rem .75rem;background:white;color:#73512d;font-size:.85rem!important}
[data-hm2-scale]{padding:.8rem 1.5rem;margin:0;border-top:1px solid #ded4c3;background:#f5f0e7;font-size:.77rem;color:#6b5e4d;line-height:1.5}
.hm2-original{margin:0;padding:.7rem 1.5rem;border-top:1px solid #dfd4c4;font-size:.8rem}
.hm2-original summary{cursor:pointer;color:#6e5840}
.hm2-original-content{display:flex;flex-wrap:wrap;gap:.4rem 1rem;max-height:220px;overflow:auto;padding-top:.7rem}
.hm2-original-content>span{border-bottom:1px solid #dbcbb2;padding:.4rem}
.hm2-original-content *{position:static!important;transform:none!important}
.hm2-bridge{border:1px solid #dbc9ab;border-left:4px solid #a87a36;border-radius:10px;padding:1.1rem;margin:1rem 0;background:#fff}
.hm2-bridge h4{font-size:1.15rem;margin:.5rem 0}
.hm2-bridge p{line-height:1.6;font-size:.93rem}
.hm2-families>select{min-height:44px;width:100%;padding:.65rem;border:1px solid #c7b18e;border-radius:8px;background:white;color:#4a392b}
.hm2-family-viewport{overflow-x:auto;max-width:100%;background:radial-gradient(ellipse at center,#fff,#f4ead9);border-radius:12px;border:1px solid #ded0b9}
.hm2-family-canvas{position:relative;min-width:640px;width:100%;box-sizing:border-box}
.hm2-family-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.hm2-family-lines path{fill:none;stroke:#826d51;stroke-width:2;vector-effect:non-scaling-stroke;cursor:pointer;pointer-events:stroke}
.hm2-family-lines [data-type=spouse]{stroke:#8c3541;stroke-width:3}
.hm2-family-lines [data-type=descent]{stroke-dasharray:6 5}
.hm2-family-lines [data-type=legal]{stroke:#bb8228;stroke-width:3;stroke-dasharray:2 4}
.hm2-person{position:absolute;transform:translateX(-50%);width:150px;min-height:62px;border:1px solid #cbb38d;border-radius:10px;background:#fffdf8;color:#3f3021;box-shadow:0 3px 8px #4b30141a;padding:.6rem;display:flex;gap:.5rem;align-items:center;justify-content:center;z-index:1;font-size:.85rem!important;cursor:pointer}
.hm2-person[aria-pressed=true]{border-color:#771d28;box-shadow:0 0 0 2px #771d28}
.hm2-person .hm2-portrait{height:36px;width:36px;flex-basis:36px;border-width:1px}
.hm2-person span{overflow-wrap:anywhere;line-height:1.3}
.hm2-legend{display:flex;flex-wrap:wrap;gap:.6rem 1rem;margin:1rem 0;font-size:.75rem;color:#68543a}
.hm2-legend span:before{content:'';display:inline-block;width:24px;vertical-align:middle;margin-right:6px;border-top:2px solid #826d51}
.hm2-legend [data-type=spouse]:before{border-color:#8c3541;border-width:3px}
.hm2-legend [data-type=descent]:before{border-top-style:dashed}
.hm2-legend [data-type=legal]:before{border-color:#bb8228;border-top-style:dotted;border-width:3px}
.hm2-family-note{font-size:.88rem;line-height:1.65}
.hm2-family-detail:not(:empty){border-top:2px solid #b99b65;padding:1rem;margin-top:1rem;background:#f8f0e2;border-radius:0 0 8px 8px}
.hm2-family-detail h4{font-size:1.1rem;margin:0}
.hm2-family-detail p{font-size:.9rem;line-height:1.65}
.hm2-edge-list{display:flex;flex-wrap:wrap;gap:.4rem;margin:.7rem 0}
.hm2-edge-list button,.hm2-family-detail>button{padding:.5rem;border:1px solid #cbb58e;background:#fff;color:#6c432e;border-radius:6px;font-size:.8rem;cursor:pointer}
.hm2-atlas-family,.hm2-atlas-links{margin:1rem 0;padding:1rem;border:1px solid #c7ae84;background:#fffaf0;border-radius:12px;color:#332c23}
.hm2-atlas-family .hm2-family-canvas{min-width:600px}
.hm2-atlas-links p{font-size:.88rem;line-height:1.6}
.hm2-reader-dialog{padding:0;border:1px solid #b99c6c;border-radius:13px;background:#fffdf8;color:#302a27;width:min(1450px,94vw);max-width:94vw;height:90dvh;max-height:92dvh;box-shadow:0 25px 100px #0007}
.hm2-reader-dialog[open]{display:flex;flex-direction:column}
.hm2-reader-dialog::backdrop{background:#160d08ab}
.hm2-reader-head{display:flex!important;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1.1rem!important;background:#771d28!important;color:white!important;position:static!important;flex:0 0 auto}
.hm2-reader-head h2{font:600 1rem/1.4 system-ui!important;margin:0!important;color:white!important;max-width:none!important}
.hm2-close{background:#fff;color:#771d28;border:0;border-radius:7px;padding:.5rem .8rem;font:600 .88rem system-ui;cursor:pointer}
.hm2-reader-dialog iframe{border:0;width:100%;flex:1;min-height:0;background:white}
.hm2-reader-foot{display:flex!important;justify-content:flex-end;padding:.8rem 1rem!important;background:#f3e9d8!important;flex:0 0 auto}
.hm2-reader-foot a{color:#771d28!important;font:600 .9rem system-ui!important}
@media(min-width:1600px){.hm2-workspace{grid-template-columns:290px minmax(0,1fr)}.hm2-detail-fields{grid-template-columns:repeat(4,minmax(0,1fr))}.hm2-panel{padding:1.5rem 2.5rem}}
@media(max-width:850px){.hm2-workspace{grid-template-columns:minmax(160px,28%) minmax(0,1fr)}.hm2-panel{padding:1.2rem}.hm2-detail-fields{grid-template-columns:1fr}.hm2-person{font-size:.8rem!important}.hm2-controls{padding:.8rem}.hm2-rail{padding:.6rem .8rem}.hm2-views button{padding:.55rem .65rem}}
@media(max-width:580px){[data-hm2-tree]{width:92%;border-radius:12px}[data-hm2-tree] .history-tree-head-239{padding:1rem}.hm2-workspace{display:flex;flex-direction:column}.hm2-navigation{width:100%;box-sizing:border-box;border-right:0;border-bottom:1px solid #ddd0bc}.hm2-index{max-height:170px;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}.hm2-node{padding:.6rem}.hm2-node>strong{font-size:.81rem}.hm2-panel{width:100%;box-sizing:border-box;padding:1rem}.hm2-detail-head h3{font-size:1.4rem}.hm2-detail-head .hm2-portrait{width:50px;height:50px;flex-basis:50px}.hm2-views{width:100%;justify-content:space-between}.hm2-views button{font-size:.8rem}.hm2-rail{gap:.4rem}.hm2-step{width:34px;height:34px;flex-basis:34px}.hm2-tick{width:6px;height:6px;border-width:1px}.hm2-reader-dialog{width:96vw;max-width:96vw;height:94dvh;max-height:94dvh}.hm2-family-viewport{margin:0}.hm2-lead{font-size:1rem}}
@media(prefers-reduced-motion:reduce){[data-hm2-tree] *{scroll-behavior:auto!important}}
