/* Anetræet – bygger på style.css (papir, blæk, guld) */
.tree-page main.tree-main{max-width:1600px;padding:0 3%}
.tree-bar{display:grid;grid-template-columns:auto minmax(260px,1fr) auto;gap:32px;align-items:end;padding:34px 0 22px;border-bottom:1px solid var(--line)}
.tree-title h1{font-size:clamp(36px,3.4vw,52px);margin:0 0 4px}
.tree-title p{margin:0;font-size:13px;color:var(--muted)}
.tree-search{position:relative}
.tree-search label{display:block;font-size:12px;color:var(--muted)}
.tree-search input{padding:10px 0;font-size:17px}
#tsuggest{position:absolute;z-index:20;left:0;right:0;top:100%;margin:6px 0 0;padding:6px;list-style:none;background:#fbfaf5;border:1px solid var(--line);box-shadow:0 18px 40px -18px rgba(35,59,50,.35);max-height:420px;overflow:auto}
#tsuggest li{padding:9px 10px;cursor:pointer;display:grid;grid-template-columns:1fr auto;gap:2px 14px}
#tsuggest li[aria-selected=true],#tsuggest li:hover{background:#ecebe0}
#tsuggest b{font-family:'Playfair Display',Georgia,serif;font-weight:400;font-size:17px}
#tsuggest span{font-size:12px;color:var(--muted)}
#tsuggest small{grid-column:1/-1;font-size:12px;color:var(--muted)}
.tree-tools{display:flex;gap:20px;align-items:center;flex-wrap:wrap}
.tree-tools button{font:600 12px 'DM Sans',sans-serif;color:var(--ink);background:transparent;border:1px solid var(--ink);padding:9px 14px;cursor:pointer}
.tree-tools button:hover{background:#ebece1}
.tree-tools button:focus-visible,.tcard:focus-visible,.chip:focus-visible,#tsuggest li:focus-visible{outline:3px solid #b47940;outline-offset:3px}
.depth{display:flex;align-items:center;gap:0}
.depth span{font-size:12px;color:var(--muted);margin-right:10px}
.depth button{border-right-width:0;min-width:36px}
.depth button:last-child{border-right-width:1px}
.depth button[aria-pressed=true]{background:var(--ink);color:var(--paper)}

.tree-stage{display:grid;grid-template-columns:minmax(0,1fr) 380px;border-bottom:1px solid var(--line);min-height:640px}
.tree-canvas{position:relative;overflow:auto;cursor:grab;height:calc(100vh - 230px);min-height:620px;max-height:900px;background:
 radial-gradient(circle at 1px 1px,#dcdccd 1px,transparent 0) 0 0/26px 26px}
.tree-canvas.dragging{cursor:grabbing;user-select:none}
.tree-canvas:focus-visible{outline:2px solid #b47940;outline-offset:-2px}
.tree-inner{position:relative;margin:auto}
.tree-lines{position:absolute;inset:0;overflow:visible;pointer-events:none}
.tree-lines path{fill:none;stroke:#a9b0a0;stroke-width:1.3}
.tree-lines path.l-line{stroke:var(--gold);stroke-width:2}
.tree-lines path.l-sp{stroke-dasharray:3 4}

.tcard{position:absolute;top:0;left:0;overflow:hidden;display:flex;gap:10px;align-items:center;padding:10px 12px;background:#fbfaf5;border:1px solid #cfd2c3;text-align:left;font:inherit;color:inherit;cursor:pointer;
 transition:transform .55s cubic-bezier(.3,.7,.2,1),opacity .4s ease,box-shadow .2s,border-color .2s;will-change:transform}
.tcard:hover{border-color:var(--ink);box-shadow:0 10px 24px -14px rgba(35,59,50,.5)}
.tcard .tc-ph{position:relative;overflow:hidden;flex:none;width:38px;height:38px;border-radius:50%;background:#e2e3d6 center/cover no-repeat;display:grid;place-items:center;font:15px 'Playfair Display',Georgia,serif;color:#7c876f}
.tcard .tc-t{min-width:0;white-space:normal}
.tcard b{font:400 15px/1.22 'Playfair Display',Georgia,serif;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:break-word}
.tcard span{display:block;font-size:11px;line-height:1.45;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tcard.is-line{border-top:3px solid var(--gold)}
.tcard.is-anc:not(.is-line)::after{content:'';position:absolute;top:7px;right:7px;width:6px;height:6px;border-radius:50%;background:var(--gold);opacity:.7}
.tcard.is-liv{background:transparent;border-style:dashed}
.tcard.is-liv b{color:var(--muted)}
.tcard.is-focus{background:var(--ink);color:var(--paper);border-color:var(--ink);padding:14px 16px;box-shadow:0 22px 40px -22px rgba(35,59,50,.8)}
.tcard.is-focus b{font-size:20px;-webkit-line-clamp:3}
.tcard.is-focus span{color:#c9d2c8}
.tcard.is-focus .tc-ph{width:54px;height:54px;background-color:#365445;color:#c9b489}
.tcard.is-focus.is-line{border-top-color:#d0b388}
.tcard.sm{padding:7px 9px;gap:0}
.tcard.sm .tc-ph{display:none}
.tcard.sm b{font-size:13px}
.tcard.sm span{font-size:10px}
.tcard.ghost{background:transparent;border:1px dashed #c4c8b8;cursor:default;color:#9aa293;justify-content:center}
.tcard.ghost b{font:italic 13px 'Playfair Display',Georgia,serif}
.tcard.enter{opacity:0}
.tree-more{position:absolute;font-size:11px;color:var(--muted);white-space:nowrap}

.tree-panel{border-left:1px solid var(--line);padding:30px 28px 40px;overflow:auto;height:calc(100vh - 230px);min-height:620px;max-height:900px;background:var(--paper)}
.tcard .tc-ph img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.tree-panel .p-photo{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;object-position:center 20%;background:#e2e3d6;margin-bottom:20px}
.tree-panel h2{font-size:32px;margin:0 0 6px}
.tree-panel .p-life{font:22px Georgia,serif;color:var(--gold);margin:0 0 4px}
.tree-panel .p-sub{font-size:13px;color:var(--muted);margin:0 0 18px}
.tree-panel .p-story{display:inline-block;margin:4px 0 18px;font-size:13px;font-weight:600}
.tree-panel h3{font:600 11px 'DM Sans',sans-serif;letter-spacing:.06em;color:var(--gold);margin:26px 0 10px;text-transform:none}
.tree-panel dl{margin:0;display:grid;grid-template-columns:78px 1fr;gap:6px 12px;font-size:13px;line-height:1.55}
.tree-panel dt{color:var(--muted);font-size:12px;text-transform:none;letter-spacing:0;margin:0}
.tree-panel dd{margin:0}
.tree-panel ul.p-tl{list-style:none;margin:0;padding:0 0 0 16px;border-left:1px solid var(--line);font-size:13px;line-height:1.5}
.tree-panel ul.p-tl li{position:relative;margin:0 0 10px}
.tree-panel ul.p-tl li::before{content:'';position:absolute;left:-20px;top:7px;width:7px;height:7px;border-radius:50%;background:var(--gold)}
.tree-panel ul.p-tl small{display:block;color:var(--muted);font-size:11px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{font:13px 'DM Sans',sans-serif;color:var(--ink);background:#fbfaf5;border:1px solid var(--line);padding:5px 10px;cursor:pointer;text-align:left}
.chip:hover{border-color:var(--ink)}
.chip small{color:var(--muted);margin-left:6px}
.chip.is-liv{border-style:dashed;color:var(--muted)}
.tree-panel .p-note{font-size:13px;line-height:1.65;color:#3c4d44;white-space:pre-line}
.tree-panel details summary{cursor:pointer;font-size:13px;font-weight:600}
.tree-panel .p-src{font-size:12px;color:var(--muted);line-height:1.5;padding-left:16px;margin:0}
.tree-panel .p-living{font-size:13px;color:var(--muted);background:#ecebe0;padding:14px 16px}
.tree-legend{font-size:12px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px 22px;align-items:center;padding:14px 0 50px;margin:0}
.lg{display:inline-block;width:22px;height:12px;margin-right:6px;vertical-align:-1px;border:1px solid #cfd2c3;background:#fbfaf5}
.lg-line{border-top:3px solid var(--gold)}
.lg-anc{width:8px;height:8px;border-radius:50%;background:var(--gold);border:0;opacity:.7}
.lg-liv{border-style:dashed;background:transparent}

@media(max-width:1000px){
 .tree-bar{grid-template-columns:1fr;gap:16px}
 .tree-stage{grid-template-columns:1fr}
 .tree-canvas{height:68vh;min-height:460px}
 .tree-panel{border-left:0;border-top:1px solid var(--line);height:auto;max-height:none;min-height:0}
}
@media(prefers-reduced-motion:reduce){.tcard{transition:none}}
