/* 1FamilyAI visual foundation — shared by web, Android and iOS layers. */
:root{
  --ink:#18352f;
  --muted:#6d7d78;
  --green:#1f6757;
  --dark:#123f36;
  --deep:#0d3029;
  --mint:#e9f5ef;
  --mint-strong:#d8eee4;
  --cream:#f7f3e9;
  --paper:#fffdfa;
  --gold:#d9a53d;
  --gold-soft:#f5e7bd;
  --line:#dfe8e3;
  --danger:#c95749;
  --shadow-sm:0 5px 18px rgba(18,63,54,.07);
  --shadow-md:0 16px 40px rgba(18,63,54,.12);
  --radius-sm:14px;
  --radius-md:20px;
  --radius-lg:28px;
}

html{background:#e8efeb;scroll-behavior:smooth}
body{
  background:
    radial-gradient(circle at 50% -10%,#d9ebe3 0,transparent 34%),
    linear-gradient(180deg,#eaf1ed,#e4ebe7);
  color:var(--ink);
  font-family:Inter,"Segoe UI",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

button,a,input{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{transition:transform .16s ease,box-shadow .16s ease,background .16s ease,opacity .16s ease}
button:active{transform:scale(.975)}
button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid rgba(217,165,61,.36);outline-offset:2px}

.phone-shell{
  width:min(100%,480px);
  min-height:100vh;
  padding:0 18px 116px;
  background:
    radial-gradient(circle at 86% 7%,rgba(216,238,228,.9),transparent 22%),
    linear-gradient(180deg,#fffefa 0,#fbfdfb 36%,#f7faf8 100%);
  box-shadow:0 0 55px rgba(18,63,54,.14);
  overflow:hidden;
}

.topbar{
  position:sticky;
  top:0;
  z-index:30;
  height:78px;
  margin:0 -18px 6px;
  padding:0 18px;
  background:#fffefa;
  border-bottom:1px solid rgba(223,232,227,.78);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.brand-mark{
  width:40px;
  height:40px;
  border-radius:14px;
  background:linear-gradient(145deg,#1f6757,#0d3029);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 8px 22px rgba(18,63,54,.22);
}
.brand strong{font-size:14px;letter-spacing:-.2px}.brand small{font-size:9px;letter-spacing:.1px}
.header-actions{gap:7px}.install-button{min-height:40px;border:1px solid var(--line);background:rgba(255,255,255,.85);border-radius:13px;padding:0 12px;color:var(--green);font-size:11px;font-weight:800}.icon-button{background:rgba(255,255,255,.9);box-shadow:var(--shadow-sm)}
.language-switcher{position:relative}.language-button{height:42px;min-width:88px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);padding:0 9px;display:flex;align-items:center;justify-content:center;gap:6px;box-shadow:var(--shadow-sm)}.language-button>img{width:22px;height:15px;object-fit:cover;border-radius:3px;box-shadow:0 0 0 1px rgba(18,63,54,.1)}.language-button>strong{font-size:11px}.language-button>i{font-size:11px;color:var(--muted);font-style:normal;transition:transform .18s ease}.language-button[aria-expanded="true"]>i{transform:rotate(180deg)}.language-menu{position:absolute;z-index:90;right:0;top:49px;width:210px;padding:7px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 20px 48px rgba(18,63,54,.22)}.language-menu[hidden]{display:none}.language-menu button{width:100%;min-height:48px;border:0;border-radius:13px;background:transparent;color:var(--ink);display:grid;grid-template-columns:36px 44px 1fr;align-items:center;text-align:left;padding:6px 8px}.language-menu button:hover,.language-menu button.selected{background:var(--mint);box-shadow:inset 3px 0 var(--green)}.language-menu button>img{width:26px;height:18px;object-fit:cover;border-radius:4px;box-shadow:0 0 0 1px rgba(18,63,54,.1)}.language-menu button>b{font-size:12px}.language-menu button>small{font-size:10px;color:var(--muted);text-align:right}
.backend-sync{display:flex;align-items:center;width:max-content;border:0;background:transparent;padding:0;color:var(--muted);cursor:pointer;text-align:left}.backend-sync span{flex:0 0 auto}.backend-sync.status-online{color:#27775c}.backend-sync.status-online span{background:#39a575;box-shadow:0 0 0 4px rgba(57,165,117,.13)}.backend-sync.status-offline,.backend-sync.status-degraded{color:#9a5c42}.backend-sync.status-offline span,.backend-sync.status-degraded span{background:#c97858}.backend-sync.status-syncing span,.backend-sync.status-reconnecting span{animation:treePulse 1.2s ease-in-out infinite}

.screen.active{animation:screenEnter .34s cubic-bezier(.2,.7,.2,1)}
@keyframes screenEnter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.date-row{margin:14px 1px 10px}.date-row span{font-size:10px;color:var(--muted)}.date-row a{background:var(--mint);border-radius:12px;padding:8px 10px;font-size:9px;font-weight:800;box-shadow:inset 0 0 0 1px rgba(31,103,87,.05)}

.welcome{
  position:relative;
  min-height:118px;
  margin:8px 0 9px;
  padding:19px;
  border:1px solid rgba(223,232,227,.88);
  border-radius:var(--radius-lg);
  background:rgba(255,255,255,.72);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.welcome:before{content:"";position:absolute;width:118px;height:118px;border-radius:50%;right:-46px;top:-54px;background:linear-gradient(145deg,var(--mint-strong),rgba(245,231,189,.55))}
.welcome>div{position:relative;z-index:1}.welcome small{font-size:10px;letter-spacing:.2px}.welcome h1{max-width:290px;font-size:24px;line-height:1.08;letter-spacing:-.7px;margin:7px 0 0}.welcome .avatar{width:52px;height:52px;background:linear-gradient(145deg,#dceee7,#f4e7bf);box-shadow:inset 0 0 0 1px rgba(31,103,87,.08)}
.sync{display:inline-flex;align-items:center;background:#fff;border:1px solid var(--line);border-radius:20px;padding:7px 10px;margin:2px 0 17px;font-size:9px;box-shadow:var(--shadow-sm)}

.ai-greeting{margin:0 0 18px;border:0;background:linear-gradient(145deg,#f3fbf7,#e8f5ef);box-shadow:var(--shadow-md)}
.ai-greeting:after{width:155px;height:155px;background:linear-gradient(145deg,rgba(216,238,228,.9),rgba(245,231,189,.62));right:-87px;top:-90px}
.ai-greeting-head>span{box-shadow:0 7px 18px rgba(18,63,54,.18)}
.greeting-main{min-height:64px;border:1px solid rgba(255,255,255,.15);background:linear-gradient(135deg,#174f43,#0d382f);box-shadow:0 11px 24px rgba(18,63,54,.18)}
.family-greeting{min-height:42px;background:rgba(255,255,255,.72)}
.greeting-bubble{box-shadow:0 5px 14px rgba(18,63,54,.06)}

.family-journey{border:0!important;border-radius:var(--radius-lg)!important;background:linear-gradient(135deg,#1f6757,#164d42 64%,#9c7b31 150%)!important;color:#fff;box-shadow:var(--shadow-md)}
.family-journey small,.family-journey span{color:rgba(255,255,255,.72)!important}.streak{background:rgba(255,255,255,.1)!important;border:1px solid rgba(255,255,255,.12)}.journey-progress{background:rgba(255,255,255,.13)!important}.journey-progress i{background:linear-gradient(90deg,#f0c760,#f6e4a9)!important}.journey-foot button{background:#fff!important;color:var(--green)!important;border-radius:12px!important;box-shadow:0 7px 16px rgba(0,0,0,.12)}

.fund-card{position:relative;border-radius:var(--radius-lg);background:linear-gradient(145deg,#174f43,#0c3029);box-shadow:var(--shadow-md);overflow:hidden}.fund-card:after{content:"";position:absolute;width:150px;height:150px;border-radius:50%;right:-92px;top:-98px;border:28px solid rgba(217,165,61,.09)}.fund-card h2{letter-spacing:-.7px}.fund-card>button,.fund-actions button{position:relative;z-index:1;min-height:42px;border-radius:13px;box-shadow:0 7px 18px rgba(0,0,0,.12)}
.quick-grid{gap:9px}.quick-grid button{min-height:76px;border:1px solid rgba(223,232,227,.85);background:rgba(255,255,255,.82);border-radius:18px;box-shadow:var(--shadow-sm);font-weight:700}.quick-grid button:nth-child(1),.quick-grid button:nth-child(2){background:linear-gradient(145deg,#f2faf6,#e8f5ef)}.quick-grid span{filter:saturate(.82)}

.section-title{margin:26px 1px 12px}.section-title h2{font-size:18px;letter-spacing:-.35px}.section-title button{min-height:36px;padding:0 4px;font-size:10px;font-weight:800}.section-title.large{padding-top:10px}.section-title.large h1{font-size:28px;letter-spacing:-.7px}
.section-title.large>.primary{min-height:42px;padding:0 14px;border-radius:14px!important;box-shadow:0 8px 18px rgba(31,103,87,.18)}
.quests button,.discussion-preview,.notice,.goal-card,.vote,.family-post,.home-tree,.family-callout{border-color:rgba(223,232,227,.92)!important;background:rgba(255,255,255,.86)!important;box-shadow:var(--shadow-sm)}
.quests button{min-height:65px!important;border-radius:17px!important}.discussion-preview{border-radius:19px;padding:14px!important}.notice{min-height:66px;border-radius:19px}.notice button{min-height:36px}.notice.urgent{border-color:rgba(201,87,73,.17)!important;background:linear-gradient(145deg,#fff,#fff8f6)!important}

.home-tree{padding:18px 13px!important;border-radius:24px!important;background:linear-gradient(180deg,#fbfefc,#f1f7f4)!important}.home-generation-label{display:block;width:max-content;margin:1px auto 9px;padding:4px 8px;border-radius:12px;background:#edf5f1;color:var(--green);font-size:8px;font-weight:800}.home-parents button,.home-children button{transition:transform .16s ease,box-shadow .16s ease}.home-parents button:active,.home-children button:active{transform:translateY(1px) scale(.97)}.home-grandparents .memory span{background:#eeeae2}.home-grandparents button,.home-parents button{min-width:82px}.home-children{justify-content:center!important;gap:58px}.home-tree-line{height:20px!important}
.ranking-tabs{padding:4px!important;background:#edf3f0!important;border-radius:15px!important}.ranking-tabs button{min-height:38px;border-radius:12px!important}.ranking-tabs .active{box-shadow:0 5px 12px rgba(18,63,54,.08)}.podium{border-radius:24px!important;overflow:hidden;box-shadow:var(--shadow-sm)}
.family-post{border-radius:24px!important;overflow:hidden}.family-post header{padding:15px!important}.photo-placeholder{background:linear-gradient(145deg,#e9f3ee,#f8f1df)!important}.post-actions{min-height:52px}.post-actions button,.post-actions a{min-height:38px;display:flex;align-items:center;justify-content:center}

/* Family tree */
.family-tools{display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important}.family-tools button{min-height:44px!important;border-radius:14px!important;border:1px solid var(--line)!important;background:#fff!important;box-shadow:var(--shadow-sm)}
.permission-note{padding:10px 12px;border-radius:13px;background:var(--cream);line-height:1.45}
.tree-toolbar{padding:5px;background:#eaf1ed;border:1px solid var(--line);border-radius:16px}.tree-toolbar button{min-height:38px;border-radius:12px}.tree-toolbar .selected{box-shadow:0 6px 15px rgba(18,63,54,.09)}
.tree{margin-top:12px;padding:32px 10px 18px;min-height:376px;border:1px solid var(--line);border-radius:26px;background:radial-gradient(circle at 50% 28%,#fff 0,#f5faf7 60%,#edf5f1 100%);box-shadow:var(--shadow-sm)}
.person{border-color:#dbe7e1;border-radius:18px;box-shadow:0 8px 18px rgba(18,63,54,.08)}.person .photo{background:linear-gradient(145deg,#d7ece3,#f5e7bd)}.person.highlight{border-color:#83b4a2;background:#f2fbf6}.person.memorial{background:linear-gradient(145deg,#faf9f5,#f0eee7)}
.lineage-tree{min-height:auto;padding:18px 10px 16px}.generation-block{position:relative}.generation-label{display:inline-flex;margin:0 auto 10px;padding:5px 9px;border-radius:14px;background:#edf5f1;color:var(--green);font-size:8px;font-weight:850;letter-spacing:.15px}.generation-row{position:relative;display:flex;align-items:center;justify-content:center}.couple-generation{gap:7px}.couple-bridge{width:40px;border-top:2px solid #c9d8d1}.generation-connector{width:2px;height:27px;margin:0 auto;background:#c9d8d1}.children-generation{gap:54px}.children-generation:before{content:"";position:absolute;top:-11px;left:27%;right:27%;border-top:2px solid #c9d8d1}.children-generation .person:before{content:"";position:absolute;top:-12px;height:12px;border-left:2px solid #c9d8d1}.lineage-tree .person{width:118px;min-height:108px;padding:10px 6px}.lineage-tree .person .photo{width:46px;height:46px}.lineage-tree .person.memorial .photo{background:#eeeae2}.tree-order-note{margin:14px 8px 0;padding:9px 10px;border-radius:13px;background:rgba(255,255,255,.72);color:var(--muted);font-size:8px;line-height:1.45;text-align:left}

/* Living family tree: organic branches replace diagram lines. */
.living-tree{
  isolation:isolate;
  height:840px;
  min-height:840px;
  margin-top:12px;
  padding:0;
  overflow:hidden;
  border:1px solid rgba(99,139,116,.2);
  border-radius:28px;
  background:
    radial-gradient(ellipse at 16% 71%,rgba(169,211,155,.2),transparent 25%),
    radial-gradient(ellipse at 84% 69%,rgba(151,199,145,.2),transparent 25%),
    linear-gradient(180deg,#f8fcf9 0%,#edf7f1 45%,#f4f1e5 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),0 18px 42px rgba(25,78,60,.09);
}
.living-tree:before,.living-tree:after{
  content:"";
  position:absolute;
  z-index:-1;
  width:210px;
  height:210px;
  top:500px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(92,153,105,.1),transparent 67%);
  filter:blur(2px);
}
.living-tree:before{left:-82px}.living-tree:after{right:-82px}
.tree-life-summary{
  position:absolute;
  z-index:12;
  top:11px;
  left:12px;
  right:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#61746c;
  font-size:8px;
}
.tree-life-summary span{display:flex;align-items:center;gap:5px;font-weight:850;text-transform:uppercase;letter-spacing:.55px}
.tree-life-summary i{width:7px;height:7px;border-radius:50%;background:#4da578;box-shadow:0 0 0 4px rgba(77,165,120,.12);animation:treePulse 2.4s ease-in-out infinite}
.tree-life-summary b{padding:5px 8px;border:1px solid rgba(69,122,94,.15);border-radius:12px;background:rgba(255,255,255,.64);color:#315f4d;font-size:8px}
.tree-canopy-glow{
  position:absolute;
  z-index:-1;
  inset:78px 22px 118px;
  border-radius:48% 52% 44% 56%;
  background:
    radial-gradient(circle at 20% 66%,rgba(97,166,107,.16),transparent 21%),
    radial-gradient(circle at 78% 63%,rgba(88,154,101,.16),transparent 22%),
    radial-gradient(ellipse at 50% 22%,rgba(208,228,178,.22),transparent 42%);
  filter:blur(10px);
  animation:canopyBreathe 7s ease-in-out infinite alternate;
}
.organic-tree{position:absolute;z-index:0;inset:0;width:100%;height:760px;overflow:visible;pointer-events:none;filter:url(#treeShadow)}
.organic-tree path,.organic-tree g{transition:opacity .3s ease,stroke .3s ease,filter .3s ease}
.tree-trunk-shadow{fill:none;stroke:rgba(63,46,29,.16);stroke-width:25;stroke-linecap:round}
.tree-trunk{fill:none;stroke:url(#trunkGradient);stroke-width:18;stroke-linecap:round;stroke-linejoin:round}
.tree-limb,.tree-twig,.tree-root{fill:none;stroke:url(#branchGradient);stroke-linecap:round;stroke-linejoin:round}
.tree-limb{stroke-width:10}.tree-limb.major{stroke-width:12}.tree-twig{stroke-width:5}.tree-root{stroke:#755638;stroke-width:6;opacity:.72}
.tree-sap{fill:none;stroke:#d8efbc;stroke-width:2.6;stroke-linecap:round;stroke-dasharray:4 14;opacity:.55;animation:sapFlow 6s linear infinite}
.generation-ribbon{
  position:absolute;
  z-index:6;
  left:50%;
  transform:translateX(-50%);
  white-space:nowrap;
  padding:4px 8px;
  border:1px solid rgba(70,121,95,.12);
  border-radius:12px;
  background:rgba(249,252,249,.8);
  color:#62766d;
  font-size:7px;
  font-weight:850;
  letter-spacing:.35px;
  text-transform:uppercase;
  backdrop-filter:blur(5px);
}
.ribbon-elders{top:42px}.ribbon-parents{top:195px}.ribbon-branches{top:354px}.ribbon-leaves{top:510px}
.tree-person,.branch-representative,.leaf-person{
  position:absolute;
  z-index:5;
  border:1px solid rgba(73,122,98,.2);
  color:var(--ink);
  box-shadow:0 10px 24px rgba(31,77,60,.12),inset 0 1px 0 rgba(255,255,255,.92);
}
.tree-person{
  top:70px;
  width:112px;
  min-height:89px;
  padding:8px 6px 7px;
  border-radius:19px;
  background:rgba(255,255,255,.9);
  display:flex;
  flex-direction:column;
  align-items:center;
}
.tree-person .photo,.branch-representative .photo{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  margin-bottom:5px;
  border-radius:50%;
  background:linear-gradient(145deg,#dcecd8,#f2e7b7);
  color:#173d32;
  font-size:10px;
  font-weight:950;
}
.tree-person strong,.branch-representative strong{font-size:11px;line-height:1.15}.tree-person small,.branch-representative small{display:block;margin-top:3px;color:#76837d;font-size:7px;line-height:1.2}
.tree-grandpa,.tree-father{left:calc(24.8% - 56px)}.tree-grandma,.tree-mother{left:calc(75.2% - 56px)}
.tree-grandpa.memorial{background:rgba(247,244,236,.93);border-color:rgba(146,126,91,.22)}.tree-grandpa.memorial .photo{background:#eee8dc}
.tree-father,.tree-mother{top:225px}
.branch-representative{
  top:395px;
  width:126px;
  min-height:91px;
  padding:9px 6px 8px;
  border-radius:22px 22px 18px 18px;
  background:rgba(255,255,255,.94);
  display:flex;
  flex-direction:column;
  align-items:center;
}
.rep-aziz{left:calc(20.5% - 63px)}.rep-nodira{left:calc(79.5% - 63px)}
.branch-representative i{position:absolute;right:7px;top:7px;padding:3px 5px;border-radius:9px;background:#e5f3e9;color:#357158;font-size:7px;font-style:normal;font-weight:850}
.branch-representative:after{content:"";position:absolute;left:50%;bottom:-7px;width:12px;height:12px;transform:translateX(-50%) rotate(45deg);border-right:1px solid rgba(73,122,98,.18);border-bottom:1px solid rgba(73,122,98,.18);background:inherit}
.leaf-person{
  --leaf-angle:-3deg;
  width:76px;
  min-height:59px;
  padding:6px 4px 5px;
  transform:translateX(-50%) rotate(var(--leaf-angle));
  border-color:rgba(67,128,81,.2);
  border-radius:64% 22% 62% 25%;
  background:linear-gradient(145deg,rgba(232,246,221,.97),rgba(196,227,185,.96));
  display:grid;
  grid-template-columns:23px 1fr;
  grid-template-rows:1fr 1fr;
  align-items:center;
  text-align:left;
  animation:leafFloat 4.2s ease-in-out infinite alternate;
}
.leaf-person:after{content:"";position:absolute;right:5px;bottom:5px;width:19px;border-top:1px solid rgba(61,116,72,.24);transform:rotate(-31deg);transform-origin:right}
.leaf-person span{grid-row:1/3;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:rgba(255,255,255,.72);color:#285940;font-size:8px;font-weight:950}
.leaf-person strong{align-self:end;font-size:8px;line-height:1.1}.leaf-person small{align-self:start;margin-top:2px;color:#587264;font-size:7px}
.leaf-a1{left:10.5%;top:570px}.leaf-a2{--leaf-angle:4deg;left:29.3%;top:591px;animation-delay:-1.1s}.leaf-a3{--leaf-angle:3deg;left:16%;top:672px;animation-delay:-2.2s}.leaf-a4{--leaf-angle:-5deg;left:35.2%;top:684px;animation-delay:-3.3s}
.leaf-n1{--leaf-angle:3deg;left:89.5%;top:570px;animation-delay:-.5s}.leaf-n2{--leaf-angle:-4deg;left:70.7%;top:591px;animation-delay:-1.6s}.leaf-n3{--leaf-angle:-3deg;left:84%;top:672px;animation-delay:-2.7s}.leaf-n4{--leaf-angle:5deg;left:64.8%;top:684px;animation-delay:-3.8s}
.tree-selection-status{
  position:absolute;
  z-index:8;
  left:18px;
  right:18px;
  bottom:12px;
  min-height:34px;
  padding:9px 12px;
  border:1px solid rgba(83,123,93,.14);
  border-radius:14px;
  background:rgba(255,253,247,.84);
  color:#5d7167;
  font-size:8px;
  font-weight:750;
  line-height:1.35;
  backdrop-filter:blur(7px);
  box-shadow:0 6px 18px rgba(55,78,59,.07);
}
.living-tree[data-active-branch="aziz"] .rep-aziz,.living-tree[data-active-branch="nodira"] .rep-nodira{border-color:#4f9b70;background:#f3fbf5;box-shadow:0 0 0 4px rgba(75,155,108,.12),0 14px 28px rgba(31,95,65,.16)}
.living-tree[data-active-branch="aziz"] .rep-aziz i,.living-tree[data-active-branch="nodira"] .rep-nodira i{background:#317553;color:#fff}
.living-tree[data-active-branch="aziz"] .organic-tree g[data-branch="aziz"] .tree-limb,.living-tree[data-active-branch="nodira"] .organic-tree g[data-branch="nodira"] .tree-limb{stroke:#397d55;filter:drop-shadow(0 0 5px rgba(90,173,110,.6))}
.living-tree[data-active-branch="aziz"] .organic-tree g[data-branch="aziz"] .tree-sap,.living-tree[data-active-branch="nodira"] .organic-tree g[data-branch="nodira"] .tree-sap{stroke:#f1f6a9;stroke-width:4;opacity:1}
.living-tree[data-active-branch="aziz"] .rep-nodira,.living-tree[data-active-branch="aziz"] [data-leaf-branch="nodira"],.living-tree[data-active-branch="aziz"] .organic-tree g[data-branch="nodira"],.living-tree[data-active-branch="nodira"] .rep-aziz,.living-tree[data-active-branch="nodira"] [data-leaf-branch="aziz"],.living-tree[data-active-branch="nodira"] .organic-tree g[data-branch="aziz"]{opacity:.25;filter:grayscale(.45)}
.leaf-person.selected{z-index:9;border-color:#2d8357;box-shadow:0 0 0 4px rgba(67,151,96,.15),0 14px 26px rgba(31,95,65,.2);transform:translateX(-50%) rotate(var(--leaf-angle)) scale(1.08)}
@keyframes sapFlow{to{stroke-dashoffset:-72}}
@keyframes treePulse{50%{box-shadow:0 0 0 7px rgba(77,165,120,0)}}
@keyframes canopyBreathe{to{transform:scale(1.035);opacity:.72}}
@keyframes leafFloat{to{margin-top:-4px}}
.family-callout{margin-top:12px;border-radius:20px!important;background:linear-gradient(145deg,#f8f3e6,#fff)!important}
.full-tree-roster{margin-top:12px;padding:14px;border:1px solid var(--line);border-radius:20px;background:#f7fbf9;box-shadow:var(--shadow-sm)}
.full-tree-roster[hidden]{display:none}.full-tree-roster>div:first-child{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:10px}.full-tree-roster>div:first-child strong,.full-tree-roster>div:first-child small{display:block}.full-tree-roster>div:first-child strong{font-size:13px}.full-tree-roster>div:first-child small{color:var(--muted);font-size:8px;text-align:right}
.full-tree-roster-list{display:flex;flex-direction:column;gap:7px;max-height:430px;overflow:auto}.full-tree-roster-person{display:grid;grid-template-columns:40px 1fr auto;align-items:center;gap:9px;width:100%;min-height:54px;padding:7px 9px;border:1px solid #dce8e2;border-radius:14px;background:#fff;text-align:left}.full-tree-roster-person>span:first-child{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(145deg,#dcecd8,#f2e7b7);color:#173d32;font-size:9px;font-weight:950}.full-tree-roster-person strong,.full-tree-roster-person small{display:block}.full-tree-roster-person strong{font-size:10px}.full-tree-roster-person small{margin-top:2px;color:var(--muted);font-size:8px}.full-tree-roster-person i{padding:5px 7px;border-radius:10px;background:#eef6f2;color:#39725c;font-size:7px;font-style:normal;font-weight:800}
.planned-action{position:relative}.planned-action:after{content:"КЕЙИН";display:inline-flex;margin-left:5px;padding:2px 4px;border-radius:6px;background:#edf1ef;color:#75817c;font-size:6px;font-weight:900;letter-spacing:.25px;vertical-align:middle}.beta-scope{display:flex;align-items:flex-start;gap:8px;margin:8px 0 0;padding:9px 11px;border:1px solid #d7e7df;border-radius:13px;background:#f1f8f4;color:#526a60;font-size:8px;line-height:1.4}.beta-scope b{flex:none;padding:3px 5px;border-radius:7px;background:var(--green);color:#fff;font-size:7px;letter-spacing:.4px}

/* Help, funds and voting */
.goal-card,.vote{padding:18px;border-radius:24px}.goal-head>span{background:var(--mint);border-radius:20px;padding:7px 9px}.goal-card h2,.vote h3{letter-spacing:-.25px}.progress,.vote-bar{height:8px}.support{gap:7px}.support button,.wide{min-height:42px;border-radius:13px!important;font-weight:750}.vote small{display:inline-flex;padding:6px 9px;border-radius:20px;background:#fff0ed}.vote-stats{font-size:10px}
.donation-history{display:flex;flex-direction:column;gap:8px}.donation-history article{border-radius:18px;padding:13px;box-shadow:var(--shadow-sm)}.donation-emoji{width:42px;height:42px;border-radius:14px}.delete-memory{min-width:34px;height:34px;border-radius:11px}.badge{padding:6px 10px}

/* AI assistant */
.assistant-hero{margin:14px 0 16px;padding:36px 22px 30px;border-radius:30px;background:linear-gradient(155deg,#e8f5ef,#fbf5e6);box-shadow:var(--shadow-sm)}.large-mark{box-shadow:0 14px 30px rgba(18,63,54,.24)}.assistant-brand{display:block;margin:9px 0 8px;font-size:13px;letter-spacing:.2px}.realtime-pill{background:rgba(255,255,255,.72)!important;border:1px solid var(--line)!important}.assistant-hero h1{font-size:27px;letter-spacing:-.7px}.suggestions button{min-height:50px;border-color:var(--line);border-radius:16px;background:rgba(255,255,255,.86);box-shadow:var(--shadow-sm)}
.composer{bottom:99px;width:min(calc(100% - 32px),448px);min-height:58px;border:1px solid rgba(223,232,227,.95);border-radius:20px;padding:7px;box-shadow:0 15px 40px rgba(18,63,54,.18)}.composer button{height:42px;border-radius:14px}

/* Discussion */
.chat-head{position:sticky;top:84px;z-index:12;margin:0 -4px 14px;padding:10px 4px;background:rgba(251,253,251,.88);backdrop-filter:blur(14px)}.chat-head>button{min-width:42px;min-height:42px;border-radius:13px}.topic{border:1px solid var(--line)!important;border-radius:26px!important;background:#fff!important;box-shadow:var(--shadow-sm);padding:18px!important}.topic-tag{border-radius:20px!important;padding:6px 9px!important}.topic h2{letter-spacing:-.4px}.topic-actions{display:grid!important;grid-template-columns:repeat(3,1fr);gap:6px}.topic-actions button{min-height:38px;border-radius:12px!important;background:#f4f7f5!important}.comments>div{padding:12px!important;border-radius:15px!important;background:#f6f8f7!important}.comment-box{min-height:48px;border-radius:16px!important;background:#f1f5f3!important;padding:4px!important}.comment-box button{width:40px;height:40px;border-radius:13px!important}
.live-family-chat{margin-bottom:16px;border:1px solid #dbe5e0;border-radius:22px;background:#f4f6f5;box-shadow:0 10px 28px rgba(17,49,42,.09);overflow:hidden}.live-chat-header{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;padding:14px;background:#fff;border-bottom:1px solid #e1e8e4}.stacked-avatars{display:flex;padding-left:8px}.stacked-avatars span{display:grid;place-items:center;width:36px;height:36px;margin-left:-8px;border:2px solid #fff;border-radius:50%;background:#dcebe4;color:#164d42;font-size:11px;font-weight:900}.stacked-avatars span+span{background:#eee3c7}.live-chat-header small{display:block;color:#79857f;font-size:7px;font-weight:850;letter-spacing:.7px}.live-chat-header h2{margin:2px 0 1px;font-size:14px;letter-spacing:-.25px}.live-chat-header p{margin:0;color:#708078;font-size:8px}.live-chat-header p i{display:inline-block;width:6px;height:6px;margin-right:3px;border-radius:50%;background:#43a978}.meme-auto-toggle{display:flex;align-items:center;gap:5px;min-height:32px;padding:0 8px;border:1px solid #d6e2dc;border-radius:10px;background:#fff;color:#65736c;font-size:7px;font-weight:800}.meme-auto-toggle b{font:inherit}.meme-auto-toggle span{width:7px;height:7px;border-radius:50%;background:#9aa59f}.meme-auto-toggle.is-on{border-color:#bcd8cc;background:#edf7f2;color:#145245}.meme-auto-toggle.is-on span{background:#2c9b70;box-shadow:0 0 0 3px rgba(44,155,112,.12)}.live-chat-day{display:flex;align-items:center;gap:8px;padding:12px 18px 6px;color:#8a958f;font-size:8px}.live-chat-day:before,.live-chat-day:after{content:"";height:1px;flex:1;background:#dfe5e2}.live-chat-thread{display:flex;flex-direction:column;gap:9px;min-height:310px;padding:8px 12px 14px}.live-message{max-width:82%;animation:messagePop .28s cubic-bezier(.2,.8,.3,1)}@keyframes messagePop{from{opacity:0;transform:translateY(6px) scale(.98)}to{opacity:1;transform:none}}.live-message.mine{align-self:flex-end}.live-message .bubble{padding:10px 12px;border-radius:17px 17px 5px 17px;background:#176453;color:#fff;font-size:11px;line-height:1.42;box-shadow:0 5px 12px rgba(20,82,69,.14)}.live-message small{display:block;margin:4px 3px 0;color:#87918c;font-size:7px;text-align:right}.system-meme-message{align-self:flex-start;width:min(86%,318px);padding:7px;border-radius:16px;background:#fff;box-shadow:0 6px 18px rgba(17,49,42,.1)}.system-meme-label{display:flex;align-items:center;justify-content:space-between;padding:3px 4px 7px;color:#617169;font-size:7px;font-weight:800}.system-meme-label b{display:inline-flex;align-items:center;gap:5px;color:#145245}.system-meme-label b:before{content:"1F";display:grid;place-items:center;width:20px;height:20px;border-radius:7px;background:#145245;color:#fff;font-size:7px}.meme-photo{position:relative;aspect-ratio:4/3;border-radius:11px;overflow:hidden;background:#d7d7d2}.meme-photo img{width:100%;height:100%;display:block;object-fit:cover}.meme-photo:after{content:"";position:absolute;inset:auto 0 0;height:42%;background:linear-gradient(transparent,rgba(0,0,0,.66));pointer-events:none}.meme-copy{position:absolute;z-index:1;left:9px;right:9px;bottom:9px;color:#fff;font-family:Impact,"Arial Black",system-ui,sans-serif;font-size:25px;line-height:.96;letter-spacing:.2px;text-align:center;text-transform:uppercase;-webkit-text-stroke:1.2px #111;text-shadow:0 2px 0 #111,0 0 4px #000}.meme-context{display:flex;justify-content:space-between;gap:6px;padding:7px 4px 2px;color:#748078;font-size:7px}.meme-context button{border:0;background:transparent;color:#176453;font-size:7px;font-weight:850}.live-chat-compose{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;background:#fff;border-top:1px solid #dfe7e3}.live-chat-compose strong,.live-chat-compose small{display:block}.live-chat-compose strong{font-size:9px}.live-chat-compose small{margin-top:2px;color:#79857f;font-size:7px}.live-chat-compose button{min-height:36px;padding:0 12px;border:0;border-radius:11px;background:#176453;color:#fff;font-size:8px;font-weight:850}.meme-logic-note{display:block;padding:8px 12px 11px;background:#fff;color:#7d8882;font-size:7px;line-height:1.4}

/* Navigation and sheets */
.bottom-nav{
  bottom:10px;
  width:min(calc(100% - 20px),460px);
  height:72px;
  padding:5px 5px max(5px,env(safe-area-inset-bottom));
  border:1px solid rgba(223,232,227,.92);
  border-radius:24px;
  background:rgba(255,255,255,.92);
  box-shadow:0 15px 40px rgba(18,63,54,.18);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.bottom-nav button{border-radius:17px;gap:3px;transition:background .18s ease,color .18s ease,transform .16s ease}.bottom-nav button span{font-size:19px}.bottom-nav button.active{background:var(--mint);color:var(--dark)}.bottom-nav .mini-b1{box-shadow:0 5px 12px rgba(18,63,54,.2)}
.sheet-backdrop{background:rgba(7,32,27,.5)!important;backdrop-filter:blur(5px)}.payment-sheet{border-radius:28px 28px 0 0!important;padding:12px 20px calc(22px + env(safe-area-inset-bottom))!important;box-shadow:0 -20px 55px rgba(7,32,27,.22)}.sheet-handle{width:42px!important;background:#cbd8d2!important}.payment-apps a,.payment-apps button{min-height:54px!important;border-radius:15px!important}.confirm-actions button{min-height:46px}.donation-alert{top:16px;border:1px solid rgba(255,255,255,.12);box-shadow:0 22px 55px rgba(7,27,22,.32)}
.backend-sheet{max-height:min(92vh,760px);overflow:auto}.backend-sheet-head{display:flex;align-items:center;justify-content:space-between;margin:8px 0 13px}.backend-sheet-head small{color:var(--green);font-size:8px;font-weight:850;letter-spacing:.65px}.backend-sheet-head h2{margin:3px 0 0}.backend-sheet-head>button{width:38px;height:38px;border:0;border-radius:12px;background:#eef4f1;color:var(--green)}.backend-connection{display:flex;align-items:center;gap:8px;margin-bottom:13px;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:#f5f8f6;color:#64756e;font-size:9px;font-weight:800}.backend-connection i{width:8px;height:8px;border-radius:50%;background:#d09a54}.backend-connection.online{border-color:#cce5d8;background:#eef8f2;color:#236b4e}.backend-connection.online i{background:#3ca876;box-shadow:0 0 0 4px rgba(60,168,118,.12)}.backend-auth-fields,.backend-tree-setup{display:flex;flex-direction:column;gap:9px}.backend-auth-fields label,.backend-tree-setup label{display:flex;flex-direction:column;gap:5px;color:#64756e;font-size:8px;font-weight:800}.backend-auth-fields input,.backend-tree-setup input{width:100%;height:45px;border:1px solid var(--line);border-radius:13px;background:#fff;padding:0 12px;color:var(--ink);font-size:11px;outline:0}.backend-auth-fields input:focus,.backend-tree-setup input:focus{border-color:#72a895;box-shadow:0 0 0 3px rgba(83,151,125,.12)}.backend-actions{display:grid;grid-template-columns:1fr 1.15fr;gap:8px}.backend-actions button,.backend-tree-setup>button,.backend-signout{min-height:44px;border:1px solid var(--line);border-radius:13px;background:#f2f5f3;color:var(--ink);font-size:10px;font-weight:850}.backend-tree-setup{padding-top:5px}.backend-tree-setup>strong{font-size:13px}.backend-signout{width:100%;margin-top:10px;color:#9d4e43}.backend-message{margin:12px 2px 0;color:#718079;font-size:8px;line-height:1.5}
.relative-sheet{max-height:min(92vh,700px);overflow:auto}.relative-form{display:flex;flex-direction:column;gap:10px}.relative-form label{display:flex;flex-direction:column;gap:5px;color:#61736b;font-size:8px;font-weight:850}.relative-form input,.relative-form select{width:100%;height:45px;border:1px solid var(--line);border-radius:13px;background:#fff;padding:0 11px;color:var(--ink);font-size:10px;outline:0}.relative-date-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.relative-form>button{min-height:46px;border:0;border-radius:13px;font-size:10px;font-weight:850}.backend-message.error{color:#b64d43}
.backend-locked{overflow:hidden}.sheet-backdrop.onboarding-required{align-items:center;z-index:120;padding:max(14px,env(safe-area-inset-top)) 14px max(14px,env(safe-area-inset-bottom));background:linear-gradient(155deg,rgba(9,47,39,.96),rgba(22,77,63,.94))!important}.sheet-backdrop.onboarding-required .backend-sheet{width:min(100%,440px);max-height:100%;border-radius:28px!important;padding:14px 20px 20px!important}.sheet-backdrop.onboarding-required .sheet-handle{display:none}.onboarding-brand{display:grid;grid-template-columns:64px 1fr;align-items:center;gap:12px;margin:2px 0 13px;padding:11px;border:1px solid #dcebe4;border-radius:18px;background:linear-gradient(135deg,#f4fbf7,#fffaf0)}.onboarding-brand img{width:64px;height:64px;border-radius:17px;object-fit:cover;box-shadow:0 8px 20px rgba(22,67,56,.18)}.onboarding-brand strong,.onboarding-brand span{display:block}.onboarding-brand strong{font-size:13px;color:var(--ink)}.onboarding-brand span{margin-top:4px;font-size:9px;line-height:1.45;color:var(--muted)}.onboarding-steps{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:7px;margin-bottom:11px}.onboarding-steps span{padding:8px;border-radius:11px;background:#edf3f0;color:#73827c;text-align:center;font-size:9px;font-weight:850}.onboarding-steps span.active{background:var(--green);color:#fff}.onboarding-steps i{font-style:normal;color:#9eb1a9}.show-password{display:flex!important;flex-direction:row!important;align-items:center!important;gap:7px!important}.show-password input{width:17px!important;height:17px!important;accent-color:var(--green)}.backend-actions{grid-template-columns:1.2fr 1fr}.backend-actions button{padding:0 8px}.auth-note{font-size:8px;line-height:1.5;color:#6d7d76}.tree-choice-copy{margin:0;color:var(--muted);font-size:9px;line-height:1.45}.join-existing-tree{display:grid;grid-template-columns:1fr auto;align-items:end;gap:8px;padding:10px;border:1px solid #cce4d9;border-radius:15px;background:#f1faf5}.join-existing-tree button{height:45px;border:0;border-radius:12px;background:var(--green);color:#fff;padding:0 12px;font-size:9px;font-weight:850}.tree-choice-divider{display:flex;align-items:center;gap:9px;color:#8a9892;font-size:8px}.tree-choice-divider:before,.tree-choice-divider:after{content:"";height:1px;background:var(--line);flex:1}.invite-sheet{max-height:min(92vh,700px);overflow:auto}.invite-explanation{margin:0 0 12px!important}.invite-label{display:flex;flex-direction:column;gap:5px;color:#61736b;font-size:9px;font-weight:850}.invite-label select{height:47px;border:1px solid var(--line);border-radius:13px;background:#fff;padding:0 11px;color:var(--ink)}.invite-create{width:100%;min-height:46px;margin-top:10px;border:0;border-radius:13px;font-weight:850}.invite-result{margin-top:12px;padding:14px;border-radius:17px;background:linear-gradient(135deg,#123f35,#1f6a58);color:#fff;text-align:center}.invite-result[hidden]{display:none}.invite-result small,.invite-result strong,.invite-result p{display:block}.invite-result small{font-size:8px;letter-spacing:1px;color:#cbe7dc}.invite-result strong{margin:6px 0;font-size:24px;letter-spacing:3px}.invite-result button{border:1px solid rgba(255,255,255,.24);border-radius:10px;background:rgba(255,255,255,.1);color:#fff;padding:8px 12px;font-weight:800}.invite-result p{margin:8px 0 0;font-size:8px;color:#d5e8e1}.invite-add-relative{width:100%;margin-top:10px;border:1px dashed #aac8bb;border-radius:12px;background:#f4f8f6;color:var(--green);padding:11px;font-size:9px;font-weight:800}.app-toast{position:fixed;z-index:200;left:50%;bottom:calc(86px + env(safe-area-inset-bottom));transform:translateX(-50%);width:min(calc(100% - 32px),420px);padding:12px 15px;border-radius:14px;background:#123f35;color:#fff;box-shadow:0 14px 40px rgba(5,29,23,.3);font-size:10px;font-weight:750;text-align:center}.app-toast[hidden]{display:none}.app-toast.error{background:#8e3f39}

@media(max-width:370px){
  .phone-shell{padding-inline:12px}.topbar{margin-inline:-12px;padding-inline:12px}.welcome{padding:16px}.welcome h1{font-size:21px}.quick-grid{grid-template-columns:repeat(2,1fr)}.quick-grid button{min-height:66px}.family-tools{grid-template-columns:1fr}.bottom-nav{width:calc(100% - 12px)}
  .living-tree{height:820px;min-height:820px;border-radius:23px}.organic-tree{height:742px}.tree-person{width:102px}.tree-grandpa,.tree-father{left:calc(24.8% - 51px)}.tree-grandma,.tree-mother{left:calc(75.2% - 51px)}.branch-representative{width:112px}.rep-aziz{left:calc(20.5% - 56px)}.rep-nodira{left:calc(79.5% - 56px)}.leaf-person{width:67px;min-height:56px;grid-template-columns:20px 1fr}.leaf-person span{width:19px;height:19px}.leaf-person strong{font-size:7px}.leaf-a1,.leaf-n1{top:558px}.leaf-a2,.leaf-n2{top:580px}.leaf-a3,.leaf-n3{top:654px}.leaf-a4,.leaf-n4{top:666px}.tree-selection-status{bottom:10px}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}*,*:before,*:after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* Living tree v2 — quiet organic connectors, readable family cards. */
.living-tree{
  height:700px;
  min-height:700px;
  overflow:hidden;
  border-color:rgba(60,107,84,.16);
  border-radius:26px;
  background:
    radial-gradient(circle at 12% 70%,rgba(116,174,119,.12) 0 7%,transparent 28%),
    radial-gradient(circle at 88% 70%,rgba(116,174,119,.12) 0 7%,transparent 28%),
    radial-gradient(ellipse at 50% 100%,rgba(151,118,75,.1),transparent 34%),
    linear-gradient(180deg,#fbfdfb 0%,#f4faf6 50%,#f7f4ea 100%);
  box-shadow:inset 0 1px 0 #fff,0 12px 30px rgba(24,71,55,.07);
}
.living-tree:before,.living-tree:after{
  top:455px;
  width:180px;
  height:180px;
  opacity:.7;
  filter:blur(12px);
}
.living-tree:before{left:-105px}.living-tree:after{right:-105px}
.tree-life-summary{
  top:13px;
  left:14px;
  right:14px;
  color:#53685f;
  font-size:10px;
}
.tree-life-summary span{gap:7px;letter-spacing:.65px}
.tree-life-summary i{width:8px;height:8px}
.tree-life-summary b{
  padding:6px 9px;
  border-color:rgba(56,111,83,.14);
  background:#fff;
  color:#315e4c;
  font-size:9px;
  box-shadow:0 4px 12px rgba(30,77,59,.06);
}
.tree-canopy-glow{
  inset:60px 16px 82px;
  border-radius:44%;
  background:
    radial-gradient(circle at 17% 72%,rgba(104,166,108,.12),transparent 24%),
    radial-gradient(circle at 83% 72%,rgba(104,166,108,.12),transparent 24%),
    radial-gradient(ellipse at 50% 15%,rgba(210,226,185,.16),transparent 38%);
  filter:blur(16px);
  opacity:.72;
}
.organic-tree{
  top:0;
  height:690px;
  filter:url(#treeShadow);
  opacity:.88;
}
.tree-trunk-shadow{stroke:rgba(61,46,31,.11);stroke-width:13}
.tree-trunk{stroke-width:8}
.tree-limb{stroke-width:5}.tree-limb.major{stroke-width:7}.tree-twig{stroke-width:3}.tree-root{stroke-width:3;opacity:.42}
.tree-sap{stroke-width:1.8;stroke-dasharray:3 16;opacity:.5}
.tree-knot{fill:#78926b;stroke:#f4f8ee;stroke-width:3}
.generation-ribbon{
  z-index:6;
  padding:5px 10px;
  border-color:rgba(63,112,87,.11);
  border-radius:99px;
  background:rgba(249,252,249,.96);
  color:#52675e;
  font-size:9px;
  letter-spacing:.48px;
  box-shadow:0 3px 10px rgba(33,74,59,.04);
  backdrop-filter:none;
}
.ribbon-elders{top:48px}.ribbon-parents{top:181px}.ribbon-branches{top:316px}.ribbon-leaves{top:468px}
.tree-person,.branch-representative,.leaf-person{
  border-color:rgba(59,104,82,.15);
  color:#183b30;
  box-shadow:0 8px 20px rgba(24,67,51,.1),inset 0 1px 0 #fff;
  -webkit-tap-highlight-color:transparent;
}
.tree-person{
  top:78px;
  left:auto;
  width:clamp(124px,38%,148px);
  min-height:82px;
  padding:11px 10px;
  border-radius:20px;
  background:#fff;
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  grid-template-rows:1fr 1fr;
  align-items:center;
  column-gap:9px;
  text-align:left;
}
.tree-person .photo,.branch-representative .photo{
  grid-row:1/3;
  width:40px;
  height:40px;
  margin:0;
  border:1px solid rgba(75,120,94,.1);
  background:linear-gradient(145deg,#dfeede,#f4e8c2);
  font-size:11px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.tree-person strong,.branch-representative strong{
  align-self:end;
  overflow:hidden;
  font-size:12px;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tree-person small,.branch-representative small{
  align-self:start;
  margin-top:4px;
  overflow:hidden;
  color:#53665e;
  font-size:9px;
  line-height:1.25;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tree-grandpa,.tree-father{left:25%;transform:translateX(-50%)}
.tree-grandma,.tree-mother{left:75%;transform:translateX(-50%)}
.tree-grandpa.memorial{
  border-color:rgba(145,119,81,.2);
  background:#fbf8f1;
}
.tree-grandpa.memorial .photo{background:#eee8dc;color:#735f43}
.tree-father,.tree-mother{top:211px}
.branch-representative{
  top:346px;
  left:auto;
  width:clamp(128px,40%,154px);
  min-height:88px;
  padding:12px 10px;
  border-radius:21px;
  background:#fff;
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  grid-template-rows:1fr 1fr;
  align-items:center;
  column-gap:9px;
  text-align:left;
}
.rep-aziz{left:23%;transform:translateX(-50%)}.rep-nodira{left:77%;transform:translateX(-50%)}
.branch-representative i{
  right:8px;
  top:-8px;
  padding:4px 7px;
  border:2px solid #f8fbf9;
  border-radius:99px;
  background:#dff0e5;
  color:#2f684f;
  font-size:8px;
}
.branch-representative:after{display:none}
.leaf-person{
  --leaf-angle:0deg;
  width:clamp(70px,20.5%,86px);
  min-height:56px;
  padding:8px 7px;
  transform:translateX(-50%);
  border-color:rgba(62,126,76,.16);
  border-radius:18px 18px 18px 7px;
  background:linear-gradient(145deg,#f1faec,#dcefd4);
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  grid-template-rows:1fr 1fr;
  column-gap:5px;
  text-align:left;
  animation:leafFloat 5.6s ease-in-out infinite alternate;
}
.leaf-person:after{
  right:6px;
  bottom:5px;
  width:14px;
  border-color:rgba(57,110,69,.2);
}
.leaf-person span{
  width:24px;
  height:24px;
  background:rgba(255,255,255,.86);
  color:#24573d;
  font-size:9px;
}
.leaf-person strong{
  align-self:end;
  overflow:hidden;
  color:#214b37;
  font-size:9px;
  line-height:1.1;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.leaf-person small{
  align-self:start;
  margin-top:3px;
  overflow:hidden;
  color:#526b5c;
  font-size:8px;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.leaf-a1{left:14%;top:516px}.leaf-a2{left:37%;top:529px}.leaf-a3{left:18%;top:585px}.leaf-a4{left:41%;top:598px}
.leaf-n1{left:86%;top:516px}.leaf-n2{left:63%;top:529px}.leaf-n3{left:82%;top:585px}.leaf-n4{left:59%;top:598px}
.tree-selection-status{
  position:relative;
  inset:auto;
  display:flex;
  align-items:center;
  min-height:42px;
  margin:9px 4px 0;
  padding:10px 13px 10px 35px;
  border-color:#dce9e2;
  border-radius:14px;
  background:#f8fbf9;
  color:#50655b;
  font-size:9px;
  line-height:1.35;
  box-shadow:none;
  backdrop-filter:none;
}
.tree-selection-status:before{
  content:"↗";
  position:absolute;
  left:12px;
  display:grid;
  place-items:center;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#dfefe7;
  color:#2d6d51;
  font-size:9px;
  font-weight:900;
}
.living-tree[data-active-branch="aziz"] .rep-aziz,.living-tree[data-active-branch="nodira"] .rep-nodira{
  border-color:#438b63;
  background:#f7fcf8;
  box-shadow:0 0 0 3px rgba(67,139,99,.12),0 12px 24px rgba(31,95,65,.13);
}
.living-tree[data-active-branch="aziz"] .rep-nodira,.living-tree[data-active-branch="nodira"] .rep-aziz{
  opacity:.72;
  filter:saturate(.82);
}
.living-tree[data-active-branch="aziz"] [data-leaf-branch="nodira"],.living-tree[data-active-branch="nodira"] [data-leaf-branch="aziz"]{
  opacity:.7;
  filter:saturate(.78);
}
.living-tree[data-active-branch="aziz"] .organic-tree g[data-branch="nodira"],.living-tree[data-active-branch="nodira"] .organic-tree g[data-branch="aziz"]{
  opacity:.46;
  filter:none;
}
.leaf-person.selected{
  z-index:9;
  border-color:#2d8357;
  box-shadow:0 0 0 3px rgba(67,151,96,.13),0 10px 22px rgba(31,95,65,.16);
  transform:translateX(-50%) scale(1.04);
}
@keyframes leafFloat{to{margin-top:-2px}}

@media(max-width:359px){
  .living-tree{height:682px;min-height:682px;border-radius:22px}
  .organic-tree{height:674px}
  .tree-person{width:120px;padding-inline:8px;grid-template-columns:37px minmax(0,1fr);column-gap:7px}
  .branch-representative{width:122px;padding-inline:8px;grid-template-columns:37px minmax(0,1fr);column-gap:7px}
  .tree-person .photo,.branch-representative .photo{width:36px;height:36px}
  .tree-person strong,.branch-representative strong{font-size:11px}
  .leaf-person{width:68px;grid-template-columns:21px minmax(0,1fr);padding-inline:5px}
  .leaf-person span{width:21px;height:21px}
  .leaf-a1,.leaf-n1{top:510px}.leaf-a2,.leaf-n2{top:522px}.leaf-a3,.leaf-n3{top:576px}.leaf-a4,.leaf-n4{top:588px}
}

@media(min-width:431px){
  .living-tree{height:716px;min-height:716px}
  .organic-tree{height:704px}
  .tree-person strong,.branch-representative strong{font-size:13px}
  .tree-person small,.branch-representative small{font-size:10px}
  .leaf-person strong{font-size:10px}.leaf-person small{font-size:9px}
}

/* Universal data-driven tree. The same template expands with members and generations. */
.living-tree.dynamic-tree{
  height:auto;
  min-height:0;
  padding:0;
  overflow:hidden;
}
.dynamic-tree .tree-life-summary{
  position:relative;
  inset:auto;
  z-index:12;
  min-height:52px;
  padding:12px 14px 10px;
  border-bottom:1px solid rgba(59,105,82,.09);
  background:rgba(252,254,252,.82);
}
.dynamic-tree .tree-canopy-glow{
  z-index:0;
  inset:70px 8px 18px;
  opacity:.58;
}
.tree-visual-scroll{
  position:relative;
  z-index:1;
  width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  overscroll-behavior-inline:contain;
  scrollbar-color:#b9d0c4 transparent;
  scrollbar-width:thin;
}
.tree-visual-scroll::-webkit-scrollbar{height:5px}.tree-visual-scroll::-webkit-scrollbar-track{background:transparent}.tree-visual-scroll::-webkit-scrollbar-thumb{border-radius:8px;background:#b9d0c4}
.tree-canvas{
  --tree-node-width:140px;
  --tree-node-height:82px;
  --tree-node-gap:24px;
  --tree-generation-gap:64px;
  position:relative;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  gap:var(--tree-generation-gap);
  width:100%;
  min-width:100%;
  min-height:480px;
  padding:42px 24px 74px;
  background:
    radial-gradient(ellipse at 50% 100%,rgba(139,105,67,.09),transparent 28%),
    radial-gradient(circle at 18% 65%,rgba(107,170,111,.08),transparent 28%),
    radial-gradient(circle at 82% 65%,rgba(107,170,111,.08),transparent 28%);
}
.tree-scale-compact .tree-canvas{--tree-node-width:140px;--tree-node-height:84px;--tree-node-gap:18px;--tree-generation-gap:58px;padding-inline:12px}
.tree-scale-dense .tree-canvas{--tree-node-width:108px;--tree-node-height:70px;--tree-node-gap:12px;--tree-generation-gap:52px;padding-inline:18px}
.tree-connector-layer{
  position:absolute;
  z-index:0;
  inset:0;
  width:100%;
  height:100%;
  overflow:visible;
  pointer-events:none;
}
.tree-core-shadow,.tree-core,.tree-dynamic-root,.tree-link{
  fill:none;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.tree-core-shadow{stroke:rgba(65,47,31,.13);stroke-width:calc(var(--tree-trunk-width) + 7px)}
.tree-core{stroke:url(#dynamicTrunkGradient);stroke-width:var(--tree-trunk-width);filter:url(#dynamicTreeShadow)}
.tree-dynamic-root{stroke:#836344;stroke-width:3;opacity:.42}
.tree-link{
  stroke-width:4;
  opacity:.78;
  transition:opacity .22s ease,stroke-width .22s ease,filter .22s ease;
}
.tree-scale-compact .tree-link{stroke-width:3.5}.tree-scale-dense .tree-link{stroke-width:3}
.tree-parent-link{filter:drop-shadow(0 2px 2px rgba(28,71,53,.1))}
.tree-spouse-link{stroke-width:2.5;stroke-dasharray:3 6;opacity:.68}
.tree-estimated-link{stroke-width:2;stroke-dasharray:2 8;opacity:.34}
.tree-link.is-active{stroke-width:5;opacity:1;filter:drop-shadow(0 0 4px rgba(77,150,94,.34))}
.tree-link.is-muted{opacity:.28;filter:none}
.tree-decor-leaf{fill:#72a978;opacity:.12}
.tree-generation{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  width:100%;
}
.tree-generation-label{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:25px;
  padding:5px 11px;
  border:1px solid rgba(62,108,85,.12);
  border-radius:99px;
  background:rgba(252,254,252,.96);
  color:#4f665c;
  box-shadow:0 3px 10px rgba(30,69,54,.05);
  font-size:9px;
  font-weight:850;
  letter-spacing:.42px;
  line-height:1;
  text-transform:uppercase;
  white-space:nowrap;
}
.tree-generation-row{
  display:flex;
  align-items:stretch;
  justify-content:center;
  gap:var(--tree-node-gap);
  width:100%;
}
.family-node{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  align-items:center;
  gap:9px;
  flex:0 0 var(--tree-node-width);
  width:var(--tree-node-width);
  min-height:var(--tree-node-height);
  padding:11px 10px;
  border:1px solid rgba(61,104,82,.2);
  border-top:3px solid var(--branch-color);
  border-radius:20px;
  background:#fff;
  color:#173d31;
  box-shadow:0 8px 20px rgba(24,68,51,.1),inset 0 1px 0 #fff;
  text-align:left;
  transition:transform .18s ease,box-shadow .18s ease,opacity .22s ease,filter .22s ease;
}
.family-node:active{transform:translateY(1px) scale(.985)}
.family-node:focus-visible{outline:3px solid rgba(47,125,86,.25);outline-offset:3px}
.family-node-avatar{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  border:1px solid rgba(66,111,88,.15);
  border-radius:50%;
  background:linear-gradient(145deg,#e4f1e5,#f5e9c7);
  color:#173d31;
  font-size:10px;
  font-weight:950;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.86);
}
.family-node-copy{min-width:0}.family-node-copy strong,.family-node-copy small{overflow:hidden;text-overflow:ellipsis}
.family-node-copy strong{display:-webkit-box;color:#173d31;font-size:12px;line-height:1.16;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal}.family-node-copy small{display:block;margin-top:5px;color:#53675e;font-size:9px;line-height:1.2;white-space:nowrap}
.family-node.is-leaf{
  border-radius:20px 20px 20px 8px;
  background:linear-gradient(145deg,#fff 0%,#eef8eb 100%);
}
.family-node.is-leaf:after{
  content:"";
  position:absolute;
  right:8px;
  bottom:7px;
  width:15px;
  border-top:1px solid var(--branch-color);
  transform:rotate(-30deg);
}
.family-node.is-branch-head{box-shadow:0 10px 24px rgba(38,91,62,.14),inset 0 1px 0 #fff}
.family-node-badge{
  position:absolute;
  right:8px;
  top:-10px;
  padding:4px 7px;
  border:2px solid #f8fbf9;
  border-radius:99px;
  background:var(--branch-color);
  color:#fff;
  font-size:7px;
  font-style:normal;
  font-weight:850;
  white-space:nowrap;
}
.family-node.memorial{border-color:#d8ceba;border-top-color:#9d8768;background:#fbf8f1}.family-node.memorial .family-node-avatar{border-color:#dfd5c4;background:#eee8dc;color:#725f45}
.family-node.is-estimated:not(.memorial){border-bottom-style:dashed}
.family-node.branch-active,.family-node.selected{
  z-index:4;
  border-color:var(--branch-color);
  box-shadow:0 0 0 3px rgba(67,139,99,.14),0 12px 26px rgba(31,95,65,.18);
  transform:translateY(-2px);
}
.family-node.branch-muted{opacity:.66;filter:saturate(.78)}
.tree-scale-compact .family-node{grid-template-columns:37px minmax(0,1fr);gap:8px;padding:10px 9px;border-radius:18px}.tree-scale-compact .family-node-avatar{width:37px;height:37px}.tree-scale-compact .family-node-copy strong{font-size:11px}.tree-scale-compact .family-node-copy small{font-size:8px}
.tree-scale-dense .family-node{grid-template-columns:32px minmax(0,1fr);gap:7px;padding:8px 7px;border-radius:16px}.tree-scale-dense .family-node-avatar{width:32px;height:32px;font-size:8px}.tree-scale-dense .family-node-copy strong{font-size:10px}.tree-scale-dense .family-node-copy small{font-size:8px}.tree-scale-dense .family-node-badge{right:5px;font-size:6px}
.tree-generation-row.has-leaf-clusters{align-items:flex-start;gap:14px}
.tree-leaf-cluster{
  position:relative;
  display:grid;
  grid-template-columns:repeat(2,var(--tree-leaf-width));
  gap:8px;
  padding:25px 8px 9px;
  border:1px solid rgba(61,104,82,.16);
  border-radius:22px;
  background:rgba(247,251,247,.9);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.85);
}
.tree-leaf-cluster-label{
  position:absolute;
  left:10px;
  right:10px;
  top:7px;
  overflow:hidden;
  color:var(--branch-color);
  font-size:7px;
  font-weight:850;
  letter-spacing:.15px;
  line-height:1.2;
  text-align:center;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.tree-leaf-cluster .family-node{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  width:var(--tree-leaf-width);
  min-height:64px;
  padding:6px 4px;
  border-top-width:2px;
  border-radius:16px 16px 16px 6px;
  text-align:center;
}
.tree-leaf-cluster .family-node-avatar{width:22px;height:22px;font-size:7px}
.tree-leaf-cluster .family-node-copy{width:100%}.tree-leaf-cluster .family-node-copy strong{display:block;font-size:8px;white-space:nowrap}.tree-leaf-cluster .family-node-copy small{margin-top:2px;font-size:7px}
.tree-leaf-cluster .family-node:after{right:4px;bottom:4px;width:10px}
.tree-empty{
  position:absolute;
  z-index:3;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(250px,80%);
  padding:18px;
  border:1px dashed #b9cec3;
  border-radius:18px;
  background:rgba(255,255,255,.88);
  color:#5c7067;
  font-size:10px;
  line-height:1.45;
  text-align:center;
}

@media(max-width:359px){
  .dynamic-tree .tree-life-summary{padding-inline:11px}.tree-canvas{padding-inline:14px}.tree-generation-label{font-size:8px}.tree-selection-status{margin-inline:0}
}
[hidden]{display:none!important}

/* Account-first family discovery onboarding. */
.onboarding-steps{grid-template-columns:1fr auto 1fr auto 1fr!important;gap:5px!important}
.onboarding-steps span{padding-inline:4px!important;font-size:8px!important}
.backend-discovery{display:flex;flex-direction:column;gap:10px;padding-top:5px}
.backend-discovery[hidden]{display:none}.backend-discovery>strong{font-size:13px}
.backend-discovery>label{display:flex;flex-direction:column;gap:5px;color:#64756e;font-size:8px;font-weight:800}
.backend-discovery input,.contact-place-form select,.contact-place-form input{width:100%;height:45px;border:1px solid var(--line);border-radius:13px;background:#fff;padding:0 12px;color:var(--ink);font-size:11px;outline:0}
.discovery-consent{flex-direction:row!important;align-items:flex-start!important;line-height:1.35}
.contact-scan-button,.secondary-tree-button{min-height:46px;border:1px solid var(--line);border-radius:14px;font-size:10px;font-weight:850}
.contact-scan-button span{margin-right:5px;font-size:16px}.secondary-tree-button{background:#f4f7f5;color:var(--green)}
.secondary-tree-button.recommended{border-color:#78ab98;background:#edf8f3;box-shadow:0 0 0 3px rgba(60,142,110,.09)}
.contact-match-list{display:flex;flex-direction:column;gap:8px}.contact-match-list[hidden]{display:none}
.contact-empty{display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid #d9e7e0;border-radius:14px;background:#f6faf8}
.contact-empty b{font-size:10px}.contact-empty span{font-size:8px;line-height:1.45;color:var(--muted)}
.contact-match-card{display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid #cfe3da;border-radius:16px;background:#f6fbf8}
.contact-match-card>div:first-child{display:flex;align-items:center;gap:9px}.contact-match-card>div:first-child>div{min-width:0}
.contact-match-card b,.contact-match-card small{display:block}.contact-match-card b{font-size:10px}
.contact-match-card small{margin-top:2px;color:var(--muted);font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.match-avatar{width:34px;height:34px;flex:0 0 34px;border-radius:11px;background:#dcefe6;color:var(--green);display:grid;place-items:center;font-size:9px;font-weight:900}
.contact-match-card>button,.contact-place-form button{min-height:40px;border:0;border-radius:11px;background:var(--green);color:#fff;font-size:9px;font-weight:850}
.contact-place-form{display:flex;flex-direction:column;gap:7px;padding-top:8px;border-top:1px solid #dce9e3}
.contact-place-form p{margin:0;color:#287056;font-size:9px;line-height:1.45;font-weight:750}
@media(max-width:370px){.onboarding-steps span{font-size:7px!important}.join-existing-tree{grid-template-columns:1fr}.join-existing-tree button{width:100%}}

.app-update-backdrop{z-index:180!important;background:rgba(7,38,31,.78)!important;backdrop-filter:blur(8px)}
.app-update-sheet{text-align:center;padding:18px 20px 22px!important;border-radius:28px 28px 0 0!important}
.update-icon{width:58px;height:58px;margin:4px auto 10px;border-radius:19px;display:grid;place-items:center;background:linear-gradient(145deg,#dff3e9,#f8ecd0);color:var(--green);font-size:28px;font-weight:900}
.app-update-sheet>small{color:var(--green);font-size:8px;font-weight:900;letter-spacing:.7px}.app-update-sheet h2{margin:5px 0 8px;font-size:22px}
.app-update-sheet>p{margin:0 auto 12px;max-width:320px;color:var(--muted);font-size:10px;line-height:1.55}
.update-notes{display:flex;flex-direction:column;gap:7px;margin:14px 0;padding:12px;text-align:left;border:1px solid #dbe9e2;border-radius:15px;background:#f6faf8}
.update-notes span{font-size:9px;color:#315f51}.app-update-sheet>button{width:100%;min-height:46px;border-radius:14px;font-size:10px;font-weight:900}
.update-later{margin-top:7px;border:1px solid var(--line);background:#f4f6f5;color:var(--muted)}
.update-help{margin-top:10px!important;font-size:8px!important}
