/* Shared page layout; tree geometry and feature styles remain in feature CSS. */
:root {
  font-family:system-ui,"Microsoft YaHei","PingFang SC",sans-serif;
  --ink:#273c33;--muted:#69776f;--line:#dfe5dc;--green:#496b55;--green-dark:#2d503b;
  --warm:#f5f3eb;--radius:12px;--sidebar-width:236px;--space-page:clamp(20px,3vw,44px);
  background:#f6f7f2;color:var(--ink);font-size:1rem;line-height:1.65;
}
html{scrollbar-gutter:stable}
body{background:#f6f7f2}body.modal-open,body.navigation-open{overflow:hidden}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{transition:background-color .15s,border-color .15s,box-shadow .15s}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid #547d61;outline-offset:3px}
.skip-link{position:fixed;top:8px;left:16px;z-index:60;padding:12px 20px;border-radius:8px;background:var(--green-dark);color:#fff;transform:translateY(-160%)}.skip-link:focus{transform:translateY(0)}
[hidden]{display:none!important}
.sidebar{width:var(--sidebar-width);padding:28px 18px 18px;background:#eeeee5;border-right-color:#dddfd3}
.brand{gap:12px;padding:0 6px 26px}.brand-mark{width:44px;height:44px;border-radius:10px;font-size:1.78571rem;background:var(--green-dark)}
.brand strong{font-size:1.35714rem;letter-spacing:2px}.brand span{font-size:0.64286rem;color:#717e6c;letter-spacing:1.5px}
.sidebar .sidebar-close,.sidebar-backdrop{display:none}
.family-switcher{padding:20px 4px;border-color:#d9ddcf}.family-switcher label{font-size:0.85714rem;color:#64735e}
.family-switcher select{min-height:48px;padding:10px;font-size:1rem;border-color:#d8dece;border-radius:8px}.family-switcher p{font-size:0.85714rem;color:#6b7766;line-height:1.6}
.nav-list{gap:6px;padding-top:22px}.nav-item{position:relative;height:48px;min-height:48px;padding:0 14px;font-size:1rem;border-radius:9px;color:#5e6d61}
.nav-item.active{color:#244a32;background:#dfe7d8}.nav-item.active::before{content:"";position:absolute;left:0;height:19px;width:3px;border-radius:3px;background:var(--green)}
.nav-item:hover{background:#e3e7dc}.nav-icon{display:inline-flex;width:20px;flex:0 0 20px}.nav-icon svg{width:20px;height:20px}
.nav-item em{font-size:0.85714rem;background:#f4f6ef;border-radius:5px;padding:0 6px;color:#65745e}
.sidebar-note{margin-top:auto;padding-top:22px;border-color:#d9ddcf}.sidebar-note strong{font-size:0.85714rem}.sidebar-note p{font-size:0.78571rem;color:#6f7969;line-height:1.8}.sidebar-note .app-version{font-size:0.78571rem;letter-spacing:.5px}
.user-card{height:auto;min-height:66px;border-color:#d9ddcf}.user-card strong{font-size:0.92857rem}.user-card span{font-size:0.85714rem}
.page-wrap{margin-left:var(--sidebar-width)}.topbar{min-height:76px;height:auto;padding:14px var(--space-page);background:#fbfcf9ed;border-color:var(--line)}
.crumb{min-width:0;font-size:0.92857rem;gap:12px}.crumb span{color:#74816f}.crumb strong{color:#354e3d}.top-actions{flex-shrink:0}.save-state{font-size:0.85714rem;color:#73816e}
.page-content{max-width:1600px;padding:24px var(--space-page) 64px}.page-content:focus{outline:none}
.account-bar{gap:10px 20px;padding:12px 16px;margin-bottom:28px;border-radius:9px;background:#fff;border-color:var(--line)}.account-tools{gap:10px}
.account-tools select{max-width:250px;min-height:44px;border-radius:7px;font-size:0.85714rem}.account-tools label,.scope-description{font-size:0.85714rem;color:#677561}
.account-tools .button{font-size:0.85714rem;padding-inline:12px}.role-badge{border-radius:5px;font-size:0.85714rem;background:#eaf0e5;color:#486040}
.button{min-height:44px;padding:10px 16px;border-radius:8px;font-size:0.92857rem;line-height:1.5;gap:8px}.button-primary{background:var(--green-dark);border-color:var(--green-dark);box-shadow:0 2px 3px #254b3010}.button-primary:hover{background:#22432e}
.button-secondary{color:#4c614b;border-color:#d7dfd0}.button-secondary:hover{background:#f0f4eb;border-color:#b8c7ac}.text-button{font-size:0.92857rem;min-height:44px;color:#486743}
.icon-button{display:inline-grid;place-items:center;border-radius:8px;color:#546951;border-color:var(--line);min-width:44px;min-height:44px;font-size:1.42857rem}.icon-button:hover{background:#edf3e7}
.button:disabled,.tree-control:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.page-heading{margin-bottom:24px;gap:20px}.eyebrow{font-size:0.71429rem;line-height:1.6;font-weight:600;color:#708066;letter-spacing:1.4px;margin-bottom:8px}
.page-heading h1{font-family:"Noto Serif SC","Songti SC",SimSun,serif;font-size:clamp(26px,2.5vw,34px);line-height:1.4;letter-spacing:1px}
.subheading{color:#687760;font-size:1rem;line-height:1.85;max-width:680px;margin:10px 0 0}.overview-heading{padding:6px 0 22px;border-bottom:1px solid var(--line)}
.heading-meta{display:flex;gap:12px;align-items:center;flex-shrink:0}.updated{font-size:0.85714rem;color:#75836e}
.stats-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:24px}.stat-card{padding:18px 20px;border:1px solid var(--line);border-radius:10px;min-height:140px;box-shadow:0 2px 5px #2b402005}
.stat-top{font-size:0.92857rem;color:#65745c}.stat-icon{width:28px;height:28px;border-radius:8px;font-size:0.92857rem}
.stat-card>strong{display:block;font-size:2.28571rem;font-weight:500;line-height:1.2;color:#284c33;margin:12px 0 6px;font-variant-numeric:tabular-nums}.stat-card small{font-size:0.78571rem;color:#74806c;line-height:1.6}
.panel{border-color:var(--line);border-radius:12px;box-shadow:0 3px 10px #2c442006}.workspace-grid{grid-template-columns:minmax(0,1.65fr) minmax(310px,1fr);gap:20px;align-items:start;margin-bottom:24px}
.tree-panel,.detail-panel,.members-panel{padding:22px;min-width:0}.panel-heading{margin-bottom:18px;gap:12px}.panel-heading h2{font-size:1.35714rem;font-weight:600}.panel-heading .eyebrow{margin-bottom:4px}
.tree-toolbar{gap:10px;flex-wrap:wrap;padding-bottom:12px;margin-bottom:0}.tree-legend{font-size:0.78571rem;gap:6px;color:#718066;flex-wrap:wrap}
.tree-controls{display:flex;align-items:center;gap:0;border:1px solid var(--line);border-radius:8px;background:#fff;flex-shrink:0;overflow:hidden}
.tree-scale{padding:0 10px;min-width:58px;font-size:0.85714rem;color:#667960;font-variant-numeric:tabular-nums;text-align:center}
.tree-control{width:44px;min-width:44px;height:44px;font-size:1.35714rem;background:#fff;border:0;border-left:1px solid var(--line);border-radius:0}.tree-control:hover:enabled{background:#edf3e8}
.tree-households{margin:4px 0 12px;padding:12px;border-color:#e3e8dd;border-radius:8px;background:#f6f8f2}.tree-households-heading{font-size:0.85714rem}.tree-households-heading>span{font-size:0.78571rem}
.tree-relationship-legend{font-size:0.78571rem;line-height:1.8;gap:6px 16px;color:#64765e}
.tree-viewport{background:radial-gradient(circle,#d4decf 1px,transparent 1px) 4px 4px/20px 20px,#fafbf7;border:1px solid #e4e9de;border-radius:8px;min-height:320px}
.tree-wrap.expanded{border-color:var(--line);border-radius:12px;padding:20px}
.tree-canvas .tree-card{border-radius:9px;border-color:#dce3d5;box-shadow:0 2px 4px #273d2810;text-align:left}.tree-canvas .tree-card strong{font-size:1rem}.tree-canvas .tree-card small{font-size:0.78571rem;color:#6f7f66}
.tree-card.current{border-color:#63845b;background:#f2f7ed;box-shadow:0 0 0 1px #63845b}.tree-foot{font-size:0.85714rem;margin-top:10px;padding-top:10px;gap:8px;flex-wrap:wrap;color:#6d7c64}
.detail-header .eyebrow{font-size:0.71429rem}.person-hero{margin:20px 0 14px;gap:14px}.avatar{background:#e9efdf;color:#526e45}.avatar-large{width:58px;height:58px;font-size:1.64286rem}
.person-hero h2{font-size:1.64286rem;line-height:1.4;margin-bottom:4px}.person-hero p,.person-location{font-size:0.85714rem;line-height:1.8;color:#6f7c66}.person-bio{font-size:0.92857rem;line-height:1.9;color:#64735c;margin-bottom:18px}
.detail-facts{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px;padding:18px 0}.detail-facts dt{font-size:0.85714rem;color:#78836f}.detail-facts dd{font-size:0.92857rem;color:#364c30;overflow-wrap:anywhere}
.relation-summary{padding:16px 0 12px}.relation-title{font-size:1rem}.relation-line{grid-template-columns:60px minmax(0,1fr);padding:8px 0;gap:8px;min-height:44px}
.relation-line>span,.relation-line em{font-size:0.85714rem;color:#75836b}.relation-line>div{gap:4px 8px}.mini-person{font-size:0.85714rem;min-height:44px;text-align:left;padding:4px;flex-wrap:wrap;border-radius:5px}.mini-person:hover{background:#eef3e7}.mini-person small{font-size:0.78571rem;line-height:1.6}
.status{font-size:0.78571rem;padding:4px 8px;border-radius:5px}.full-button{min-height:44px;font-size:0.85714rem;margin-top:10px}.full-button.button-danger{color:#9a5147;background:#fff;border-color:#e8d6d0}.full-button.button-danger:hover{background:#fff1ec}
.member-row{min-height:76px;padding:12px 8px;gap:12px}.member-row:hover{background:#f3f6ee}.member-row.selected{background:#eef4e7}.member-main{gap:12px}.member-main .avatar{width:40px;height:40px;font-size:1.07143rem}
.member-main strong{font-size:1rem}.member-main small{font-size:0.85714rem;color:#7b8673;margin-top:4px}.member-branch,.member-date{font-size:0.85714rem;color:#6e7b64}.row-arrow{font-size:1.21429rem;color:#819673}
.directory-head{font-size:0.85714rem;color:#77866d;padding:16px 8px}.directory-panel{padding:0 18px;overflow:hidden}.directory-heading-hint{color:#78866d;font-size:0.85714rem}
.toolbar{align-items:center;margin:24px 0 12px;gap:16px}.search-field{display:flex;flex:1;gap:10px;min-width:0;align-items:center}.search-box{max-width:440px;height:48px;border-color:#d8e1cf;border-radius:8px;padding-inline:14px}
.search-box:focus-within{outline:2px solid #608252;outline-offset:2px}.search-box input{font-size:1rem}.search-clear{white-space:nowrap;flex-shrink:0}.toolbar-actions{gap:12px}
.filter-button{font-size:0.92857rem;border-radius:8px;min-height:44px;border-color:#d8e1cf}.filter-button[aria-expanded="true"]{color:var(--green-dark);background:#e9f0e1;border-color:#8ea47d}
.directory-sort,.directory-sort select{font-size:0.85714rem;color:#607554}.directory-count{margin:16px 0;font-size:0.85714rem;color:#677a5c}.empty-state{padding:48px 20px}.empty-state strong{font-size:1.14286rem}.empty-state p{font-size:0.92857rem}.empty-state .button{margin-top:10px}
.notice-dismissible{display:flex;gap:12px;align-items:center;justify-content:space-between}.notice-dismissible .icon-button{background:transparent;border:0;flex-shrink:0}
.modal-backdrop{background:#1d30265c;backdrop-filter:blur(3px);padding:24px;z-index:40}.modal{width:min(640px,100%);border-radius:16px;padding:24px;max-height:calc(100dvh - 48px);scrollbar-gutter:stable;overscroll-behavior:contain}.small-modal{width:min(460px,100%)}
.modal-head{position:sticky;top:-24px;z-index:2;padding:16px 0;margin:-8px 0 18px;background:#fff;border-bottom:1px solid var(--line);gap:12px;align-items:center}.modal-head h2{font-size:1.42857rem;line-height:1.6}
.modal-actions{position:sticky;bottom:-24px;margin-top:24px;padding:16px 0;background:#fff;border-top:1px solid var(--line);z-index:1}.modal .form-hint,.form-hint{font-size:0.85714rem;color:#74816a}
.modal input,.modal select,.modal textarea{font-size:1rem;min-height:44px;border-radius:7px}.modal form label{font-size:0.92857rem;color:#586f4d}
.member-preview{width:min(560px,100%)}.member-preview .detail-header>div{display:none}.member-preview .detail-header{justify-content:flex-end;margin-top:-6px}.member-preview .person-hero{margin-top:0}
@media(min-width:1024px) and (max-width:1279px){
  :root{--sidebar-width:216px;--space-page:24px}.workspace-grid{grid-template-columns:minmax(0,1fr)}.detail-panel{order:0}.account-tools{width:auto}.account-tools label{flex-basis:auto}.stat-card{padding:16px}.updated{display:none}
}
@media(max-width:1023px){
  :root{--space-page:24px}.sidebar{width:288px;max-width:calc(100vw - 44px);z-index:22;transform:translateX(-100%);transition:transform .2s}.sidebar.open{visibility:visible;transform:translateX(0)}
  .sidebar .sidebar-close{display:inline-grid;margin-left:auto;border:0;background:transparent}.brand{gap:9px;padding-inline:0}.brand strong{font-size:1.21429rem}
  .sidebar-backdrop{display:block;position:fixed;inset:0;z-index:21;border:0;background:#1d30265c;width:100%;height:100%}.page-wrap{margin-left:0}
  .topbar{min-height:68px;padding:10px var(--space-page);gap:12px}.mobile-menu{display:block;flex-shrink:0;border-radius:8px;background:#eef2e9;font-size:1.42857rem}.crumb{margin-right:auto}
  .account-bar{flex-wrap:wrap;gap:12px}.account-tools{width:100%}.account-tools label{flex-basis:auto}.account-tools select{max-width:none;flex:1}.workspace-grid{grid-template-columns:minmax(0,1fr)}.detail-panel{order:0}.heading-meta .updated{margin-bottom:0}.toolbar{flex-direction:row}.toolbar-actions{height:auto}
}
@media(max-width:767px){
  :root{--space-page:16px}.topbar{min-height:64px;gap:10px}.crumb{font-size:0.85714rem;gap:8px;flex-wrap:wrap;line-height:1.4}.crumb span{max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-actions .button{font-size:0.85714rem;padding:10px 12px}.save-state{display:none}
  .page-content{padding-top:18px}.account-bar{padding:12px;margin-bottom:22px}.account-bar>div:first-child{gap:8px}.scope-description{font-size:0.78571rem}.account-tools{gap:8px}.account-tools label{display:none}.account-tools select{width:100%;font-size:1.14286rem}.account-tools .button{font-size:0.85714rem}
  .page-heading,.page-heading.compact{align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:20px}.page-heading h1{font-size:1.92857rem}.eyebrow{font-size:0.64286rem;letter-spacing:1.1px}.subheading{font-size:0.92857rem;max-width:none;line-height:1.85;margin-top:8px}.overview-heading{padding-bottom:18px}
  .heading-meta{display:flex;justify-content:space-between;width:100%;text-align:left}.heading-meta .button{font-size:0.85714rem;min-height:44px}.heading-meta .updated{display:block;font-size:0.85714rem}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:18px}.stat-card{padding:14px;min-height:124px;border-radius:10px}.stat-top{font-size:0.85714rem}.stat-card>strong{font-size:2rem;margin-top:9px}.stat-card small{font-size:0.78571rem}.stat-icon{width:24px;height:24px}
  .workspace-grid{gap:18px;margin-bottom:18px}.tree-panel,.detail-panel,.members-panel{padding:16px}.panel-heading h2{font-size:1.28571rem}.detail-panel{order:0}.tree-toolbar{gap:12px}.tree-controls{margin-left:auto}.tree-legend{font-size:0.71429rem}.tree-viewport{min-height:300px;max-height:58vh}.tree-wrap.expanded{padding:14px}.tree-foot{font-size:0.78571rem}.tree-relationship-legend{gap:6px 12px}
  .member-row{grid-template-columns:minmax(0,1fr) auto;min-height:80px;gap:6px;padding:12px 4px}.member-main strong{font-size:1rem}.member-main small{font-size:0.78571rem}.member-branch{font-size:0.78571rem}.directory-panel{padding-inline:12px}.directory-heading-hint,.directory-head{display:none}
  .toolbar{flex-direction:column;align-items:stretch;gap:12px}.search-box{max-width:none}.search-box input{font-size:1.14286rem}.toolbar-actions{justify-content:space-between;gap:12px}.filter-button{flex:0 0 auto;min-width:88px;height:44px;padding:8px 12px}.directory-sort select{width:auto;min-width:0;max-width:190px}.search-clear{font-size:0.85714rem}
  .modal-backdrop{padding:10px;align-items:center}.modal{padding:18px;max-height:calc(100dvh - 20px);border-radius:12px}.modal-head{top:-18px;padding:12px 0}.modal-head h2{font-size:1.35714rem}.modal-actions{bottom:-18px;padding:12px 0}.modal-actions .button{flex:1}
  .modal input,.modal select,.modal textarea,.access-form input,.access-form select,.access-form textarea{font-size:1.14286rem}.form-grid{grid-template-columns:minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}


.empty-households{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:4px 12px;font-size:0.85714rem;color:var(--muted)}

.search-box input:focus-visible{outline:none}

#save-status{margin:0;padding:8px var(--space-page);background:var(--surface,#f6f8f3);overflow-wrap:anywhere}
