:root {
  --bg: #faf7f2; --surface: #fff; --band: #f2ede5; --line: #e0d9cd; --line-strong: #c3b9a8;
  --text: #1b1a17; --muted: #5a564e; --faint: #8a857a;
  --accent: #1f5e52; --accent-dark: #17483f; --accent-soft: #d8e6e1;
  --green: #2e6b4f; --blue: #2b5477; --amber: #8a6118; --red: #9b3024;
  --serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --script: 'Noto Sans Bengali', 'Noto Naskh Arabic', 'Nirmala UI', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0; }
h1 { font-size: 36px; } h2 { font-size: 24px; } h3 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 14px; }
.serif { font-family: var(--serif); }
.script { font-family: var(--script); }
.eyebrow { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); }
.band { background: var(--band); border-bottom: 1px solid var(--line); padding: 8px 24px; text-align: center; font-size: 14px; color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.hidden { display: none !important; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand span { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.nav a { padding: 10px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.avatar-btn { margin-left: 8px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; text-decoration: none; }
.nav a.avatar-btn, .nav a.avatar-btn:hover { color: #fff; padding: 0; min-height: 0; justify-content: center; }
.badge { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--red); color: #fff; font-size: 13px; font-weight: 600; align-items: center; justify-content: center; }

main.page { padding-top: 28px; padding-bottom: 64px; }

/* cards & buttons */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.card.tight { padding: 16px 20px; }
.note { background: var(--band); border-radius: 8px; padding: 14px 18px; font-size: 15px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.danger { color: var(--red); border-color: #d9b3ad; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 15px; }
.btn.big { min-height: 52px; font-size: 18px; padding: 0 26px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { min-height: 44px; padding: 0 18px; border: 0; background: transparent; font: inherit; cursor: pointer; color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 600; }

/* forms */
label { font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .hint { font-size: 14px; color: var(--faint); font-weight: 400; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea {
  min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; color: var(--text); background: #fff; width: 100%;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 400; min-height: 44px; }
.check input { width: 20px; height: 20px; }
.error { color: var(--red); font-size: 15px; }
.ok { color: var(--green); font-size: 15px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin: 0; }
legend { padding: 0 6px; font-family: var(--serif); font-size: 19px; }

/* layout helpers */
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .main { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split > .side { flex: 1 1 300px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat .num { font-family: var(--serif); font-size: 34px; line-height: 1.1; }

/* person bits */
.ph { border-radius: 50%; background: var(--band); object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--serif); overflow: hidden; }
.ph.sq { border-radius: 12px; }
.pchip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--text); }
.pchip:hover { border-color: var(--accent); color: var(--text); }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.status.verified { color: var(--green); } .status.pending { color: var(--blue); } .status.claimed { color: var(--amber); } .status.disputed { color: var(--red); }
.tag { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 999px; background: var(--band); color: var(--muted); }
.private { color: var(--faint); font-style: italic; }
dl.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; font-size: 15px; }
dl.facts dt { color: var(--faint); } dl.facts dd { margin: 2px 0 0; }

/* profile */
.profile-head { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.profile-head .ph { width: 180px; height: 180px; font-size: 56px; }
.longbio p + p { margin-top: 12px; }
.longbio.clamped { max-height: 9.6em; overflow: hidden; position: relative; }
.longbio.clamped::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(transparent, #fff); }
.rel-group h3 { font-family: var(--sans); font-size: 14px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
audio, video { width: 100%; max-width: 560px; border-radius: 8px; background: #000; }
audio { background: transparent; }

/* tree */
.tree-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px 16px; overflow: auto; position: relative; }
.tree-inner { position: relative; min-width: max-content; margin: 0 auto; }
.tree-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.gen-row { display: flex; gap: 18px; justify-content: center; padding: 26px 8px; position: relative; z-index: 1; }
.tcard { width: 168px; text-align: left; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; color: var(--text); cursor: pointer; display: flex; gap: 8px; align-items: center; line-height: 1.25; }
.tcard:hover { border-color: var(--accent); }
.tcard.sel { border: 2px solid var(--accent); background: var(--accent-soft); padding: 7px; }
.tcard.me { border: 3px solid var(--accent); padding: 6px; }
.tcard.center { box-shadow: 0 0 0 4px var(--accent-soft); }
.tcard.priv { background: var(--band); color: var(--faint); font-style: italic; }
.tcard .ph { width: 40px; height: 40px; font-size: 15px; }
.tcard .nm { font-family: var(--serif); font-size: 15px; display: block; }
.tcard .dt { font-size: 12.5px; color: var(--muted); display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 26px; font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; gap: 8px; align-items: center; }
.ln { width: 28px; border-top: 2px solid var(--muted); display: inline-block; }
.ln.dash { border-top-style: dashed; } .ln.dot { border-top-style: dotted; }
.ln.dbl { width: 16px; height: 5px; border-top: 2px solid var(--muted); border-bottom: 2px solid var(--muted); }

/* tables (admin) */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--faint); font-weight: 500; font-size: 14px; }
td select, td input { min-height: 38px; padding: 4px 8px; }
.scroll-x { overflow-x: auto; }

/* privacy grid */
.priv-grid { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(200px, 270px); gap: 10px 16px; align-items: center; }
.priv-grid .lab small { display: block; color: var(--faint); font-weight: 400; font-size: 13.5px; }

/* landing */
.hero { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding: 48px 0 32px; }
.hero h1 { font-size: 52px; line-height: 1.15; margin-top: 16px; }
.hero .lead { margin-top: 24px; max-width: 34em; font-size: 19px; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 8px; z-index: 50; max-width: 90vw; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (max-width: 640px) { h1 { font-size: 30px; } .hero h1 { font-size: 38px; } .profile-head .ph { width: 120px; height: 120px; } }
