/* ------------------------------------------------------------------ */
/* Dasar                                                               */
/* ------------------------------------------------------------------ */

:root {
  --bg: #f6f2e9;
  --bg-2: #efe8d9;
  --card: #fffdf8;
  --ink: #1f2a25;
  --ink-2: #5d6a62;
  --ink-3: #8a948c;
  --line: #e3dbc9;
  --line-2: #efe9da;
  --green: #15573d;
  --green-2: #1d704e;
  --green-soft: #e6efe7;
  --gold: #a97c2f;
  --gold-soft: #f1e6cf;
  --rose: #a4576b;
  --bahaya: #9b3a2f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 16px;
  --shadow: 0 1px 2px rgba(31, 42, 37, 0.05), 0 10px 30px rgba(31, 42, 37, 0.055);
  --atas-h: 56px;
  --bawah-h: 62px;
  --iklan-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 85% -8%, rgba(21, 87, 61, 0.075), transparent 62%),
    radial-gradient(820px 480px at -12% 18%, rgba(169, 124, 47, 0.07), transparent 58%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ada-iklan {
  --iklan-h: 50px;
}

body.ada-iklan-banner {
  --iklan-h: clamp(60px, 16.666vw, 116px);
}

body.terkunci {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  font-family: inherit;
  color: inherit;
}

a {
  color: var(--green);
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--atas-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(246, 242, 233, 0.9);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(227, 219, 201, 0.85);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #f4ead4;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(150deg, #1e6f4e, #11432f);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-mark.besar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  margin: 0 auto 14px;
}

.brand-mark.besar svg {
  width: 30px;
  height: 30px;
}

.brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.16;
}

.brand-text strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.004em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  font-size: 10.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.topbar-cari {
  margin-left: auto;
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  border: 1px solid transparent;
}

.topbar-cari:hover {
  background: var(--green-soft);
  color: var(--green);
}

.topbar-cari svg {
  width: 21px;
  height: 21px;
}

/* ------------------------------------------------------------------ */
/* Navigasi bawah                                                      */
/* ------------------------------------------------------------------ */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: calc(var(--bawah-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid var(--line);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding-top: 4px;
  text-decoration: none;
  color: #7b867e;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
}

.tab-ikon {
  width: 38px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.tab-ikon svg {
  width: 21px;
  height: 21px;
}

.tab.aktif {
  color: var(--green);
}

.tab.aktif .tab-ikon {
  background: var(--green-soft);
}

.tab.aktif .tab-ikon svg {
  stroke-width: 2;
}

/* ------------------------------------------------------------------ */
/* Iklan                                                               */
/* ------------------------------------------------------------------ */

.iklan {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bawah-h) + env(safe-area-inset-bottom));
  z-index: 45;
  height: var(--iklan-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  background: #efe7d6;
  border-top: 1px solid #e2d7c1;
  font-size: 11.5px;
  color: #5f5747;
  overflow: hidden;
}

.iklan-putar {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.iklan-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.35s ease;
}

.iklan-slide.aktif {
  opacity: 1;
  pointer-events: auto;
}

.iklan-slide[href] {
  cursor: pointer;
}

.iklan-slide-teks {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5f5747;
  padding: 0 8px;
}

.iklan-slide-teks:hover {
  text-decoration: underline;
}

.iklan-aksi {
  display: flex;
  flex: none;
  gap: 4px;
  align-items: center;
}

.iklan-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #15573d;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.iklan-cta-wa {
  background: #1b8a5a;
}

.iklan-cta-web {
  background: #8a6a2f;
}

.iklan-cta:hover {
  filter: brightness(1.08);
}

.iklan--teks .iklan-slide {
  gap: 6px;
}

.iklan--teks .iklan-slide-teks {
  flex: 1;
}

.iklan--teks .iklan-aksi {
  position: static;
  margin-left: auto;
}

.iklan--teks .iklan-cta {
  height: 20px;
  padding: 0 7px;
  font-size: 8.5px;
}

.iklan--teks .iklan-dots {
  display: none;
}

.iklan--banner {
  display: block;
  padding: 0;
}

.iklan--banner .iklan-putar {
  position: absolute;
  inset: 0;
}

.iklan--banner .iklan-slide {
  display: block;
  background: #e9e0cf;
}

.iklan--banner .iklan-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iklan--banner .iklan-slide-teks {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 44px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #5f5747;
  white-space: normal;
  overflow: hidden;
}

.iklan--banner .iklan-aksi {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 3;
}

.iklan--banner .iklan-label {
  position: absolute;
  top: 6px;
  left: 8px;
  z-index: 3;
  background: rgba(31, 42, 37, 0.56);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

@media (min-width: 760px) {
  body.ada-iklan-banner {
    --iklan-h: 94px;
  }

  .iklan--banner .iklan-slide img {
    object-fit: contain;
  }
}

.iklan--banner .iklan-tutup {
  position: absolute;
  top: 4px;
  right: 6px;
  z-index: 4;
  color: #fff;
  background: rgba(31, 42, 37, 0.5);
}

.iklan-dots {
  position: absolute;
  bottom: 5px;
  left: 50%;
  z-index: 4;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}

.iklan-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.iklan-dot.aktif {
  width: 14px;
  border-radius: 3px;
  background: #fff;
}

.iklan-admin-daftar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.iklan-admin {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
}

.iklan-admin-kepala {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.iklan-admin-kepala strong {
  font-size: 13px;
  color: var(--ink);
}

.iklan-admin-gambar img {
  display: block;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 6 / 1;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe7d6;
  object-fit: cover;
}

.iklan-admin .field {
  margin-top: 8px;
}

.iklan-label {
  flex: none;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7a5c;
  border: 1px solid #c9b995;
  border-radius: 4px;
  padding: 2px 4px;
  line-height: 1;
}

.iklan-teks {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #5f5747;
  text-decoration: none;
}

.iklan-teks:hover {
  text-decoration: underline;
}

.iklan-tutup {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #8a7a5c;
  font-size: 12px;
  cursor: pointer;
}

.iklan-tutup:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* ------------------------------------------------------------------ */
/* Kerangka halaman                                                    */
/* ------------------------------------------------------------------ */

.utama {
  padding-bottom: calc(var(--bawah-h) + var(--iklan-h) + env(safe-area-inset-bottom) + 18px);
}

.utama--pohon {
  padding-bottom: 0;
  height: calc(100vh - var(--atas-h) - var(--bawah-h) - var(--iklan-h) - env(safe-area-inset-bottom));
  height: calc(100dvh - var(--atas-h) - var(--bawah-h) - var(--iklan-h) - env(safe-area-inset-bottom));
  overflow: hidden;
}

.halaman {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 8px;
  animation: muncul 0.28s ease both;
}

@keyframes muncul {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.kepala-halaman {
  margin: 4px 0 16px;
}

.kepala-halaman h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 7vw, 32px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.kepala-halaman p {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 46ch;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 6px;
}

.eyebrow-doa {
  text-transform: none;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.kembali {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  margin-left: -6px;
  padding: 0 8px 0 4px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
}

.kembali svg {
  width: 17px;
  height: 17px;
}

.kembali:hover {
  color: var(--green);
  background: var(--green-soft);
}

.chev {
  flex: none;
  display: grid;
  place-items: center;
  color: #b3aa97;
}

.chev svg {
  width: 16px;
  height: 16px;
}

/* ------------------------------------------------------------------ */
/* Avatar                                                              */
/* ------------------------------------------------------------------ */

.ava {
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-2);
  color: var(--ink-2);
  font-weight: 700;
  letter-spacing: 0.02em;
  overflow: hidden;
}

.ava-huruf {
  font-family: var(--sans);
}

.ava-xl {
  width: 88px;
  height: 88px;
  font-size: 28px;
  border-radius: 26px;
}

.ava-lg {
  width: 56px;
  height: 56px;
  font-size: 19px;
}

.ava-md {
  width: 44px;
  height: 44px;
  font-size: 15px;
}

.ava-sm {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.ava-xs {
  width: 26px;
  height: 26px;
  font-size: 9.5px;
}

.ava-xxs {
  width: 20px;
  height: 20px;
  font-size: 8px;
}

/* ------------------------------------------------------------------ */
/* Tombol                                                              */
/* ------------------------------------------------------------------ */

.tombol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--green);
  color: #fdfbf5;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.1s ease;
}

.tombol:hover {
  background: var(--green-2);
}

.tombol:active {
  transform: translateY(1px);
}

.tombol.lebar,
.lebar {
  width: 100%;
}

.tombol-lembut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.tombol-lembut:hover {
  border-color: #cfc4ab;
  background: #fffefa;
}

.tombol-lembut svg {
  width: 17px;
  height: 17px;
}

.tombol-lembut.kecil {
  min-height: 38px;
  padding: 0 12px;
  font-size: 12.5px;
}

.tombol-bahaya-lembut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #e6c9c3;
  border-radius: 12px;
  background: #fdf4f2;
  color: var(--bahaya);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.tombol-bahaya-lembut:hover {
  background: #fbeae6;
}

.tautan {
  background: none;
  border: 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px;
}

.tautan-hapus {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--bahaya);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.tombol-baris {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ------------------------------------------------------------------ */
/* Pohon                                                               */
/* ------------------------------------------------------------------ */

.pohon {
  position: relative;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background-color: #f4efe3;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(122, 108, 82, 0.18) 1px, transparent 0),
    radial-gradient(700px 400px at 50% 0%, rgba(255, 253, 247, 0.9), transparent 70%);
  background-size: 22px 22px, 100% 100%;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.pohon:active {
  cursor: grabbing;
}

.pohon::before,
.pohon::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  z-index: 2;
  pointer-events: none;
}

.pohon::before {
  left: 0;
  background: linear-gradient(90deg, #f4efe3 8%, rgba(244, 239, 227, 0));
}

.pohon::after {
  right: 0;
  background: linear-gradient(270deg, #f4efe3 8%, rgba(244, 239, 227, 0));
}

.pohon-kanvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.pohon-garis {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: visible;
}

.garis-darah {
  fill: none;
  stroke: #c7b99c;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.garis-pasangan {
  stroke: #b98f52;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.tnode {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  background: var(--card);
  border: 1.5px solid #ded5c1;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(31, 42, 37, 0.05);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.tnode[data-peran="darah"] {
  border-color: #b9d2c1;
  border-left: 4px solid #2f7253;
}

.tnode[data-peran="mantu"] {
  border-color: #e6c6ce;
  border-left: 4px solid #a4576b;
}

.tnode:hover {
  box-shadow: 0 4px 14px rgba(31, 42, 37, 0.1);
}

.tnode.fokus {
  box-shadow: 0 0 0 2px rgba(21, 87, 61, 0.28), 0 6px 18px rgba(21, 87, 61, 0.14);
}

.tnode-wafat {
  background: #fbf8f0;
}

.tnode-ghost {
  border-top-style: dashed;
  border-right-style: dashed;
  border-bottom-style: dashed;
}

.tnode-ava {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
}

.tnode-ava-huruf {
  background: var(--bg-2);
  color: var(--ink-2);
}

.tnode-isi {
  min-width: 0;
  padding-right: 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tnode-anak {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 15px;
  padding: 0 4px;
  border: 1px solid #e6d7b5;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.tnode-nama {
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.18;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.tnode-tahun {
  font-size: 9.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gen-label-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.gen-label-layer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38px;
  z-index: 0;
  background: linear-gradient(
    90deg,
    #f4efe3 0%,
    #f4efe3 74%,
    rgba(244, 239, 227, 0) 100%
  );
  pointer-events: none;
}

.gen-label {
  position: absolute;
  left: 8px;
  z-index: 1;
  transform: translateY(-50%);
  padding: 2px 5px;
  border: 1px solid #ddd2bb;
  border-left: 2px solid #c9b995;
  border-radius: 4px;
  background: rgba(250, 247, 239, 0.94);
  box-shadow: 0 1px 2px rgba(31, 42, 37, 0.05);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #9d8d70;
  pointer-events: none;
  white-space: nowrap;
}

.pohon-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(31, 42, 37, 0.82);
  color: #f7f3e8;
  font-size: 10.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.pohon-hint.sembunyi {
  opacity: 0;
  transform: translate(-50%, -8px);
}

.pohon-ctrl {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pohon-ctrl button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink-2);
  font-size: 19px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(31, 42, 37, 0.08);
}

.pohon-ctrl button:hover {
  color: var(--green);
  border-color: #c8bda3;
}

.pohon-legenda {
  position: absolute;
  left: 10px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
  font-size: 9px;
  color: var(--ink-2);
  pointer-events: none;
}

.legenda-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.garis-legenda {
  width: 13px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.garis-keturunan {
  background: #2f7253;
}

.garis-mantu {
  background: #a4576b;
}

.titik {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.titik-l {
  background: #2f7253;
}

.titik-p {
  background: #a4576b;
}

/* ------------------------------------------------------------------ */
/* Segmented control                                                   */
/* ------------------------------------------------------------------ */

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 14px;
  background: #ece5d5;
  margin-bottom: 16px;
}

.seg-tiga {
  grid-template-columns: repeat(3, 1fr);
}

.seg button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6f7a72;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg button.aktif {
  background: var(--card);
  color: var(--green);
  box-shadow: 0 1px 3px rgba(31, 42, 37, 0.1);
}

.seg-kecil {
  margin-bottom: 0;
  grid-template-columns: 1fr 1fr;
  background: #f1ebdd;
}

.seg-kecil button {
  min-height: 38px;
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ */
/* Pencarian                                                           */
/* ------------------------------------------------------------------ */

.kolom-cari {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 6px 0 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kolom-cari:focus-within {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(29, 112, 78, 0.12);
}

.kolom-cari svg {
  flex: none;
  width: 19px;
  height: 19px;
  color: var(--ink-3);
}

.kolom-cari input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.kolom-cari input::placeholder {
  color: #a3aa9f;
}

.kolom-cari.kecil {
  height: 44px;
  margin-bottom: 8px;
}

.kolom-bersih {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f0eadb;
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}

.jumlah-hasil {
  font-size: 11.5px;
  color: var(--ink-3);
  margin: 10px 2px 8px;
}

.daftar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.baris {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: left;
  font: inherit;
}

.baris:last-child {
  border-bottom: 0;
}

a.baris:hover,
button.baris:hover {
  background: #fbf7ee;
}

button.baris {
  border-left: 0;
  border-right: 0;
  border-top: 0;
  cursor: pointer;
}

.baris-isi {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.baris-nama {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.baris-nama em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}

.baris-meta {
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.baris-diam {
  background: var(--card);
}

.kosong-kecil {
  padding: 14px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.petunjuk {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------------ */
/* Hubungan                                                            */
/* ------------------------------------------------------------------ */

.pilih-dua {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pilih-orang {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  min-height: 66px;
}

.pilih-orang:hover {
  border-color: #cbbfa5;
  border-left-color: var(--gold);
}

.pilih-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.pilih-nama {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

.pilih-nama.redup {
  color: var(--ink-3);
  font-weight: 500;
}

.pilih-meta {
  font-size: 11px;
  color: var(--ink-3);
}

.tukar {
  align-self: center;
  width: 38px;
  height: 38px;
  margin: -4px 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  z-index: 1;
}

.tukar:hover {
  color: var(--green);
  border-color: #c8bda3;
}

.hint-hubungan {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed #d8cdb5;
  border-radius: 14px;
  text-align: center;
  color: var(--ink-2);
  font-size: 12.5px;
}

.hint-hubungan .redup {
  color: var(--ink-3);
  margin-top: 4px;
}

.hasil-hubungan {
  margin-top: 18px;
  padding: 22px 18px 18px;
  border: 1px solid #d9e3d9;
  border-radius: 18px;
  background:
    radial-gradient(120% 120% at 50% -20%, #ffffff, transparent 60%),
    linear-gradient(170deg, #f0f6f0, #e9f1e9);
  text-align: center;
  animation: muncul 0.3s ease both;
}

.hasil-kosong {
  border-color: var(--line);
  background: var(--card);
}

.hubungan-eyebrow {
  font-size: 12.5px;
  color: var(--ink-2);
}

.hubungan-label {
  font-family: var(--serif);
  font-size: clamp(28px, 8vw, 38px);
  line-height: 1.1;
  font-weight: 600;
  color: var(--green);
  margin: 2px 0 2px;
  text-transform: capitalize;
  letter-spacing: -0.01em;
}

.hubungan-dari {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.hubungan-detail {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 36ch;
  margin: 0 auto;
}

.hubungan-aksi {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.rantai {
  list-style: none;
  margin: 20px auto 0;
  padding: 6px 0 0;
  max-width: 340px;
  text-align: left;
}

.rantai li {
  display: flex;
  gap: 10px;
  position: relative;
  padding-bottom: 6px;
}

.rantai-rail {
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: -2px;
  width: 1.5px;
  background: #d5ddcf;
}

.rantai li:last-child .rantai-rail {
  display: none;
}

.rantai-isi {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.rantai-isi:hover {
  background: rgba(255, 255, 255, 0.7);
}

.rantai-teks {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.rantai-teks strong {
  font-size: 13.5px;
  font-weight: 650;
}

.rantai-teks small {
  font-size: 10.5px;
  color: var(--ink-3);
}

/* Bagan segitiga: leluhur bersama di puncak, dua jalur keturunan ke bawah */
.segitiga {
  position: relative;
  width: min(100%, 380px);
  height: var(--tg);
  margin: 18px auto 0;
}

.segitiga-garis {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.segitiga-garis path {
  fill: none;
  stroke: #aec3ac;
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.seg-node {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 33%;
  min-height: 58px;
  padding: 6px 7px;
  border: 1px solid #cfdccf;
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 2px 7px rgba(21, 87, 61, 0.08);
  color: inherit;
  text-decoration: none;
  text-align: left;
  transform: translateX(-50%);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.seg-node:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 16px rgba(21, 87, 61, 0.14);
}

.seg-node:focus-visible {
  outline: 2px solid var(--green-2);
  outline-offset: 2px;
}

.seg-apex {
  width: 44%;
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(21, 87, 61, 0.2);
}

.seg-apex .ava {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.seg-apex .seg-teks small {
  color: #e8c98d;
  font-size: 7px;
}

.seg-kaki {
  border: 2px solid var(--gold);
  background: #fffaf0;
}

.seg-teks {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.seg-teks strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 10.3px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.seg-teks small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--gold);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 380px) {
  .seg-teks strong {
    font-size: 10px;
  }

  .seg-teks small {
    font-size: 6.2px;
  }
}

/* ------------------------------------------------------------------ */
/* Doa                                                                 */
/* ------------------------------------------------------------------ */

.daftar-doa {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doa-kartu {
  position: relative;
  display: block;
  padding: 18px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 253, 248, 0.98), rgba(246, 239, 223, 0.96));
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.doa-kartu:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(31, 42, 37, 0.06), 0 16px 34px rgba(31, 42, 37, 0.08);
}

.doa-arsir {
  position: absolute;
  right: -34px;
  top: -52px;
  width: 150px;
  height: 170px;
  border-radius: 50% 50% 46% 46%;
  border: 1px solid rgba(169, 124, 47, 0.3);
  pointer-events: none;
}

.doa-arsir::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: inherit;
  border: 1px solid rgba(169, 124, 47, 0.18);
}

.doa-eyebrow {
  position: relative;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.doa-kartu h2 {
  position: relative;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  margin: 4px 0 6px;
  color: var(--ink);
  max-width: 85%;
}

.doa-kartu p {
  position: relative;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doa-kaki {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(169, 124, 47, 0.18);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #857254;
}

.doa-kepala {
  padding: 2px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.doa-kepala h1 {
  font-family: var(--serif);
  font-size: clamp(25px, 7vw, 32px);
  font-weight: 600;
  line-height: 1.16;
  margin: 2px 0 4px;
}

.doa-jumlah {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.doa-aksi {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Daftar doa tunggal */

.halaman-doa .kepala-halaman {
  margin-bottom: 18px;
}

.halaman-doa .kepala-halaman h1 {
  font-size: clamp(25px, 7.2vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.018em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.kotak-doa {
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(120% 100% at 50% -20%, #fffefb, transparent 62%),
    linear-gradient(165deg, #fdfaf2, #f8f1e2);
  box-shadow: var(--shadow);
}

.kotak-doa-judul {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.pilih-doa {
  margin: 14px 0 10px;
}

.ceklis-cetak {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0 0 16px;
}

.ceklis-cetak label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.ceklis-cetak input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
}

.pilih-doa select {
  width: 100%;
}

.doa-fokus {
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
}

.daftar-doa-nama {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doa-baris {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px dotted #e0d5bf;
}

.doa-baris:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.doa-nomor {
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.doa-nama {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.doa-nama:hover {
  color: var(--green);
}

.doa-kosong {
  padding: 22px 6px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12.5px;
}

.doa-teks {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.72;
  color: #3c463f;
  white-space: pre-line;
  padding: 16px 16px 16px 18px;
  border-left: 3px solid var(--gold);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(90deg, #fbf5e9, rgba(251, 245, 233, 0.35));
  margin-bottom: 18px;
}

.daftar-nasab {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nasab-kartu {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(31, 42, 37, 0.04);
}

.nasab-kartu:hover {
  border-color: #cfc4ab;
}

.nasab-atas {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nasab-identitas {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.nasab-identitas strong {
  font-size: 14px;
  font-weight: 650;
}

.nasab-identitas small {
  font-size: 11px;
  color: var(--ink-3);
}

.nasab-baris {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dotted #e2d8c4;
  font-family: var(--serif);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.catatan-kecil {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
  margin-top: 10px;
}

.catatan-kecil code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  background: #efe8d8;
  padding: 1px 4px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* Profil                                                              */
/* ------------------------------------------------------------------ */

.halaman-profil {
  padding-top: 8px;
}

.profil-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.profil-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 26px 18px 20px;
  border-radius: 24px;
  color: #f8f2e4;
  background:
    radial-gradient(120% 100% at 50% -20%, rgba(72, 156, 118, 0.55), transparent 60%),
    linear-gradient(165deg, #1a6446, #103f2c 75%);
  box-shadow: 0 14px 36px rgba(16, 63, 44, 0.18);
}

.profil-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.12) 1px, transparent 0);
  background-size: 18px 18px;
  opacity: 0.5;
  pointer-events: none;
}

.profil-ava {
  position: relative;
  display: inline-block;
  margin-bottom: 12px;
}

.profil-ava .ava {
  border: 3px solid rgba(244, 234, 212, 0.55);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.profil-hero h1 {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(24px, 6.6vw, 32px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

.profil-alias {
  position: relative;
  font-size: 12px;
  color: rgba(248, 242, 228, 0.68);
  margin-top: 3px;
  font-style: italic;
}

.profil-hidup {
  position: relative;
  font-size: 12.5px;
  color: rgba(248, 242, 228, 0.82);
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

.chip-baris {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 253, 246, 0.92);
  font-size: 10.5px;
  font-weight: 600;
}

.profil-aksi {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.profil-hero .tombol {
  background: #f4ead4;
  color: #14432f;
  min-height: 42px;
  font-size: 13px;
}

.profil-hero .tombol:hover {
  background: #fff8e8;
}

.profil-hero .tombol-lembut {
  min-height: 42px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8f2e4;
}

.profil-hero .tombol-lembut:hover {
  background: rgba(255, 255, 255, 0.14);
}

.profil-admin {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.bagian {
  margin-top: 20px;
}

.bagian-judul {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 4px 7px;
}

.bagian-kartu {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(31, 42, 37, 0.035);
}

.bagian-kartu > .baris:last-child {
  border-bottom: 0;
}

.nasab-profil {
  padding: 14px 16px;
}

.nasab-profil p {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
  color: #3d473f;
}

.catatan {
  padding: 15px 16px;
}

.catatan p {
  white-space: pre-line;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ */
/* Admin                                                               */
/* ------------------------------------------------------------------ */

.halaman-admin {
  padding-top: 14px;
}

.admin-kepala {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-kepala h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
}

.statistik {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.statistik > div {
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: center;
}

.statistik strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  color: var(--green);
}

.statistik span {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.aksi-cepat {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 9px;
  margin-bottom: 16px;
}

.aksi-kartu {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}

.aksi-kartu.utama {
  background: var(--green);
  border-color: var(--green);
  color: #fbf8ef;
}

.aksi-plus {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
}

.aksi-plus svg {
  width: 15px;
  height: 15px;
}

.aksi-kartu.utama .aksi-plus {
  background: rgba(255, 255, 255, 0.16);
  color: #fbf8ef;
}

.kartu {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 15px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(31, 42, 37, 0.035);
}

.kartu-kepala {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.kartu-kepala h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.kartu-hitung {
  font-size: 11px;
  color: var(--ink-3);
}

.banner-contoh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border: 1px solid #e6d6b3;
  border-radius: 13px;
  background: #fbf3e2;
}

.banner-contoh p {
  flex: 1;
  min-width: 170px;
  font-size: 11.5px;
  line-height: 1.45;
  color: #6b5836;
}

.banner-contoh strong {
  color: #57451f;
}

.banner-contoh button {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d9c39a;
  border-radius: 9px;
  background: #fffaf0;
  color: #7a5a22;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.banner-contoh button:hover {
  background: #fff4dd;
}

.hapus-bulat {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fbf7ee;
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
}

.hapus-bulat:hover {
  background: #f7e9e5;
  color: var(--bahaya);
  border-color: #e6c9c3;
}

.kartu .daftar {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0 -4px;
}

.kartu .baris {
  padding-left: 4px;
  padding-right: 4px;
}

.form {
  display: flex;
  flex-direction: column;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  min-width: 0;
}

.field > span {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

.field > span b {
  color: var(--bahaya);
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefb;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  line-height: 1.55;
  min-height: 96px;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(29, 112, 78, 0.1);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a8aea4;
}

.field-group {
  margin: 4px 0 16px;
  padding: 13px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: #fcf9f2;
}

.field-group-judul {
  margin: 18px 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.field-group .field-group-judul {
  margin-top: 0;
}

.field-group .field:last-child {
  margin-bottom: 0;
}

.dua-kolom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.switch input {
  width: 20px;
  height: 20px;
  min-height: 0;
  accent-color: var(--green);
}

.pilih-baris {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffefb;
  text-align: left;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}

.pilih-baris:hover {
  border-color: #cbbfa5;
}

.pilih-baris .redup {
  color: var(--ink-3);
  font-weight: 500;
}

.pilih-baris .chev {
  margin-left: auto;
}

.slot-pasangan {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.chip-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 5px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 12px;
  font-weight: 600;
}

.chip-edit button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #f1eadb;
  color: var(--ink-2);
  font-size: 10px;
  cursor: pointer;
}

.chip-tambah {
  min-height: 34px;
  padding: 0 12px;
  border: 1px dashed #c9bda3;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip-tambah:hover {
  color: var(--green);
  border-color: var(--green);
}

.foto-field {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.foto-pratinjau {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-2);
  display: grid;
  place-items: center;
}

.foto-pratinjau img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foto-aksi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.simpan-bar {
  position: sticky;
  bottom: calc(var(--bawah-h) + var(--iklan-h) + env(safe-area-inset-bottom) + 8px);
  z-index: 10;
  margin-top: 8px;
  padding: 8px 0;
  background: linear-gradient(to bottom, rgba(246, 242, 233, 0), rgba(246, 242, 233, 0.96) 38%);
}

.halaman-form .tombol-bahaya-lembut.lebar {
  margin-top: 10px;
}

.footer-situs {
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  padding: 18px 8px 6px;
}

.kaki-publik {
  max-width: 720px;
  margin: 22px auto 0;
  padding: 0 16px 8px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ */
/* Login                                                               */
/* ------------------------------------------------------------------ */

.login {
  min-height: calc(100vh - var(--atas-h) - var(--bawah-h) - var(--iklan-h));
  min-height: calc(100dvh - var(--atas-h) - var(--bawah-h) - var(--iklan-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 40px;
}

.login-kartu {
  width: 100%;
  max-width: 380px;
  padding: 26px 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-kartu h1 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 6px;
}

.login-kartu > p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 18px;
}

.login-kartu .field {
  text-align: left;
  margin-bottom: 14px;
}

/* ------------------------------------------------------------------ */
/* Lembar pilih orang                                                  */
/* ------------------------------------------------------------------ */

.lembar-latar {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(18, 28, 23, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: pudar 0.18s ease both;
}

@keyframes pudar {
  from {
    opacity: 0;
  }
}

.lembar {
  width: 100%;
  max-width: 560px;
  max-height: 84vh;
  max-height: 84dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
  animation: naik 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  overflow: hidden;
}

@keyframes naik {
  from {
    transform: translateY(18px);
    opacity: 0.6;
  }
}

.lembar-grip {
  flex: none;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #d8cdb7;
  margin: 8px auto 0;
}

.lembar-kepala {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px 8px;
}

.lembar-kepala h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}

.ikon-tombol {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #ebe4d3;
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}

.lembar-cari {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 8px;
  padding: 0 12px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}

.lembar-cari svg {
  width: 18px;
  height: 18px;
  color: var(--ink-3);
}

.lembar-cari input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
}

.lembar-daftar {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line-2);
  padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
  background: var(--card);
}

/* ------------------------------------------------------------------ */
/* Kosong, toast, galat                                                */
/* ------------------------------------------------------------------ */

.kosong {
  text-align: center;
  padding: 46px 22px;
  border: 1px dashed #d8cdb5;
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.6);
  margin-top: 12px;
}

.kosong-ikon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
}

.kosong-ikon svg {
  width: 30px;
  height: 30px;
}

.kosong h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 6px;
}

.kosong p {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
  max-width: 34ch;
  margin: 0 auto 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bawah-h) + var(--iklan-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 200;
  transform: translate(-50%, 14px);
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 12px;
  background: #1c3a2c;
  color: #f8f3e6;
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.tampil {
  opacity: 1;
  transform: translate(-50%, 0);
}

.galat-muat {
  max-width: 420px;
  margin: 18vh auto;
  padding: 0 20px;
  text-align: center;
}

.galat-muat h1 {
  font-family: var(--serif);
  font-size: 26px;
  margin-bottom: 8px;
}

.galat-muat p {
  color: var(--ink-2);
  font-size: 13px;
  margin-bottom: 6px;
}

/* ------------------------------------------------------------------ */
/* Layar lebih besar                                                   */
/* ------------------------------------------------------------------ */

@media (min-width: 760px) {
  :root {
    --atas-h: 62px;
    --bawah-h: 64px;
  }

  body {
    font-size: 15px;
  }

  .topbar {
    padding: 0 24px;
  }

  .brand-text strong {
    font-size: 15.5px;
  }

  .halaman {
    padding: 28px 24px 12px;
  }

  .tabbar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 560px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 24px rgba(31, 42, 37, 0.06);
  }

  .iklan {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 560px;
    border: 1px solid #e2d7c1;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
  }

  .lembar-latar {
    align-items: center;
    padding: 24px;
  }

  .lembar {
    border-radius: 20px;
    max-height: 72vh;
    max-height: 72dvh;
  }

  .lembar-grip {
    display: none;
  }

  .lembar-kepala {
    padding-top: 16px;
  }
}

@media (max-width: 359px) {
  .brand-text small {
    display: none;
  }

  .statistik strong {
    font-size: 21px;
  }

  .aksi-cepat {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ */
/* Pohon ringkas                                                       */
/* ------------------------------------------------------------------ */

.pohon-ringkas {
  padding-top: 20px;
}

.pohon-ringkas .kepala-halaman {
  margin-bottom: 14px;
}

.pohon-ringkas .kepala-halaman h1 {
  font-size: clamp(22px, 5.8vw, 28px);
}

.mode-pohon {
  max-width: 260px;
  margin-bottom: 16px;
}

.ringkas-daftar {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ringkas-blok {
  min-width: 0;
}

.ringkas-baris {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}

.ringkas-daftar > .ringkas-blok > .ringkas-baris {
  margin-top: 0;
}

.ringkas-toggle,
.ringkas-titik {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 10px;
}

.ringkas-toggle {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.ringkas-toggle:hover {
  color: var(--green);
  border-color: #cbbf9f;
}

.ringkas-titik::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cdc2a8;
}

.ringkas-utama {
  flex: 1;
  min-width: 0;
}

.ringkas-kartu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(31, 42, 37, 0.04);
}

.ringkas-kartu:hover {
  border-color: #cfc3a8;
}

.ringkas-isi {
  flex: 1;
  min-width: 0;
  padding-right: 38px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ringkas-anak-ke {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 14px;
}

.ringkas-nama {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}

.ringkas-meta {
  font-size: 10.5px;
  color: var(--ink-3);
}

.ringkas-dari {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
}

.ringkas-pasangan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 5px 4px 0;
  font-size: 10.5px;
  color: var(--ink-3);
}

.ringkas-pasangan a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}

.ringkas-pisah {
  color: #b2a88f;
}

.ringkas-anak {
  margin-left: 13px;
  padding-left: 12px;
  border-left: 1.5px solid #ded3bd;
}

.ringkas-anak.sembunyi {
  display: none;
}

.ringkas-grup {
  margin: 8px 0 3px 2px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ringkas-blok-ghost .ringkas-kartu {
  border-style: dashed;
  border-color: #d5c6a6;
  background: #fffdf6;
}

.ringkas-anak .ringkas-kartu {
  background: #fffdf9;
}

.pohon-ringkas .tombol-lembut.lebar {
  margin-top: 18px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ------------------------------------------------------------------ */
/* Cetak                                                               */
/* ------------------------------------------------------------------ */

@media print {
  body {
    background: #fff !important;
    color: #111;
  }

  .topbar,
  .tabbar,
  .iklan,
  .toast,
  .kembali,
  .doa-aksi,
  .profil-aksi,
  .profil-admin,
  .pohon-ctrl,
  .pohon-hint,
  .pohon-legenda,
  .kaki-publik,
  .simpan-bar {
    display: none !important;
  }

  .utama {
    padding: 0 !important;
    height: auto !important;
  }

  .halaman {
    max-width: none;
    padding: 0;
    animation: none;
  }

  .doa-kepala {
    border-bottom: 1px solid #bbb;
    margin-bottom: 14px;
  }

  .doa-kepala h1 {
    font-size: 26pt;
  }

  .doa-teks {
    background: none;
    border-left: 2px solid #333;
    font-size: 11pt;
    break-inside: avoid;
  }

  .daftar-nasab {
    gap: 0;
  }

  .nasab-kartu {
    break-inside: avoid;
    border: 0;
    border-bottom: 1px solid #ccc;
    border-radius: 0;
    box-shadow: none;
    padding: 10px 0;
  }

  .nasab-kartu .chev,
  .nasab-kartu .ava {
    display: none;
  }

  .nasab-baris {
    border-top: 0;
    margin-top: 2px;
    padding-top: 0;
    font-size: 10.5pt;
  }

  a {
    color: #111;
    text-decoration: none;
  }
}
