:root {
  color-scheme: light;
  --canvas: #f8f8f3;
  --paper: #fffefa;
  --sidebar: #fcfcf7;
  --ink: #25332a;
  --muted: #626c61;
  --line: #e5e8dc;
  --forest: #30513c;
  --green: #e7eee1;
  --gold: #f2ead7;
  --rose: #f1e5e0;
  --serif: Lora, Georgia, serif;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 310px; font-size: 16px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 2px solid #55765d; outline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { font-family: var(--serif); font-weight: 500; }
button { background: none; border: 0; padding: 0; }
small { font-size: .8125rem; }
[hidden] { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.loading { padding: 3rem; color: var(--muted); }

.entry { display: grid; align-items: center; justify-items: center; min-height: 100svh; padding: 24px; }
.entry-card { width: min(100%, 29rem); padding: clamp(20px, 6vw, 36px); }
.entry-card .brand { margin: 0 0 26px; }
.entry-card h1 { line-height: 1.2; letter-spacing: -.04em; }
.entry-card form { margin-top: 22px; }
.entry-card .form-actions .button { width: 100%; justify-content: center; }

.layout { display: grid; grid-template-columns: 242px minmax(0,1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); min-height: 100vh; border-right: 1px solid var(--line); padding: 28px 17px 19px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 0 33px 8px; width: fit-content; text-align: left; }
.brand-mark { width: 41px; height: 41px; display: grid; place-items: center; color: #f7f5e7; background: #36563e; border-radius: 13px; }
.brand strong { display: block; font: 600 1.5rem/1 var(--serif); letter-spacing: -.055em; }
.brand small { display: block; margin-top: 5px; font-size: .61rem; font-weight: 700; letter-spacing: .145em; color: #616a5b; }
.family-switch { display: flex; align-items: center; gap: 10px; background: #f4f5ed; border: 1px solid #e9ebdf; border-radius: 10px; padding: 9px; min-width: 0; }
.family-mark { background: #e3eadb; color: #46664c; display: grid; place-items: center; width: 33px; height: 33px; flex: none; border-radius: 8px; }
.family-switch > div { min-width: 0; flex: 1; }
.family-switch strong,.family-switch small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-switch strong { font-size: .83rem; font-weight: 700; }
.family-switch small { color: var(--muted); margin-top: 2px; font-size: .72rem; }
.sidebar-section { color: #667062; margin: 30px 10px 9px; font-size: .68rem; font-weight: 700; letter-spacing: .12em; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; width: 100%; gap: 11px; min-height: 43px; padding: 0 11px; border-radius: 8px; text-align: left; font-size: .9rem; color: #505d51; font-weight: 500; }
.nav-item:hover { background: #f0f2e9; }
.nav-item.active { background: #e7efe2; color: #30523b; font-weight: 700; }
.nav-item svg { flex: none; }
.side-bottom { margin-top: auto; padding-top: 38px; }
.invite-card { display: grid; justify-items: start; gap: 8px; background: #f2f0e5; border: 1px solid #eae7db; border-radius: 12px; padding: 13px; }
.invite-mark { display: grid; place-items: center; width: 29px; height: 29px; color: #776742; background: #eae3ce; border-radius: 7px; }
.invite-card strong { font-size: .86rem; }
.invite-card p { font-size: .79rem; line-height: 1.36; color: #646855; }
.side-footer { display: flex; align-items: center; justify-content: center; gap: 6px; color: #647061; font-size: .68rem; margin-top: 17px; white-space: nowrap; }

.main-shell { min-width: 0; }
.topbar { height: 66px; background: #fdfdf8; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 37px; gap: 12px; }
.crumb, .top-actions, .account { display: flex; align-items: center; gap: 10px; }
.crumb { font-size: .86rem; color: #647063; white-space: nowrap; }
.crumb strong { color: #303d31; font-weight: 700; }
.top-actions { gap: 8px; }
.top-actions .top-signup { min-height: 36px; }
.account { min-height: 36px; padding: 0 11px; font-size: .84rem; font-weight: 700; border: 1px solid #dfe5d9; background: var(--paper); border-radius: 8px; white-space: nowrap; }
.account:hover { background: #eef2e9; }
.account .avatar { width: 25px; height: 25px; font-size: .65rem; }
.demo-label { display: flex; align-items: center; gap: 6px; color: #5e6e5d; font-size: .75rem; margin-right: 6px; }
.demo-label i { width: 6px; height: 6px; background: #72906b; border-radius: 50%; }
.mobile-menu, .mobile-scrim { display: none !important; }
.content { padding: 34px 37px 48px; max-width: 1530px; margin: auto; min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 17px; margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(1.9rem,3vw,2.55rem); line-height: 1.14; letter-spacing: -.05em; color: #283b2c; }
.page-heading p { margin-top: 8px; color: #606b5e; font-size: .938rem; line-height: 1.46; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; }

.button { min-height: 39px; border: 1px solid transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; font-weight: 700; font-size: .84rem; line-height: 1.2; text-align: center; white-space: nowrap; }
.button svg { flex: none; }
.button.primary { background: #355940; color: #fffdf4; border-color: #355940; }
.button.primary:hover { background: #284832; }
.button.secondary { border-color: #dce4d7; background: var(--paper); color: #385a40; }
.button.secondary:hover, .button.text-button:hover { background: #eff3e9; }
.button.danger { background: #8e392e; border-color: #8e392e; color: #fffdf7; }
.button.danger:hover { background: #742b22; }
.button.danger-outline { color: #8e392e; border-color: #edcfc9; background: var(--paper); }
.button.danger-outline:hover { background: #f8ece8; }
.button.text-button { color: #3d6647; padding: 0 8px; min-height: 32px; }
.button.invite-button { color: #3e593d; border-color: #d9dfd1; background: #fffdf4; min-height: 33px; font-size: .77rem; padding: 0 8px; width: 100%; margin-top: 3px; }
.button.invite-button:hover { background: #e7ebdc; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 31px; height: 31px; border-radius: 7px; color: #536452; }
.icon-button:hover { background: #edf1e7; }
.text-link { color: #385e45; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-align: left; }

.hero { min-height: 247px; border-radius: 15px; overflow: hidden; color: #faf8ec; background: #2c4734; isolation: isolate; display: flex; align-items: center; position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #243f2c 0%,#284330 13%,rgba(40,66,46,.96) 32%,rgba(42,62,40,.53) 57%,rgba(31,47,30,.09) 100%), url('/hero.jpg') center 49% / cover; }
.hero-content { padding: 28px 36px 31px; max-width: 68%; }
.hero-label { display: flex; align-items: center; gap: 7px; font-size: .68rem; font-weight: 700; letter-spacing: .14em; color: #dfdfbf; }
.hero h2 { font-size: clamp(2.05rem,4.0vw,3.42rem); letter-spacing: -.058em; line-height: 1.1; margin: 12px 0 9px; overflow-wrap: anywhere; }
.hero p { font-size: .92rem; color: #eeeede; margin-bottom: 21px; }
.button.hero-button { background: #f5f2e1; color: #304e37; border-color: #f5f2e1; min-height: 36px; }
.button.hero-button:hover { background: #dfebd8; }

.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 19px 0 22px; }
.metric { display: flex; align-items: center; gap: 12px; text-align: left; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; min-height: 84px; }
.metric:hover { border-color: #bfcdb7; background: #fcfdf7; }
.icon-tile { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; flex: none; }
.green { background: var(--green); color: #496a50; }
.gold { background: var(--gold); color: #826d41; }
.rose { background: var(--rose); color: #885e55; }
.metric strong,.metric small { display: block; }
.metric strong { font: 600 1.57rem/1.04 var(--serif); color: #2b3c2d; }
.metric small { margin-top: 4px; color: #606c5e; font-size: .81rem; line-height: 1.23; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: 17px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 17px; min-height: 72px; border-bottom: 1px solid var(--line); }
.section-heading h2,.report h2,.story h2 { font-size: 1.24rem; letter-spacing: -.035em; color: #2c3e31; overflow-wrap: anywhere; }
.section-heading p { margin-top: 4px; color: #697264; font-size: .8rem; line-height: 1.35; }
.heading-icon,.row-chevron { color: #687b66; display: flex; }
.member-row { display: flex; text-align: left; align-items: center; gap: 10px; width: 100%; padding: 8px 16px; min-height: 56px; }
.member-row + .member-row { border-top: 1px solid #eeefe7; }
.member-row:last-child { border-radius: 0 0 12px 12px; }
.member-row:hover { background: #f6f8f0; }
.member-meta { flex: 1; min-width: 0; line-height: 1.21; }
.member-meta strong,.member-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-meta strong { font-size: .865rem; }
.member-meta small { color: #697366; margin-top: 3px; font-size: .75rem; }
.avatar { display: inline-grid; width: 36px; height: 36px; border-radius: 50%; place-items: center; overflow: hidden; font-size: .73rem; font-weight: 700; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.small { width: 31px; height: 31px; font-size: .72rem; }
.avatar.large { width: 65px; height: 65px; font-size: 1.2rem; }
.tone-0 { background: #e7e9db; color: #4c654d; }
.tone-1 { background: #ecdfd0; color: #775a43; }
.tone-2 { background: #eee6d9; color: #776447; }
.tone-3 { background: #e3e7d8; color: #52634b; }
[class*="portrait-"] { background-image: url('/portraits.jpg'); background-size: 200% 200%; }
[class*="portrait-"] > span { visibility: hidden; }
.portrait-0 { background-position: 0 0; }
.portrait-1 { background-position: 100% 0; }
.portrait-2 { background-position: 0 100%; }
.portrait-3 { background-position: 100% 100%; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 20px; line-height: 1.05; font-size: .71rem; font-weight: 700; white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.alive { background: #e9f1e4; color: #3d6745; }
.badge.deceased { background: #f0ede5; color: #6d6352; }
.badge.unknown { background: #edf0e9; color: #626d60; }
.activity-list { list-style: none; margin: 0; padding: 0 15px; }
.activity-list li { display: flex; align-items: flex-start; padding: 10px 2px; gap: 10px; }
.activity-list li + li { border-top: 1px solid #eeefe7; }
.activity-list .icon-tile { width: 30px; height: 30px; border-radius: 8px; }
.activity-list li div { min-width: 0; overflow-wrap: anywhere; }
.activity-list strong,.activity-list span,.activity-list small { display: block; }
.activity-list span.icon-tile { display: grid; }
.activity-list strong { font-size: .83rem; }
.activity-list div span,.activity-list small { font-size: .75rem; color: #667263; margin-top: 2px; }
.activity-list small { font-size: .7rem; }
.empty { display: grid; place-items: center; text-align: center; padding: 32px 20px; gap: 9px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 1.15rem; }
.empty p { font-size: .9rem; max-width: 35ch; }
.empty .button { margin-top: 4px; }

.filters { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; color: #586b57; min-width: 0; }
.search input { width: min(280px,100%); }
input:not([type=checkbox]), select, textarea { width: 100%; min-height: 39px; border: 1px solid #d8dfd1; border-radius: 7px; background: #fffefa; padding: 8px 9px; font-size: .9rem; }
input:disabled { opacity: .55; }
input[type=file] { font-size: .82rem; }
.filters select,.inline-field select { width: auto; }
select { appearance: none; padding-right: 29px; background-image: linear-gradient(45deg, transparent 50%, #5b6b59 50%), linear-gradient(135deg, #5b6b59 50%, transparent 50%); background-position: calc(100% - 15px) 53%, calc(100% - 10px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .875rem; }
th,td { padding: 10px 14px; border-bottom: 1px solid #eeefe7; white-space: nowrap; }
th { color: #5d6e5d; background: #fafbf6; font-size: .79rem; }
tr:last-child td { border-bottom: 0; }
.table-person { display: inline-flex; align-items: center; gap: 8px; }
.table-person:hover strong { text-decoration: underline; }
.inline-field { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--muted); }
.tree-scroll { overflow: auto; background-color: #f8faf5; background-image: radial-gradient(#dce4d6 1px, transparent 1px); background-size: 18px 18px; }
.tree-canvas { width: var(--tree-w); min-width: var(--tree-w); min-height: var(--tree-h); position: relative; margin: 0 auto; }
.tree-lines { position: absolute; inset: 0; pointer-events: none; }
.tree-lines path { stroke: #77947b; stroke-width: 1.75; stroke-linejoin: round; fill: none; }
.generation-label { position: absolute; left: 13px; transform: translateY(-50%); color: #5a6b59; font-size: .75rem; font-weight: 700; }
.tree-node { position: absolute; display: flex; align-items: center; gap: 6px; width: var(--card-w); height: var(--card-h); padding: 7px; background: #fffefa; border: 1px solid #d4ded0; border-radius: 10px; text-align: left; }
.tree-node:hover { border-color: #729076; background: #fbfdf8; }
.tree-node strong,.tree-node small { display: block; }
.tree-node strong { font-size: .8rem; overflow-wrap: anywhere; }
.tree-node small { font-size: .67rem; color: var(--muted); margin-top: 2px; }
.tree-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 11px 15px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.tree-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tree-legend i { width: 22px; border-top: 2px solid #77947b; }

.story-list { display: grid; gap: 12px; }
.story { display: flex; align-items: flex-start; gap: 13px; padding: 18px; }
.story > div { flex: 1; min-width: 0; }
.story time { display: block; color: #646e5e; font-size: .79rem; margin-bottom: 5px; }
.story p { margin-top: 8px; line-height: 1.5; color: #536150; white-space: pre-wrap; overflow-wrap: anywhere; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%,235px),1fr)); gap: 15px; }
.album-card,.photo-card { overflow: hidden; text-align: left; }
.album-card:hover,.photo-card:hover { border-color: #b5c6b1; }
.album-card img,.photo-card img,.album-placeholder { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; background: #e7eee1; }
.album-placeholder { display: grid; place-items: center; color: #698269; }
.album-title,.photo-card > span { display: block; padding: 12px; overflow-wrap: anywhere; }
.album-title strong,.album-title small { display: block; }
.album-title small { color: var(--muted); margin-top: 5px; }
.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.report { padding: 20px; }
.report h2 { margin-top: 10px; }
.report p { color: var(--muted); margin: 7px 0 16px; line-height: 1.47; }
.format { font-size: .73rem; font-weight: 700; color: #61715e; margin-left: 5px; }

dialog { padding: 20px; background: var(--paper); border: 1px solid #dce4d7; border-radius: 14px; width: min(530px, calc(100% - 24px)); max-height: calc(100dvh - 24px); color: var(--ink); box-shadow: 0 20px 80px #15231938; }
dialog::backdrop { background: #21332764; }
.modal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.modal-top h2 { font-size: 1.45rem; letter-spacing: -.04em; overflow-wrap: anywhere; }
.modal-top p,.auth-switch,.muted { font-size: .875rem; color: var(--muted); margin-top: 5px; overflow-wrap: anywhere; }
.field { display: grid; gap: 4px; margin-bottom: 9px; font-weight: 700; font-size: .83rem; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.relationship-fields, .contact-fields { min-width: 0; margin: 0 0 13px; padding: 9px 10px 7px; border: 1px solid #dce4d7; border-radius: 8px; background: #f5f7ee; }
.relationship-fields legend, .contact-fields legend { padding: 0 4px; font-weight: 700; font-size: .88rem; }
.relationship-fields > p { color: var(--muted); font-size: .8rem; line-height: 1.4; margin-bottom: 9px; }
.relationship-entry { display: grid; grid-template-columns: minmax(0,1fr) 30px; align-items: end; gap: 4px; }
.relationship-entry .form-grid { min-width: 0; }
.relationship-entry .remove-relationship-row { margin-bottom: 12px; }
.location-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 0 8px; }
.phone-entry { display: grid; grid-template-columns: minmax(0,1fr) 31px; align-items: end; gap: 4px; }
.remove-phone-row { margin-bottom: 12px; }
.family-branch-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.checkbox { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: .85rem; }
.form-error { color: #8c3228; background: #f9eeea; padding: 7px 9px; border-radius: 6px; font-size: .85rem; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.auth-switch { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.invite-alternative { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.profile-overview { display: flex; gap: 10px; align-items: center; margin-bottom: 11px; }
.profile-overview p { color: var(--muted); font-size: .83rem; margin-top: 4px; }
.detail-list { display: grid; gap: 7px; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 115px minmax(0,1fr); font-size: .85rem; gap: 8px; }
.detail-list dt { font-weight: 700; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.contact-details { margin-top: 6px; }
.member-phones { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; }
.profile-bio { white-space: pre-wrap; line-height: 1.5; margin-top: 12px; overflow-wrap: anywhere; color: #596657; }
.detail-heading { font-size: 1rem; margin-top: 14px; }
.relation-row { display: flex; align-items: center; gap: 8px; min-height: 33px; border-bottom: 1px solid var(--line); font-size: .85rem; }
.relation-row .text-link { flex: 1; overflow-wrap: anywhere; }
.relation-row > span { color: var(--muted); }
.workspace-list { display: grid; gap: 7px; }
.lightbox { width: 100%; max-height: 70vh; object-fit: contain; background: #f1f2eb; border-radius: 8px; }
#notice { position: fixed; z-index: 10; bottom: 18px; right: 18px; max-width: calc(100% - 36px); padding: 11px 14px; border-radius: 8px; color: #fffefa; background: #304e39; font-size: .87rem; pointer-events: none; visibility: hidden; }
#notice.visible { visibility: visible; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 211px minmax(0,1fr); }
  .topbar,.content { padding-left: 24px; padding-right: 24px; }
  .metric { padding: 12px; gap: 8px; }
  .icon-tile { width: 37px; height: 37px; }
}
@media (max-width: 820px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .content { padding-top: 25px; }
  .hero-content { max-width: 85%; padding-left: 23px; }
  .page-heading { align-items: flex-start; }
  .page-heading .heading-actions { flex: 0 0 auto; justify-content: flex-end; }
}
@media (max-width: 680px) {
  .layout { display: block; }
  .sidebar { position: fixed; transform: translateX(-101%); transition: transform .18s ease; z-index: 5; top: 0; bottom: 0; left: 0; width: min(260px,85vw); height: auto; min-height: 0; }
  .nav-open .sidebar { transform: translateX(0); }
  .mobile-scrim { display: block !important; position: fixed; z-index: 4; inset: 0; background: #23362862; }
  .mobile-menu { display: inline-grid !important; }
  .topbar { height: 58px; padding: 0 12px; }
  .content { padding: 20px 13px 28px; }
  .page-heading { gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
  .page-heading .heading-actions { margin-top: 4px; }
  .hero { min-height: 214px; }
  .hero-content { max-width: 97%; }
  .hero::before { background-position: center, 59% 48%; }
  .report-grid { grid-template-columns: 1fr; }
  .demo-label { display: none; }
}
@media (max-width: 380px) {
  .crumb-root,.crumb > svg { display: none; }
  .top-actions .top-signup { padding-inline: 7px; }
  .account { padding-inline: 7px; }
  .account > svg { display: none; }
  .metric small { font-size: .75rem; }
  .metric strong { font-size: 1.35rem; }
  .metric .icon-tile { width: 32px; height: 32px; }
  .metric .icon-tile svg { width: 17px; }
  .story { gap: 8px; padding: 12px; }
}
