/* Paper, ink and evergreen: shared presentation, independent of business data. */
:root{
 --ink:#203e34;--muted:#62766b;--line:#dee7df;--green:#3f735c;--green-dark:#24523f;
 --paper:#fffefa;--warm:#f5f0e5;--radius:16px;--sidebar-width:248px;
 --surface-soft:#f0f5ef;--gold:#ad8951;--shadow-soft:0 5px 22px #213e3006;
 --shadow-raised:0 12px 30px #213e3010;--motion-fast:160ms;--motion-page:360ms;
 --ease-out:cubic-bezier(.22,1,.36,1);
}
body{background:#f6f7f2}
::selection{background:#d7e8d4;color:#183e2d}
/* A quiet, high-contrast rail anchors the archive. */
.sidebar{background:#203e33;color:#edf3e9;border-right:1px solid #294b3c;padding:28px 18px 18px;scrollbar-width:thin;scrollbar-color:#547361 transparent}
.brand{padding-bottom:25px}.brand strong{color:#f5f2e5;letter-spacing:2px}.brand span{color:#b2c4b4;letter-spacing:3px}
.brand-mark{background:#e9dfc1;color:#254733;border-radius:13px 5px 13px 5px;box-shadow:inset 0 0 0 4px #203e3310;flex-shrink:0}
.family-switcher{border-color:#ffffff1a;padding-block:18px}.family-switcher label{color:#b2c4b4;font-size:.78571rem;letter-spacing:1px}
.family-switcher select{background:#ffffff0c;border-color:#ffffff26;color:#f2f4eb;border-radius:10px}.family-switcher select option{background:#fff;color:#203e34}.family-switcher p{color:#b2c4b4}
.nav-list{gap:5px;padding-top:18px}.nav-item{color:#c0cec2;border-radius:10px;min-height:46px;height:46px;gap:12px}
.nav-item.active{color:#f8f3e5;background:#ffffff12;box-shadow:inset 0 0 0 1px #ffffff0a}.nav-item.active::before{background:#d1b47b;height:20px;left:0}
.nav-item.active .nav-icon{color:#dcc89d}.nav-item em{background:#ffffff12;color:#e7eede}.nav-item:hover{background:#ffffff0e;color:#fff}
.nav-icon{opacity:.9}.sidebar-note{border-color:#ffffff1a;margin-top:24px}.sidebar-note strong,.user-card strong{color:#e1eade}.sidebar-note p,.user-card span{color:#b0c1b0}
.user-card{border-color:#ffffff1a;padding-top:16px;margin-top:auto}.sidebar .avatar{background:#ffffff12;color:#efe3c6}.sidebar .sidebar-close{color:#e7efe3}
.topbar{background:#fffef9ed;border-color:#e4e9df;box-shadow:0 3px 16px #203e3303;gap:16px}.top-actions{gap:12px}.crumb strong{color:var(--ink)}
#save-status{background:#edf2e9;color:#526b58;font-size:.75rem;padding-block:6px;letter-spacing:.2px}
.page-content{padding-top:24px}.account-bar{background:#fffefa;border-radius:12px;border-color:var(--line);box-shadow:none;margin-bottom:28px}
.role-badge{border-radius:6px;background:#eaf1e7;color:#31553c}.account-tools select{background:#fafbf7;border-color:#dce4d9}
/* The family name is the primary focal point. The ornament carries no data. */
.overview-heading{position:relative;isolation:isolate;overflow:hidden;align-items:center;min-height:210px;padding:32px 36px;margin-bottom:24px;border:1px solid #dce5d6;border-radius:20px;background:#edf2e7}
.overview-heading::before{content:"";position:absolute;z-index:-1;right:5%;top:-90px;width:350px;height:350px;border:1px solid #bbcbb766;border-radius:50%;box-shadow:0 0 0 38px #edf2e7,0 0 0 39px #becdb64d,0 0 0 77px #edf2e7,0 0 0 78px #becdb633;pointer-events:none}
.overview-heading>div{min-width:0}.overview-heading>div:first-child{flex:1}.overview-heading .eyebrow{color:#5b775f;letter-spacing:2px;font-size:.78571rem}.overview-heading .eyebrow span{color:#73866d}
.page-heading h1{font-family:"Noto Serif TC","Songti TC","Songti SC",SimSun,serif;font-weight:500;letter-spacing:1px;color:var(--ink)}
.overview-heading h1{font-size:clamp(32px,3.3vw,46px);line-height:1.4}.overview-heading .subheading{max-width:580px;color:#536d58;margin-top:12px}.overview-heading .heading-meta{flex-direction:column;align-items:flex-end;gap:12px;max-width:40%}.overview-heading .updated{color:#56705c}
.page-heading:not(.overview-heading){padding-left:16px;border-left:3px solid #a8bc9b}.page-heading h1{overflow-wrap:anywhere}.subheading{color:#607465;line-height:1.9}
.stats-grid{gap:16px}.stat-card{position:relative;overflow:hidden;background:var(--paper);padding:20px 22px;border-radius:15px;border-color:var(--line);box-shadow:var(--shadow-soft);min-height:150px}
.stat-card::after{content:"";position:absolute;left:22px;bottom:0;width:32px;height:3px;background:#b0c5a3;border-radius:3px 3px 0 0}.stat-card:first-child{background:#294d3b;border-color:#294d3b}.stat-card:first-child .stat-top,.stat-card:first-child small{color:#c4d4c1}.stat-card:first-child>strong{color:#fff9e9}.stat-card:first-child .stat-icon{background:#ffffff14;color:#e1eacb}.stat-card:first-child::after{background:#d2b780}
.stat-card>strong{font-size:2.6rem;letter-spacing:-1px;font-weight:500;margin:12px 0 7px}.stat-icon{width:32px;height:32px;border-radius:10px;background:#eef3e9;color:#547453}.stat-icon.branch{background:#f5eedf;color:#93723d}.stat-icon.alert{background:#f9eee2;color:#a16f3d}
.panel{background:var(--paper);border-color:var(--line);border-radius:16px;box-shadow:var(--shadow-soft)}.panel-heading{padding-bottom:16px;border-bottom:1px solid #edf0e7;margin-bottom:18px}.panel-heading h2{letter-spacing:.5px}.panel-heading .eyebrow{color:#7a8971;font-size:.68rem;letter-spacing:1.8px}
.notification-todos{border-left:3px solid #b8c99c}.notification-todos .panel-heading{padding-bottom:6px;border:0;margin-bottom:0}.notification-todo{padding-block:12px}.notification-todos .form-hint{margin-block:0 10px}.notification-todos{margin-bottom:24px}
.member-row{border-radius:9px;transition:background-color var(--motion-fast),box-shadow var(--motion-fast)}.member-row.selected{background:#edf3e8}.member-row .avatar{box-shadow:0 0 0 4px #f7f8f2}.member-main strong{letter-spacing:.4px}.row-arrow{color:#648169}
.directory-head{background:#f6f8f1;border-bottom:1px solid var(--line)}.directory-panel{padding-top:8px;padding-bottom:8px}.avatar{background:#e7efdd;color:#3e653e}.avatar.female{background:#f2e9e2;color:#936c5a}
.status{border-radius:20px;padding:5px 9px}.person-hero h2{font-family:"Songti TC","Songti SC",serif}.detail-facts{background:#f8f9f3;border-radius:12px;padding:18px 14px;margin-block:18px}.detail-panel .person-bio{color:#5c735f}
.tree-viewport{border-radius:12px;background-color:#f9faf5}.tree-canvas .tree-card{border-radius:11px;border-color:#d8e2d1;box-shadow:0 3px 9px #294d3b08;transition:background-color var(--motion-fast),border-color var(--motion-fast),box-shadow var(--motion-fast)}
.tree-card.current{background:#edf4e6;box-shadow:0 0 0 1px #719363,0 4px 14px #294d3b10}.tree-households{background:#f5f7ee;border-radius:10px}.tree-controls{border-radius:10px}.tree-wrap.expanded{background:var(--paper);border-radius:16px}
/* Forms share one surface, including newly added management tools. */
:where(.page-content,.modal,.auth-page) :is(input:not([type]),input[type=text],input[type=search],input[type=email],input[type=password],input[type=url],input[type=number],input[type=date],input[type=datetime-local],select,textarea){border:1px solid #d5dfd0;border-radius:9px;background:#fbfcf8;color:var(--ink);min-height:46px;padding:10px 12px;max-width:100%;transition:border-color var(--motion-fast),box-shadow var(--motion-fast),background-color var(--motion-fast)}
:where(.page-content,.modal,.auth-page) textarea{resize:vertical;line-height:1.8}:where(input,select,textarea):disabled{background:#f0f2ec;color:#6b7869;cursor:not-allowed}
.search-box input,.auth-password input{border:0!important;background:transparent!important;box-shadow:none!important}.search-box{background:#fffefa;border-radius:11px;min-height:48px}.auth-password input{border-radius:11px!important}
input[type=checkbox],input[type=radio]{accent-color:#3f735c}.button,.icon-button,.filter-button,.mobile-menu{border-radius:10px;transition:background-color var(--motion-fast),border-color var(--motion-fast),box-shadow var(--motion-fast),transform var(--motion-fast) var(--ease-out)}
.button-primary{background:#2c5943;border-color:#2c5943;box-shadow:0 3px 8px #294d3b14}.button-secondary{background:#fffefa;border-color:#d7e1d1;color:#3e5e43}.button-danger{box-shadow:none}.text-button{border-radius:7px;text-underline-offset:5px}.button:disabled{transform:none;box-shadow:none}
:where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #60885d;outline-offset:3px}
:where(input,select,textarea):focus-visible{background:#fffefa;box-shadow:0 0 0 4px #60885d12}.search-box input:focus-visible,.auth-password input:focus-visible{outline:none}
.modal-backdrop{background:#142b2266;backdrop-filter:blur(5px)}.modal{background:var(--paper);border:1px solid #e2e8da;border-radius:20px;box-shadow:0 25px 90px #152a2240}.modal-head,.modal-actions{background:var(--paper)}.modal-head h2{font-family:"Songti TC","Songti SC",serif;font-weight:600}.modal-actions{gap:12px}
.notice,.pending-notice,.auth-notice{border-radius:11px}.notice{box-shadow:0 3px 12px #294d3b06}.form-error,.auth-error{border-left:3px solid #b66349;padding-left:12px}.form-error:empty,.auth-error:empty{border:0;padding:0}
:where(.story-source,.story-detail blockquote,.deduplication-page pre,.archives-page pre){border-radius:10px}.story-timeline{border-color:#cbd8bf}.story-timeline li{position:relative;padding:12px 14px;background:#f6f8ef;border:1px solid #e5ebdb;border-radius:12px}.story-timeline li::before{content:"";position:absolute;left:-31px;top:24px;width:10px;height:10px;background:#76966a;border:3px solid #fffefa;border-radius:50%;box-shadow:0 0 0 1px #c6d4bc}
.archive-list{list-style:none;padding-left:0}.archive-list li{padding:14px;background:#f5f7ef;border:1px solid #e1e8d8;border-radius:12px}.archive-list small{display:block;color:var(--muted);margin-top:8px}.archive-image{border-radius:12px;overflow:hidden;box-shadow:var(--shadow-raised)}
.merge-candidates li{padding:12px;border:1px solid #e2e8d9;border-radius:10px;background:#f7f9f1}.merge-rows fieldset{border-color:var(--line);border-radius:12px;background:#fdfdf8}.merge-rows .merge-comparison label{padding:10px;border-radius:9px;border:1px solid transparent}.merge-rows label:has(input:checked){background:#ecf3e6;border-color:#c3d4b7}.merge-preview{background:#f4f7ec;border-color:#9bb38b}.merge-history article{border-color:var(--line)}
.platform-metrics>div{border-radius:15px;background:var(--paper);box-shadow:var(--shadow-soft)}.platform-metrics strong{font-variant-numeric:tabular-nums;color:#2e5941;font-size:2.2rem}.platform-tabs{gap:8px}.notification-item{padding:18px;border:1px solid var(--line);border-radius:12px;margin-block:12px}.notification-item.is-unread{border-left:3px solid #7f9d6e;background:#f5f8ef}
/* Login uses the same materials and typography. */
.auth-page{background:radial-gradient(ellipse at 0% 0%,#e4ecd9,transparent 65%),#f6f5ee}.auth-card{background:var(--paper);border-color:#dce5d4;border-radius:24px;box-shadow:0 24px 80px #2547340d}.auth-brand-mark{background:#2c5943;border-radius:14px 5px 14px 5px}.auth-story h1{color:#264b39}.auth-art span{background:#fffefa99;border-color:#b5c8a9}.auth-tabs a{transition:color var(--motion-fast),border-color var(--motion-fast)}.auth-password{background:#fbfcf8;border-radius:10px;border-color:#d5dfd0}.auth-password button{border-radius:7px}.auth-notice{background:#f1f5e9}.auth-status{border-radius:10px}
/* Motion is finite. Content is visible even without animation or JavaScript. */
@keyframes archive-fade{from{opacity:.35}to{opacity:1}}
@keyframes archive-rise{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@keyframes archive-dialog{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes archive-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:no-preference){
 .page-enter>:not(.account-bar){animation:archive-fade var(--motion-page) var(--ease-out) both}
 .page-enter>.page-heading{animation:archive-rise 420ms var(--ease-out) both}
 .page-enter>.stats-grid .stat-card{animation:archive-rise 440ms var(--ease-out) both}.page-enter>.stats-grid .stat-card:nth-child(2){animation-delay:45ms}.page-enter>.stats-grid .stat-card:nth-child(3){animation-delay:90ms}.page-enter>.stats-grid .stat-card:nth-child(4){animation-delay:135ms}
 .modal-backdrop{animation:archive-fade 180ms ease-out}.modal{animation:archive-dialog 260ms var(--ease-out)}
 .auth-card{animation:archive-rise 500ms var(--ease-out)}.auth-intro{animation:archive-fade 600ms ease-out}
 .notice-dismissible{animation:archive-rise 240ms var(--ease-out)}
 .sidebar{transition:transform 260ms var(--ease-out)}.sidebar-backdrop:not([hidden]){animation:archive-fade 180ms ease-out}
 .nav-item{transition:background-color var(--motion-fast),color var(--motion-fast),box-shadow var(--motion-fast)}
 .auth-form[aria-busy=true] .auth-submit::after{content:"";width:14px;height:14px;border:2px solid #ffffff55;border-top-color:currentColor;border-radius:50%;animation:archive-spin 800ms linear infinite;flex-shrink:0}
}
@media(hover:hover) and (pointer:fine){
 .button-primary:hover:enabled{background:#224c36;box-shadow:0 6px 14px #294d3b24;transform:translateY(-1px)}.button-secondary:hover:enabled{background:#f0f5e9;border-color:#aebe9f;box-shadow:0 3px 10px #294d3b0a}
 .stat-card{transition:box-shadow 220ms,border-color 220ms}.stat-card:hover{border-color:#bdcdb0;box-shadow:var(--shadow-raised)}
 .tree-card:hover{border-color:#7e9f6e;box-shadow:0 4px 12px #294d3b14}.member-row:hover{background:#f2f6ec}.text-button:hover{text-decoration:underline}
}
.button:active:enabled,.icon-button:active:enabled,.mobile-menu:active:enabled{transform:translateY(1px);box-shadow:none}
@media(max-width:1279px){.overview-heading{padding:28px;gap:24px}.overview-heading .heading-meta{max-width:42%}}
@media(max-width:1023px){.sidebar{width:280px}.sidebar .sidebar-close{color:#e8eee4}.topbar{gap:12px}.page-content{padding-top:20px}}
@media(max-width:767px){
 .topbar{padding-block:12px;gap:8px 10px}.top-actions{gap:8px}.top-actions .button{padding-inline:12px}.crumb{flex:1}.mobile-menu{background:#eaf0e3;border:1px solid #dce5d3}.topbar .language-switcher select{background:#fffefa}
 .account-bar{margin-bottom:20px;padding:12px}.account-tools{gap:8px}.account-tools select{font-size:max(16px,1rem)}.account-tools>.button{font-size:.85714rem}
 .overview-heading{padding:24px 20px;min-height:0;border-radius:16px;gap:20px;align-items:flex-start}.overview-heading h1{font-size:2.25rem}.overview-heading::before{right:-200px;top:-90px;width:320px;height:320px}.overview-heading .subheading{font-size:.92857rem;line-height:1.85}.overview-heading .heading-meta{flex-direction:row;align-items:center;justify-content:space-between;max-width:none;width:100%}.overview-heading .updated{font-size:.85714rem}
 .page-heading:not(.overview-heading){padding-left:12px}.page-heading h1{line-height:1.5}.stats-grid{gap:10px}.stat-card{padding:16px;min-height:135px;border-radius:13px}.stat-card>strong{font-size:2.25rem}.stat-card::after{left:16px}.stat-icon{width:28px;height:28px}.stat-top{gap:6px}.stat-card small{line-height:1.7}
 .panel{border-radius:14px}.panel-heading{padding-bottom:12px}.notification-todos{padding:16px}.notification-todo{align-items:flex-start;gap:10px}.notification-todo .action-row{justify-content:flex-start}.tree-panel,.detail-panel,.members-panel{padding:16px}.member-row{padding-block:14px}.detail-facts{gap:16px 10px}
 :where(.page-content,.modal,.auth-page) :is(input:not([type]),input[type=text],input[type=search],input[type=email],input[type=password],input[type=url],input[type=number],input[type=date],input[type=datetime-local],select,textarea){font-size:max(16px,1rem)}
 .modal{border-radius:16px}.modal-head{gap:12px}.modal-head h2{line-height:1.5}.auth-card{border-radius:18px}.auth-page{padding-top:20px}.auth-layout{gap:24px}.archive-list li{padding:12px}.merge-rows .merge-comparison label{padding:8px}
}
/* Preserve reading preferences and keyboard clarity over decorative materials. */
:root[data-text-size=large]{--sidebar-width:270px}:root[data-text-size=large] .nav-item{height:auto;min-height:52px}.sidebar :is(button,select):focus-visible{outline-color:#ecd7a3}
:root[data-contrast=high] .sidebar{background:#f0f5eb;border-color:#536553}:root[data-contrast=high] .nav-item.active{background:#dce8d2;box-shadow:inset 0 0 0 2px #214b30}:root[data-contrast=high] .family-switcher select{background:#fff;border-color:#536553}:root[data-contrast=high] .overview-heading,:root[data-contrast=high] .stat-card{background:#fff;border-color:#536553}:root[data-contrast=high] .overview-heading::before{display:none}:root[data-contrast=high] .stat-card:first-child>strong{color:#102219}:root[data-contrast=high] .sidebar .brand-mark{background:#123820;color:#fff!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.button:active:enabled,.button-primary:hover:enabled,.icon-button:active:enabled,.mobile-menu:active:enabled{transform:none}}
@media print{*,*::before,*::after{animation:none!important;transition:none!important;box-shadow:none!important}.overview-heading{background:#fff}.overview-heading::before{display:none}}

/* Public registration stays visible across authentication and application pages. */
body{min-height:100svh;display:flex;flex-direction:column}
#app{flex:1;min-width:0}
.site-footer{flex-shrink:0;min-height:76px;padding:16px var(--space-page,24px);display:flex;align-items:center;justify-content:center;text-align:center;border-top:1px solid var(--line);background:var(--theme-bg,#f6f7f2);color:var(--muted);font-size:13px;line-height:1.8}
.site-footer a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;padding:6px 10px;color:inherit;text-decoration:none;overflow-wrap:anywhere;text-underline-offset:4px}
.site-footer a:hover{text-decoration:underline;color:var(--green-dark)}
.site-footer a:focus-visible{outline:3px solid var(--green);outline-offset:3px;border-radius:4px}
body:has(.app-shell)>.site-footer{margin-left:var(--sidebar-width)}
#app:has(.auth-page) .auth-page{min-height:calc(100svh - 76px)}
@media(max-width:1023px){body:has(.app-shell)>.site-footer{margin-left:0}}
@media print{.site-footer{display:none}}
