@font-face{font-family:AtlasSerif;src:local('Noto Serif CJK SC'),local('Source Han Serif SC'),local('SimSun')}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#f4f2eb;color:#233e37;font-family:'Segoe UI','Microsoft YaHei',sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button{cursor:pointer}button{border:0;background:none;color:inherit}button:disabled{opacity:.35;cursor:default}a{color:inherit}button:hover{filter:brightness(.93)}.topbar{height:84px;padding:0 44px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #deded4;background:#fbfaf6;gap:20px}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;font-family:AtlasSerif,serif;font-size:24px;font-weight:700;letter-spacing:2px}.brand-mark{font-size:44px;line-height:1;color:#ac873c}.brand-sub{display:block;font-family:'Segoe UI',sans-serif;font-size:9px;letter-spacing:2px;margin-top:4px;color:#77817a}.topbar nav{height:100%;display:flex;gap:27px}.topbar nav button{height:100%;font-size:14px;border-bottom:3px solid transparent;padding:3px 3px 0}.topbar nav button.active{border-color:#1b5748;font-weight:700}.top-actions{display:flex;align-items:center;gap:19px}.top-actions>span{font-size:11px;color:#7f8981}.button-dark,.button-light{border-radius:5px;padding:10px 15px;font-weight:600}.button-dark{color:#fff;background:#1c4b3e}.button-light{border:1px solid #d6dcd3;background:#fbfcf8}.button-light.active{background:#e6eee5;border-color:#82a88f}.intro{display:flex;align-items:center;justify-content:space-between;padding:34px 44px 29px;gap:20px}.eyebrow{font-size:10px;letter-spacing:2.5px;color:#8c8a75;font-weight:600}h1{font-family:AtlasSerif,serif;font-size:38px;letter-spacing:4px;font-weight:600;margin:13px 0 12px}h1 span{font-family:'Microsoft YaHei',sans-serif;font-size:14px;font-weight:400;letter-spacing:1px;margin-left:25px;color:#7d857c}.intro p{font-size:12px;color:#7a827b;margin:0}.spoiler{font-size:10px;border:1px solid #d8d0b9;color:#9b8147;margin-left:15px;padding:3px 6px;border-radius:3px}.intro-stats{display:flex;gap:30px;flex-shrink:0}.intro-stats div{border-left:1px solid #dddccc;padding-left:23px}.intro-stats strong{display:block;font-family:Georgia,serif;font-weight:400;font-size:32px}.intro-stats span{font-size:10px;color:#858c82;letter-spacing:1px}.workbench{margin:0 28px;border:1px solid #dedfd2;background:#fcfcf8;border-radius:9px;overflow:hidden;box-shadow:0 8px 30px #2c493509}.toolbar{height:66px;display:flex;align-items:center;gap:10px;padding:12px 20px;border-bottom:1px solid #e2e4d9}.search{display:flex;align-items:center;gap:10px;border:1px solid #dde1d7;border-radius:5px;background:#fff;padding:7px 12px;width:290px}.search>span{font-size:25px;line-height:22px;color:#718977}.search input{border:0;outline:0;min-width:0;width:100%;background:none;font-size:12px}.toolbar-filters{display:flex;gap:18px;align-items:center;margin-right:auto}.toolbar select{max-width:200px;border:0;background:transparent;font-size:12px;color:#566b60}.check{display:flex;align-items:center;font-size:11px;color:#748071;gap:6px}.check input{accent-color:#255640}.toolbar .button-light{font-size:12px;padding:9px 12px}.icon-button{font-size:25px}.search-results{padding:12px 20px;background:#f0f4ed;display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid #dbe1d6}.search-results button{border:1px solid #d2dfcf;padding:7px 12px;background:white;border-radius:4px}.map-heading{padding:16px 22px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #edf0e7}.map-heading strong{font-size:12px;letter-spacing:1px}.map-heading>div>span{display:block;font-size:10px;color:#8a9486;margin-top:5px}.legend{display:flex;gap:16px}.legend>span{display:flex!important;align-items:center;gap:6px;font-size:10px!important}.line{display:inline-block;width:20px;border-top:2px solid #56846c}.line.marriage{border-color:#b59044}.line.love{border-color:#bb8585;border-top-style:dashed}.line.care{border-color:#8794b2;border-top-style:dashed}#mapViewport{height:650px;position:relative;overflow:hidden;touch-action:none;cursor:grab;background-color:#f8f9f2;background-image:radial-gradient(#c9d4c34a 1px,transparent 1px);background-size:20px 20px}#mapViewport.dragging{cursor:grabbing}#atlas{width:100%;height:100%;display:block;user-select:none}.map-controls{position:absolute;left:20px;bottom:20px;display:flex;align-items:center;background:#fff;border:1px solid #d4ddcf;border-radius:6px;box-shadow:0 3px 12px #2133220c;height:37px;overflow:hidden}.map-controls button{padding:8px 12px;border-right:1px solid #e8ece3;font-size:12px}.map-controls span{font-size:11px;padding:0 9px;min-width:52px;text-align:center}.map-note{position:absolute;right:20px;bottom:27px;font-size:10px;color:#8c9785;background:#f8f9f2dd;padding:4px 8px}.node{cursor:pointer}.node .card-bg{transition:stroke .15s;fill:#fffefa;stroke:#cbd7c8;stroke-width:1.3}.node:hover .card-bg,.node.selected .card-bg{stroke:#234f3e;stroke-width:2.7}.node.dim{opacity:.25}.edge{fill:none;stroke-width:1.8;opacity:.64}.edge-label{font-size:10px;fill:#577261;paint-order:stroke;stroke:#f8f9f2;stroke-width:5px;stroke-linejoin:round}.edge-group.dim{opacity:.075}.edge-group.selected .edge{stroke-width:3;opacity:1}.node-name{font-size:13px;font-weight:600;fill:#224638}.node-original{font-size:8.5px;fill:#88947e}.node-note{font-size:9.5px;fill:#74856e}.generation-label{font-family:Georgia,serif;font-size:40px;fill:#d7dfce}.generation-title{font-size:11px;fill:#8f9c86;letter-spacing:2px}.map-subtitle{font-family:Georgia,serif;font-size:10px;letter-spacing:3px;fill:#a4ac99}.card-badge{font-size:8px;fill:#a58b47}.timeline-intro{padding:42px 40px 25px}.timeline-intro h2{font-family:AtlasSerif,serif;font-size:29px;letter-spacing:3px;margin:10px 0}.timeline-intro p{font-size:12px;color:#83917e;line-height:1.8}.stage-nav{display:flex;gap:5px;padding:0 30px 22px;flex-wrap:wrap}.stage-nav button{padding:8px 10px;border-radius:4px;font-size:11px;border:1px solid #dbe1d3;background:#f6f8f0}.stage-section{position:relative;padding:30px 35px 40px 120px;border-top:1px solid #e4e8da}.stage-section:before{content:'';position:absolute;left:67px;top:0;bottom:0;border-left:1px solid #ccd7be}.stage-number{position:absolute;left:43px;top:35px;width:49px;height:49px;border:1px solid #cbd5bc;background:#f5f7ed;border-radius:50%;display:grid;place-items:center;font-family:Georgia,serif;font-size:21px;color:#7e8f6b}.stage-header{display:flex;justify-content:space-between;gap:20px;align-items:center}.stage-section h3{font-family:AtlasSerif,serif;font-size:24px;margin:9px 0 10px;letter-spacing:2px}.stage-section p{font-size:12px;line-height:1.9;color:#788774;max-width:760px}.stage-people{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px;margin-top:23px}.mini-person{background:#f8f9f2;border:1px solid #dce3d3;border-radius:6px;overflow:hidden;text-align:left;padding:0;min-width:0}.mini-person img,.mini-person .portrait-placeholder{width:100%;height:126px;object-fit:cover;object-position:center 25%}.mini-person .info{padding:12px}.mini-person strong{font-size:12px;line-height:1.7;display:block}.mini-person small{color:#87917d;font-size:10px;display:block;margin-top:4px}.stage-relations{display:flex;flex-wrap:wrap;gap:7px;margin-top:18px}.relation-chip{padding:7px 9px;background:#f2f4e9;border-radius:3px;font-size:10px;line-height:1.8}.relation-chip em{font-style:normal;color:#a88840;padding:0 6px}.directory-heading{display:flex;align-items:center;justify-content:space-between;padding:20px 30px}.directory-heading h2{font-family:AtlasSerif,serif;font-size:24px;letter-spacing:2px}.directory-heading p{font-size:12px;color:#88937e}#directory{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:18px;padding:0 30px 35px}.portrait-placeholder{background:linear-gradient(150deg,#e6ebdd,#c5d2bd);display:flex;flex-direction:column;align-items:center;justify-content:center;color:#8d9d7e}.portrait-placeholder span{font-family:AtlasSerif,serif;font-size:32px;letter-spacing:8px}.portrait-placeholder small{font-size:10px;margin-top:9px;letter-spacing:1px}footer{padding:20px 35px 30px;display:flex;justify-content:space-between;color:#8a9382;font-size:10px}footer button{text-decoration:underline;font-size:10px}.hidden{display:none!important}.backdrop{position:fixed;inset:0;background:#0a1d164a;z-index:10}.drawer{position:fixed;right:0;top:0;bottom:0;width:450px;max-width:100%;background:#fafaf4;z-index:11;overflow-y:auto;box-shadow:-15px 0 60px #0f221927}.close{font-size:27px;width:36px;height:36px;background:#fafaf4dc;border-radius:50%;line-height:30px}.drawer>.close{position:absolute;top:15px;right:15px;z-index:1}.drawer-hero{height:245px;position:relative;background:#dfe7d6}.drawer-hero img{height:100%;width:100%;object-fit:cover;object-position:center 25%}.drawer-hero>.portrait-placeholder{height:100%}.drawer-body{padding:25px 30px}.drawer h2{font-family:AtlasSerif,serif;font-size:28px;line-height:1.4;margin:8px 0}.original{font-family:Georgia,serif;font-size:14px;color:#899780;font-style:italic}.tag{display:inline-block;font-size:10px;padding:4px 7px;background:#e8edde;color:#758567;border-radius:3px;margin:3px 4px 3px 0}.drawer p{font-size:12px;line-height:1.9;color:#75836b}.drawer h3{font-size:13px;margin-top:26px;letter-spacing:1px}.age-gallery{display:flex;gap:10px;overflow-x:auto;padding-bottom:8px}.age-item{flex:0 0 105px;font-size:10px;color:#7c8873}.age-item img{width:105px;height:115px;object-fit:cover;border-radius:4px}.age-item strong{display:block;margin:6px 0}.age-item a{display:block;font-size:9px;margin-top:4px}.relationship-row{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e3e7d9;padding:12px 0;gap:10px;font-size:12px}.relationship-row small{font-size:10px;color:#92a084}.relationship-row .target{text-align:left}.relationship-row em{font-style:normal;color:#8f753e;font-size:10px}.evidence{padding:9px 0;border-bottom:1px solid #e6eadc;font-size:11px;line-height:1.8}.evidence a{color:#587b54}.evidence small{display:block;color:#95a08b}.drawer-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}.drawer-actions button{font-size:11px}.status-note{padding:11px;background:#f0eddd;color:#97804c!important;border-radius:4px;font-size:11px!important}dialog{border:1px solid #cdd7c0;border-radius:9px;width:640px;max-width:94vw;max-height:90vh;padding:0;color:#294733;background:#fafbf4}dialog::backdrop{background:#10201672}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:18px 25px;border-bottom:1px solid #dde5d2}.modal-head h2{font-family:AtlasSerif,serif;font-size:21px;margin:0}#modalBody{padding:24px 25px;overflow-y:auto;max-height:74vh}#modalBody p{font-size:12px;color:#7e8d71;line-height:1.9}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.form-grid label{font-size:11px;color:#6d805e}.form-grid input,.form-grid select,.form-grid textarea{display:block;margin-top:6px;width:100%;padding:10px;border:1px solid #cfd9c4;border-radius:4px;background:#fff;color:#294733;font-size:12px}.form-grid .full{grid-column:1/-1}.form-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:20px}.export-list{display:grid;grid-template-columns:1fr 1fr;gap:10px}.export-list button{border:1px solid #cfdac3;background:#f1f5e9;padding:16px;text-align:left;border-radius:5px;font-size:13px;font-weight:600}.export-list small{display:block;font-size:10px;font-weight:400;color:#8b997d;margin-top:7px;line-height:1.7}#toast{position:fixed;bottom:30px;left:50%;transform:translate(-50%,20px);opacity:0;background:#224b36;color:#fff;padding:12px 22px;border-radius:5px;font-size:12px;z-index:100;pointer-events:none;transition:.2s;max-width:90vw}#toast.visible{opacity:1;transform:translate(-50%,0)}.subtle{font-size:10px;color:#8d9b81}.danger{color:#a96555}.about-list{font-size:12px;line-height:2;color:#6f8162}.connection-path{padding:12px;line-height:2;background:#edf2e3;border-radius:4px;font-size:12px}
@media(min-height:950px){#mapViewport{height:calc(100vh - 350px);min-height:650px}}@media(max-width:1100px){.topbar{padding:0 24px}.top-actions>span{display:none}.intro{padding:28px}.intro-stats{gap:15px}h1 span{display:block;margin:10px 0 0;font-size:12px}.toolbar-filters{gap:8px}.legend{gap:8px}.map-note{display:none}.search{width:220px}.workbench{margin:0 16px}}@media(max-width:760px){.topbar{height:auto;min-height:80px;padding:15px 16px;flex-wrap:wrap;gap:10px}.brand{font-size:20px}.brand-mark{font-size:33px}.brand-sub{font-size:8px}.topbar nav{order:3;width:100%;justify-content:center;gap:30px;height:40px}.topbar nav button{font-size:12px}.top-actions button{font-size:11px;padding:9px}.intro{padding:26px 19px;align-items:flex-start}.intro h1{font-size:29px}.intro p{line-height:2;font-size:11px}.intro-stats{gap:10px}.intro-stats div{padding-left:10px}.intro-stats div:last-child{display:none}.intro-stats strong{font-size:23px}.intro-stats span{font-size:9px;white-space:nowrap}.spoiler{margin-left:0;display:inline-block;padding:0 5px}.workbench{margin:0 8px}.toolbar{height:auto;flex-wrap:wrap;padding:12px}.search{width:100%;order:0}.toolbar-filters{order:1;margin-right:auto;flex-wrap:wrap}.toolbar>.button-light,.toolbar>.icon-button{order:2}.toolbar select{max-width:140px;font-size:11px}.check{font-size:10px}.toolbar>.button-light{font-size:10px;padding:8px}.map-heading{display:block;padding:13px}.legend{margin-top:13px;gap:13px}#mapViewport{height:590px}.map-controls{left:10px;bottom:12px}.stage-section{padding:22px 18px 28px 65px}.stage-section:before{left:30px}.stage-number{left:12px;width:37px;height:37px;font-size:16px;top:27px}.stage-section h3{font-size:20px}.stage-header{display:block}.stage-people{grid-template-columns:repeat(2,1fr);gap:9px}.stage-people .mini-person img,.stage-people .portrait-placeholder{height:110px}.timeline-intro{padding:30px 22px 15px}.stage-nav{padding:0 18px 20px}.stage-nav button{font-size:10px}#directory{padding:0 16px 25px;grid-template-columns:repeat(2,1fr);gap:12px}.directory-heading{padding:12px 18px}.mini-person .info{padding:10px}footer{padding:20px 16px;display:block;line-height:2}.drawer-body{padding:23px}.form-grid{grid-template-columns:1fr}.export-list{grid-template-columns:1fr}}
@media print{.topbar,.intro,.toolbar,.map-heading,.map-controls,.map-note,footer,.drawer,.backdrop,dialog,#toast{display:none!important}.workbench{margin:0;border:0;box-shadow:none}#mapViewport{height:auto!important;background:white}#atlas{width:100%;height:auto}.stage-section{break-inside:avoid}.stage-nav{display:none}body{background:white}}

.photo-note{display:block;font-size:10px;line-height:1.65;color:#788774;margin:8px 0}.photo-select{font-size:10px;padding:5px 7px;border:1px solid #ccd8c4;border-radius:3px;margin:5px 0;background:#f1f4e9}.age-item strong{overflow-wrap:anywhere}
/* Horizontal reading edition */
.chapter-window{overflow:hidden;width:100%}#chapterTrack{display:flex;align-items:flex-start;will-change:transform}.chapter-page{flex:0 0 100%;min-width:0;padding:12px 32px 22px;box-sizing:border-box}.chapter-header{padding:0 10px 15px;border-bottom:1px solid #dce3d3}.chapter-header h3{font-family:AtlasSerif,serif;font-size:28px;margin:10px 0;color:#224638}.chapter-header p{font-size:13px;color:#778870;line-height:1.9;max-width:860px;margin:0}.chapter-canvas{overflow:auto;max-height:680px;overscroll-behavior:contain;background:#f8f9f2;border-radius:8px;margin-top:20px}.chapter-canvas svg{display:block;width:100%;height:auto;min-height:420px}.chapter-canvas .node-name{font-size:15px}.chapter-canvas .edge-label{font-size:13px}.chapter-canvas .node-original{font-size:9px}#stageNav{display:flex;align-items:center;justify-content:center;gap:24px;padding:22px 16px 30px;position:relative;border-top:1px solid #e4e8da}#stageNav .chapter-arrow{padding:0;width:42px;height:42px;border-radius:50%;border:1px solid #cbd7c2;background:#fafbf5;color:#254f3b;font-size:30px;line-height:1}#stageNav .chapter-arrow:disabled{opacity:.25;cursor:default}.chapter-dots{display:flex;gap:4px}#stageNav .chapter-dots button{padding:12px 8px;border:0;background:none;border-radius:50%}.chapter-dots span{display:block;width:8px;height:8px;background:#c9d3be;border-radius:50%;transition:background .2s,transform .2s}.chapter-dots .active span{background:#294f3a;transform:scale(1.4)}#chapterStatus{position:absolute;right:30px;font-size:11px;color:#849279}.node:focus-visible .card-bg{stroke:#224638;stroke-width:4}.drawer-hero{height:290px}.drawer-hero img{object-fit:contain;background:#e4e9dc}.group-hero{height:auto;min-height:150px}.group-hero img{width:100%;height:auto;display:block;object-fit:contain}.character-story{font-size:14px!important;line-height:2!important;color:#4e6647!important}.age-item{flex-basis:130px}.age-item img{width:130px;height:170px;object-position:50% 20%}.upload-quiet{margin-top:16px;font-size:11px}.person-network{border-left:1px solid #cad6be;padding-left:16px}.person-network>strong{font-size:13px}.relation-link{font-size:11px;color:#8d743e;min-width:64px}.relationship-row .target{flex:1}.relation-event{padding-left:8px;margin-top:5px!important;font-size:11px!important}.sons-list{padding-left:18px;font-size:12px;line-height:2.1}.sons-list span{display:block;color:#839274;font-size:11px}.photo-note{display:none}@media(max-width:760px){.chapter-page{padding:8px 12px 16px}.chapter-header{padding-left:3px}.chapter-header h3{font-size:23px}.chapter-header p{font-size:12px}.chapter-canvas{max-height:580px}.chapter-canvas svg{min-height:380px}#stageNav{gap:10px}#chapterStatus{position:static}.timeline-intro{padding-bottom:10px}.drawer-hero{height:260px}.group-hero{height:auto}}@media(prefers-reduced-motion:reduce){#chapterTrack{transition:none!important}}@media print{.chapter-window{overflow:visible}#chapterTrack{display:block;transform:none!important}.chapter-page{break-after:page}.chapter-canvas{overflow:visible;max-height:none}}

.chapter-canvas{height:620px;max-height:none}.chapter-canvas svg{height:100%;min-height:0}.chapter-header{min-height:116px}.chapter-page{padding-bottom:12px}@media(max-width:760px){.chapter-canvas{height:540px}.chapter-header{min-height:140px}}

.chapter-header{position:relative;padding-right:125px}.chapter-zoom{position:absolute;right:0;top:12px;display:flex;border:1px solid #d3ddc8;border-radius:20px;overflow:hidden;background:#fafbf5}.chapter-zoom button{padding:8px 10px;font-size:12px;color:#4c6d42}@media(max-width:760px){.chapter-header{padding-right:0;padding-bottom:45px}.chapter-zoom{top:auto;bottom:8px}}

/* Relationship focus and accessible chapter navigation */
.edge-group{cursor:pointer;outline:none}.edge-hit{pointer-events:stroke}.relation-focused .edge-group:not(.is-focused){opacity:.12!important}.relation-focused .edge-group.is-focused{opacity:1!important}.relation-focused .node:not(.relation-endpoint){opacity:.32!important}.relation-endpoint{opacity:1!important}.relation-endpoint .card-bg{stroke:#386e4b!important;stroke-width:3!important}.edge-focus-overlay{pointer-events:none}.edge-focus-overlay .edge{opacity:1;stroke-width:4;filter:drop-shadow(0 0 3px #fff)}.edge-focus-overlay .edge-label{font-weight:800;fill:#214f35;font-size:15px;paint-order:stroke;stroke:#fffdf2;stroke-width:8px;stroke-linejoin:round}.edge-group:focus-visible .edge{stroke-width:4;opacity:1}.edge-group:focus-visible .edge-label{font-weight:bold}
#timeline{position:relative}.chapter-side-arrow{position:absolute;top:var(--chapter-control-y,55%);transform:translateY(-50%);z-index:3;display:grid;place-items:center;width:48px;height:48px;border:1px solid #9bad8c;border-radius:50%;background:#fffef8;box-shadow:0 3px 12px #193d2720;color:#214f35;font-size:36px;line-height:1}.chapter-side-arrow:hover{background:#e8efdf;border-color:#3d684a}.chapter-side-arrow:disabled{opacity:.25;cursor:default}.chapter-side-arrow:focus-visible{outline:3px solid #a1b687;outline-offset:3px}#chapterPrev{left:8px}#chapterNext{right:8px}.chapter-page{padding-left:64px;padding-right:64px}.chapter-zoom{position:static;display:inline-flex;align-items:center;gap:4px;margin-top:14px;border-radius:8px;padding:4px;background:#edf2e4}.chapter-zoom button{font-size:13px;padding:8px 12px;border-radius:5px;background:#fffef8;min-height:36px}.chapter-zoom button[data-chapter-zoom=in]{background:#28573e;color:white}.chapter-zoom-level{min-width:50px;text-align:center;font-size:12px;color:#56734b}.chapter-header{padding-right:0;min-height:156px}.chapter-canvas{overflow:hidden;cursor:grab;touch-action:none}.chapter-canvas.panning{cursor:grabbing}.chapter-canvas svg{min-width:0!important;display:block;width:100%;height:100%}.chapter-canvas .node{cursor:pointer}.chapter-canvas .edge-group{cursor:pointer}#stageNav{padding-top:16px;padding-bottom:20px}.card-badge{display:none}
@media(max-width:760px){.chapter-page{padding-left:40px;padding-right:40px}.chapter-side-arrow{width:34px;height:42px;font-size:28px}#chapterPrev{left:2px}#chapterNext{right:2px}.chapter-header{min-height:190px;padding-bottom:12px}.chapter-header h3{font-size:21px}.chapter-zoom{gap:1px;padding:3px;flex-wrap:wrap}.chapter-zoom button{font-size:11px;padding:6px}.chapter-zoom-level{min-width:39px}.chapter-canvas{height:520px}.edge-focus-overlay .edge-label{font-size:16px}}@media print{.chapter-side-arrow,.chapter-zoom{display:none!important}.edge-hit{display:none}}

.chapter-side-arrow{display:flex;align-items:center;justify-content:center;padding:0;line-height:0;font-size:0}.chapter-side-arrow svg{display:block;width:24px;height:24px;flex:none;pointer-events:none}.chapter-side-arrow svg path{fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.family-group .edge{stroke-linejoin:round;stroke-linecap:round}@media(max-width:760px){.chapter-side-arrow{width:36px;height:36px}.chapter-side-arrow svg{width:22px;height:22px}}

/* Keep the same label footprint and semantic color in all interaction states. */
.edge-label,.chapter-canvas .edge-label,.edge-focus-overlay .edge-label{font-size:13px!important;stroke-width:4px;font-weight:600}.edge-focus-overlay .edge-label{font-weight:700;stroke-width:4px}.edge-focus-overlay .arrow-neck{stroke-width:4;stroke-linecap:butt}

.line-edit-help{padding:10px 18px;background:#edf3e9;color:#32583e;font-size:12px}.line-edit-help button{border:1px solid #b8c9b0;border-radius:4px;padding:5px 9px;margin-left:8px;background:white}.line-editing .edge-label{cursor:move}.line-handle{fill:#fff;stroke:#245e9a;stroke-width:2;cursor:move}.editing-relation .edge{opacity:1;stroke-width:3}.line-editing .edge-group{cursor:crosshair}

/* Public reading controls continue the existing paper, green and brass palette. */
.fullscreen-controls{display:flex;gap:8px;flex-shrink:0}.fullscreen-controls button{min-height:42px;white-space:nowrap}.fullscreen-nav{display:none;gap:8px;flex-shrink:0}.fullscreen-nav button{padding:8px 10px;border-radius:5px;min-height:42px;font-size:12px}.fullscreen-nav button.active{background:#e5eddf;color:#24543d;font-weight:700}.toolbar{height:auto;min-height:66px}.organization .card-bg{fill:#f5efdc;stroke:#b79b57;stroke-dasharray:5 3}.organization .node-original{font-size:8px}.organization-logo{padding:35px}.adaptation-note,.logo-note{font-size:12px;line-height:1.8;color:#788369}.drawer{z-index:60}.backdrop{z-index:55}#closeDrawer{z-index:2;background:#fffef8dc;border-radius:50%}.drawer-actions button{min-height:42px}.feedback-fab{position:fixed;z-index:65;right:20px;bottom:max(18px,env(safe-area-inset-bottom));padding:13px 18px;border:1px solid #c4d0ba;border-radius:28px;background:#214d3d;color:#fff;box-shadow:0 4px 20px #173c3324;min-height:46px;font-size:13px}.feedback-fab:hover{background:#2b6048}.map-note{right:190px}footer{padding-bottom:80px}
#feedbackDialog{width:540px;max-height:90dvh;overflow-y:auto}#feedbackForm{padding:20px 25px 24px}#feedbackDescription{margin:0 0 22px;color:#71816d;font-size:13px;line-height:1.9}#feedbackForm label{display:block;font-size:13px;font-weight:600;margin:16px 0 8px}.required-mark{font-size:11px;font-weight:400;color:#84927b;margin-left:6px}#feedbackForm select,#feedbackForm textarea,#feedbackEmail{width:100%;border:1px solid #ccd7c1;border-radius:5px;padding:11px 12px;background:#fffefb;color:#294733;font:inherit;font-size:14px}#feedbackForm textarea{resize:vertical;min-height:130px;max-height:32dvh;line-height:1.75}.feedback-context{margin:17px 0 18px;padding:11px 13px;border-left:3px solid #a6b78d;background:#eef2e7;display:flex;gap:14px;align-items:center;font-size:12px}.feedback-context>span{color:#859277;flex-shrink:0}.feedback-context strong{font-weight:500;overflow-wrap:anywhere}.feedback-count{display:block;text-align:right;color:#84937b;font-size:11px;margin-top:4px}.feedback-privacy{font-size:11px;color:#849079;line-height:1.9;margin:16px 0 4px}.feedback-status{font-size:12px;color:#34684a;line-height:1.8;overflow-wrap:anywhere;margin:9px 0;min-height:0}.feedback-status.error{color:#a14b37}.feedback-actions{display:flex;justify-content:flex-end;margin-top:14px}.feedback-actions button{min-height:44px;min-width:128px}.honeypot{display:none!important}.feedback-fab:focus-visible,.chapter-side-arrow:focus-visible{outline:3px solid #9cae82;outline-offset:3px}.hidden{display:none!important}
body.graph-fullscreen{overflow:hidden}.graph-fullscreen>.topbar,.graph-fullscreen .intro,.graph-fullscreen footer{display:none}.graph-fullscreen .workbench{position:fixed;inset:0;z-index:30;margin:0;border:0;border-radius:0;height:100dvh;display:flex;flex-direction:column;overflow:hidden}.graph-fullscreen .toolbar{flex-shrink:0;padding:10px 16px}.graph-fullscreen .fullscreen-nav{display:flex}.graph-fullscreen .search{width:250px}.graph-fullscreen .search-results{flex-shrink:0;max-height:25dvh;overflow-y:auto}.graph-fullscreen .view:not(.hidden){display:flex;flex-direction:column;flex:1;min-height:0}.graph-fullscreen .map-heading{padding:9px 16px;flex-shrink:0}.graph-fullscreen #mapViewport{height:auto;min-height:0;flex:1}.graph-fullscreen .timeline-intro{display:none}.graph-fullscreen #timeline{flex:1;min-height:0;display:flex}.graph-fullscreen .chapter-window{height:100%}.graph-fullscreen #chapterTrack{height:100%;align-items:stretch}.graph-fullscreen .chapter-page{height:100%;display:flex;flex-direction:column;min-height:0;padding-top:8px;padding-bottom:0}.graph-fullscreen .chapter-header{min-height:0;flex-shrink:0;padding-bottom:8px}.graph-fullscreen .chapter-header h3{font-size:21px;margin:5px 0}.graph-fullscreen .chapter-header p{display:none}.graph-fullscreen .chapter-header .eyebrow{font-size:8px}.graph-fullscreen .chapter-zoom{position:absolute;right:0;top:4px;margin:0}.graph-fullscreen .chapter-canvas{height:auto;min-height:100px;flex:1;margin-top:8px}.graph-fullscreen #stageNav{flex-shrink:0;padding:7px 150px 7px 20px;min-height:48px}.graph-fullscreen .map-note{right:185px}.graph-fullscreen .map-controls{bottom:18px}
@media(max-width:1050px){.toolbar{flex-wrap:wrap}.fullscreen-controls{margin-left:auto}.graph-fullscreen .toolbar-filters{margin-right:0}.graph-fullscreen .fullscreen-nav{margin-right:auto}.graph-fullscreen .search{width:230px}.graph-fullscreen .toolbar{gap:6px}.fullscreen-controls button{font-size:11px!important;padding:8px 10px!important}}
@media(max-width:760px){.toolbar .search{order:0;width:100%}.toolbar-filters{order:1}.fullscreen-controls{order:2}.fullscreen-controls button{min-height:42px}.feedback-fab{right:12px;bottom:max(12px,env(safe-area-inset-bottom));font-size:12px;padding:11px 14px}.graph-fullscreen .toolbar{padding:7px 10px}.graph-fullscreen .fullscreen-nav{order:0;width:100%;justify-content:center}.graph-fullscreen .toolbar .search{order:1;width:100%;padding-top:5px;padding-bottom:5px}.graph-fullscreen .toolbar-filters{order:2;max-width:116px}.graph-fullscreen .toolbar select{max-width:110px}.graph-fullscreen .fullscreen-controls{order:3;gap:4px}.graph-fullscreen .map-heading{padding:6px 10px}.graph-fullscreen .map-heading>div>span,.graph-fullscreen .legend{display:none!important}.graph-fullscreen .chapter-page{padding-left:38px;padding-right:38px}.graph-fullscreen .chapter-header{padding-bottom:4px}.graph-fullscreen .chapter-header h3{font-size:17px;margin:3px 0}.graph-fullscreen .chapter-zoom{position:static;padding:2px;margin-top:3px;flex-wrap:nowrap}.graph-fullscreen .chapter-zoom button{min-height:36px;padding:6px}.graph-fullscreen .chapter-zoom-level{min-width:35px}.graph-fullscreen #stageNav{padding-left:6px;padding-right:135px;gap:4px}.graph-fullscreen .chapter-dots button{padding:12px 6px!important}.graph-fullscreen #chapterStatus{font-size:10px}.graph-fullscreen .chapter-side-arrow{width:34px;height:42px}.map-controls{max-width:calc(100% - 145px);left:8px}.map-controls button{padding:8px}.map-controls span{padding:0 5px;min-width:42px}#focusFamily{display:none}.drawer{width:min(420px,100vw)}#feedbackForm{padding:16px 18px 20px}.feedback-context{display:block}.feedback-context strong{display:block;margin-top:7px}#feedbackDialog{max-height:94dvh}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.card-bg,#toast{transition:none!important}}

.brand-mark.brand-tree{display:block;width:46px;height:46px;flex-shrink:0;object-fit:contain;border-radius:10px}
@media(max-width:760px){.brand-mark.brand-tree{width:40px;height:40px}}
.topbar{position:relative}
.donation-fab{position:fixed;z-index:65;right:20px;bottom:max(78px,calc(env(safe-area-inset-bottom) + 78px));background:#fbfaf6;color:#345544;border:1px solid #b8c9ad;border-radius:28px;padding:11px 18px;min-height:44px;box-shadow:0 3px 15px #173c3317;font-size:13px}
#donationDialog{width:min(660px,calc(100vw - 24px));max-height:92dvh;overflow-y:auto;padding:32px;border:1px solid #d8dfd2;border-radius:20px;background:#fbfaf6;color:#233e37;box-shadow:0 24px 90px #173c332b}
#donationDialog::backdrop{background:#233e3759;backdrop-filter:blur(5px)}
#donationDialog>.modal-head{position:relative;display:flex;flex-direction:column;gap:16px;align-items:center;padding:0;border:0;background:transparent}
#donationDialog .close{position:absolute;top:-17px;right:-17px;color:#7a8873;background:transparent;width:40px;height:40px;border-radius:50%}
#donationDialog h2{font-size:25px;letter-spacing:1px;margin:0;color:#233e37}.donation-coffee{color:#ac873c}
.donation-body{text-align:center;line-height:1.8;padding:0}.donation-body>p{margin:16px auto 0;font-size:14px;color:#6f7e6b}
.donation-options{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:25px auto 0;max-width:520px}
.donation-options section{min-width:0;text-align:center;border:1px solid #d8dfd2;border-radius:14px;background:#f3f5ed;padding:18px 14px 12px}
.donation-options h3{font-size:17px;font-weight:500;color:#233e37;margin:0 0 14px}
.donation-options img{display:block;width:100%;height:230px;object-fit:contain;background:#fff;border-radius:6px;user-select:auto;-webkit-touch-callout:default}
.donation-options a{display:inline-block;color:#476643;padding:8px 12px;margin-top:5px;font-size:12px;text-underline-offset:4px}
.donation-body>.donation-footer{font-size:12px;color:#849079;margin-top:20px;background:none;padding:0}
@media(max-width:760px){.donation-fab{right:12px;bottom:max(70px,calc(env(safe-area-inset-bottom) + 70px));font-size:12px;padding:10px 14px}#donationDialog{padding:28px 20px 22px}#donationDialog h2{font-size:22px}.donation-options{grid-template-columns:1fr;gap:12px;max-width:260px}.donation-options section{padding:13px 14px 7px}.donation-options img{height:225px}.donation-body>p{font-size:13px}}
.topbar>nav:not(.fullscreen-nav){position:absolute;left:50%;transform:translateX(-50%);justify-content:center}
@media(max-width:760px){.topbar>nav:not(.fullscreen-nav){position:static;left:auto;transform:none;order:3;width:100%;justify-content:center;gap:30px;height:40px}}

.help-button{display:flex;align-items:center;gap:7px;margin-left:auto;min-height:42px;padding:8px 14px;border:1px solid #ccd5c4;border-radius:22px;font-size:13px;color:#345544;background:#fbfaf6;flex-shrink:0}
.help-button>span{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:1px solid currentColor;border-radius:50%;font-family:Georgia,serif;font-size:13px}
.help-button:hover{background:#edf2e7}.help-button:focus-visible{outline:3px solid #9cae82;outline-offset:3px}
.author-credit{display:inline-block;margin-left:14px}
#modal{background:#fbfaf6}#modalBody .help-intro{margin:0 0 20px;color:#50634f;font-size:13px}.help-guide{margin:0}.help-guide>div{padding:12px 0;border-top:1px solid #e0e5d9}.help-guide dt{font-size:13px;font-weight:600;color:#294733;margin-bottom:5px}.help-guide dd{margin:0;font-size:12px;line-height:1.9;color:#71816b}#modalBody .help-credit{border-top:1px solid #e0e5d9;padding-top:16px;margin:8px 0 0;font-size:11px}.help-credit strong{font-weight:500;color:#345544}
.donation-options{grid-template-columns:1fr;max-width:280px}
@media(max-width:760px){.help-button{padding:7px 11px;font-size:12px}.intro-stats div:last-child{display:block}.author-credit{display:block;margin-left:0}footer>span{display:block}.donation-options{max-width:260px}#modalBody{padding:18px;max-height:72dvh}}
/* Compact header actions, unobstructed reading, and responsive graph fullscreen. */
.header-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex-shrink:0}
.header-action,.header-actions .help-button{position:static;margin:0;display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:40px;padding:8px 12px;border:1px solid #ccd5c4;border-radius:22px;font-size:12px;background:#fbfaf6;color:#345544;box-shadow:none;white-space:nowrap}
.header-action:hover{background:#edf2e7}.header-action:focus-visible{outline:3px solid #9cae82;outline-offset:3px}
.back-to-top{position:fixed;z-index:40;right:max(14px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));width:40px;height:40px;border:1px solid #becbb3;border-radius:50%;background:#fbfaf6ed;color:#345544;font-size:23px;box-shadow:0 3px 12px #173c3317}
.back-to-top:focus-visible{outline:3px solid #9cae82;outline-offset:3px}footer{padding-bottom:30px}
#mapViewport,.chapter-canvas{touch-action:none;user-select:none;-webkit-user-select:none;overscroll-behavior:contain}
#mapViewport.panning{cursor:grabbing}
.graph-fullscreen .workbench{width:100vw;height:100dvh!important;max-width:none;box-sizing:border-box;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
.graph-fullscreen .view:not(.hidden){overflow:hidden;min-height:0!important}
.graph-fullscreen #timeline{overflow:hidden;width:100%;flex:1;min-height:0}
.graph-fullscreen .chapter-window{width:100%;min-height:0;overflow:hidden}
.graph-fullscreen #chapterTrack{width:100%;min-height:0}
.graph-fullscreen .chapter-canvas{min-height:0!important;height:auto!important;max-height:none!important}
.graph-fullscreen .chapter-canvas svg{min-height:0!important}
.graph-fullscreen #stageNav{padding-right:20px}
.graph-fullscreen #mapViewport{min-height:0!important;height:auto!important}
.graph-fullscreen .map-controls{max-width:calc(100% - 16px)}
@media(max-width:1000px) and (min-width:761px){.topbar{height:auto;min-height:84px;flex-wrap:wrap;padding-top:12px;padding-bottom:10px}.topbar>nav:not(.fullscreen-nav){position:static;transform:none;order:3;width:100%;height:38px}}
@media(max-width:760px){.topbar{padding:12px;gap:8px}.brand{font-size:18px;gap:6px}.brand-mark.brand-tree{width:34px;height:34px}.brand-sub{font-size:7px;letter-spacing:1px}.header-actions{gap:4px}.header-action,.header-actions .help-button{font-size:11px;padding:6px 8px;min-height:38px;gap:3px}.header-actions .help-button>span{width:15px;height:15px;font-size:11px}.fullscreen-controls{gap:5px}.fullscreen-controls button{font-size:11px!important;padding:8px!important}.graph-fullscreen .toolbar{padding:6px 10px}.graph-fullscreen .fullscreen-nav{width:auto;flex:1}.graph-fullscreen .toolbar .search{order:2;width:100%}.graph-fullscreen .fullscreen-controls{order:1}.graph-fullscreen .toolbar-filters{order:3}.graph-fullscreen .map-heading{display:none}.graph-fullscreen #stageNav{padding:6px 10px;min-height:42px}.graph-fullscreen .chapter-header h3{font-size:17px}.graph-fullscreen .chapter-page{padding-top:4px}.graph-fullscreen .chapter-zoom{margin-top:3px}.graph-fullscreen .chapter-dots button{padding:10px 8px!important}.graph-fullscreen #chapterStatus{position:static}.back-to-top{width:38px;height:38px}}
@media(max-width:360px){.brand{font-size:16px}.brand-sub{display:none}.brand-mark.brand-tree{width:30px;height:30px}.header-action,.header-actions .help-button{padding:6px 7px}}

/* Fullscreen is a focused reading surface: chapter title, navigation and exit. */
.exit-fullscreen{display:none}
.graph-fullscreen .toolbar{position:absolute;top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));z-index:5;width:auto;min-height:0;height:auto;padding:0;background:transparent;border:0;display:block}
.graph-fullscreen .toolbar .search,.graph-fullscreen .fullscreen-controls,.graph-fullscreen #searchResults,.graph-fullscreen .map-heading,.graph-fullscreen .map-controls,.graph-fullscreen .map-note{display:none!important}
.graph-fullscreen .exit-fullscreen{display:block;min-height:38px;padding:8px 12px!important;background:#fbfaf6ed;border:1px solid #ccd5c4;border-radius:18px;font-size:12px!important;white-space:nowrap}
.graph-fullscreen .chapter-zoom,.graph-fullscreen .chapter-header>.eyebrow,.graph-fullscreen .chapter-header>p{display:none!important}
.graph-fullscreen .chapter-header{min-height:0;margin:0;padding:8px 110px 8px 0;flex-shrink:0}
.graph-fullscreen .chapter-header h3{margin:0;font-size:20px;line-height:1.5}
.graph-fullscreen .chapter-page{padding-top:8px}
@media(max-width:760px){.graph-fullscreen .chapter-header{padding-top:5px;padding-bottom:8px;padding-right:82px}.graph-fullscreen .chapter-header h3{font-size:16px}.graph-fullscreen .exit-fullscreen{padding:7px 10px!important;font-size:11px!important;min-height:34px}.graph-fullscreen .chapter-page{padding-top:10px}}
/* Keep context legible while giving the selected relationship more contrast. */
.edge-group.dim{opacity:.55!important}
.relation-focused .edge-group:not(.is-focused){opacity:.5!important}
.relation-focused .node:not(.relation-endpoint){opacity:.62!important}
/* Overlay controls leave the entire canvas width available for reading. */
.chapter-page,.graph-fullscreen .chapter-page{padding-left:0;padding-right:0}
.chapter-header{min-height:0;padding:0 20px 16px}
.graph-fullscreen .chapter-header{padding:12px 16px 8px}
.chapter-canvas,.graph-fullscreen .chapter-canvas{position:relative;margin-top:0}
.chapter-side-arrow{background:#fbfaf65c;border-color:#78918040;box-shadow:none;backdrop-filter:blur(2px)}
.chapter-side-arrow:hover{background:#fbfaf6a6}
.chapter-side-arrow:disabled{visibility:hidden}
.fullscreen-controls,.graph-fullscreen .fullscreen-controls{position:absolute;top:12px;right:12px;z-index:4;display:flex!important;gap:0}
.fullscreen-controls button,.graph-fullscreen .fullscreen-controls button{min-height:36px;padding:7px 10px!important;border:1px solid #78918040;border-radius:18px;background:#fbfaf66b;backdrop-filter:blur(2px);font-size:12px!important;white-space:nowrap}
.fullscreen-controls .exit-fullscreen{display:none}
.graph-fullscreen .fullscreen-controls #graphFullscreen{display:none}
.graph-fullscreen .fullscreen-controls .exit-fullscreen{display:block}
.graph-fullscreen .toolbar{display:none}
@media(max-width:760px){.chapter-header{padding-left:12px;padding-right:12px}.fullscreen-controls,.graph-fullscreen .fullscreen-controls{top:8px;right:8px}.fullscreen-controls button,.graph-fullscreen .fullscreen-controls button{font-size:11px!important;min-height:34px}.graph-fullscreen .chapter-page{padding-top:0}}
/* Every chapter keeps the relationship key visible without shrinking its canvas. */
.chapter-legend,.graph-fullscreen .chapter-legend{position:absolute;left:10px;bottom:10px;z-index:3;display:flex!important;flex-wrap:wrap;gap:6px 12px;max-width:calc(100% - 20px);padding:6px 9px;border-radius:6px;background:#fbfaf6c9;backdrop-filter:blur(2px);pointer-events:none}
.chapter-legend>span{font-size:10px!important;color:#657462}
@media(max-width:760px){.chapter-legend,.graph-fullscreen .chapter-legend{left:6px;bottom:6px;max-width:calc(100% - 12px);gap:5px 9px;padding:5px 7px}.chapter-legend>span{font-size:9px!important}}
/* Use the same upper-left legend placement in both reading views. */
.graph-legend,.chapter-legend,.graph-fullscreen .graph-legend,.graph-fullscreen .chapter-legend{position:absolute;top:10px;left:10px;bottom:auto;z-index:3;display:flex!important;flex-wrap:wrap;gap:6px 12px;max-width:calc(100% - 125px);padding:6px 9px;border-radius:6px;background:#fbfaf6c9;backdrop-filter:blur(2px);pointer-events:none}
.graph-legend>span,.chapter-legend>span{font-size:10px!important;color:#657462}
@media(max-width:760px){.graph-legend,.chapter-legend,.graph-fullscreen .graph-legend,.graph-fullscreen .chapter-legend{top:8px;left:6px;bottom:auto;max-width:calc(100% - 108px);gap:5px 9px;padding:5px 7px}.graph-legend>span,.chapter-legend>span{font-size:9px!important}}
.line.friend,.line.employer{border-color:#bd8b89;border-top-style:solid}
.line.comrade{border-color:#8193b4;border-top-style:solid}
.line.mentor{border-color:#587fa8;border-top-style:solid}
.line.company{border-color:#96783e;border-top-style:solid}
.graph-legend .line,.chapter-legend .line{width:16px;flex-shrink:0}
.line.friendship{border-color:#bd8b89;border-top-style:dashed}
/* Timeline zoom controls match the overview and float over the canvas. */
.chapter-map-controls,.graph-fullscreen .chapter-map-controls{display:flex!important;position:absolute;left:10px;bottom:10px;z-index:4;max-width:calc(100% - 20px);background:#fffef8eb}
.chapter-map-controls .chapter-scale{min-width:52px;text-align:center}
@media(max-width:760px){.chapter-map-controls,.graph-fullscreen .chapter-map-controls{left:8px;bottom:8px}}
