/*
  Tema Islami / Family Soft
  Lapisan ini sengaja menjadi override agar struktur PHP lama tetap aman.
*/
:root{
  --forest:#0f4b37;
  --forest-2:#176046;
  --forest-3:#2f8f67;
  --sage:#eaf4ec;
  --sage-2:#dfeee2;
  --cream:#fffaf0;
  --cream-2:#fbf3e3;
  --paper:#fffdfa;
  --gold:#caa667;
  --gold-soft:#f4e6c6;
  --ink:#1c3027;
  --muted:#68766f;
  --rose:#b95648;
  --blue:#4b88c7;
  --violet:#9b72cc;
  --shadow:0 14px 34px rgba(31,47,39,.10);
  --shadow-soft:0 8px 22px rgba(31,47,39,.08);
}

*{scrollbar-width:none}
*::-webkit-scrollbar{display:none}

html,body{
  background:linear-gradient(180deg,#f4efe5 0%,#ece5d8 100%);
}

body{
  overflow:hidden;
}

.app-shell{
  max-width:460px;
  background:
    radial-gradient(circle at 90% 7%,rgba(206,227,202,.55),transparent 24%),
    radial-gradient(circle at 9% 92%,rgba(243,222,181,.26),transparent 24%),
    radial-gradient(circle at 22px 22px,rgba(202,166,103,.08) 1.5px,transparent 1.7px),
    linear-gradient(180deg,#fffdf8 0%,#fbf7ee 52%,#fffdf8 100%);
  background-size:auto,auto,44px 44px,auto;
  border-color:rgba(15,75,55,.08);
}

.app-shell::after{
  content:"✦";
  position:absolute;
  right:-28px;
  top:92px;
  font-size:112px;
  line-height:1;
  color:rgba(202,166,103,.055);
  transform:rotate(14deg);
  pointer-events:none;
  z-index:0;
}

@media(min-width:461px){
  .app-shell{
    height:calc(100dvh - 36px);
    margin:18px 0;
    border:1px solid rgba(15,75,55,.10);
    border-radius:28px;
    box-shadow:0 28px 76px rgba(31,47,39,.16);
  }
}

.topbar{
  height:66px;
  gap:9px;
  padding:10px 14px;
  background:rgba(255,252,246,.93);
  border-bottom:1px solid rgba(15,75,55,.08);
  box-shadow:0 8px 20px rgba(31,47,39,.045);
  backdrop-filter:blur(18px);
}

.line-btn{
  width:38px;
  height:38px;
  flex:0 0 38px;
  border-radius:14px;
  border-color:rgba(15,75,55,.12);
  box-shadow:0 7px 18px rgba(31,47,39,.07);
}

.line-btn svg{width:19px;height:19px}

.brand-mark{
  width:36px;
  height:36px;
  flex:0 0 36px;
  object-fit:contain;
  filter:drop-shadow(0 6px 12px rgba(15,75,55,.15));
}

.brand-lockup{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:2px;
}

.brand-kicker,
.eyebrow{
  display:block;
  color:#98773e;
  font-size:9px;
  line-height:1;
  font-weight:900;
  letter-spacing:.11em;
  text-transform:uppercase;
}

.brand-title{
  overflow:hidden;
  color:var(--forest);
  font-size:16px;
  line-height:1.08;
  font-weight:900;
  letter-spacing:-.025em;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.side-menu{
  left:14px;
  top:72px;
  width:230px;
  padding:8px;
  border:1px solid rgba(15,75,55,.11);
  border-radius:22px;
  background:rgba(255,253,249,.985);
  box-shadow:0 20px 48px rgba(31,47,39,.16);
}

.menu-intro{
  display:flex;
  align-items:center;
  gap:9px;
  padding:7px 7px 11px;
  margin-bottom:3px;
  border-bottom:1px solid rgba(15,75,55,.08);
}

.menu-intro img{width:34px;height:34px;border-radius:11px}
.menu-intro strong,.menu-intro span{display:block}
.menu-intro strong{color:var(--forest);font-size:12px;font-weight:900}
.menu-intro span{margin-top:3px;color:var(--muted);font-size:10px;font-weight:700}

.side-menu a{
  gap:10px;
  padding:11px 10px;
  border-radius:14px;
  color:var(--ink);
  font-size:12px;
  font-weight:800;
}

.side-menu a:hover,
.side-menu a:focus-visible{background:#edf6ef}

.content-scroll{
  inset:66px 0 38px 0;
  padding:14px 0 112px;
  overscroll-behavior:contain;
  scroll-behavior:smooth;
}

.tree-hint{
  position:sticky;
  left:14px;
  z-index:6;
  width:max-content;
  max-width:calc(100vw - 28px);
  margin:0 14px 16px;
  padding:8px 11px;
  border:1px solid rgba(15,75,55,.10);
  border-radius:999px;
  background:rgba(255,253,249,.88);
  box-shadow:0 6px 15px rgba(31,47,39,.055);
  color:#557067;
  font-size:10px;
  line-height:1.25;
  font-weight:800;
  backdrop-filter:blur(10px);
}

.tree-hint span{margin-right:4px;color:var(--gold);font-size:12px}

.tree-wrap{
  min-width:max-content;
  padding:0 30px 126px!important;
}

.tree{
  zoom:var(--zoom,.82);
  transform-origin:top center;
  padding-bottom:12px;
}

.family-unit{
  display:flex;
  flex-direction:column;
  align-items:center;
  position:relative;
}

.couple-row{gap:15px}

.marriage-line{
  width:28px!important;
  height:3px;
  flex:0 0 28px!important;
  border-radius:99px;
  background:linear-gradient(90deg,#b89453,#d6be8e);
  box-shadow:none;
}

.person-card{
  width:116px;
  min-height:152px;
  padding:10px 9px 12px;
  border:1px solid rgba(218,204,178,.82);
  border-radius:23px;
  background:rgba(255,255,255,.91);
  box-shadow:0 10px 24px rgba(31,47,39,.085);
}

.person-card:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(31,47,39,.12);
}

.person-card.is-dead{
  background:linear-gradient(180deg,#f4f4f3,#e7e7e4);
  border-color:#d0d0ca;
}

.photo-box,
.modal-photo{position:relative}

.photo-box{
  width:72px;
  height:72px;
  border:3px solid #fff;
  border-radius:18px;
  outline:1px solid rgba(15,75,55,.12);
  background:linear-gradient(145deg,#e4f0e5,#fff1cf);
  box-shadow:0 7px 15px rgba(15,75,55,.09);
}

.avatar-svg{
  width:44px;
  height:44px;
  fill:none;
  stroke:var(--forest);
  stroke-width:3;
  opacity:.9;
}

.modal-photo .avatar-svg{width:72px;height:72px}
.person-card.is-dead .avatar-svg{stroke:#555d59}

.person-name{
  margin-top:9px;
  color:var(--ink);
  font-size:11.3px;
  line-height:1.2;
  font-weight:900;
}

.person-label{
  max-width:100px;
  margin-top:6px;
  padding:5px 8px;
  border:1px solid rgba(47,143,103,.10);
  background:#edf6ef;
  color:var(--forest);
  font-size:9px;
  font-weight:900;
}

.death-date{margin-top:6px;color:var(--rose);font-size:9.2px}
.death-count{margin-top:2px;font-size:8.6px;line-height:1.24}

.children-row{
  gap:24px!important;
  margin-top:64px!important;
}

.children-row::before,
.children-row::after,
.child-branch::before{
  content:"";
  position:absolute;
  border-radius:999px;
}

.children-row::before{
  top:-30px!important;
  left:58px;
  right:58px;
  height:3px!important;
  background:var(--forest-3);
}

.children-row::after{
  top:-62px!important;
  left:50%;
  width:3px!important;
  height:32px!important;
  transform:translateX(-50%);
  background:var(--forest-3);
}

.child-branch::before{
  top:-30px!important;
  left:50%;
  width:3px!important;
  height:30px!important;
  transform:translateX(-50%);
  background:var(--forest-3);
}

.depth-1>.children-row::before,
.depth-1>.children-row::after,
.depth-1>.children-row>.child-branch::before{background:var(--blue)}

.depth-2>.children-row::before,
.depth-2>.children-row::after,
.depth-2>.children-row>.child-branch::before{background:var(--violet)}

.has-one-child>.children-row::before{
  left:50%!important;
  right:auto!important;
  width:3px!important;
  height:32px!important;
  transform:translateX(-50%);
}

.has-one-child>.children-row>.child-branch::before{display:none}

.zoom-tools{
  right:12px;
  bottom:50px;
  gap:8px;
}

.zoom-tools button{
  width:42px;
  height:42px;
  border:1px solid rgba(15,75,55,.12);
  border-radius:15px;
  background:rgba(255,255,255,.93);
  color:var(--forest);
  box-shadow:0 9px 20px rgba(31,47,39,.12);
  backdrop-filter:blur(12px);
}

.zoom-tools svg{width:20px;height:20px;stroke-width:2.35}

.footer{
  height:38px;
  gap:5px;
  background:rgba(15,75,55,.985);
  font-size:10px;
  font-weight:750;
}
.footer-logo{height:20px;max-width:54px}

/* Modal detail: terasa seperti bottom-sheet aplikasi */
.modal-backdrop{
  background:rgba(19,28,24,.32);
  backdrop-filter:blur(6px);
}

.member-modal{
  max-width:360px;
  border:1px solid rgba(15,75,55,.11);
  border-radius:28px;
  background:
    radial-gradient(circle at 50% 10%,rgba(222,239,225,.88),transparent 32%),
    var(--paper);
  box-shadow:0 28px 78px rgba(15,27,22,.22);
}

.modal-note{background:#eef7f0}

/* Halaman privat dan admin */
.page-scroll{
  inset:66px 0 38px 0;
  padding:18px 15px 78px;
}

.admin-card,
.pin-card{
  border:1px solid rgba(15,75,55,.10);
  border-radius:22px;
  background:rgba(255,254,251,.94);
  box-shadow:var(--shadow-soft);
}

.auth-card{
  padding:22px 18px 19px;
  text-align:center;
}

.card-symbol{
  width:74px;
  height:74px;
  margin:4px auto 16px;
}
.card-symbol img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 12px 20px rgba(15,75,55,.18))}

.auth-card h1{margin-top:8px!important;font-size:22px}
.auth-card p{max-width:300px;margin:0 auto 15px!important}

.pin-icon{
  width:88px;
  height:88px;
  margin:7px auto 17px;
  border:1px solid rgba(15,75,55,.09);
  background:linear-gradient(145deg,#edf7ef,#dfeee2);
  box-shadow:0 11px 22px rgba(31,47,39,.09);
}

.page-banner{
  position:relative;
  display:grid;
  grid-template-columns:46px minmax(0,1fr) auto;
  gap:11px;
  align-items:center;
  margin-bottom:14px;
  padding:15px 13px;
  overflow:hidden;
  border:1px solid rgba(15,75,55,.10);
  border-radius:22px;
  background:
    radial-gradient(circle at 100% 0%,rgba(244,230,198,.78),transparent 40%),
    linear-gradient(135deg,rgba(234,244,236,.97),rgba(255,253,249,.97));
  box-shadow:var(--shadow-soft);
}

.page-banner::after{
  content:"✦";
  position:absolute;
  right:13px;
  top:-17px;
  color:rgba(202,166,103,.16);
  font-size:64px;
  line-height:1;
  pointer-events:none;
}

.page-banner-icon{
  position:relative;
  z-index:1;
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:var(--forest);
  color:#fff7e8;
  box-shadow:0 8px 17px rgba(15,75,55,.18);
}

.page-banner-icon svg{width:22px;height:22px;stroke-width:1.9}
.page-banner div:nth-child(2){position:relative;z-index:1;min-width:0}
.page-banner h1{margin:5px 0 3px;color:var(--forest);font-size:18px;line-height:1.08}
.page-banner p{margin:0;color:#5e7068;font-size:10.5px;line-height:1.4;font-weight:700}

.logout-chip{
  position:relative;
  z-index:2;
  align-self:start;
  padding:7px 9px;
  border:1px solid rgba(15,75,55,.12);
  border-radius:999px;
  background:rgba(255,255,255,.72);
  color:var(--forest);
  font-size:9.5px;
  font-weight:900;
  text-decoration:none;
}

.admin-card h2{font-size:17px}
.hint,.admin-card p,.pin-card p{color:var(--muted);font-size:12px}

.admin-form{gap:11px}
.admin-form label{color:#2b4238;font-size:11px;letter-spacing:.01em}
.admin-form input,
.admin-form select,
.admin-form textarea,
.pin-form input{
  border-color:#e4d9c5;
  border-radius:13px;
  background:rgba(255,255,255,.96);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9);
  font-size:12px;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus,
.pin-form input:focus{
  outline:2px solid rgba(47,143,103,.18);
  border-color:rgba(47,143,103,.48);
}

.primary-btn{
  min-height:44px;
  border-radius:14px;
  background:linear-gradient(180deg,#2e9169,#0f4b37);
  box-shadow:0 8px 18px rgba(15,75,55,.16);
}
.secondary-btn{border-radius:14px;background:#fffdfa}

.check-panel{
  border-radius:15px;
  background:linear-gradient(180deg,#f5faf6,#eff7f1);
}

.member-list{gap:8px}
.member-row{
  border-color:rgba(15,75,55,.08);
  border-radius:15px;
  background:rgba(255,255,255,.88);
  box-shadow:0 4px 11px rgba(31,47,39,.035);
}

/* Halaman hari istimewa */
.event-list{gap:10px}
.event-card{
  position:relative!important;
  display:grid!important;
  grid-template-columns:40px minmax(0,1fr) 60px!important;
  gap:10px!important;
  align-items:center!important;
  min-height:82px;
  padding:12px 11px!important;
  border:1px solid rgba(15,75,55,.09);
  border-radius:19px;
  background:rgba(255,255,255,.91);
  box-shadow:0 7px 17px rgba(31,47,39,.065);
}

.event-icon{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:14px;
  font-size:18px;
  font-weight:900;
}
.event-icon.birthday{background:#e7f4ea;color:#287b5c}
.event-icon.memorial{background:#fbefe3;color:#ad7047}
.event-main{min-width:0!important}
.event-card strong{
  display:block!important;
  overflow:hidden!important;
  color:var(--ink);
  font-size:13px!important;
  font-weight:900;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.event-card p{margin:5px 0 0;color:var(--muted);font-size:10.5px;line-height:1.32;font-weight:700}
.event-badge{
  display:inline-flex!important;
  margin:5px 0 0!important;
  padding:4px 6px!important;
  font-size:8px!important;
}
.event-days{align-self:center!important;justify-self:end!important;min-width:55px!important;text-align:right!important;color:var(--forest)}
.event-days b{display:block!important;font-size:25px!important;line-height:1!important;font-weight:900!important}
.event-days span{display:block!important;margin-top:4px!important;font-size:9px!important;font-weight:900!important;white-space:nowrap!important}


.empty-state-card{
  padding:20px 15px;
  border:1px dashed rgba(15,75,55,.18);
  border-radius:18px;
  background:rgba(255,255,255,.70);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-align:center;
}

.welcome{background:linear-gradient(180deg,#fffdf8,#fbf3e4)}
.welcome-mark{
  width:78px;
  height:78px;
  background:transparent;
  box-shadow:none;
}
.welcome-mark img{width:100%;height:100%;filter:drop-shadow(0 14px 22px rgba(15,75,55,.20))}
.welcome h1{font-size:24px}

@media(max-width:390px){
  .app-shell{max-width:390px}
  .topbar{padding-inline:11px;gap:8px}
  .brand-mark{width:33px;height:33px;flex-basis:33px}
  .brand-title{font-size:15px}
  .tree{zoom:var(--zoom,.74)}
  .tree-wrap{padding-inline:22px!important}
  .tree-hint{max-width:calc(100vw - 22px);margin-inline:11px;font-size:9.5px}
  .person-card{width:108px;min-height:146px}
  .photo-box{width:68px;height:68px}
  .children-row{gap:18px!important;margin-top:58px!important}
  .children-row::before{top:-27px!important;left:54px;right:54px}
  .children-row::after{top:-58px!important;height:31px!important}
  .child-branch::before{top:-27px!important;height:27px!important}
  .grid-2{grid-template-columns:1fr}
  .page-banner{grid-template-columns:42px minmax(0,1fr) auto;padding:13px 11px;gap:9px}
  .page-banner-icon{width:42px;height:42px;border-radius:14px}
  .page-banner h1{font-size:16px}
  .page-banner p{font-size:9.8px}
}

@media(max-width:330px){
  .brand-kicker{display:none}
  .brand-mark{display:none}
  .event-card{grid-template-columns:36px minmax(0,1fr) 50px!important}
  .event-icon{width:36px;height:36px}
}

/* =========================================================
   Revisi soft4: sinkronisasi profil publik, galeri, scroll,
   kontrol zoom, pola latar Islami, dan garis silsilah presisi.
   ========================================================= */
html,body{
  height:100%;
  max-height:100%;
  overflow:hidden;
}

.app-shell{
  height:100dvh;
  min-height:0;
  background-image:
    url("../img/islamic-pattern.svg"),
    radial-gradient(circle at 91% 7%,rgba(206,227,202,.60),transparent 25%),
    radial-gradient(circle at 8% 93%,rgba(243,222,181,.31),transparent 25%),
    linear-gradient(180deg,#fffdf8 0%,#fbf7ee 52%,#fffdf8 100%);
  background-repeat:repeat,no-repeat,no-repeat,no-repeat;
  background-size:96px 96px,auto,auto,auto;
  background-position:center,center,center,center;
}

.app-shell::after{
  content:"✦";
  right:-22px;
  top:92px;
  color:rgba(202,166,103,.075);
  font-size:104px;
}

.content-scroll,
.page-scroll{
  z-index:1;
  overflow-x:auto!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:auto;
  touch-action:pan-x pan-y;
}

.content-scroll{
  padding-bottom:170px;
}

.page-scroll{
  padding-bottom:100px;
}

.tree-wrap{
  padding-bottom:220px!important;
}

/* Garis pasangan dibuat ringkas agar tidak tampak melebar. */
.couple-row{gap:10px}
.marriage-line{
  width:18px!important;
  flex-basis:18px!important;
  min-width:18px!important;
}

/* Panjang garis saudara dihitung JS berdasarkan pusat kartu pertama dan terakhir. */
.children-row::before{
  left:var(--connector-left,58px)!important;
  right:var(--connector-right,58px)!important;
}

.has-one-child>.children-row::before{
  left:50%!important;
  right:auto!important;
}

/* Tombol zoom eksplisit pada halaman silsilah. */
.zoom-tools{
  position:absolute;
  right:12px;
  bottom:50px;
  z-index:38;
  display:grid;
  gap:8px;
}

.zoom-tools button{
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  padding:0;
  cursor:pointer;
}

.zoom-tools .zoom-home{
  height:50px;
  gap:1px;
  padding:4px 0 3px;
}

.zoom-tools .zoom-home svg{width:17px;height:17px}
.zoom-tools .zoom-home span{
  display:block;
  color:var(--forest);
  font-size:8px;
  line-height:1;
  font-weight:900;
}

/* Detail profil: tanggal lahir tidak ditampilkan, hanya umur. */
.modal-age{
  margin:7px 0 0;
  color:var(--forest);
  font-size:13px;
  font-weight:900;
}


/* Admin */
.admin-tabs{
  position:sticky;
  top:-4px;
  z-index:8;
  display:flex;
  gap:8px;
  margin:0 0 14px;
  padding:6px;
  border:1px solid rgba(15,75,55,.09);
  border-radius:16px;
  background:rgba(255,253,249,.90);
  box-shadow:0 8px 18px rgba(31,47,39,.07);
  backdrop-filter:blur(14px);
}

.admin-tabs a{
  flex:1;
  padding:9px 8px;
  border-radius:11px;
  background:#edf6ef;
  color:var(--forest);
  font-size:10.5px;
  font-weight:900;
  text-align:center;
  text-decoration:none;
}

.section-kicker{
  display:block;
  margin-bottom:5px;
  color:#98773e;
  font-size:9px;
  font-weight:900;
  letter-spacing:.11em;
  text-transform:uppercase;
}

.check-panel small{
  display:block;
  margin:0 0 3px;
  color:var(--muted);
  font-size:10px;
  line-height:1.45;
  font-weight:700;
}

.remove-photo{
  display:flex;
  align-items:center;
  gap:7px;
  padding:9px 10px;
  border:1px dashed rgba(185,86,72,.30);
  border-radius:12px;
  background:#fff7f5;
  color:#9b463b!important;
}

.remove-photo input{
  width:auto!important;
  height:auto!important;
  margin:0!important;
}

.admin-gallery-list{
  display:flex;
  flex-direction:column;
  gap:9px;
}

.admin-gallery-row{
  display:grid;
  grid-template-columns:56px minmax(0,1fr) auto;
  gap:9px;
  align-items:center;
  padding:8px;
  border:1px solid rgba(15,75,55,.08);
  border-radius:15px;
  background:rgba(255,255,255,.90);
}

.admin-gallery-row img{
  width:56px;
  height:56px;
  border-radius:11px;
  object-fit:cover;
}

.admin-gallery-row strong,
.admin-gallery-row span{display:block}
.admin-gallery-row strong{color:var(--ink);font-size:11.5px}
.admin-gallery-row span{
  display:-webkit-box;
  overflow:hidden;
  margin-top:4px;
  color:var(--muted);
  font-size:9.5px;
  line-height:1.35;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

.admin-gallery-row button{
  border:0;
  border-radius:10px;
  background:#fff0f0;
  color:#9b2d2d;
  padding:8px;
  font:inherit;
  font-size:10px;
  font-weight:900;
  cursor:pointer;
}

/* Galeri publik */
.gallery-grid{
  display:grid;
  gap:14px;
}

.gallery-card{
  overflow:hidden;
  border:1px solid rgba(15,75,55,.10);
  border-radius:22px;
  background:rgba(255,254,251,.94);
  box-shadow:var(--shadow-soft);
}

.gallery-photo{
  aspect-ratio:4/3;
  overflow:hidden;
  background:linear-gradient(145deg,#edf6ef,#fbf1dd);
}

.gallery-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.gallery-copy{padding:14px}
.gallery-copy h2{
  margin:0;
  color:var(--forest);
  font-size:15px;
  line-height:1.25;
}
.gallery-copy p{
  margin:7px 0 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.55;
  font-weight:650;
}

.gallery-empty{
  padding:28px 20px;
  border:1px dashed rgba(15,75,55,.22);
  border-radius:22px;
  background:rgba(255,254,251,.76);
  box-shadow:var(--shadow-soft);
  text-align:center;
}

.gallery-empty-icon{
  width:64px;
  height:64px;
  display:grid;
  place-items:center;
  margin:0 auto 13px;
  border-radius:20px;
  background:#edf6ef;
  color:var(--forest);
}
.gallery-empty-icon svg{width:31px;height:31px;stroke-width:1.7}
.gallery-empty h2{margin:0;color:var(--forest);font-size:17px}
.gallery-empty p{margin:8px auto 0;max-width:280px;color:var(--muted);font-size:11.5px;line-height:1.55;font-weight:700}

@media(max-width:390px){
  .content-scroll{padding-bottom:190px}
  .tree-wrap{padding-bottom:250px!important}
  .children-row::before{
    left:var(--connector-left,54px)!important;
    right:var(--connector-right,54px)!important;
  }
  .has-one-child>.children-row::before{left:50%!important;right:auto!important}
  .zoom-tools{right:10px}
  .admin-gallery-row{grid-template-columns:50px minmax(0,1fr) auto}
  .admin-gallery-row img{width:50px;height:50px}
}


/* =========================================================
   soft5 — navigasi bawah menyatu dengan footer
   Footer memakai safe-area agar tidak terpotong pada mobile.
   ========================================================= */
:root{
  --bottom-nav-h:62px;
  --footer-h:27px;
  --bottom-stack-h:89px;
}

html,body{
  min-height:100svh;
  min-height:100dvh;
}

.app-shell{
  height:100svh;
  height:100dvh;
  min-height:0;
}

.public-topbar{
  padding-left:16px;
}

.bottom-shell{
  position:absolute;
  z-index:55;
  left:0;
  right:0;
  bottom:0;
  overflow:hidden;
  padding-bottom:env(safe-area-inset-bottom,0px);
  border-top:1px solid rgba(15,75,55,.10);
  background:rgba(255,253,248,.97);
  box-shadow:0 -10px 28px rgba(31,47,39,.10);
  backdrop-filter:blur(18px);
}

.bottom-nav{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  align-items:center;
  height:var(--bottom-nav-h);
  padding:5px 8px 4px;
  gap:4px;
  background:linear-gradient(180deg,rgba(255,254,251,.98),rgba(251,247,238,.98));
}

.bottom-nav-item{
  display:flex;
  min-width:0;
  height:51px;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  border:1px solid transparent;
  border-radius:15px;
  color:#6b7a73;
  text-decoration:none;
  transition:.18s ease;
}

.bottom-nav-item svg{
  width:19px;
  height:19px;
  stroke-width:1.9;
}

.bottom-nav-item span{
  overflow:hidden;
  max-width:100%;
  font-size:9px;
  line-height:1;
  font-weight:900;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.bottom-nav-item.active{
  border-color:rgba(15,75,55,.10);
  background:#eaf4ec;
  color:var(--forest);
  box-shadow:0 5px 12px rgba(15,75,55,.08);
}

.bottom-nav-item:active{
  transform:scale(.97);
}

.footer{
  position:relative!important;
  inset:auto!important;
  z-index:1!important;
  height:var(--footer-h)!important;
  min-height:var(--footer-h);
  padding:0 8px!important;
  gap:4px!important;
  background:var(--forest)!important;
  font-size:8.5px!important;
  line-height:1!important;
  white-space:nowrap;
}

.footer-logo{
  height:17px!important;
  max-width:45px!important;
}

.content-scroll,
.page-scroll{
  bottom:calc(var(--bottom-stack-h) + env(safe-area-inset-bottom,0px))!important;
}

.content-scroll{
  padding-bottom:156px!important;
}

.page-scroll{
  padding-bottom:30px!important;
}

.zoom-tools{
  bottom:calc(var(--bottom-stack-h) + env(safe-area-inset-bottom,0px) + 12px)!important;
}

@media(max-width:390px){
  .content-scroll{padding-bottom:192px!important}
  .tree-wrap{padding-bottom:260px!important}
  .footer{font-size:7.8px!important}
  .footer-logo{height:15px!important;max-width:40px!important}
}

@media(min-width:461px){
  .bottom-shell{
    border-radius:0 0 27px 27px;
  }
}

/* Tinggi desktop tetap mempertimbangkan margin luar kartu aplikasi. */
@media(min-width:461px){
  .app-shell{
    height:calc(100dvh - 36px);
  }
}

/* Pada layar mobile, svh menjaga footer tetap di area yang benar-benar terlihat. */
@media(max-width:460px){
  .app-shell{
    height:100vh;
    height:100svh;
    max-height:100dvh;
  }
}


/* =========================================================
   soft6 — full mobile, pemutar musik, dan galeri 3 kolom
   ========================================================= */
:root{
  --music-dock-bottom:calc(var(--bottom-stack-h) + env(safe-area-inset-bottom,0px) + 10px);
}

/* Di perangkat mobile, aplikasi memenuhi layar tanpa bingkai luar. */
@media(max-width:768px){
  html,body{
    width:100%;
    min-width:100%;
    min-height:100%;
    background:#fffdf8;
  }
  body{display:block;}
  .app-shell{
    width:100vw;
    max-width:none!important;
    height:100vh!important;
    height:100svh!important;
    max-height:100dvh!important;
    margin:0!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }
  .bottom-shell{border-radius:0!important;}
}

/* Pemutar musik melayang di kiri bawah, tepat di atas Beranda. */
.music-dock{
  position:absolute;
  z-index:58;
  left:10px;
  bottom:var(--music-dock-bottom);
  display:grid;
  grid-template-columns:26px minmax(0,1fr) auto;
  align-items:center;
  gap:7px;
  width:min(292px,calc(100% - 78px));
  min-height:44px;
  padding:6px 7px 6px 8px;
  border:1px solid rgba(15,75,55,.13);
  border-radius:16px;
  background:rgba(255,253,248,.96);
  box-shadow:0 10px 24px rgba(31,47,39,.13);
  backdrop-filter:blur(15px);
}

.music-visual{
  display:flex;
  height:22px;
  align-items:flex-end;
  justify-content:center;
  gap:3px;
}

.music-visual i{
  width:3px;
  height:8px;
  border-radius:99px;
  background:var(--forest-3);
  opacity:.55;
  transform-origin:bottom;
}

.music-visual.is-playing i{
  opacity:1;
  animation:musicPulse .86s ease-in-out infinite alternate;
}
.music-visual.is-playing i:nth-child(2){animation-delay:.18s}
.music-visual.is-playing i:nth-child(3){animation-delay:.36s}

@keyframes musicPulse{
  from{height:6px;transform:scaleY(.86)}
  to{height:21px;transform:scaleY(1)}
}

.music-copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.music-copy small{
  color:#98773e;
  font-size:7.5px;
  line-height:1;
  font-weight:900;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.music-copy strong{
  overflow:hidden;
  color:var(--forest);
  font-size:9.5px;
  line-height:1.15;
  font-weight:900;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.music-actions{display:flex;gap:4px;}
.music-actions button{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border:1px solid rgba(15,75,55,.11);
  border-radius:10px;
  background:#f7fbf8;
  color:var(--forest);
  cursor:pointer;
}
.music-actions button:active{transform:scale(.95)}
.music-actions svg{width:16px;height:16px;stroke-width:2.2}
.music-dock.is-playing #musicPlay{background:#e4f2e7}
.music-dock.is-stopped #musicStop{background:#f5ebdf;color:#9b6437}

/* Tombol zoom tetap di atas dock musik agar tidak bertabrakan. */
.zoom-tools{
  bottom:calc(var(--bottom-stack-h) + env(safe-area-inset-bottom,0px) + 66px)!important;
}

/* Galeri: tiga foto persegi per baris tanpa judul dan keterangan. */
.gallery-grid{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.gallery-card{
  appearance:none;
  display:block;
  width:100%;
  padding:0;
  overflow:hidden;
  border:1px solid rgba(15,75,55,.10);
  border-radius:14px;
  background:rgba(255,254,251,.96);
  box-shadow:0 6px 14px rgba(31,47,39,.07);
  cursor:pointer;
}
.gallery-card:active{transform:scale(.97)}
.gallery-photo{
  display:block;
  width:100%;
  aspect-ratio:1/1;
}
.gallery-copy{display:none!important;}

.gallery-modal{
  position:fixed;
  inset:0;
  z-index:250;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(13,24,19,.88);
  backdrop-filter:blur(10px);
}
.gallery-modal.show{display:flex;}
.gallery-modal-inner{
  display:flex;
  max-width:min(100%,960px);
  max-height:calc(100dvh - 36px);
  align-items:center;
  justify-content:center;
}
.gallery-modal img{
  display:block;
  max-width:100%;
  max-height:calc(100dvh - 36px);
  object-fit:contain;
  border-radius:15px;
  box-shadow:0 22px 70px rgba(0,0,0,.36);
}
.gallery-modal-close{
  position:fixed;
  z-index:2;
  top:calc(14px + env(safe-area-inset-top,0px));
  right:14px;
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.18);
  border-radius:14px;
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
}
.gallery-modal-close svg{width:22px;height:22px;stroke-width:2.4}

/* Daftar foto di admin tidak lagi menampilkan judul atau keterangan. */
.admin-gallery-row{
  grid-template-columns:58px minmax(0,1fr) auto;
}
.admin-gallery-row strong{font-size:11px;}
.admin-gallery-row span{display:none!important;}

@media(max-width:390px){
  .music-dock{
    left:8px;
    width:min(274px,calc(100% - 70px));
    gap:5px;
  }
  .music-copy strong{font-size:8.8px;}
  .gallery-grid{gap:6px;}
  .gallery-card{border-radius:12px;}
}


/* =========================================================
   soft7 — transisi lembut, reveal card, popup galeri swipe,
   kontrol zoom lebih ringkas, dan petunjuk autoplay.
   ========================================================= */

/* Perpindahan halaman tetap ringan agar nuansa aplikasi terasa halus. */
.content-scroll,
.page-scroll{
  animation:softPageEnter .30s cubic-bezier(.22,.72,.25,1) both;
}

body.page-leaving .content-scroll,
body.page-leaving .page-scroll{
  pointer-events:none;
  opacity:0;
  transform:translateY(7px);
  transition:opacity .16s ease,transform .16s ease;
}

@keyframes softPageEnter{
  from{opacity:0;transform:translateY(9px)}
  to{opacity:1;transform:translateY(0)}
}

/* Reveal dijalankan satu kali saat halaman terbuka, bukan saat scroll. */
.person-card,
.gallery-card,
.event-card,
.admin-card,
.gallery-empty{
  animation:none;
}

.soft-reveal{
  animation:softCardReveal .42s cubic-bezier(.22,.72,.25,1) both;
  animation-delay:var(--reveal-delay,0ms);
}

@keyframes softCardReveal{
  from{opacity:0;transform:translateY(10px) scale(.985)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

/* Kontrol silsilah dibuat lebih ringkas agar tidak menutupi kartu. */
.zoom-tools{
  right:10px!important;
  gap:6px!important;
}
.zoom-tools button{
  width:38px!important;
  height:38px!important;
  border-radius:13px!important;
}
.zoom-tools svg{width:18px!important;height:18px!important}
.zoom-tools .zoom-home{
  height:45px!important;
  padding:3px 0 3px!important;
}
.zoom-tools .zoom-home svg{width:15px!important;height:15px!important}
.zoom-tools .zoom-home span{font-size:7.5px!important}

/* Browser yang menolak autoplay diberi petunjuk halus tanpa memaksa audio. */
.music-dock.needs-interaction #musicPlay{
  animation:softPlayHint 1.35s ease-in-out infinite;
  border-color:rgba(202,166,103,.52);
  background:#fff6df;
}
@keyframes softPlayHint{
  0%,100%{box-shadow:0 0 0 0 rgba(202,166,103,.22)}
  50%{box-shadow:0 0 0 7px rgba(202,166,103,0)}
}

/* Popup galeri: zoom lembut, swipe mobile, panah desktop, tanpa caption. */
.gallery-modal.show{
  animation:galleryBackdropIn .20s ease both;
}
.gallery-modal.show .gallery-modal-inner{
  animation:galleryPhotoOpen .25s cubic-bezier(.22,.72,.25,1) both;
}
.gallery-modal-inner{
  position:relative;
  width:100%;
  touch-action:pan-y;
}
.gallery-modal img.gallery-image-next{
  animation:galleryImageNext .24s cubic-bezier(.22,.72,.25,1) both;
}
.gallery-modal img.gallery-image-prev{
  animation:galleryImagePrev .24s cubic-bezier(.22,.72,.25,1) both;
}
.gallery-modal-arrow{
  position:fixed;
  z-index:3;
  top:50%;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.18);
  border-radius:15px;
  background:rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
  transform:translateY(-50%);
  backdrop-filter:blur(10px);
}
.gallery-modal-arrow svg{width:21px;height:21px;stroke-width:2.3}
.gallery-modal-arrow:active{transform:translateY(-50%) scale(.95)}
.gallery-modal-prev{left:14px}
.gallery-modal-next{right:14px}
.gallery-modal-count{
  position:fixed;
  z-index:3;
  left:50%;
  bottom:calc(18px + env(safe-area-inset-bottom,0px));
  padding:7px 10px;
  border:1px solid rgba(255,255,255,.17);
  border-radius:999px;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-size:10px;
  line-height:1;
  font-weight:900;
  transform:translateX(-50%);
  backdrop-filter:blur(10px);
}
.gallery-modal-single .gallery-modal-arrow,
.gallery-modal-single .gallery-modal-count{display:none}

@keyframes galleryBackdropIn{
  from{opacity:0}
  to{opacity:1}
}
@keyframes galleryPhotoOpen{
  from{opacity:0;transform:scale(.96)}
  to{opacity:1;transform:scale(1)}
}
@keyframes galleryImageNext{
  from{opacity:.25;transform:translateX(18px) scale(.985)}
  to{opacity:1;transform:translateX(0) scale(1)}
}
@keyframes galleryImagePrev{
  from{opacity:.25;transform:translateX(-18px) scale(.985)}
  to{opacity:1;transform:translateX(0) scale(1)}
}

@media(max-width:520px){
  .gallery-modal-arrow{
    width:38px;
    height:38px;
    border-radius:13px;
  }
  .gallery-modal-prev{left:9px}
  .gallery-modal-next{right:9px}
}

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

/* =========================================================
   soft8 — timeline galeri, satu tombol musik, fade audio,
   dan animasi yang lebih terlihat.
   ========================================================= */

/* Musik: hanya satu tombol yang berubah menjadi play atau pause. */
.music-actions{
  display:flex;
  gap:0;
}
.music-actions button{
  width:30px;
  height:30px;
}
.music-dock.is-playing #musicToggle{
  border-color:rgba(47,143,103,.20);
  background:#e4f2e7;
}
.music-dock.is-paused #musicToggle{
  border-color:rgba(202,166,103,.32);
  background:#fff7e6;
  color:#98773e;
}
.music-dock.needs-interaction #musicToggle{
  animation:softPlayHint 1.6s ease-in-out infinite;
  border-color:rgba(202,166,103,.58);
  background:#fff6df;
}

/* Transisi antarpagina dibuat sedikit lebih lambat agar fade audio terasa alami. */
.content-scroll,
.page-scroll{
  animation-duration:.72s!important;
}
body.page-leaving .content-scroll,
body.page-leaving .page-scroll{
  opacity:0;
  transform:translateY(10px);
  transition:opacity .52s ease,transform .52s ease!important;
}
.soft-reveal{
  animation-duration:.76s!important;
}

/* Popup foto lebih tenang dan terlihat jelas. */
.gallery-modal.show{
  animation-duration:.42s!important;
}
.gallery-modal.show .gallery-modal-inner{
  animation-duration:.52s!important;
}
.gallery-modal img.gallery-image-next,
.gallery-modal img.gallery-image-prev{
  animation-duration:.46s!important;
}

/* Galeri disusun sebagai timeline tahun. Foto tanpa tahun selalu di paling atas. */
.gallery-timeline{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.gallery-year-block{
  position:relative;
}
.gallery-year-heading{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 9px;
  padding:0 2px;
}
.gallery-year-heading::after{
  content:"";
  height:1px;
  flex:1;
  background:linear-gradient(90deg,rgba(202,166,103,.42),rgba(202,166,103,0));
}
.gallery-year-dot{
  width:9px;
  height:9px;
  flex:0 0 9px;
  border:2px solid #f9edcf;
  border-radius:999px;
  background:var(--gold);
  box-shadow:0 0 0 3px rgba(202,166,103,.14);
}
.gallery-year-heading h2{
  margin:0;
  color:#8a6a34;
  font-size:13px;
  line-height:1;
  font-weight:900;
  letter-spacing:.04em;
}

/* Input tahun opsional pada panel admin. */
.field-help{
  display:block;
  margin:3px 0 7px;
  color:var(--muted);
  font-size:9.5px;
  line-height:1.4;
  font-weight:700;
}
.admin-gallery-row{
  grid-template-columns:58px minmax(0,1fr) auto!important;
}
.admin-gallery-year-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:6px;
  align-items:end;
}
.admin-gallery-year-form label{
  min-width:0;
}
.admin-gallery-year-form span{
  display:block!important;
  margin:0 0 4px!important;
  color:var(--muted)!important;
  font-size:8.5px!important;
  line-height:1!important;
  font-weight:900!important;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.admin-gallery-year-form input{
  width:100%;
  min-width:0;
  height:34px;
  padding:7px 8px;
  border:1px solid rgba(15,75,55,.12);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font:inherit;
  font-size:10px;
  font-weight:800;
}
.admin-gallery-year-form button{
  height:34px;
  background:#edf6ef!important;
  color:var(--forest)!important;
}

@media(max-width:390px){
  .gallery-timeline{gap:15px;}
  .gallery-year-heading{margin-bottom:7px;}
  .gallery-year-heading h2{font-size:12px;}
  .admin-gallery-row{
    grid-template-columns:50px minmax(0,1fr)!important;
  }
  .admin-gallery-row img{width:50px;height:50px;}
  .admin-gallery-row>form:last-child{
    grid-column:2;
    justify-self:end;
  }
}
