*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,"Noto Sans KR",sans-serif;background:#f5f4f0;color:#1e211f}header{height:64px;padding:10px 14px;display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #ddd;position:sticky;top:0;z-index:3}header button{border:0;background:none;font-size:28px;min-width:44px;min-height:44px}header .title{text-align:center}header small{display:block;color:#777;margin-top:2px}.header-actions{display:flex;align-items:center}.header-actions button{font-size:22px;padding:0 5px}header>a{color:#313832;text-decoration:none;font-size:13px}main{max-width:560px;margin:auto;padding:18px 14px 90px}.relation-title{font-size:12px;color:#73766f;text-align:center;margin:12px 0 8px}.row{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.person{width:104px;border:0;background:#fff;border-radius:18px;padding:12px 8px;box-shadow:0 2px 12px #0000000d;min-height:142px}.person.center{width:132px;box-shadow:0 5px 20px #00000017}.avatar{width:68px;height:68px;border-radius:50%;margin:auto;background:#d8d8d4;display:grid;place-items:center;font-size:24px;overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover;object-position:var(--focus-x,50%) var(--focus-y,50%)}.private .avatar{filter:grayscale(1);background:#aaa}.person b,.person small{display:block;margin-top:7px}.person small{font-size:12px;color:#777}.connector{height:26px;width:1px;background:#b7b7b2;margin:auto}.card{background:#fff;border-radius:18px;padding:18px;margin-bottom:12px}.card h2{margin:0 0 4px}.field{display:flex;justify-content:space-between;gap:20px;padding:11px 0;border-bottom:1px solid #eee}.field:last-child{border:0}.field span:first-child{color:#777}.actions{display:flex;gap:8px;margin-top:14px}.actions button{flex:1;padding:12px;border:0;border-radius:12px}nav{position:fixed;bottom:0;left:0;right:0;height:68px;background:#fff;border-top:1px solid #ddd;display:flex;justify-content:center}nav button{width:min(33.333%,187px);border:0;background:none;color:#777}nav button.active{font-weight:700;color:#111}@media(min-width:700px){body{background:#ecebe7}}
.empty{color:#8a8d87;font-size:13px;text-align:center}.loading{text-align:center;color:#777;padding:60px 0}.profile-head{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:center}.profile-head .actions{grid-column:1/-1}.avatar.large{width:82px;height:82px}.card h3{margin:0 0 14px}.timeline{list-style:none;padding:0;margin:0}.timeline li{display:grid;grid-template-columns:62px 1fr;gap:10px;padding:10px 0;border-bottom:1px solid #eee}.timeline time{color:#777}.timeline small{display:block;color:#888;margin-top:3px}.gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.gallery figure{margin:0}.gallery img{width:100%;aspect-ratio:1;object-fit:cover;object-position:var(--focus-x,50%) var(--focus-y,50%);border-radius:12px}.gallery figcaption{font-size:11px;color:#777;margin-top:4px}.private-detail{text-align:center}.private-detail .avatar{margin:10px auto}
.edit-form label{display:block;font-size:13px;color:#666;margin:14px 0}.edit-form input,.edit-form select{display:block;width:100%;margin-top:6px;padding:12px;border:1px solid #d8d8d2;border-radius:10px;background:#fff;font:inherit;color:#222}.notice{font-size:12px;color:#777;line-height:1.55;background:#f5f4f0;padding:10px;border-radius:10px}.actions .primary{background:#1f2923;color:#fff}.error{font-size:13px;color:#9a2b2b;margin:12px 0 0}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.section-head h3{margin:0}.small-button,.profile-photo,.profile-focus{border:0;border-radius:10px;padding:8px 10px}.profile-photo,.profile-focus{width:100%;margin-top:5px}.edit-form fieldset{border:0;padding:0;margin:12px 0}.edit-form legend{font-weight:700;margin-bottom:8px}.edit-form .check{display:flex;flex-direction:row;align-items:center;gap:9px;padding:8px 0}.edit-form .check input{width:auto;margin:0}.error{color:#a52a2a}.notice{font-size:13px;color:#666}.primary{font-weight:700}
.timeline li{position:relative}.timeline-actions{display:flex;gap:6px;margin-top:6px}.timeline-actions button,.section-head button{border:0;border-radius:9px;padding:7px 10px}.timeline-form label{display:block;margin:12px 0}.timeline-form input,.timeline-form select,.timeline-form textarea{width:100%;padding:11px;border:1px solid #ccc;border-radius:10px;font:inherit}.timeline-form textarea{min-height:90px}.timeline-form .row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tree-actions{display:flex;justify-content:center;gap:8px;margin:22px 0}.tree-actions button{padding:11px 18px}
.login-page{min-height:100vh;display:grid;place-items:center}.login-shell{width:min(100%,440px);padding:22px}.login-card{padding:28px}.login-card h1{margin:2px 0 10px;font-size:30px}.eyebrow{margin:0;color:#667269;font-size:13px;font-weight:700}.login-help{color:#666;line-height:1.55}.login-button{width:100%;min-height:48px;border:0;border-radius:12px}.text-button{width:100%;border:0;background:none;padding:12px;color:#666}.admin-login{margin-top:18px!important}.photo-placeholder{aspect-ratio:1;display:grid;place-items:center;border-radius:12px;background:#ecece8;color:#777;font-size:12px}
.admin-request{padding:12px 0;border-bottom:1px solid #eee}.admin-request:last-child{border:0}.warning{font-size:12px;color:#6f4d00;background:#fff6d8;padding:12px;border-radius:10px}#person-admin{display:grid;gap:8px}#person-admin input,#person-admin select,#person-admin button{min-height:44px;padding:9px;border:1px solid #ddd;border-radius:10px;background:#fff}header>#logout{font-size:13px;padding:0 8px}
.focus-form .focus-preview{width:180px;height:180px;margin:18px auto}.focus-form output{float:right;color:#222}.focus-form input[type=range]{padding:0;border:0}
.focus-x-0{--focus-x:0%}.focus-x-10{--focus-x:10%}.focus-x-20{--focus-x:20%}.focus-x-30{--focus-x:30%}.focus-x-40{--focus-x:40%}.focus-x-50{--focus-x:50%}.focus-x-60{--focus-x:60%}.focus-x-70{--focus-x:70%}.focus-x-80{--focus-x:80%}.focus-x-90{--focus-x:90%}.focus-x-100{--focus-x:100%}
.focus-y-0{--focus-y:0%}.focus-y-10{--focus-y:10%}.focus-y-20{--focus-y:20%}.focus-y-30{--focus-y:30%}.focus-y-40{--focus-y:40%}.focus-y-50{--focus-y:50%}.focus-y-60{--focus-y:60%}.focus-y-70{--focus-y:70%}.focus-y-80{--focus-y:80%}.focus-y-90{--focus-y:90%}.focus-y-100{--focus-y:100%}
.app-version{text-align:center;color:#858983;font-size:11px;letter-spacing:.02em;padding:24px 0 12px}
.family-branches{display:grid;gap:24px}.family-branch{background:#ffffff80;border-radius:18px;padding:12px 8px}.couple-row{display:flex;align-items:center;justify-content:center}.couple-link{width:24px;height:2px;background:#aeb2ab;flex:0 0 24px}.descent-stem,.overview-connector{height:28px;width:2px;background:#aeb2ab;margin:0 auto}.child-row{position:relative}.branch-empty{margin:14px 0 4px}.overview-tree{display:grid;gap:0}.overview-generation{padding:2px 0 8px}
.couple-row>.person{flex:0 1 132px;min-width:0}.couple-link{align-self:stretch;height:auto;position:relative;background:none}.couple-link::before{content:"";position:absolute;left:0;right:0;top:50%;height:2px;background:#aeb2ab}.has-children .couple-link::after{content:"";position:absolute;left:calc(50% - 1px);top:50%;bottom:0;width:2px;background:#aeb2ab}

.generation-body{display:flex;align-items:center;gap:12px;min-width:max-content}.generation-label{width:88px;flex:0 0 88px;display:flex;flex-direction:column;gap:6px;text-align:center;font-size:13px}.generation-body .row{flex:1}

/* The chart scrolls inside the page; header, forms and navigation keep their size. */
main.overview-view{max-width:1500px;width:100%}.overview-tree{display:block;min-width:0}
.tree-help{font-size:12px;line-height:1.6;color:#6f766e;margin:0 0 12px}
/* Layout coordinates and zoom share one SVG viewBox, including generation labels. */
.overview-frame{width:100%;min-width:0}
.overview-viewport{width:100%;height:max(190px,calc(100svh - 380px));overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;border:1px solid #e4e7e0;border-radius:14px;background:#ffffff30;scrollbar-width:thin}
.overview-canvas{display:block;margin:0 auto;flex:none;overflow:hidden}
.overview-canvas .generation-label{width:100%;height:100%;padding:8px 4px;justify-content:center;gap:7px;font-size:calc(12px * var(--tree-font,1));line-height:1.5}
.overview-canvas .generation-label span{font-size:calc(11px * var(--tree-font,1));color:#596457;overflow-wrap:anywhere}
.overview-generation{padding:0}.tree-node,.tree-node .person{width:100%;height:100%;min-height:0}
.tree-node .person{display:flex;flex-direction:column;align-items:center;justify-content:center;margin:0;padding:10px 6px;border:1px solid #e3e6df;border-radius:16px;box-shadow:none;font:inherit;font-size:calc(14px * var(--tree-font,1))}
.tree-node .person.center{border:2px solid #869c82;background:#fff}
.tree-node .avatar{width:62px;height:62px;flex:0 0 62px;margin:0 auto;font-size:calc(24px * var(--tree-font,1))}
.tree-node .person b{overflow-wrap:anywhere;line-height:1.25;max-width:100%}
.tree-node .person small{margin-top:6px;font-size:calc(11px * var(--tree-font,1))}
.parent-child-link{fill:none;stroke:#879580;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tree-controls{width:min(100%,410px);margin:12px 0 0;padding:10px 12px;border:1px solid #dce2d9;border-radius:14px;background:#fff;box-shadow:0 3px 14px #1e35200a}
.tree-zoom-controls{display:flex;align-items:center;gap:6px}
.tree-zoom-controls button{min-width:40px;min-height:38px;border:0;border-radius:9px;background:#f0f3ed;color:#253225;font:inherit;font-size:12px}
.tree-zoom-controls button[data-tree-zoom="in"],.tree-zoom-controls button[data-tree-zoom="out"]{font-size:22px}
.tree-zoom-controls button:disabled{opacity:.35}.tree-zoom-controls output{min-width:44px;text-align:center;font-size:12px;font-variant-numeric:tabular-nums}
.tree-font-control{display:flex;align-items:center;gap:10px;font-size:12px;margin-top:5px;min-height:38px}
.tree-font-control input{flex:1;min-width:60px;margin:0;accent-color:#426544}
.tree-font-control output{min-width:38px;font-variant-numeric:tabular-nums}
#adminLink{font-size:12px;color:#52634f;text-decoration:none;padding:12px 6px}
.field-help{font-size:12px;line-height:1.5;color:#6f766e;margin:6px 0 14px}
[hidden]{display:none!important}.lineage-fields{margin:4px 0}.edit-form input:focus,.edit-form select:focus{outline:2px solid #8aa482;outline-offset:1px}


.tree-font-80{--tree-font:0.8}.tree-font-90{--tree-font:0.9}.tree-font-100{--tree-font:1.0}.tree-font-110{--tree-font:1.1}.tree-font-120{--tree-font:1.2}.tree-font-130{--tree-font:1.3}.tree-font-140{--tree-font:1.4}.tree-font-150{--tree-font:1.5}.tree-font-160{--tree-font:1.6}.tree-font-170{--tree-font:1.7}.tree-font-180{--tree-font:1.8}

.login-page{display:block;min-height:100svh;background:linear-gradient(165deg,#fff 12%,#f5f9ff 65%,#eaf2ff 100%);color:#20304a}
.login-shell{width:min(100%,460px);max-width:460px;padding:24px 20px 28px;margin:0 auto}
.login-brand{width:min(74vw,260px);margin:0 auto 18px;border-radius:28px;overflow:hidden;background:#fff;box-shadow:0 8px 35px #243b7007}
.login-brand img{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain}
.login-card{padding:26px 24px;border:1px solid #e2eaf7;border-radius:24px;box-shadow:0 14px 42px #20396b0d;margin:0}
.login-card h1{font-size:25px;letter-spacing:-.04em;margin:9px 0 12px}.login-card .eyebrow{color:#657ba1;font-size:12px}
.login-help{font-size:14px;color:#657187;margin-bottom:22px}.login-card .edit-form label{color:#425370;font-size:14px}
.login-card .edit-form input{font-size:19px;letter-spacing:.04em;border-color:#d5dfef;min-height:54px;border-radius:12px}
.login-card .edit-form input:focus{outline:2px solid #5d83e7}
.login-button{background:#183fe6;color:#fff;font-size:15px;min-height:52px;margin-top:4px}
.login-card .notice{background:#f1f6ff;color:#4a638c}.login-footer{text-align:center;color:#8492ab;font-size:11px;margin:20px 0 0}
@media(min-width:700px){.login-shell{padding-top:48px}.login-brand{width:240px}}
@media(max-height:700px){.login-shell{padding-top:16px}.login-brand{width:160px;margin-bottom:12px}.login-card{padding:22px}.login-help{margin-bottom:14px}.login-footer{margin-top:14px}}

/* RC13: immediate-family editing and administrator-managed power users. */
.power-user-banner{border:1px solid #cdded5;background:#eef6f1;color:#294b37;font-size:14px;line-height:1.7}
#admin-search label{display:block;font-size:14px;margin:14px 0 6px}.admin-search-controls{display:flex;gap:8px}.admin-search-controls input{width:100%;min-width:0;flex:1;padding:10px;border:1px solid #cdd4ce;border-radius:10px;font:inherit}.admin-search-controls button,#power-user-list button{min-height:44px;border:0;border-radius:10px;background:#ecf1ed;color:#243e2c;padding:10px 15px;font:inherit}
.admin-person{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px;padding:15px 0;border-bottom:1px solid #e5eae6}.admin-person:last-child{border-bottom:0}.admin-person a,#power-user-list a{color:#294b37;overflow-wrap:anywhere}.admin-person small{display:block;margin-top:5px;font-size:12px;color:#6b756e;overflow-wrap:anywhere}.admin-person .field-help{grid-column:1/-1;margin:4px 0 0}.power-user-check{display:flex;align-items:center;gap:8px;min-height:44px;font-size:14px;cursor:pointer}.power-user-check input{width:22px;height:22px;margin:0;accent-color:#315e42}.power-user-check:has(input:disabled){cursor:default;color:#7b847d}.admin-status{font-size:13px;line-height:1.6;color:#315e42;min-height:1.6em}#power-user-count{font-size:14px;font-weight:400;color:#6b756e}#admin button:disabled{opacity:.55}#admin .error{line-height:1.6}

/* RC14: photo dimensions do not depend on type size or spacing. */
.tree-node .person{padding:var(--tree-v,2px) var(--tree-h,2px);gap:var(--tree-v,2px);border-width:2px;border-radius:12px}
.tree-node .person b{margin:0;line-height:1.25;white-space:nowrap;overflow-wrap:normal;flex:0 0 auto}
.tree-node .person small{margin:0;line-height:1.25;white-space:nowrap;flex:0 0 auto}
.tree-node .person small:empty{display:none}
.tree-node .avatar{width:62px;height:62px;min-width:62px;min-height:62px;flex:0 0 62px}
.tree-controls{padding:7px 4px;width:min(100%,410px);margin-top:8px}
.tree-adjust-controls{display:flex;align-items:center;justify-content:space-between;gap:2px;margin-top:5px}
.tree-adjust-group{display:flex;align-items:center;gap:1px;white-space:nowrap;min-width:0}
.tree-adjust-group span{font-size:10px;letter-spacing:-.05em}
.tree-adjust-group button{border:0;border-radius:6px;min-width:27px;height:40px;font-size:20px;background:#edf2ed;color:#253225;padding:0 4px;touch-action:manipulation}
.tree-settings-value{display:block;font-size:10px;color:#6f766e;margin:2px 4px}
.age-status-form{padding-top:12px}.age-status-form .check{display:flex;align-items:center;gap:8px;font-size:14px}.age-status-form input{width:20px;height:20px}
.tree-h-0{--tree-h:0px}.tree-v-0{--tree-v:0px}
.tree-h-2{--tree-h:2px}.tree-v-2{--tree-v:2px}
.tree-h-4{--tree-h:4px}.tree-v-4{--tree-v:4px}
.tree-h-6{--tree-h:6px}.tree-v-6{--tree-v:6px}
.tree-h-8{--tree-h:8px}.tree-v-8{--tree-v:8px}
.tree-h-10{--tree-h:10px}.tree-v-10{--tree-v:10px}
.tree-h-12{--tree-h:12px}.tree-v-12{--tree-v:12px}
.tree-h-14{--tree-h:14px}.tree-v-14{--tree-v:14px}
.tree-h-16{--tree-h:16px}.tree-v-16{--tree-v:16px}

.tree-options{display:flex;justify-content:flex-end;margin:0 4px 4px}.tree-simplify{display:inline-flex;align-items:center;gap:5px;font-size:13px;min-height:36px;margin:0;cursor:pointer}.tree-simplify input{width:20px;height:20px;margin:0;accent-color:#334d3c}

/* RC15: five-row browsing, fixed generation rail, compact persistent controls. */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap!important;border:0!important}
body.overview-mode{--app-header:calc(52px + env(safe-area-inset-top,0px));--app-nav:calc(60px + env(safe-area-inset-bottom,0px));height:100dvh;overflow:hidden;background:#f5f4f0}
.overview-mode header{height:var(--app-header);padding:calc(4px + env(safe-area-inset-top,0px)) max(4px,env(safe-area-inset-right,0px)) 4px max(2px,env(safe-area-inset-left,0px));gap:2px;flex:none}
.overview-mode header .title{min-width:0;flex:1}.overview-mode header .title>b{display:none}
.overview-mode #crumb{font-size:16px;line-height:1.3;font-weight:700;color:#1e211f;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.overview-mode header #back{padding:0;min-width:36px}.overview-mode .header-actions button{min-width:34px;padding:0 3px}.overview-mode #adminLink{padding:10px 4px}
.overview-mode nav{height:var(--app-nav);padding-bottom:env(safe-area-inset-bottom,0px);z-index:5}
main.overview-view{max-width:none;width:100%;height:calc(100dvh - var(--app-header) - var(--app-nav));padding:0 max(0px,env(safe-area-inset-right,0px)) 0 max(0px,env(safe-area-inset-left,0px));margin:0;min-height:0}
.overview-view #app{height:100%;min-height:0}.overview-view .app-version{display:none}
.overview-tree{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0}
.overview-frame{display:grid;grid-template-columns:56px minmax(0,1fr);flex:1;min-height:0;overflow:hidden}
.overview-viewport{height:100%;min-height:0;min-width:0;overflow:hidden;border:0;border-radius:0;background:transparent;touch-action:none;overscroll-behavior:none;scrollbar-width:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.overview-viewport::-webkit-scrollbar{display:none}.overview-canvas{margin:0;display:block;overflow:hidden}
.generation-gutter{display:block;width:56px;height:100%;overflow:hidden;pointer-events:none;background:#f5f4f0;font-family:inherit}
.generation-gutter .generation-label{display:inline}.generation-number{font-weight:700;fill:#2b302c}.generation-name{font-weight:500;fill:#52634f}
.tree-node .person.center{border-color:#456e50;background:#fff;box-shadow:inset 0 0 0 1px #456e50}
.tree-node .person{touch-action:none}.tree-node .person:focus-visible{outline:2px solid #315e42;outline-offset:-4px}
.tree-controls{flex:none;width:100%;max-width:none;margin:0;padding:4px 4px 6px;border:0;border-top:1px solid #dce2d9;border-radius:0;background:#fff;box-shadow:none}
.tree-primary-controls{display:flex;align-items:center;justify-content:space-between;min-height:36px;margin-bottom:3px}
.tree-primary-controls .tree-simplify{padding:0 5px;min-height:36px;font-size:13px;gap:6px}
.tree-primary-controls button{border:0;border-radius:9px;min-height:34px;padding:5px 14px;font:inherit;font-size:13px;color:#253225;background:#edf2ed;touch-action:manipulation}
.tree-adjust-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:0}
.tree-adjust-group{display:flex;align-items:center;justify-content:space-between;gap:0;min-width:0;border:1px solid #dce2d9;border-radius:10px;padding:2px;background:#fff}
.tree-adjust-group span{font-size:12px;letter-spacing:-.05em;text-align:center;white-space:nowrap}
.tree-adjust-group button{border:0;border-radius:7px;min-width:24px;width:28px;height:38px;padding:0;font-size:22px;line-height:1;flex:none}
.tree-adjust-group button:disabled{opacity:.35}
@media(max-width:340px){.tree-adjust-group span{font-size:11px}.tree-adjust-group button{width:24px}.tree-adjust-controls{gap:3px}.overview-mode #crumb{font-size:14px}}
