@font-face{font-family:Golos;src:url('assets/fonts/golos-0.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Golos;src:url('assets/fonts/golos-1.ttf') format('truetype');font-weight:500;font-display:swap}
@font-face{font-family:Golos;src:url('assets/fonts/golos-2.ttf') format('truetype');font-weight:600;font-display:swap}
:root{font-family:Golos,system-ui,sans-serif;color:#293e31;background:#f7f5ed;font-synthesis:none;--pine:#315c46;--sage:#7e9279;--gold:#ae7d39;--line:#d9ddce}
*{box-sizing:border-box}body{margin:0;overflow:hidden;height:100dvh;background:radial-gradient(ellipse at 18% 50%,#e9eee16b,transparent 45%),radial-gradient(ellipse at 75% 60%,#f0e5c64f,transparent 48%)}button,input,select{font:inherit}button,select{cursor:pointer}button{color:inherit}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #c29a52;outline-offset:3px}button{border:0;background:none}a{color:inherit}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.botanical{position:fixed;inset:135px 0 0;pointer-events:none;overflow:hidden;opacity:.5}.botanical svg{display:block;width:100%;height:100%;pointer-events:none}.botanical .tree-boughs,.botanical .tree-roots{opacity:.84}.botanical .tree-foliage{opacity:.82}.masthead{position:fixed;z-index:20;top:25px;left:34px;right:34px;display:flex;align-items:center;gap:18px}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;font-size:27px;letter-spacing:-1.2px;font-weight:600}.brand small{display:block;font-size:10px;font-weight:400;letter-spacing:.03em;color:#81907a;margin-top:3px}.sprout{display:grid;place-items:center;width:48px;height:48px;border-radius:20px 7px 20px 7px;background:#315c46;color:#f5edcf;font-size:53px;font-weight:400;line-height:1;transform:rotate(-12deg)}.search-area{position:relative;margin-left:auto;width:260px}#search{width:100%;border:1px solid #d9ddce;border-radius:24px;padding:13px 20px;background:#fffff9d9;color:#314937;font-size:12px;box-shadow:0 2px 18px #4a604807}#search::placeholder{color:#8d9786}#matches{position:absolute;top:52px;width:100%;max-height:300px;overflow:auto;background:#fffef7;border:1px solid var(--line);border-radius:16px;padding:6px;box-shadow:0 12px 35px #40513815}#matches button{display:block;width:100%;padding:12px;text-align:left;border-radius:10px;font-size:12px}#matches button:hover{background:#eef2e7}#matches p{font-size:12px;padding:6px 12px}.round-button{border:1px solid #d9ddce;border-radius:50%;width:36px;height:36px;flex-shrink:0;background:#fffdf4a6;color:#7a8973;font-size:17px}.heading{position:fixed;top:109px;left:37px;pointer-events:none;z-index:4;max-width:400px}.eyebrow{font-size:9px;font-weight:500;letter-spacing:.16em;color:#89927c}.heading h1{font-weight:500;font-size:22px;letter-spacing:-.6px;margin:8px 0}.heading p{font-size:11px;color:#8d947f;line-height:1.5;margin:0}#garden{position:fixed;inset:0;overflow:hidden;touch-action:none;cursor:grab}#garden.dragging{cursor:grabbing}#world{position:absolute;transform-origin:0 0;will-change:transform}#branches{position:absolute;inset:0;overflow:visible;pointer-events:none}#leaves{position:absolute;inset:0}.branch{fill:none;stroke:#5d8063;stroke-width:2.1;stroke-linecap:round;opacity:.75}.branch.reported{stroke-dasharray:3 5;opacity:.62}.branch.hypothesis,.branch.unknown{stroke:#ad8245;stroke-dasharray:8 6}.branch.active{stroke:#507b38;stroke-width:4;opacity:1}.branch-label{font-family:Golos,system-ui,sans-serif;font-size:10px;fill:#788168;paint-order:stroke;stroke:#f7f5ed;stroke-width:5px;stroke-linejoin:round}.leaf{position:absolute;width:230px;height:170px;padding:18px;text-align:left;background:#fffef7;border:1px solid #cbd7c3;border-radius:36px 12px 36px 12px;box-shadow:0 8px 24px #4a60480b;color:#2f4937;transition:box-shadow .2s,border-color .2s,background .2s;cursor:pointer}.leaf:before{content:'';position:absolute;right:14px;top:12px;width:28px;height:15px;border-radius:80% 0 80% 0;border:1px solid #dce4d0;transform:rotate(-25deg)}.leaf:hover{background:#f6f9ee;border-color:#87a079;box-shadow:0 12px 28px #4a604818}.leaf.selected{border-color:#648752;box-shadow:0 0 0 3px #9eb4873b,0 12px 35px #4a604818}.leaf.in-path{background:#eaf1df}.leaf.root{background:#315c46;border-color:#315c46;color:#fffcec;box-shadow:0 10px 30px #315c4626}.leaf.root .lifespan,.leaf.root .place,.leaf.root .photo-kind{color:#d0ddbd}.leaf.root:before{border-color:#94b18b}.portrait{width:42px;height:42px;object-fit:cover;border-radius:50%;border:1px solid #d9e2cb;float:left;margin:0 12px 12px 0;background:#edf2e4}.initials{display:grid;place-items:center;color:#8ba078;font-size:14px;letter-spacing:.04em;font-weight:500}.leaf h2{font-size:16px;line-height:1.3;font-weight:500;margin:0 0 7px;padding-right:5px;min-height:41px}.lifespan{clear:both;font-size:12px;color:#718366;margin:3px 0 6px}.place{font-size:10px;color:#909a81;margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.place img{width:11px;height:11px;vertical-align:-1px;margin-right:5px;opacity:.6}.photo-kind{font-size:8px;color:#9a9477;margin-top:8px;letter-spacing:.02em}.leaf .root-label{position:absolute;right:16px;bottom:15px;font-size:8px;letter-spacing:.1em;text-transform:uppercase;color:#d1dfbb}.unknown-badge{position:absolute;bottom:-21px;left:0;right:0;text-align:center;font-size:9px;color:#998467;letter-spacing:.02em}.selection-note{position:fixed;z-index:9;left:50%;bottom:118px;transform:translateX(-50%);max-width:560px;padding:10px 17px;border:1px solid #e0ddc9;border-radius:15px;background:#fffdf3ed;color:#807454;font-size:11px;text-align:center;line-height:1.6;pointer-events:none}
.tools{position:fixed;left:35px;bottom:32px;display:flex;gap:12px;z-index:10}.zoom-tools,.relation-tools{display:flex;align-items:center;gap:4px;min-height:48px;padding:7px 10px;border:1px solid #d8decd;background:#fffdf5ee;border-radius:25px;box-shadow:0 5px 22px #4a604808}.zoom-tools button{font-size:12px;min-width:30px;min-height:30px;border-radius:20px}.zoom-tools button:hover{background:#edf2e4}.zoom-tools #zoom-out,.zoom-tools #zoom-in{font-size:20px}.zoom-tools span{height:18px;width:1px;background:#dce1d3;margin:0 8px}.relation-tools label{font-size:10px;margin:0 7px;color:#8d967e}.relation-tools select{border:0;background:transparent;color:#4e6944;font-size:11px;max-width:170px;padding:6px}.legend{position:fixed;left:39px;bottom:96px;display:flex;align-items:center;gap:6px;color:#969c89;font-size:9px;pointer-events:none}.legend i{width:15px;height:0;border-top:2px solid #658465;margin-left:8px}.legend i:first-child{margin-left:0}.legend .reported{border-top-style:dotted}.legend .hypothesis{border-top-style:dashed;border-color:#ad8245}#map-button{position:fixed;right:34px;bottom:30px;width:165px;height:116px;padding:12px;border:1px solid #dce1d1;border-radius:22px 7px 22px 7px;background:#fcfbf3dc;color:#9aa18c;z-index:7}#mini-map{width:100%;height:76px;display:block}#map-button span{font-size:8px;letter-spacing:.09em;text-transform:uppercase}#details{position:fixed;right:27px;top:95px;bottom:165px;width:315px;overflow:auto;background:#fffef7f5;border:1px solid #d9dfcd;border-radius:26px 9px 26px 9px;padding:27px;z-index:12;box-shadow:0 20px 60px #3d503312}#close-details{position:absolute;right:12px;top:12px;width:28px;height:28px;font-size:20px}.detail-portrait{display:block;width:95px;height:95px;object-fit:contain;border-radius:24px 6px 24px 6px;background:#f0f3e9;border:1px solid #e0e6d5;margin:0 0 18px}.detail-initials{display:grid;place-items:center;color:#93a480;font-size:28px}#details h2{font-weight:500;font-size:24px;letter-spacing:-.5px;line-height:1.3;margin:0 0 13px}#details h3{font-weight:500;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#879578;margin:24px 0 11px}#details p,#details a{font-size:12px;line-height:1.7;overflow-wrap:anywhere}#details a{color:#557542}#details .detail-muted{font-size:10px;color:#96a087}#details .related-person{display:block;width:100%;text-align:left;padding:10px 0;border-bottom:1px solid #edf0e5;font-size:12px}#details .related-person small{display:block;color:#98977f;font-size:9px;line-height:1.6;margin-top:4px}.evidence-warning{background:#f5eddb;border-radius:10px;padding:10px 12px;color:#9c783e;font-size:10px!important}.path-step{padding:8px 0 8px 12px;border-left:2px solid #cbd9b6;font-size:12px}.path-step small{display:block;font-size:9px;color:#9b967d;margin-top:5px}#guide{border:1px solid #d9dfcc;border-radius:30px 9px 30px 9px;background:#fffdf5;color:#344c38;max-width:540px;padding:36px}#guide::backdrop{background:#304c3426;backdrop-filter:blur(3px)}#guide h2{font-weight:500;font-size:26px;line-height:1.3}#guide p{font-size:12px;line-height:1.8;color:#7f8b73}#guide a{font-size:10px}#close-guide{position:absolute;right:13px;top:13px}#error{position:fixed;z-index:40;top:35%;left:50%;transform:translateX(-50%);max-width:500px;padding:24px;border-radius:20px;background:#fff1dc;color:#98683b;font-size:14px;line-height:1.7}
@media(max-width:800px),(max-width:950px) and (max-height:500px){.masthead{top:17px;left:19px;right:19px;gap:10px}.brand{font-size:22px;gap:8px}.brand small{display:none}.sprout{width:36px;height:36px;font-size:40px;border-radius:14px 5px 14px 5px}.search-area{width:180px}.heading{top:88px;left:22px;max-width:260px}.heading h1{font-size:18px}.heading p{font-size:10px}.tools{left:16px;right:16px;bottom:18px;gap:7px;flex-wrap:wrap}.zoom-tools,.relation-tools{min-height:42px;padding:5px 8px}.relation-tools label{display:none}.relation-tools select{max-width:130px}.legend{left:22px;bottom:112px;font-size:8px}.selection-note{bottom:154px;width:calc(100vw - 32px);font-size:10px;max-width:450px}#map-button{right:20px;bottom:123px;width:95px;height:75px;padding:7px;border-radius:14px 4px 14px 4px}#mini-map{height:44px}#map-button span{font-size:6px}#details{left:16px;right:16px;top:auto;bottom:113px;width:auto;max-height:51dvh;padding:22px;border-radius:23px 7px 23px 7px}.detail-portrait{float:left;width:65px;height:65px;margin:0 15px 15px 0}#details h2{font-size:21px;padding-right:20px;min-height:55px}#details h3{clear:both}#guide{width:calc(100vw - 32px);padding:28px}.heading{max-width:230px}}
@media(prefers-reduced-motion:reduce){.leaf{transition:none}}

.sprout svg{width:32px;height:32px;display:block;transform:rotate(12deg)}
@media(max-width:800px),(max-width:950px) and (max-height:500px){.sprout svg{width:25px;height:25px}}

body::after{content:'';position:fixed;z-index:2;pointer-events:none;left:0;right:0;top:0;height:205px;background:linear-gradient(to bottom,#f7f5ed 0%,#f7f5ed 78%,#f7f5ed00 100%)}
@media(max-width:800px),(max-width:950px) and (max-height:500px){body::after{height:195px;background:linear-gradient(to bottom,#f7f5ed 0%,#f7f5ed 82%,#f7f5ed00 100%)}}
/* Evidence is accessible from both a branch and its relationship row. */
#leaves{pointer-events:none}.leaf{pointer-events:auto}.branch-hit{fill:none;stroke:transparent;stroke-width:18;pointer-events:stroke;cursor:pointer}.branch-hit:focus{outline:none;stroke:#b69b6940;stroke-width:20}.branch.has-conflict,.branch.has-conflict.active{stroke:#b07447;stroke-dasharray:5 4}.relation-row{padding:5px 0 12px;border-bottom:1px solid #e7ecdf}#details .relation-row .related-person{border:0;padding-bottom:5px}.evidence-button{display:inline-block;border:1px solid #d9e2ca;background:#f1f5e9;color:#5c774a;border-radius:12px;padding:7px 11px;font-size:10px;line-height:1.5;text-align:left;margin-top:5px}.evidence-button:hover{background:#e5edda;border-color:#bccda6}.path-step .evidence-button{margin:7px 0 3px}.conflict-label{font-size:10px!important;color:#a5723d!important;margin:4px 0;line-height:1.5}#evidence-dialog{position:fixed;inset:18px 18px 18px auto;margin:0;width:min(580px,calc(100vw - 36px));height:calc(100dvh - 36px);max-height:none;max-width:none;border:1px solid #d0dac3;border-radius:28px 9px 28px 9px;background:#fffdf5;color:#354c38;padding:0;box-shadow:0 25px 90px #263d3429;overflow:auto}#evidence-dialog::backdrop{background:#2b44332e;backdrop-filter:blur(2px)}.evidence-header{position:sticky;top:0;z-index:1;background:#fffdf5f7;padding:27px 28px 20px;border-bottom:1px solid #e4e9da;backdrop-filter:blur(10px)}#close-evidence{position:absolute;top:15px;right:15px}.evidence-header h2{font-size:26px;font-weight:500;letter-spacing:-.5px;margin:12px 25px 12px 0}.evidence-header>p{font-size:12px;line-height:1.7;color:#7e8b72;margin:0;white-space:pre-line;overflow-wrap:anywhere}#evidence-body{padding:20px 28px 30px}#evidence-body p{font-size:12px;line-height:1.75;white-space:pre-line;overflow-wrap:anywhere}.evidence-demo{background:#eef3e5;color:#7f8d6e;padding:10px 12px;border-radius:12px;font-size:10px!important;margin:0 0 18px}.evidence-empty{color:#989b86;padding:8px 0}.claim-card{margin:0 0 25px;padding:0 0 24px;border-bottom:1px solid #e1e7d6}.claim-card:last-child{border-bottom:0}.claim-status{font-size:9px!important;text-transform:uppercase;letter-spacing:.08em;color:#8c9a7d;margin:8px 0}.claim-card h3{font-size:18px;font-weight:500;line-height:1.5;margin:8px 0 19px;overflow-wrap:anywhere}.source-card{border:1px solid #e0e6d6;border-left:3px solid #afc18e;border-radius:3px 13px 13px 3px;padding:17px;background:#fcfcf5;margin:13px 0}.source-card>h4{font-size:14px;line-height:1.5;font-weight:500;margin:0 0 8px;overflow-wrap:anywhere}.source-card>a{font-size:11px;color:#5c7c41;display:inline-block;margin-bottom:8px}.evidence-field{margin-top:14px}.evidence-field h4{font-size:10px;font-weight:500;color:#8b947d;margin:0 0 4px}.evidence-field p{margin:0;color:#58674f}.source-classification{font-size:9px!important;color:#8a9678;margin:11px 0 0}.source-reading p{background:#f0f3e7;padding:11px 13px;border-radius:9px}.conflict-card{padding:14px 17px;background:#f6f0df;border:1px solid #e7dabb;border-radius:12px;margin:15px 0}.conflict-card>h4{font-size:11px;font-weight:500;color:#9d7841;margin:0 0 8px}.conflict-card>p{margin:0;color:#8d7a59}.conflict-card.resolved{background:#eef3e9;border-color:#d3dfc5}.conflict-card.resolved>h4{color:#789064}.conclusion-card{padding:3px 0 0 16px;border-left:2px solid #bed0a3;margin-top:20px}
@media(max-width:800px),(max-width:950px) and (max-height:500px){#evidence-dialog{inset:10px;width:calc(100vw - 20px);height:calc(100dvh - 20px);border-radius:22px 7px 22px 7px}.evidence-header{padding:23px 20px 16px}.evidence-header h2{font-size:22px}#evidence-body{padding:17px 20px 24px}.source-card{padding:13px}.evidence-button{min-height:32px}}
.assertion-label{border-left:2px solid #c4d5b0;padding:8px 12px;background:#f1f5e9;color:#70825c;font-size:11px!important;margin:0 0 17px}

/* The person card is a small family archive, with editing only in a local case. */
textarea{font:inherit}textarea:focus-visible{outline:3px solid #c29a52;outline-offset:3px}
#details{width:440px;right:20px;top:92px;bottom:24px;padding:26px 24px;scrollbar-width:thin;scrollbar-color:#c7d2bb transparent}
#close-details{width:36px;height:36px;z-index:2;right:12px;top:12px}
.person-header{display:flex;align-items:flex-start;gap:17px;padding-right:24px;margin:1px 0 22px}
.person-header .detail-portrait{flex:none;float:none;width:78px;height:92px;margin:0;object-fit:cover;border-radius:24px 6px 24px 6px}
.person-heading{min-width:0}.person-heading .eyebrow{font-size:8px;letter-spacing:.12em}
#details .person-heading h2{font-size:24px;line-height:1.25;margin:7px 0 8px;min-height:0;padding:0;overflow-wrap:anywhere}
#details .person-dates,#details .person-place{font-size:11px;color:#697c60;margin:4px 0;line-height:1.5}
#details .local-case-label{display:flex;align-items:center;gap:6px;color:#61764f;font-size:10px;margin:0 0 15px;background:#edf3e5;padding:8px 11px;border-radius:10px}
.local-case-label:before{content:'';width:5px;height:5px;background:#6e8c51;border-radius:50%;flex:none}
.dossier-tabs{display:flex;gap:4px;border-bottom:1px solid #dde4d2;margin:0 -2px 22px;padding-bottom:7px}
.dossier-tab{flex:1;min-height:40px;padding:9px 8px;border-radius:11px;font-size:12px;color:#819071;white-space:nowrap}
.dossier-tab[aria-selected=true]{background:#e8efdd;color:#365b37;font-weight:500}.dossier-tab:hover{background:#f0f4e9}
.dossier-panel{min-height:150px}.dossier-section{margin:24px 0}.dossier-section:first-child{margin-top:0}
#details .dossier-section h3{font-size:11px;letter-spacing:.08em;margin:0 0 10px;color:#697f57}
#details .dossier-prose{white-space:pre-wrap;font-size:13px;line-height:1.85;color:#4e6247;margin:0}
#details .dossier-empty,.dossier-empty{font-size:12px;line-height:1.8;color:#859078;margin:12px 0;overflow-wrap:anywhere}
#details .dossier-intro{color:#7c896e;font-size:11px;line-height:1.8;margin:0 0 20px}
.dossier-action{display:inline-flex;justify-content:center;align-items:center;gap:6px;min-height:40px;border:1px solid #d4dfc7;border-radius:11px;padding:9px 13px;color:#4f7041;background:#fafcf5;font-size:11px;line-height:1.5;text-decoration:none;text-align:center}
.dossier-action:hover{background:#eef4e4;border-color:#b8cba4}.primary-soft{background:#edf3e3;border-color:#ccdbbc}.primary-solid{color:#fffdf1;background:#365f42;border-color:#365f42}.primary-solid:hover{background:#294e35;border-color:#294e35}.dossier-action:disabled{opacity:.55;cursor:wait}
.archive-entry{display:block;width:100%;padding:19px 20px;border:1px solid #dbe4ce;border-radius:19px 6px 19px 6px;background:linear-gradient(120deg,#eef4e7,#f7f8ed);text-align:left;color:#3e633f;margin:26px 0}
.archive-entry>span{font-size:10px;letter-spacing:.09em;text-transform:uppercase;color:#7e926b}.archive-entry>strong{display:block;font-size:22px;font-weight:500;margin:8px 0 7px}.archive-entry>small{font-size:10px;color:#7d8b6a}.archive-entry:hover{border-color:#b6c8a2;background:#edf3e2}
.materials-toolbar{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin:0 0 15px}
.material-filter{display:block;font-size:10px;color:#879476}.material-filter select{display:block;max-width:180px;width:100%;margin-top:4px;padding:8px 28px 8px 10px;border:1px solid #dbe2ce;border-radius:10px;background:#fcfdf7;color:#557148;font-size:11px;min-height:38px}
#details .material-count{font-size:10px;color:#8d987d;margin:0 0 14px}.material-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:start}
.material-card{border:1px solid #dfe6d4;border-radius:16px 5px 16px 5px;background:#fefef8;overflow:hidden;min-width:0;box-shadow:0 4px 14px #49603705}
.material-open{padding:0;text-align:left;width:100%;display:block}.material-open:focus-visible{outline-offset:-3px}
.material-thumbnail{height:142px;overflow:hidden;background:#edf1e4;border-bottom:1px solid #e1e7d7;display:flex;align-items:center;justify-content:center}.material-thumbnail img{width:100%;height:100%;object-fit:cover;transition:transform .18s}.material-open:hover .material-thumbnail img{transform:scale(1.04)}
.file-thumbnail{background:linear-gradient(135deg,#eff2e6,#f8f7ec);flex-direction:column;gap:9px}.material-symbol{font-size:35px;font-weight:400;color:#92a37c;line-height:1}.material-file-label{font-size:9px;color:#96a181;letter-spacing:.09em;text-align:center;padding:0 10px}
.material-title{display:block;font-size:12px;font-weight:500;color:#49623f;line-height:1.55;padding:13px 13px 0;overflow-wrap:anywhere}
#details .material-meta{font-size:9px;color:#8a9578;line-height:1.5;padding:0 13px;margin:6px 0 10px}
#details .material-description{font-size:10px;color:#74816a;line-height:1.65;padding:0 13px;margin:0 0 12px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
#details .material-source{font-size:9px;color:#8b977c;border-top:1px solid #edf0e4;padding:9px 13px;margin:0;line-height:1.5}
.archive-empty{text-align:center;padding:30px 15px 35px;border:1px dashed #d7e1c9;border-radius:18px;background:#f8faf1}.archive-empty-icon{display:inline-grid;place-items:center;width:65px;height:65px;border-radius:50%;background:#edf3e4;font-size:35px;color:#a0b084}#details .archive-empty h3{margin:18px 0 10px;text-transform:none;font-size:17px;letter-spacing:-.2px;color:#687d57}#details .archive-empty p{font-size:12px;color:#8b977b;margin:0;line-height:1.8}
.finding-card{border:1px solid #e1e7d6;border-radius:14px;padding:17px;margin:0 0 13px;background:#fcfdf7}.finding-status{display:inline-block;font-size:9px;color:#70835b;padding:5px 8px;border-radius:7px;background:#edf2e5;line-height:1.5}.finding-status.hypothesis,.finding-status.candidate{color:#987343;background:#f5eddd}
#details .finding-card h3{text-transform:none;letter-spacing:0;color:#4f6546;font-size:13px;line-height:1.7;font-weight:500;margin:12px 0 8px;overflow-wrap:anywhere}
#details .finding-label{font-size:11px;color:#8b947d;margin:6px 0;white-space:pre-wrap}
#material-dialog,#editor-dialog{position:fixed;inset:24px;margin:auto;width:min(900px,calc(100vw - 48px));height:calc(100dvh - 48px);max-height:none;max-width:none;border:1px solid #d1dcc5;border-radius:26px 8px 26px 8px;background:#fffdf5;color:#354c38;padding:0;box-shadow:0 25px 90px #263d3429;overflow:auto}
#editor-dialog{width:min(650px,calc(100vw - 48px));height:auto;max-height:calc(100dvh - 48px)}
#material-dialog::backdrop,#editor-dialog::backdrop{background:#2b443340;backdrop-filter:blur(3px)}
.material-header{position:sticky;top:0;z-index:2;background:#fffdf5f7;padding:25px 30px 20px;border-bottom:1px solid #e3e9d9;backdrop-filter:blur(10px)}
.material-header .round-button{position:absolute;right:15px;top:15px}.material-header h2{font-size:25px;font-weight:500;letter-spacing:-.4px;line-height:1.3;margin:9px 32px 9px 0;overflow-wrap:anywhere}.material-header>p{font-size:11px;line-height:1.7;color:#819073;margin:0;overflow-wrap:anywhere}
#material-body,#editor-body{padding:23px 30px 30px}.material-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:0 0 20px}.material-actions>a:not(.dossier-action){font-size:11px;color:#5c7e42;line-height:1.6}
.material-preview{padding:17px;border:1px solid #e3e7d9;border-radius:15px;background:#f3f5ec;min-height:120px;overflow:hidden}.material-preview>img{display:block;width:auto;max-width:100%;max-height:65dvh;object-fit:contain;margin:0 auto}.material-preview iframe{display:block;width:100%;height:58dvh;border:0;border-radius:6px;background:#fff}.material-preview video{display:block;width:100%;max-height:65dvh;background:#273b2e;border-radius:8px}.material-preview audio{display:block;width:100%;margin:25px 0}.material-preview .detail-muted{font-size:10px;color:#859175;line-height:1.7}
.material-text{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.9 Golos,system-ui,sans-serif;color:#59694d;background:#fffef8;padding:20px;margin:0;max-height:55dvh;overflow:auto;border-radius:8px}
#material-body .dossier-section h3{font-size:11px;color:#7d8f6b;text-transform:uppercase;letter-spacing:.07em;font-weight:500}.material-metadata{display:grid;grid-template-columns:145px 1fr;gap:12px 18px;padding-top:23px;border-top:1px solid #e2e7d6;font-size:12px;line-height:1.7}.material-metadata dt{color:#879474;font-size:10px}.material-metadata dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;color:#5d6e50}.material-metadata a{color:#5b7b42}
#editor-body form{display:block}.editor-field{margin:0 0 20px}.editor-field>label{display:block;font-size:12px;color:#5b704e;font-weight:500;margin:0 0 8px}.editor-field input,.editor-field textarea,.editor-field select{display:block;width:100%;max-width:100%;font-size:12px;line-height:1.7;padding:11px 13px;border:1px solid #d4dfc7;border-radius:10px;background:#fffef9;color:#415a38}.editor-field textarea{resize:vertical;min-height:120px}.editor-field input[type=file]{font-size:11px;background:#f4f8ed}.editor-field input[type=file]::file-selector-button{border:1px solid #d4dfc7;border-radius:7px;padding:7px 10px;background:#eaf1df;color:#4b6d3e;margin-right:10px;font:inherit}.editor-field>small{display:block;font-size:10px;line-height:1.7;color:#8a967b;margin:7px 0 0}.editor-field textarea:disabled,.editor-field input:disabled,.editor-field select:disabled{opacity:.65}
.editor-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-top:8px}.editor-status{font-size:12px;line-height:1.8;padding:12px 14px;border-radius:11px;background:#edf3e3;color:#6a8257;overflow-wrap:anywhere}.editor-status.failed{background:#f6eddf;color:#936d44}.detach-material{margin-top:28px;padding-top:20px;border-top:1px solid #e6e4d8}.detach-material>p{font-size:11px;color:#8f8c76;line-height:1.8}.danger-soft{color:#94714e;border-color:#dfd5c2;background:#fbf6eb}.danger-soft:hover{background:#f4ead8;border-color:#cfbfa3}
#case-status{position:fixed;z-index:30;left:50%;bottom:24px;transform:translateX(-50%);background:#365f42;color:#fffdef;border:1px solid #6e8b56;padding:13px 19px;border-radius:13px;font-size:12px;line-height:1.7;max-width:min(550px,calc(100vw - 32px));box-shadow:0 8px 28px #30492d20}
@media(max-width:1100px) and (min-width:801px){#details{width:400px}.material-grid{gap:11px}.material-thumbnail{height:123px}}
@media(max-width:800px),(max-width:950px) and (max-height:500px){
 #details{top:78px;bottom:113px;left:10px;right:10px;width:auto;max-height:none;padding:22px 19px;border-radius:22px 7px 22px 7px;background:#fffef7fa;box-shadow:0 20px 70px #344d3020}
 #close-details{top:11px;right:11px;width:36px;height:36px}.person-header{gap:13px;padding-right:24px;margin-bottom:18px}.person-header .detail-portrait{width:65px;height:77px;margin:0}.person-heading .eyebrow{font-size:7px}
 #details .person-heading h2{font-size:21px;line-height:1.25;margin-top:6px}.dossier-tabs{gap:2px;margin-bottom:20px}.dossier-tab{font-size:11px;min-height:44px;padding:8px 6px}
 .dossier-action{min-height:44px}.material-grid{gap:11px}.material-thumbnail{height:126px}.material-title{font-size:12px;padding:11px 11px 0}.material-filter select{min-height:42px}.materials-toolbar{gap:10px}.material-filter{flex:1;min-width:130px}.material-filter select{max-width:none}.person-dates{clear:none}
 #material-dialog,#editor-dialog{inset:10px;width:calc(100vw - 20px);height:calc(100dvh - 20px);max-height:none;border-radius:22px 7px 22px 7px}.material-header{padding:23px 20px 17px}.material-header h2{font-size:22px}.material-header .round-button{width:40px;height:40px;right:11px;top:11px}
 #material-body,#editor-body{padding:18px 20px 25px}.material-preview{padding:10px}.material-preview iframe{height:52dvh}.material-metadata{grid-template-columns:1fr;gap:4px;padding-top:18px}.material-metadata dd{margin-bottom:9px}.material-actions{gap:10px}.material-actions .dossier-action{flex:1;min-width:145px}.material-text{font-size:11px;padding:12px}.editor-field input,.editor-field textarea,.editor-field select{font-size:16px}.editor-field input[type=file]{font-size:12px}.editor-actions .dossier-action{flex:1}#case-status{bottom:20px;font-size:11px;width:max-content;text-align:center}
}
@media(max-width:365px){.material-grid{grid-template-columns:1fr}.material-thumbnail{height:180px}.person-header .detail-portrait{width:52px;height:65px}.dossier-tab{font-size:10px}.material-header h2{font-size:20px}}
@media(prefers-reduced-motion:reduce){.material-thumbnail img{transition:none}}

#details{background:#fffef7}#close-details{position:fixed;right:32px;top:104px;background:#fffef7}.material-thumbnail{position:relative}.thumbnail-loading{position:absolute;inset:0;display:grid;place-items:center}.material-thumbnail img{position:relative;object-fit:contain}
@media(max-width:800px),(max-width:950px) and (max-height:500px){#details{background:#fffef7}#close-details{right:21px;top:89px}}

/* The full branching tree stays behind every interactive layer. */
@media(max-width:800px),(max-width:950px) and (max-height:500px){.botanical{inset:70px -38% -15px;opacity:.55}.botanical svg{width:100%;height:100%}}

.legend{padding:6px 9px;margin-left:-9px;border-radius:10px;background:#f7f5eded}

/* Generation rows stay behind the evidence paths and never intercept card clicks. */
.generation-rule{stroke:#55724b;stroke-opacity:.15;stroke-width:1;stroke-dasharray:5 9;pointer-events:none}.generation-caption{font:500 14px Georgia,serif;fill:#52684d;pointer-events:none}.records-zone{fill:#f5f4ed;fill-opacity:.5;stroke:#8d947d;stroke-opacity:.3;stroke-dasharray:6 8;pointer-events:none}

/* Phones start near the selected family and use a full-height, readable person sheet. */
@media(max-width:800px),(max-width:950px) and (max-height:500px){
 html,body{width:100%;max-width:100%;overflow:hidden;overscroll-behavior:none}
 .masthead{top:calc(8px + env(safe-area-inset-top,0px));left:12px;right:12px;display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:8px 10px}
 .brand{grid-column:1;grid-row:1;min-width:0;min-height:44px;font-size:22px}.brand .sprout{width:38px;height:38px}
 .masthead #about{grid-column:2;grid-row:1;width:44px;height:44px}
 .search-area{grid-column:1 / -1;grid-row:2;margin:0;width:100%;min-width:0}
 #search{min-height:44px;font-size:16px;padding:10px 16px;border-radius:15px;background:#fffef9}
 #matches{top:50px;max-height:min(45dvh,320px);overscroll-behavior:contain}#matches button{min-height:48px;font-size:14px;line-height:1.45}
 .heading{top:calc(116px + env(safe-area-inset-top,0px));left:16px;right:16px;max-width:none}
 .heading .eyebrow{font-size:8px}.heading h1{font-size:17px;line-height:1.3;margin:5px 0;max-width:100%;overflow-wrap:anywhere}.heading p{font-size:11px;margin:0;line-height:1.4}
 body::after{height:calc(220px + env(safe-area-inset-top,0px));background:linear-gradient(to bottom,#f7f5ed 0%,#f7f5edf5 75%,#f7f5ed00 100%)}
 .tools{left:10px;right:10px;bottom:calc(8px + env(safe-area-inset-bottom,0px));display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
 .zoom-tools,.relation-tools{width:100%;min-width:0;min-height:50px;padding:3px 7px;border-radius:17px;justify-content:center;background:#fffdf7f5}
 .zoom-tools button{min-width:44px;min-height:44px;font-size:13px}.zoom-tools #fit{flex:1;max-width:150px;white-space:nowrap}.zoom-tools span{margin:0 4px}
 .relation-tools{gap:5px}.relation-tools label{display:block;flex:none;margin:0 5px;font-size:11px}
 .relation-tools select{min-height:44px;min-width:0;max-width:none;padding:8px;font-size:14px;flex:1;overflow:hidden;text-overflow:ellipsis}#target{flex:1.3}
 .legend{left:17px;bottom:calc(122px + env(safe-area-inset-bottom,0px));font-size:9px;gap:5px;padding:6px 7px}
 #map-button{display:none}
 .selection-note{bottom:calc(151px + env(safe-area-inset-bottom,0px));font-size:12px;line-height:1.5}
 #details{inset:calc(8px + env(safe-area-inset-top,0px)) 8px calc(8px + env(safe-area-inset-bottom,0px));z-index:30;width:auto;max-height:none;padding:58px 18px 24px;border-radius:20px;background:#fffef7;overscroll-behavior:contain;scroll-padding-top:16px}
 #close-details{position:fixed;top:calc(17px + env(safe-area-inset-top,0px));right:17px;width:44px;height:44px;background:#fffef7;border:1px solid #d4ddc9;box-shadow:0 2px 12px #344c3820}
 .person-open .masthead,.person-open .heading,.person-open .tools,.person-open .legend,.person-open .selection-note{visibility:hidden}
 .person-header{gap:12px;padding-right:0}.person-header .detail-portrait{width:68px;height:80px}.person-heading .eyebrow{font-size:9px}
 #details .person-heading h2{font-size:23px;line-height:1.3}#details .person-dates,#details .person-place{font-size:13px;line-height:1.55}
 #details p,#details a,#details .dossier-prose,#details .finding-card h3{font-size:14px;line-height:1.75}
 #details .detail-muted,#details .dossier-intro,#details .local-case-label,#details .material-meta,#details .material-source{font-size:12px;line-height:1.6}
 .dossier-tab{min-height:46px;font-size:12px;padding:8px 5px}.dossier-action,.evidence-button{min-height:44px;font-size:13px;line-height:1.5}
 #details .related-person{min-height:50px;font-size:15px;line-height:1.45}#details .related-person small{font-size:12px;line-height:1.5}.path-step{font-size:14px}.path-step small{font-size:12px}
 #details .material-description{font-size:12px;line-height:1.65}.material-title{font-size:14px}.material-filter select{min-height:44px;font-size:14px}
 #guide,#evidence-dialog,#material-dialog,#editor-dialog{inset:calc(8px + env(safe-area-inset-top,0px)) 8px calc(8px + env(safe-area-inset-bottom,0px));width:calc(100vw - 16px);max-width:none;max-height:calc(100dvh - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));height:auto;margin:0;border-radius:20px;overscroll-behavior:contain}
 #evidence-dialog,#material-dialog{height:calc(100dvh - 16px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px))}
 #guide{padding:56px 22px 24px;overflow:auto}#guide p{font-size:14px;line-height:1.75}#guide a{display:inline-block;min-height:44px;padding:12px 2px;font-size:12px}
 .material-header,.evidence-header{padding:24px 18px 18px}.material-header h2,.evidence-header h2{font-size:23px;line-height:1.35;margin-right:43px}
 .material-header .round-button,#close-evidence,#close-guide,#close-material,#close-editor{width:44px;height:44px;right:10px;top:10px}
 #material-body,#editor-body,#evidence-body{padding:18px}.material-header>p,.evidence-header>p,#evidence-body p,.material-metadata,.material-text{font-size:14px;line-height:1.7}
 .material-metadata dt,.claim-status,.source-classification{font-size:12px!important}.source-card h4{font-size:14px}.source-card>a{display:inline-block;min-height:44px;padding:10px 0;font-size:13px}
 .editor-field input,.editor-field textarea,.editor-field select{font-size:16px;min-height:44px}.editor-field>label{font-size:14px}.editor-field>small{font-size:12px}.editor-actions{gap:8px}
 #case-status{z-index:55;bottom:calc(14px + env(safe-area-inset-bottom,0px));font-size:13px}
}
@media(max-width:365px){
 .material-grid{grid-template-columns:1fr}.dossier-tab{font-size:11px;padding-left:3px;padding-right:3px}
 .person-header .detail-portrait{width:56px;height:66px}#details .person-heading h2{font-size:21px}
 .zoom-tools{gap:1px;padding-left:3px;padding-right:3px}.zoom-tools button{min-width:44px}.zoom-tools #fit{font-size:12px}
 .relation-tools label{margin:0 2px}.relation-tools select{font-size:13px;padding:7px 4px}
}

/* A landscape phone needs room for the tree between two compact control bars. */
@media(min-width:501px) and (max-width:950px) and (max-height:500px){
 .masthead{grid-template-columns:auto minmax(0,1fr) 44px;gap:10px}
 .search-area{grid-column:2;grid-row:1}.masthead #about{grid-column:3}
 .heading{top:calc(60px + env(safe-area-inset-top,0px));display:flex;flex-wrap:wrap;align-items:center;gap:3px 12px;min-height:44px;padding-right:180px}
 .heading .eyebrow{width:100%;font-size:7px}.heading h1{font-size:15px;margin:0}.heading p{font-size:10px}
 .heading .feedback-open{position:absolute;right:0;top:0;margin:0}
 body::after{height:calc(125px + env(safe-area-inset-top,0px))}
 .tools{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .legend{bottom:calc(65px + env(safe-area-inset-bottom,0px));font-size:8px}
 .selection-note{bottom:calc(88px + env(safe-area-inset-bottom,0px))}
}
