/* Teratak Kasih: modern, clean, interactive. Mobile first. */
:root {
  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --surface-2: #F9FAF9;
  --ink: #0E1512;
  --ink-2: #4A5651;
  --ink-3: #8C9792;
  --line: #E5E9E7;
  --line-2: #D7DDDA;
  --brand: #0B3B2E;
  --brand-2: #135A45;
  --accent: #10B981;
  --accent-ink: #047857;
  --accent-soft: #D1FAE5;
  --accent-glow: rgba(16, 185, 129, .35);
  --amber: #F59E0B;
  --amber-soft: #FEF3C7;
  --rose: #E11D48;
  --radius: 22px;
  --shadow-1: 0 1px 2px rgba(14, 21, 18, .05), 0 1px 1px rgba(14, 21, 18, .03);
  --shadow-2: 0 4px 12px rgba(14, 21, 18, .06), 0 1px 3px rgba(14, 21, 18, .05);
  --shadow-3: 0 18px 40px rgba(14, 21, 18, .14), 0 4px 10px rgba(14, 21, 18, .06);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --app-w: 560px;
  --glass: rgba(255, 255, 255, .92);
  --glass-bar: rgba(244, 246, 245, .86);
  --dot: #CDD5D1;
  --hover: #F2FBF7;
  --spring: cubic-bezier(.2, .9, .25, 1.15);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: #E6EAE8; color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
/* wide screens: dot grid around the phone-width app, like the tree canvas */
@media (min-width: 700px) { body { background: radial-gradient(70% 60% at 15% 10%, rgba(16, 185, 129, .12), transparent 70%), radial-gradient(#C7D2CD 1.2px, transparent 1.6px) 0 0/24px 24px, #E6EAE8; background-attachment: fixed; } }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.app { min-height: 100vh; min-height: 100dvh; max-width: var(--app-w); margin: 0 auto; background: var(--bg); position: relative; overflow-x: clip; }
@media (min-width: 600px) { .app { box-shadow: 0 0 0 1px var(--line), 0 30px 80px rgba(14, 21, 18, .12); } }
.enter { animation: enter .35s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }

/* ---------- headers ---------- */
.bar { position: sticky; top: 0; z-index: 20; padding: calc(14px + var(--safe-t)) 20px 10px; background: var(--glass-bar); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); display: flex; align-items: flex-end; gap: 12px; transition: box-shadow .2s; }
.bar.scrolled { box-shadow: 0 1px 0 var(--line); }
.bar .titles { flex: 1; min-width: 0; }
.eyebrow { font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big-title { font-size: 32px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 2px 0 0; }
.me-btn { flex: none; position: relative; width: 42px; height: 42px; border-radius: 50%; padding: 0; border: 0; background: none; }
.me-btn .av { width: 42px; height: 42px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--brand); }
.icon-btn { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow-2); display: grid; place-items: center; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:active, .me-btn:active { transform: scale(.92); }
.icon-btn.pill { width: auto; padding: 0 15px 0 13px; border-radius: 99px; display: flex; gap: 6px; font: 700 14px/1 var(--font); }
.icon-btn.pill svg { width: 18px; height: 18px; }
.cari-tip { margin: 10px 2px 12px; font-size: 13px; color: var(--ink-3); }
.cari-kira { padding: 10px 16px 6px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.cari-li .chip { flex: none; align-self: center; max-width: 42%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cari-via { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.cari-via svg { width: 13px; height: 13px; flex: none; }
main { padding: 4px 20px calc(var(--tab-h) + var(--safe-b) + 28px); }
main.main--tree { padding: 0; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: var(--app-w); padding-bottom: var(--safe-b); background: var(--glass); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--line); }
.tabbar-inner { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tab-h); padding: 6px 8px; }
.tab-ind { position: absolute; top: 6px; bottom: 6px; left: 8px; width: calc((100% - 16px) / 4); border-radius: 16px; background: var(--accent-soft); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .45s var(--spring); }
.tabbar button { position: relative; z-index: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-3); font-size: 11px; font-weight: 700; transition: color .2s; }
.tabbar button svg { width: 23px; height: 23px; transition: transform .3s var(--spring); }
.tabbar button[aria-current="page"] { color: var(--accent-ink); }
.tabbar button[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }

/* ---------- segmented with sliding indicator ---------- */
.seg { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px; border-radius: 16px; background: var(--glass); box-shadow: var(--shadow-3); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); border-radius: 12px; background: var(--brand); box-shadow: 0 4px 12px rgba(11, 59, 46, .35); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .45s var(--spring); }
.seg button { position: relative; z-index: 1; border: 0; background: none; padding: 11px 2px; border-radius: 12px; font-weight: 700; font-size: 13px; color: var(--ink-2); white-space: nowrap; transition: color .25s; }
.seg button[aria-pressed="true"] { color: #fff; }

/* ---------- tree screen ---------- */
.tree-screen { position: relative; overflow: hidden; height: calc(100vh - var(--tab-h) - var(--safe-b)); height: calc(100dvh - var(--tab-h) - var(--safe-b)); min-height: 460px; background: var(--surface-2); }
.tree-viewport {
  position: absolute; inset: 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background-image: radial-gradient(circle, var(--dot) 1.2px, transparent 1.3px);
  background-size: 24px 24px;
}
.tree-viewport.grabbing { cursor: grabbing; }
.tree-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.tree-lines { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.tree-lines path { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-linecap: round; transition: stroke .35s, stroke-width .35s, opacity .35s; }
.tree-lines path.lit { stroke: var(--accent); stroke-width: 2.6; stroke-dasharray: 2 7; animation: flow 1.1s linear infinite; }
.tree-lines path.dim { opacity: .45; }
.tree-lines circle.knot { fill: var(--line-2); transition: fill .35s; }
.tree-lines circle.knot.lit { fill: var(--accent); }
@keyframes flow { to { stroke-dashoffset: -18; } }

.tree-top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; padding: calc(14px + var(--safe-t)) 16px 26px; display: flex; align-items: center; gap: 10px; background: linear-gradient(var(--surface-2) 30%, transparent); pointer-events: none; }
.tree-top > * { pointer-events: auto; }
.tree-top .titles { flex: 1; min-width: 0; pointer-events: none; }
.tree-top .big-title { font-size: 28px; }
.tree-tools { position: absolute; z-index: 3; right: 14px; top: calc(84px + var(--safe-t)); display: flex; flex-direction: column; border-radius: 16px; background: var(--glass); box-shadow: var(--shadow-2); backdrop-filter: blur(12px); overflow: hidden; border: 1px solid var(--line); }
.tree-tools button { width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); }
.tree-tools button + button { border-top: 1px solid var(--line); }
.tree-tools button svg { width: 19px; height: 19px; }
.tree-tools button:active { background: var(--bg); }
.tree-bottom { position: absolute; z-index: 3; left: 14px; right: 14px; bottom: 14px; display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.tree-bottom > * { pointer-events: auto; }
.tree-bottom .seg { width: 100%; max-width: 420px; }
.caption { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-3); transition: opacity .25s, transform .25s; }
.caption.swap { opacity: 0; transform: translateY(6px); }
.caption .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(16, 185, 129, .25); flex: none; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, .1); } }
.empty-hint { padding: 140px 24px; width: 320px; text-align: center; color: var(--ink-2); }

/* ---------- tree node ---------- */
.node { position: absolute; width: 120px; display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: 0; padding: 0; transition: opacity .4s var(--ease), filter .4s var(--ease), transform .45s var(--spring); }
.node .ring { position: relative; border-radius: 50%; padding: 3px; background: var(--surface); box-shadow: var(--shadow-2); transition: box-shadow .4s var(--ease), background .4s, transform .2s; }
.node .av { width: 76px; height: 76px; }
.node .name { font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.node .rel { font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; margin-top: -4px; }
.node .badge { position: absolute; right: -10px; top: -4px; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2.5px var(--surface-2), 0 4px 10px rgba(16, 185, 129, .4); white-space: nowrap; transform: scale(0); transition: transform .4s var(--spring); }
.node .badge:not(:empty) { transform: scale(1); }
.node .you { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%) scale(0); padding: 2px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; transition: transform .4s var(--spring); }
.node.is-self .you { transform: translateX(-50%) scale(1); }
.node.is-self .name { margin-top: 6px; }
.node.is-self .ring { background: var(--brand); box-shadow: 0 0 0 5px rgba(11, 59, 46, .12), var(--shadow-3); }
.node.is-lit .ring { background: var(--accent); box-shadow: 0 0 0 6px rgba(16, 185, 129, .16), 0 10px 28px var(--accent-glow); }
.node.is-dim { opacity: .3; filter: grayscale(1); transform: scale(.92); }
.node.is-dead .av img { filter: grayscale(.8); }
.node:active .ring { transform: scale(.95); }
.node.pulse .ring { animation: pulse 1.4s var(--ease) 2; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .55), var(--shadow-2); } 100% { box-shadow: 0 0 0 26px rgba(16, 185, 129, 0), var(--shadow-2); } }
.node.pressing .ring { transform: scale(.9); transition: transform .5s linear; }
.node:focus-visible { outline: none; }
.node:focus-visible .ring { outline: 3px solid var(--accent); outline-offset: 3px; }
.tree-stage.far .rel { visibility: hidden; }

/* ---------- avatar ---------- */
.av { border-radius: 50%; overflow: hidden; background: #E9EEEB; display: grid; place-items: center; flex: none; }
.av img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.av .ini { font-weight: 800; color: var(--brand-2); font-size: 22px; }
.av.xs { width: 32px; height: 32px; }
/* photo crop and viewer */
.photo-open { position: relative; border: 0; padding: 0; background: none; border-radius: 50%; cursor: zoom-in; }
.photo-zoom { position: absolute; right: 2px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.photo-zoom svg { width: 15px; height: 15px; }
.linkbtn { border: 0; background: none; padding: 0; margin-left: 4px; font: inherit; font-weight: 700; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.crop-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(6, 12, 10, .72); backdrop-filter: blur(6px); animation: enter .2s var(--ease) both; }
.crop-modal.out, .photo-view.out { opacity: 0; transition: opacity .2s; }
.crop-card { width: 100%; max-width: 420px; background: var(--bg); border-radius: 26px; padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow-3); }
.crop-head b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.crop-head small { color: var(--ink-3); font-size: 13px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 20px; background: #111; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 20px; background: radial-gradient(circle closest-side, transparent calc(100% - 1px), rgba(0, 0, 0, .55) 100%); }
.crop-ring::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9); }
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.crop-zoom svg { width: 18px; height: 18px; flex: none; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }
.photo-view { position: fixed; inset: 0; z-index: 200; background: #050807; color: #fff; opacity: 0; transition: opacity .2s; }
.photo-view.in { opacity: 1; }
.pv-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; user-select: none; }
.pv-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.pv-stage img.anim { transition: transform .2s var(--ease), width .2s var(--ease); }
.photo-view .x { position: absolute; z-index: 2; top: calc(14px + var(--safe-t)); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(8px); }
.photo-view .x svg { width: 20px; height: 20px; }
.pv-cap { position: absolute; z-index: 2; left: 16px; top: calc(24px + var(--safe-t)); right: 70px; font-weight: 800; font-size: 16px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.pv-hint { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, .6); pointer-events: none; }
.av.sm { width: 44px; height: 44px; }
.av.md { width: 56px; height: 56px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); border: 1px solid var(--line); padding: 16px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 26px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip.amber { background: var(--amber-soft); color: #92400E; }
.chip.dark { background: var(--ink); color: var(--bg); }
.list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-1); overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; border: 0; background: none; text-align: left; text-decoration: none; color: inherit; transition: background .15s; }
button.li:active, a.li:active { background: var(--bg); }
.li .t { font-weight: 700; font-size: 15px; }
.li .s { font-size: 13px; color: var(--ink-3); }
.li .chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.li .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--brand-2); }
.li .ico svg { width: 19px; height: 19px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 15.5px; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s; }
.btn.block { width: 100%; }
.btn.accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(16, 185, 129, .3); }
.btn.light { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.danger { background: #FFF1F2; color: var(--rose); }
.btn:active { transform: scale(.97); }
.btn svg { width: 19px; height: 19px; }
.link { background: none; border: 0; color: var(--accent-ink); font-weight: 700; padding: 0; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.action { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: none; box-shadow: var(--shadow-1); transition: transform .15s; }
.action:active { transform: scale(.95); }
.action .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.action .ico svg { width: 20px; height: 20px; }

/* ---------- switch ---------- */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .25s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-2); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- faraid ---------- */
.picker { display: flex; gap: 14px; overflow-x: auto; padding: 6px 20px 10px; margin: 0 -20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.picker::-webkit-scrollbar { display: none; }
.pick { flex: none; scroll-snap-align: center; display: grid; justify-items: center; gap: 6px; width: 64px; border: 0; background: none; padding: 0; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pick .av { width: 56px; height: 56px; box-shadow: 0 0 0 2px var(--bg); transition: box-shadow .3s, transform .3s var(--spring); }
.pick span:last-child { white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
.pick.on { color: var(--ink); }
.pick.on .av { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--brand); transform: scale(1.06); }
.donut-wrap { position: relative; width: min(250px, 70vw); aspect-ratio: 1; margin: 6px auto 4px; }
.donut { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 22; transition: stroke-dasharray .9s var(--ease), stroke-width .3s var(--spring), opacity .3s; cursor: pointer; }
.donut circle.track { stroke: var(--line); cursor: default; }
.donut circle.on { stroke-width: 30; }
.donut.focus circle:not(.on):not(.track) { opacity: .45; }
.donut-centre { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-centre .v { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.donut-centre .n { font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-top: 6px; }
.donut-centre .r { font-size: 12px; color: var(--ink-3); }
.share { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; width: 100%; padding: 13px 16px; border: 0; background: none; text-align: left; transition: background .2s; }
.share .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.share .t { font-weight: 700; font-size: 15px; }
.share .s { font-size: 12.5px; color: var(--ink-3); }
.share .pc { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.share .bar { grid-column: 2 / -1; height: 5px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.share .bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .9s var(--ease); }
.share .why { grid-column: 2 / -1; font-size: 12px; color: var(--ink-3); display: none; }
.share.on { background: var(--hover); }
.share.on .why { display: block; }
.share.me .t::after { content: 'Anda'; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; vertical-align: 2px; }
details.list summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; }
details.list summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .25s; margin-top: 3px; }
details.list[open] summary::after { transform: rotate(-135deg); margin-top: 8px; }
.blocked { margin: 0; padding: 0 16px 14px 34px; font-size: 13.5px; color: var(--ink-2); }
.blocked li { margin: 6px 0; }
.note { padding: 13px 15px; border-radius: 16px; background: var(--amber-soft); color: #78350F; font-size: 13.5px; }
.disclaimer { font-size: 12px; color: var(--ink-3); text-align: center; margin: 14px 6px 0; line-height: 1.5; }

/* ---------- birthdays ---------- */
.hero-card { position: relative; overflow: hidden; border-radius: 28px; padding: 20px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #1F7A5E 0%, var(--brand) 55%, #072A20 100%); box-shadow: var(--shadow-3); }
.hero-card .av { width: 72px; height: 72px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); }
.hero-card .k { font-size: 12.5px; font-weight: 700; color: #A7F3D0; letter-spacing: .02em; }
.hero-card .who { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 2px 0; }
.hero-card .when { font-size: 13.5px; color: #CDEBDD; }
.hero-card .count { display: flex; align-items: baseline; gap: 6px; margin: 18px 0 16px; }
.hero-card .count b { font-size: 64px; font-weight: 800; letter-spacing: -.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.hero-card .count span { font-size: 16px; font-weight: 700; color: #CDEBDD; }
.hero-card .btn { background: #fff; color: var(--brand); }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: fall 2.6s var(--ease) forwards; }
@keyframes fall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), 300px) rotate(var(--r)); } }
.month { position: sticky; top: calc(92px + var(--safe-t)); z-index: 2; padding: 8px 2px 6px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); background: var(--bg); }
.days-pill { flex: none; min-width: 64px; text-align: center; padding: 6px 10px; border-radius: 12px; background: var(--bg); font-size: 12.5px; font-weight: 800; color: var(--ink-2); line-height: 1.1; }
.days-pill b { display: block; font-size: 18px; color: var(--ink); letter-spacing: -.02em; }
.days-pill.soon { background: var(--amber-soft); color: #92400E; }
.days-pill.soon b { color: #92400E; }

/* ---------- guide ---------- */
.books { display: flex; gap: 12px; overflow-x: auto; padding: 4px 20px 12px; margin: 0 -20px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.books::-webkit-scrollbar { display: none; }
.book { flex: none; width: 168px; scroll-snap-align: start; display: flex; flex-direction: column; align-self: flex-start; text-align: left; border: 0; background: none; padding: 0; color: inherit; }
/* guide covers: the guide's colour, a dot grid, a book spine and its own line-art */
.book .cover { position: relative; height: 228px; border-radius: 8px 18px 18px 8px; padding: 14px 14px 14px 22px; display: flex; flex-direction: column; color: #fff; overflow: hidden; isolation: isolate;
  background: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.3px) 0 0/12px 12px, radial-gradient(120% 80% at 100% 0%, var(--c2) 0%, var(--c1) 70%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 14px 24px -14px rgba(8, 14, 11, .55), var(--shadow-1); transition: transform .25s var(--spring); }
.book:active .cover { transform: scale(.97); }
.cv-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .16) 70%, rgba(0, 0, 0, .1)); }
.cv-top { display: flex; align-items: center; gap: 7px; }
.cv-no { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 7px; background: rgba(255, 255, 255, .2); }
.book .cover small { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; opacity: .85; }
.cv-art { flex: 1; display: grid; place-items: center; position: relative; }
.cv-art::before { content: ''; position: absolute; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%); }
.cv-art svg { position: relative; width: 92px; height: 92px; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); }
.cv-foot { display: grid; gap: 7px; }
.book .cover b { font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.cv-meta { justify-self: start; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 99px; background: rgba(0, 0, 0, .18); }
.book h4 { margin: 10px 2px 2px; font-size: 14.5px; font-weight: 700; }
.book p { margin: 0 2px; font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }
.code-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--bg); }
.code-box b { font-size: 26px; font-weight: 800; letter-spacing: .14em; flex: 1; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.input, textarea.input { width: 100%; min-height: 52px; padding: 12px 15px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; transition: border-color .2s, box-shadow .2s; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(16, 185, 129, .15); }
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio-row span { display: block; text-align: center; padding: 13px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; transition: all .2s; }
.radio-row input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff; }
.av-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.av-grid button { border: 0; border-radius: 50%; padding: 3px; background: transparent; transition: background .2s, transform .3s var(--spring); }
.av-grid button[aria-pressed="true"] { background: var(--accent); transform: scale(1.05); }
.av-grid button[aria-pressed="true"] .av { box-shadow: 0 0 0 3px var(--surface); }
.av-grid .av { width: 100%; aspect-ratio: 1; height: auto; }
.search { position: relative; }
.search svg { position: absolute; left: 15px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--ink-3); }
.search .input { padding-left: 44px; background: var(--surface); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 11, .38); display: flex; align-items: flex-end; justify-content: center; animation: fade .25s both; }
.scrim.closing { animation: fade .22s reverse both; }
.sheet { width: 100%; max-width: var(--app-w); max-height: 92vh; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 28px 28px 0 0; padding: 0 20px calc(26px + var(--safe-b)); animation: up .42s var(--spring) both; box-shadow: 0 -10px 40px rgba(8, 14, 11, .2); }
.scrim.closing .sheet { animation: down .22s var(--ease) both; }
.sheet-head { position: sticky; top: 0; z-index: 3; margin: 0 -20px 6px; padding: 8px 20px 10px; background: var(--glass-bar); backdrop-filter: blur(12px); touch-action: none; cursor: grab; }
.grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 2px auto 10px; }
.sheet-head .row h3 { flex: 1; margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--line); color: var(--ink-2); display: grid; place-items: center; }
.x svg { width: 16px; height: 16px; }
@media (min-width: 600px) { .scrim { align-items: center; } .sheet { border-radius: 28px; max-width: 480px; } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- profile ---------- */
.profile-top { text-align: center; padding: 4px 0 6px; }
.profile-top .av { width: 116px; height: 116px; margin: 0 auto; box-shadow: 0 0 0 4px var(--surface), var(--shadow-3); }
.profile-top h2 { font-size: 25px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 6px; line-height: 1.15; }
.map-mini { height: 110px; border-radius: 16px; margin: 0 16px 14px; position: relative; overflow: hidden; background: linear-gradient(90deg, transparent 47%, #fff 47% 50%, transparent 50%) 0 0 / 64px 64px, linear-gradient(0deg, transparent 47%, #fff 47% 50%, transparent 50%) 0 0 / 80px 56px, linear-gradient(120deg, transparent 60%, #BFE3D2 60% 67%, transparent 67%), #E3EEE8; }
.map-mini svg { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -85%); color: var(--rose); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .2)); animation: drop .6s var(--spring) both .15s; }
@keyframes drop { from { transform: translate(-50%, -200%); opacity: 0; } }

/* ---------- welcome ---------- */
.welcome { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(20px + var(--safe-t)) 20px calc(24px + var(--safe-b)); }
.constellation { position: relative; height: 300px; margin: 0 -20px 6px; }
.constellation svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.constellation svg path { fill: none; stroke: var(--line-2); stroke-width: 1.5; stroke-dasharray: 3 6; animation: flow 2s linear infinite; }
.constellation .av { position: absolute; box-shadow: 0 0 0 3px var(--surface), var(--shadow-3); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }
.buyer-hint { margin: 14px auto 0; padding: 8px 12px; border: 0; border-radius: 12px; background: none; font: 500 13.5px/1.4 var(--font); color: var(--ink-3); text-align: center; cursor: pointer; }
.buyer-hint b { display: block; color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.welcome-logo { width: 54px; height: 54px; margin: 0 0 14px; filter: drop-shadow(0 10px 18px rgba(11, 59, 46, .3)); }
.welcome-logo svg { width: 100%; height: 100%; display: block; }
.welcome h1 { font-size: 44px; font-weight: 800; letter-spacing: -.045em; line-height: 1; margin: 0 0 10px; }
.welcome .lead { font-size: 17px; color: var(--ink-2); margin: 0 0 24px; }
.code-input { text-align: center; text-transform: uppercase; letter-spacing: .3em; font-weight: 800; font-size: 22px !important; }
.who-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.who-grid button { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 14px 6px 12px; display: grid; justify-items: center; gap: 6px; box-shadow: var(--shadow-1); transition: transform .2s var(--spring), box-shadow .2s, border-color .2s; }
.who-grid button.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.who-grid button[hidden] { display: none; }
.who-head { display: grid; gap: 10px; margin-top: 14px; }
.welcome .who-head { position: sticky; top: 0; z-index: 2; margin: 14px -20px 0; padding: 10px 20px 4px; background: var(--glass-bar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.who-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.who-count b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.who-count span { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.who-count span::before { content: "·"; margin-right: 8px; }
.who-note { font-size: 13px; font-weight: 600; color: var(--accent-ink); min-height: 0; }
.who-note:empty { display: none; }
.who-none { padding: 28px 12px; text-align: center; color: var(--ink-3); font-size: 15px; border: 1px dashed var(--line-2); border-radius: 20px; margin: 4px 0 16px; }
.who-grid button:active { transform: scale(.95); }
.who-grid .av { width: 60px; height: 60px; }
.who-grid b { font-size: 14px; }
.who-grid small { color: var(--ink-3); font-size: 11px; line-height: 1.25; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 84px); transform: translate(-50%, 16px) scale(.96); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 16px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .3s var(--spring); z-index: 60; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-3); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
/* keep the toast clear of the first-time tips card */
body:has(.coach) .toast { bottom: calc(var(--tab-h) + var(--safe-b) + 128px); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- intro: tree grows ---------- */
.node.intro { animation: pop .6s var(--spring) backwards; animation-delay: var(--d, 0ms); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.5); } }
.tree-lines path.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .7s var(--ease) forwards; animation-delay: var(--d, 0ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- peek card + relationship path ---------- */
.peek { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: 12px; padding: 6px 16px 16px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); transform: translateY(calc(100% + 30px)); transition: transform .45s var(--spring); touch-action: none; }
.peek.open { transform: translateY(0); }
.peek .grab { margin: 4px auto 10px; }
.peek-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.chain-label { font-size: 12px; font-weight: 700; color: var(--ink-3); margin: 14px 0 8px; letter-spacing: .01em; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; row-gap: 8px; padding-bottom: 2px; }
.chain::-webkit-scrollbar { display: none; }
.link-step { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--bg); animation: enter .4s var(--ease) both; }
.link-step b { display: block; font-size: 12.5px; line-height: 1.1; }
.link-step small { display: block; font-size: 10.5px; color: var(--ink-3); line-height: 1.1; }
.link-step small:empty { display: none; }
.chain .arrow { color: var(--ink-3); font-weight: 800; flex: none; }
.peek-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 14px; }
.peek-actions .btn.light { width: 52px; padding: 0; }
.tree-bottom { transition: opacity .25s, transform .3s var(--ease); }
.tree-bottom.hide { opacity: 0; transform: translateY(20px); pointer-events: none; }
.tree-stage.peeking .node:not(.on-path):not(.is-peek) { opacity: .22; filter: grayscale(1); transform: scale(.92); }
.tree-stage.peeking .node.on-path { opacity: 1; filter: none; transform: none; }
.tree-stage.peeking .tree-lines path:not(.path) { opacity: .25; }
.tree-lines path.path { stroke: var(--brand-2); stroke-width: 3; opacity: 1; stroke-dasharray: 2 7; animation: flow .9s linear infinite; }
.node.is-peek .ring { box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 7px var(--ink), var(--shadow-3); }

/* ---------- minimap ---------- */
#main:has(.radial) .minimap { opacity: 0; pointer-events: none; }
.minimap { transition: opacity .2s; }
.minimap { position: absolute; z-index: 3; left: 14px; top: calc(84px + var(--safe-t)); width: 96px; height: 66px; padding: 0; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); box-shadow: var(--shadow-2); backdrop-filter: blur(12px); overflow: hidden; }
.minimap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.minimap circle { fill: var(--line-2); transition: fill .3s; }
.minimap circle.lit { fill: var(--accent); }
.minimap circle.me { fill: var(--ink); }
.mm-rect { position: absolute; left: 0; top: 0; border: 1.5px solid var(--accent); border-radius: 4px; background: rgba(16, 185, 129, .08); pointer-events: none; }

/* ---------- coach tips ---------- */
.coach { position: absolute; z-index: 5; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 22px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-3); animation: up .45s var(--spring) both; }
.coach.out { animation: down .25s var(--ease) both; }
.coach b { font-size: 15px; }
.coach p { margin: 2px 0 0; font-size: 13px; opacity: .75; line-height: 1.35; }
.coach-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(16, 185, 129, .25); color: var(--accent); font-size: 11px; font-weight: 800; }
.coach .btn { min-height: 42px; padding: 0 14px; font-size: 14px; flex: none; }

/* ---------- faraid what-if ---------- */
.assume { margin: 6px 0 4px; }
.assume-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px 20px 4px; margin: 0 -20px; }
.assume-row::-webkit-scrollbar { display: none; }
.assume-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; transition: all .25s var(--spring); }
.assume-chip.off { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.assume-chip.off span { text-decoration: line-through; }
.assume-chip.off .av { filter: grayscale(1); opacity: .7; }

/* ---------- dark theme ---------- */
:root[data-theme="dark"] {
    --bg: #0C110F; --surface: #151C19; --surface-2: #101614; --ink: #EEF3F0; --ink-2: #A9B6AF; --ink-3: #74827B;
    --line: #222C28; --line-2: #33403A; --brand: #1E7A5C; --brand-2: #34D399; --accent-ink: #34D399; --accent-soft: rgba(16, 185, 129, .16);
    --amber-soft: rgba(245, 158, 11, .16); --glass: rgba(21, 28, 25, .9); --glass-bar: rgba(12, 17, 15, .86); --dot: #26302C; --hover: rgba(16, 185, 129, .08);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 4px 14px rgba(0, 0, 0, .35); --shadow-3: 0 18px 40px rgba(0, 0, 0, .5); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C110F; --surface: #151C19; --surface-2: #101614; --ink: #EEF3F0; --ink-2: #A9B6AF; --ink-3: #74827B;
    --line: #222C28; --line-2: #33403A; --brand: #1E7A5C; --brand-2: #34D399; --accent-ink: #34D399; --accent-soft: rgba(16, 185, 129, .16);
    --amber-soft: rgba(245, 158, 11, .16); --glass: rgba(21, 28, 25, .9); --glass-bar: rgba(12, 17, 15, .86); --dot: #26302C; --hover: rgba(16, 185, 129, .08);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 4px 14px rgba(0, 0, 0, .35); --shadow-3: 0 18px 40px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] body { background: #070A09; }
@media (min-width: 700px) { :root[data-theme="dark"] body { background: radial-gradient(70% 60% at 15% 10%, rgba(16, 185, 129, .10), transparent 70%), radial-gradient(rgba(255, 255, 255, .07) 1.2px, transparent 1.6px) 0 0/24px 24px, #070A09; } }
:root[data-theme="dark"] .chip.amber, :root[data-theme="dark"] .days-pill.soon, :root[data-theme="dark"] .days-pill.soon b, :root[data-theme="dark"] .note { color: #FCD34D; }
:root[data-theme="dark"] .btn.danger { background: rgba(225, 29, 72, .14); }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) body { background: #070A09; }
  @media (min-width: 700px) { :root:not([data-theme="light"]) body { background: radial-gradient(70% 60% at 15% 10%, rgba(16, 185, 129, .10), transparent 70%), radial-gradient(rgba(255, 255, 255, .07) 1.2px, transparent 1.6px) 0 0/24px 24px, #070A09; } }
:root:not([data-theme="light"]) .chip.amber, :root:not([data-theme="light"]) .days-pill.soon, :root:not([data-theme="light"]) .days-pill.soon b, :root:not([data-theme="light"]) .note { color: #FCD34D; }
:root:not([data-theme="light"]) .btn.danger { background: rgba(225, 29, 72, .14); }
}

/* ---------- toast action ---------- */
.toast { display: flex; align-items: center; gap: 14px; }
.toast.has-act { pointer-events: auto; }
.toast-act { border: 0; background: none; color: var(--accent); font-weight: 800; font-size: 14px; padding: 0; }

/* ---------- tour ---------- */
.tree-stage.touring .node:not(.is-peek) { opacity: .3; filter: grayscale(.7); transform: scale(.94); }
.tour { position: absolute; z-index: 5; left: 12px; right: 12px; bottom: 12px; padding: 14px 16px 16px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: up .45s var(--spring) both; overflow: hidden; }
.tour-prog { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--line); }
.tour-prog i { display: block; height: 100%; width: 0; background: var(--accent); animation: prog linear forwards; }
@keyframes prog { to { width: 100%; } }
.tour .row { animation: enter .35s var(--ease) both; }
.tour-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.tour-ctl { display: flex; align-items: center; gap: 8px; }
.tour-ctl .icon-btn { box-shadow: none; background: var(--bg); }
.tour-ctl .icon-btn.big { width: 52px; height: 52px; background: var(--ink); color: var(--bg); }
.tour-ctl .btn { margin-left: auto; min-height: 44px; }

/* ---------- radial quick add ---------- */
.radial { position: absolute; width: 0; height: 0; z-index: 2; }
.radial button { position: absolute; left: 0; top: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); display: flex; align-items: center; gap: 4px; padding: 6px 10px 6px 7px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; white-space: nowrap; box-shadow: 0 6px 16px rgba(16, 185, 129, .4); animation: radial .45s var(--spring) both; }
.radial button svg { width: 14px; height: 14px; stroke-width: 3; }
@keyframes radial { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } }

/* ---------- generation labels ---------- */
.gen-labels { position: absolute; z-index: 2; left: 0; top: 0; pointer-events: none; }
.gen-labels span { position: absolute; left: 0; top: 0; padding: 4px 9px 4px 10px; border-radius: 0 999px 999px 0; background: var(--glass); border: 1px solid var(--line); border-left: 0; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--ink-3); white-space: nowrap; transition: opacity .25s; }

/* ---------- birthdays extras ---------- */
.hero-actions { display: flex; gap: 8px; }
.btn.glass { background: rgba(255, 255, 255, .16); color: #fff; width: 52px; padding: 0; flex: none; }
.btn.glass.sm { width: 40px; min-height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.view-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 18px 0 4px; border-radius: 14px; background: var(--line); }
.view-toggle button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; padding: 9px; border-radius: 11px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); }
.view-toggle button svg { width: 17px; height: 17px; }
.view-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.cal { margin-top: 12px; padding: 12px; }
.cal-head { margin-bottom: 8px; }
.cal-head .icon-btn { width: 36px; height: 36px; box-shadow: none; background: var(--bg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid.dow span { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-3); padding: 4px 0; }
.day { position: relative; aspect-ratio: 1; border: 0; border-radius: 12px; background: none; display: grid; place-items: center; font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: background .2s, transform .2s var(--spring); }
.day.has { background: var(--accent-soft); color: var(--accent-ink); }
.day.has > span { position: absolute; top: 4px; left: 6px; font-size: 10.5px; }
.day.today { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.day.sel { background: var(--ink); color: var(--bg); transform: scale(1.06); }
.day-av { position: relative; margin-top: 8px; display: grid; place-items: center; font-style: normal; }
.day-av .av { width: 26px; height: 26px; box-shadow: 0 0 0 2px var(--surface); }
.day-av b { position: absolute; right: -10px; bottom: -4px; font-size: 9.5px; padding: 1px 4px; border-radius: 99px; background: var(--ink); color: var(--bg); }
.wish-img { width: 100%; border-radius: 22px; box-shadow: var(--shadow-3); animation: enter .4s var(--ease) both; }

/* ---------- places ---------- */
.place .place-bar { height: 6px; border-radius: 99px; background: var(--bg); margin: 8px 0; overflow: hidden; }
.place .place-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .9s var(--ease); }
.stackav { display: flex; }
.stackav .av { width: 26px; height: 26px; box-shadow: 0 0 0 2px var(--surface); }
.stackav .av + .av { margin-left: -7px; }

.node.is-peek, .tree-stage.peeking .node.is-peek { opacity: 1; filter: none; transform: scale(1.04); }
.node.is-peek .ring { background: var(--ink); }

.day { overflow: visible; }
.day-av { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); margin: 0; }
.day-av .av { width: 22px; height: 22px; }
.day.has > span { top: 3px; left: 5px; }

/* ---------- blocked heirs ---------- */
.node.is-blocked { opacity: .8; filter: grayscale(.4); }
.node.is-blocked .ring { background: var(--line-2); }
.node .badge.muted { background: var(--ink-3); box-shadow: 0 0 0 2.5px var(--surface-2); font-size: 10px; }
.peek-info { margin-top: 10px; padding: 9px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.peek-info.muted { background: var(--bg); color: var(--ink-2); }
.link-step .via { display: flex; margin-left: 2px; }
.link-step .via .av { width: 20px; height: 20px; box-shadow: 0 0 0 2px var(--bg); }
.link-step .via .av + .av { margin-left: -6px; }

/* ---------- wali tiers ---------- */
.node.is-amber .ring { background: var(--amber); box-shadow: 0 0 0 6px rgba(245, 158, 11, .16), 0 10px 26px rgba(245, 158, 11, .3); }
.node .badge.amber { background: var(--amber); box-shadow: 0 0 0 2.5px var(--surface-2), 0 4px 10px rgba(245, 158, 11, .4); }
.minimap circle.amber { fill: var(--amber); }
.peek-info.amber { background: var(--amber-soft); color: #92400E; }
.legend { display: none; gap: 12px; padding: 5px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.legend.show { display: inline-flex; animation: enter .3s var(--ease) both; }
.legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }
.legend i.g { background: var(--accent); } .legend i.a { background: var(--amber); } .legend i.n { background: var(--ink-3); }
.legend { align-items: center; }
.legend-info { display: grid; place-items: center; width: 22px; height: 22px; margin: -3px -6px -3px -2px; padding: 0; border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); cursor: pointer; }
.legend-info svg { width: 15px; height: 15px; }
.note-list { display: grid; gap: 14px; margin: 6px 0 18px; }
.note-row { display: grid; grid-template-columns: 14px 1fr; gap: 12px; align-items: start; }
.note-row i { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; }
.note-row i.g { background: var(--accent); } .note-row i.a { background: var(--amber); } .note-row i.n { background: var(--ink-3); } .note-row i.o { background: transparent; border: 2px solid var(--line-2); }
.note-row b { font-size: 16px; }
.note-row p { margin: 2px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.note-foot { margin: 2px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.tree-bottom.hide .legend { display: none; }

/* ---------- #panggilan tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 14px; background: var(--bg); border: 1.5px solid transparent; animation: enter .3s var(--ease) both; }
.tag b { font-size: 14px; color: var(--ink); }
.tag small { font-size: 11px; font-weight: 700; color: var(--ink-3); padding: 2px 7px; border-radius: 99px; background: var(--surface); }
.tag button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); font-size: 16px; line-height: 1; display: grid; place-items: center; }
.tag button:active { background: var(--line); }
.tag.on { border-color: var(--accent); background: var(--accent-soft); }
.tag.on b { color: var(--accent-ink); }
.tag.on small::before { content: "Anda guna · "; }
.tag:not(:has(button)) { padding-right: 10px; }
.tag-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.tag-input { display: flex; align-items: center; gap: 4px; padding: 0 14px; border-radius: 15px; border: 1.5px solid var(--line); background: var(--surface); }
.tag-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(16, 185, 129, .15); }
.tag-input span { font-weight: 800; color: var(--accent-ink); font-size: 17px; }
.tag-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; min-height: 48px; font-size: 16px; }
.tag-add { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 36px; margin-right: -8px; padding: 0 13px 0 10px; border: 0; border-radius: 11px; background: var(--accent); color: #03251B; font: 800 14px/1 var(--font); }
.tag-add svg { width: 16px; height: 16px; }
.tag-add:active { transform: scale(.95); }
.tag-who { display: grid; gap: 8px; margin-top: 2px; }
.tag-who-l { font-size: 12.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .01em; }
.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { flex: none; position: relative; cursor: pointer; }
.tchip input { position: absolute; opacity: 0; pointer-events: none; }
.tchip span { display: block; white-space: nowrap; padding: 7px 12px; border-radius: 99px; background: var(--bg); border: 1.5px solid transparent; font-size: 13px; font-weight: 700; color: var(--ink-2); transition: background .15s, border-color .15s, color .15s; }
.tchip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px rgba(11, 59, 46, .5); }
.tchip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-hint { font-size: 12.5px; color: var(--accent-ink); font-weight: 600; }

/* ---------- online sync ---------- */
.code-input { letter-spacing: .08em !important; font-size: 19px !important; }
.sync-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--ink-3); }
.sync-dot[data-s="ok"] { background: var(--accent); }
.sync-dot[data-s="busy"], .sync-dot[data-s="wait"] { background: var(--amber); animation: beat 1.2s ease-in-out infinite; }
.sync-dot[data-s="err"] { background: var(--rose); }
.sync-dot[data-s="local"] { display: none; }
.sync-line { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.sync-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.sync-line[data-s="ok"]::before { background: var(--accent); }
.sync-line[data-s="busy"]::before, .sync-line[data-s="wait"]::before { background: var(--amber); }
.sync-line[data-s="err"] { color: var(--rose); }
.sync-line[data-s="err"]::before { background: var(--rose); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--brand); }
.admin-link { flex: 1; min-width: 0; font-size: 11.5px; word-break: break-all; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--ink-2); }
.hist-btn { min-height: 38px; padding: 0 12px; font-size: 13px; flex: none; }
.hist-btn.danger { background: #FFF1F2; color: var(--rose); border-color: transparent; }
.code-box b { font-size: clamp(17px, 5.4vw, 24px); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---------- module cards ---------- */
button.book { border: 0; background: none; padding: 0; text-align: left; color: inherit; }
.book.skel { height: 300px; border-radius: 18px; background: linear-gradient(90deg, var(--line), var(--surface), var(--line)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- module page ---------- */
.back-link { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 6px 0; color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.back-link svg { width: 18px; height: 18px; }
.mod-hero { position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px 20px; color: #fff; margin-top: 6px; box-shadow: var(--shadow-3); isolation: isolate;
  background: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.3px) 0 0/14px 14px, radial-gradient(120% 90% at 100% 0%, var(--c2) 0%, var(--c1) 70%); }
.mod-hero > *:not(.mod-art) { position: relative; z-index: 1; }
.mod-art { position: absolute; right: -18px; top: -14px; width: 168px; height: 168px; opacity: .3; z-index: 0; }
.mod-art svg { width: 100%; height: 100%; }
.mod-hero h2 { max-width: calc(100% - 70px); }
.mod-hero small { font-size: 12px; font-weight: 700; opacity: .8; letter-spacing: .02em; }
.mod-hero h2 { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 6px 0 8px; }
.mod-hero p { margin: 0 0 14px; font-size: 14.5px; opacity: .9; max-width: 40ch; }
.mod-hero .mod-start { flex: 1; background: #fff; color: var(--brand); }
.bab-no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--bg); font-weight: 800; font-size: 13px; color: var(--ink-2); }

/* ---------- reader ---------- */
.reader-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reader { font-size: 16.5px; line-height: 1.7; color: var(--ink); }
.reader h1 { font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 8px 0 16px; text-wrap: balance; }
.reader h2 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; margin: 26px 0 8px; text-wrap: balance; }
.reader h3 { font-size: 16.5px; font-weight: 700; margin: 18px 0 6px; }
.reader p { margin: 0 0 12px; }
.reader ul, .reader ol { padding-left: 22px; margin: 0 0 14px; }
.reader li { margin: 4px 0; }
.reader sup.cite a { font-size: 11px; font-weight: 800; color: var(--accent-ink); text-decoration: none; padding: 0 2px; }
.reader .box { border-radius: 16px; padding: 13px 15px; margin: 14px 0; font-size: 15px; line-height: 1.55; }
.reader .box.tip { background: var(--accent-soft); color: var(--ink); }
.reader .box.warn { background: var(--amber-soft); }
.reader .box.try { background: var(--surface); border: 1px solid var(--line); }
.reader .box.try b { color: var(--accent-ink); margin-right: 4px; }
.reader blockquote.dalil { margin: 14px 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.reader .table-wrap { overflow-x: auto; margin: 14px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.reader table { width: 100%; border-collapse: collapse; font-size: 14px; }
.reader th { text-align: left; background: var(--bg); font-weight: 700; }
.reader th, .reader td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.reader hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.reader .refs { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.reader .refs h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.reader .refs ol { padding-left: 20px; }
.reader .refs li { word-break: break-word; margin: 6px 0; }
.reader .refs li:target { background: var(--amber-soft); border-radius: 6px; }
.reader-nav { display: flex; justify-content: space-between; gap: 10px; margin: 26px 0 8px; }
.reader-nav .btn { flex: 1; }

/* quiz, checklist, tools */
.quiz { margin: 18px 0; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.quiz-k, .tool-k { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.quiz-q { font-weight: 700; margin: 6px 0 10px !important; }
.quiz-o { display: block; width: 100%; text-align: left; margin: 6px 0; padding: 11px 14px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--bg); font-size: 15px; transition: all .2s; }
.quiz-o.right { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.quiz-o.wrong { border-color: var(--rose); background: #FFF1F2; color: var(--rose); }
.quiz-o:disabled { cursor: default; }
.quiz-why { margin: 10px 0 0 !important; font-size: 14px; color: var(--ink-2); animation: enter .3s var(--ease) both; }
.keylist { list-style: none; padding: 14px 16px !important; margin: 14px 0; background: var(--surface); border-radius: 14px; display: grid; gap: 8px; }
.keylist li { margin: 0 !important; position: relative; padding-left: 18px; }
.keylist li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tool { margin: 18px 0; padding: 16px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--accent-soft); box-shadow: var(--shadow-2); display: grid; gap: 10px; }
.tool p { margin: 0 !important; font-size: 14.5px; color: var(--ink-2); }
.av-pick { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 2px; scroll-behavior: smooth; -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 24px), transparent); }
.av-pick::-webkit-scrollbar { display: none; }
.av-pick button { flex: none; width: 64px; display: grid; justify-items: center; gap: 5px; padding: 4px 0 6px; border: 0; background: none; color: var(--ink-2); font: 600 11.5px/1.2 var(--font); cursor: pointer; }
.av-pick button .av { width: 48px; height: 48px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); transition: box-shadow .15s, transform .15s; }
.av-pick button span { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-pick button[aria-checked="true"] { color: var(--ink); font-weight: 800; }
.av-pick button[aria-checked="true"] .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--accent); transform: scale(1.06); }
.tool-go { justify-content: space-between; gap: 10px; text-align: left; }
.tool-go svg { width: 18px; height: 18px; flex: none; }
.wali-list { display: grid; gap: 6px; }
.wali-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.wali-row small { grid-column: 2 / -1; font-size: 11.5px; color: var(--ink-3); }
.wali-row span { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.wali-row.now span { background: var(--accent); color: #fff; }
.wali-row.next span { background: var(--amber-soft); color: #92400E; }
.wali-row.no { opacity: .65; } .wali-row.no span { background: var(--line); color: var(--ink-2); }
.wasiat-out { display: grid; gap: 6px; }
.wo { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.wo b { font-variant-numeric: tabular-nums; }
.wo.hi { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
