/* ============================================================
   KOBROSLI FAMILY – عائلة آل قبرصلي
   Brand design system
   ============================================================ */
:root {
  --emerald:   #075C43;
  --cedar:     #24866A;
  --gold:      #C6A15B;
  --ivory:     #FAF8F2;
  --charcoal:  #252B28;
  --leaf-male:    #3478D4;
  --leaf-female:  #E58AB4;
  --leaf-wife:    #A37AD8;
  --leaf-husband: #51AFA7;
  --memorial:  #A4A6AA;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(7, 92, 67, 0.10);
  --shadow-lg: 0 14px 44px rgba(7, 92, 67, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: 'Cairo', 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
html[dir="ltr"] body { font-family: 'Inter', 'Cairo', system-ui, sans-serif; }
img { max-width: 100%; }
a { color: var(--emerald); text-decoration: none; }
h1,h2,h3 { line-height: 1.3; color: var(--emerald); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(7,92,67,0.12);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.05rem; font-weight: 800; color: var(--emerald); }
.brand-text small { color: var(--gold); font-size: 0.72rem; letter-spacing: 1px; }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; transition: background 0.2s; }
.main-nav a:hover { background: rgba(36,134,106,0.10); }
.nav-join { background: var(--emerald); color: #fff !important; box-shadow: var(--shadow); }
.nav-join:hover { background: var(--cedar) !important; }
.nav-admin { color: var(--gold); }
.lang-switch { border: 1px solid var(--gold); color: var(--gold) !important; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; color: var(--emerald); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px; border: none;
  font: inherit; font-weight: 700; cursor: pointer; text-align: center; transition: all 0.2s;
}
.btn-primary { background: linear-gradient(135deg, var(--emerald), var(--cedar)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--emerald); color: var(--emerald); }
.btn-outline:hover { background: var(--emerald); color: #fff; }
.btn-danger { background: #b4453a; color: #fff; }
.btn-sm { padding: 7px 16px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  padding: 72px 20px 88px;
  background:
    radial-gradient(1100px 420px at 50% -10%, rgba(36,134,106,0.18), transparent),
    linear-gradient(180deg, #F2F7F2, var(--ivory));
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 4px; font-weight: 800; }
.hero .hero-en { font-size: clamp(0.9rem, 2.4vw, 1.2rem); letter-spacing: 4px; color: var(--gold); font-weight: 700; margin: 0 0 14px; }
.hero .slogan { font-size: clamp(1.05rem, 3vw, 1.5rem); color: var(--cedar); font-weight: 700; margin: 0 0 10px; }
.hero p.sub { max-width: 640px; margin: 0 auto 28px; color: #4b544f; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-cedar { margin: 0 auto 22px; width: min(320px, 70vw); filter: drop-shadow(0 18px 30px rgba(7,92,67,0.25)); }

/* ---------- Sections / cards ---------- */
section.block { padding: 56px 0; }
section.block h2 { text-align: center; font-size: clamp(1.4rem, 4vw, 2rem); margin-bottom: 8px; }
section.block .section-sub { text-align: center; color: #5a635e; margin: 0 0 32px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; border: 1px solid rgba(7,92,67,0.06);
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat-card { text-align: center; padding: 28px 16px; }
.stat-card .num { font-size: 2.4rem; font-weight: 800; color: var(--emerald); }
.stat-card .lbl { color: #5a635e; font-weight: 600; }
.stat-card .ico { font-size: 1.6rem; }

/* ---------- Alerts / badges ---------- */
.alert { padding: 14px 18px; border-radius: 12px; margin: 16px 0; font-weight: 600; }
.alert-success { background: #e6f4ee; color: var(--emerald); border: 1px solid #bfe3d4; }
.alert-error { background: #fbeae8; color: #93352c; border: 1px solid #f0c7c1; }
.alert-info { background: #eef3fb; color: #2a4f86; border: 1px solid #cdddf5; }

.badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge-pending { background: #fdf3e0; color: #9a6b12; }
.badge-approved { background: #e6f4ee; color: var(--emerald); }
.badge-rejected { background: #fbeae8; color: #93352c; }
.badge-needs_correction { background: #eef3fb; color: #2a4f86; }
.badge-blood-male { background: rgba(52,120,212,0.14); color: var(--leaf-male); }
.badge-blood-female { background: rgba(229,138,180,0.18); color: #b44f80; }
.badge-spouse-female { background: rgba(163,122,216,0.16); color: #7a51b4; }
.badge-spouse-male { background: rgba(81,175,167,0.18); color: #2b7d76; }
.badge-memorial { background: #f0f0f2; color: #6c6f74; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 700; margin: 14px 0 6px; font-size: 0.95rem; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #d8ded9;
  font: inherit; background: #fff; color: var(--charcoal);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cedar); box-shadow: 0 0 0 3px rgba(36,134,106,0.15); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-weight: 600; }
.check input { width: 18px; height: 18px; }
.hint { color: #6a736e; font-size: 0.85rem; margin-top: 4px; }

/* ---------- Wizard ---------- */
.wizard-steps { display: flex; justify-content: center; gap: 8px; margin: 24px 0 28px; flex-wrap: wrap; }
.wizard-steps .step {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: #eef2ee; color: #6a736e; font-weight: 700; font-size: 0.85rem;
}
.wizard-steps .step .n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #d8ded9; color: #fff; font-size: 0.85rem;
}
.wizard-steps .step.active { background: var(--emerald); color: #fff; }
.wizard-steps .step.active .n { background: var(--gold); }
.wizard-steps .step.done { background: #e6f4ee; color: var(--emerald); }
.wizard-steps .step.done .n { background: var(--cedar); }
.wizard-pane { display: none; }
.wizard-pane.active { display: block; animation: fadeUp 0.35s ease; }
.wizard-nav { display: flex; justify-content: space-between; margin-top: 28px; gap: 12px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.search-results { background: #fff; border: 1px solid #d8ded9; border-radius: 12px; margin-top: 6px; max-height: 240px; overflow: auto; }
.search-results .item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #f0f2f0; }
.search-results .item:hover { background: #eef7f2; }
.search-results .item small { display: block; color: #6a736e; }
.selected-chip { display: inline-flex; align-items: center; gap: 8px; background: #e6f4ee; color: var(--emerald); padding: 6px 14px; border-radius: 999px; font-weight: 700; margin-top: 6px; }
.selected-chip button { background: none; border: none; cursor: pointer; color: #93352c; font-weight: 800; }

.child-card { border: 1.5px dashed #cdd6cf; border-radius: 12px; padding: 14px 18px; margin: 12px 0; background: #fcfdfc; }

/* ---------- Family tree (traditional chart) ---------- */
.tree-toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; margin-bottom: 18px; }
.tree-toolbar > div { min-width: 180px; }
.tree-scroll { overflow: auto; padding: 24px 8px 40px; background:
  radial-gradient(800px 300px at 50% 0, rgba(198,161,91,0.08), transparent), #fff;
  border-radius: var(--radius); box-shadow: var(--shadow); }
.ftree, .ftree ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; }
.ftree ul { padding-top: 26px; position: relative; }
.ftree li { position: relative; padding: 26px 10px 0; display: flex; flex-direction: column; align-items: center; }
/* connectors */
.ftree li::before, .ftree li::after {
  content: ''; position: absolute; top: 0; width: 50%; height: 26px;
  border-top: 2px solid var(--cedar);
}
.ftree li::before { right: 50%; border-right: 2px solid var(--cedar); }
html[dir="rtl"] .ftree li::before { right: auto; left: 50%; border-right: none; border-left: 2px solid var(--cedar); }
.ftree li::after { left: 50%; }
html[dir="rtl"] .ftree li::after { left: auto; right: 50%; }
.ftree li:only-child::before, .ftree li:only-child::after { display: none; }
.ftree li:only-child { padding-top: 0; }
.ftree li:first-child::before { border: none; }
.ftree li:last-child::after { border: none; }
.ftree li:last-child::before { border-right: 2px solid var(--cedar); border-radius: 0 8px 0 0; }
html[dir="rtl"] .ftree li:last-child::before { border-right: none; }
.ftree > li { padding-top: 0; }
.ftree > li::before, .ftree > li::after { display: none; }
.ftree ul::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 26px; background: var(--cedar); }

.couple { display: flex; gap: 10px; align-items: center; }
.couple .ring { color: var(--gold); font-size: 1.1rem; }
.leaf {
  min-width: 118px; max-width: 160px; text-align: center; background: #fff;
  border-radius: 14px; padding: 10px 10px 8px; box-shadow: var(--shadow);
  border-top: 5px solid var(--memorial); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.leaf:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.leaf.leaf-male { border-top-color: var(--leaf-male); }
.leaf.leaf-female { border-top-color: var(--leaf-female); }
.leaf.leaf-wife { border-top-color: var(--leaf-wife); }
.leaf.leaf-husband { border-top-color: var(--leaf-husband); }
.leaf .avatar {
  width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
  background: #eef2ee; font-size: 1.3rem; overflow: hidden;
}
.leaf.leaf-male .avatar { background: rgba(52,120,212,0.12); }
.leaf.leaf-female .avatar { background: rgba(229,138,180,0.15); }
.leaf.leaf-wife .avatar { background: rgba(163,122,216,0.14); }
.leaf.leaf-husband .avatar { background: rgba(81,175,167,0.15); }
.leaf .avatar img { width: 100%; height: 100%; object-fit: cover; }
.leaf .lname { font-weight: 700; font-size: 0.88rem; line-height: 1.35; color: var(--charcoal); }
.leaf .lgen { font-size: 0.72rem; color: #78817b; }
.leaf.married { transform: scale(1.04); }
.leaf .mark-deceased { position: absolute; top: 6px; inset-inline-end: 8px; color: var(--memorial); font-size: 0.8rem; }
.leaf .mark-married { position: absolute; top: 6px; inset-inline-start: 8px; color: var(--gold); font-size: 0.8rem; }
.toggle-kids {
  margin-top: 6px; border: none; background: #eef2ee; color: var(--emerald); border-radius: 999px;
  padding: 2px 12px; font-weight: 800; cursor: pointer; font-size: 0.8rem;
}
.leaf.highlight { outline: 3px solid var(--gold); outline-offset: 2px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 18px 0; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; font-weight: 600; color: #4b544f; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- Member popup ---------- */
.popup-backdrop {
  position: fixed; inset: 0; background: rgba(20,32,27,0.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.popup-backdrop.open { display: flex; }
.popup {
  background: #fff; border-radius: 20px; max-width: 420px; width: 100%;
  padding: 28px; box-shadow: var(--shadow-lg); animation: fadeUp 0.25s ease;
  text-align: center; position: relative; max-height: 90vh; overflow: auto;
}
.popup .close { position: absolute; top: 12px; inset-inline-end: 14px; border: none; background: none; font-size: 1.3rem; cursor: pointer; color: #78817b; }
.popup .avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; font-size: 2rem; background: #eef2ee; overflow: hidden; }
.popup .avatar img { width: 100%; height: 100%; object-fit: cover; }
.popup h3 { margin: 0 0 2px; }
.popup .sub { color: #6a736e; font-size: 0.9rem; margin-bottom: 14px; }
.popup .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---------- Profile ---------- */
.profile-header { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.profile-photo {
  width: 120px; height: 120px; border-radius: 50%; background: #eef2ee;
  display: grid; place-items: center; font-size: 2.6rem; overflow: hidden; flex-shrink: 0;
  border: 4px solid #fff; box-shadow: var(--shadow);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k { font-size: 0.78rem; color: #78817b; font-weight: 700; }
.kv .v { font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: #eef2ee; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.88rem; }
.chip:hover { background: #e0ebe4; }
.path-strip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.path-strip .node { background: #fff; border: 1.5px solid var(--cedar); color: var(--emerald); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.86rem; }
.path-strip .node.founder { background: var(--emerald); color: #fff; border-color: var(--gold); }
.path-strip .arrow { color: var(--gold); font-weight: 800; }

/* ---------- Roots journey ---------- */
.roots-journey { position: relative; max-width: 560px; margin: 0 auto; padding-inline-start: 26px; }
.roots-journey::before { content: ''; position: absolute; inset-inline-start: 8px; top: 10px; bottom: 10px; width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--cedar)); border-radius: 4px; }
.roots-item { position: relative; margin: 0 0 18px; }
.roots-item::before { content: ''; position: absolute; inset-inline-start: -24px; top: 18px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--cedar); border: 3px solid var(--ivory); box-shadow: 0 0 0 2px var(--cedar); }
.roots-item.founder::before { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); }

/* ---------- Tables ---------- */
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th, table.data td { padding: 12px 14px; text-align: start; border-bottom: 1px solid #f0f2f0; font-size: 0.92rem; }
table.data th { background: #f3f7f4; color: var(--emerald); font-weight: 800; }
table.data tr:hover td { background: #fbfdfb; }

/* ---------- Bars (dashboard mini charts) ---------- */
.bar-row { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 10px; margin: 8px 0; }
.bar-row .bar { height: 12px; border-radius: 999px; background: #eef2ee; overflow: hidden; }
.bar-row .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cedar), var(--emerald)); border-radius: 999px; }
.bar-row .n { font-weight: 800; color: var(--emerald); text-align: end; }

/* ---------- Auth card ---------- */
.auth-wrap { max-width: 440px; margin: 48px auto; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 64px; background: var(--emerald); color: #e8f1ec; padding: 36px 0 22px; }
.footer-inner { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.site-footer strong { font-size: 1.15rem; }
.site-footer .slogan { color: var(--gold); margin: 2px 0 6px; }
.footer-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: #cfe4da; font-weight: 600; }
.copyright { font-size: 0.82rem; color: #9ec3b2; margin: 8px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; inset-inline: 0; flex-direction: column; align-items: stretch;
    background: var(--ivory); padding: 14px 20px 20px; box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
}

/* ---------- Family photos: vertical rotating carousel ---------- */
.photos-block { background: linear-gradient(180deg, #fff, var(--ivory)); }
.photos-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.photos-head h2 { margin: 0; }
.photo-add { cursor: pointer; font-size: 1.05rem; padding: 14px 26px; }
.vcarousel { position: relative; max-width: 760px; margin: 18px auto 0; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-lg); background: #0b2e24; }
.vc-track { height: min(72vh, 560px); overflow-y: auto; scroll-snap-type: y mandatory;
  scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior: contain; outline-offset: -3px; }
.vc-track::-webkit-scrollbar { display: none; }
.vc-slide { margin: 0; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; position: relative;
  display: flex; align-items: center; justify-content: center; }
.vc-slide img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.vc-slide figcaption { position: absolute; inset-inline: 0; bottom: 0; display: flex; justify-content: space-between;
  align-items: flex-end; gap: 10px; padding: 34px 18px 14px; color: #fff; font-weight: 600;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.vc-slide figcaption small { font-weight: 400; opacity: .85; }
.vc-del { background: rgba(255,255,255,.18); border: 0; color: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.vc-ctrl { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px; }
.vc-ctrl button { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; font-size: .95rem;
  background: rgba(255,255,255,.88); color: var(--emerald); box-shadow: var(--shadow); }
.vc-ctrl button:hover { background: var(--gold); color: #fff; }
.vc-count { position: absolute; top: 12px; inset-inline-start: 14px; background: rgba(0,0,0,.5); color: #fff;
  padding: 3px 12px; border-radius: 20px; font-size: .85rem; }
@media (prefers-reduced-motion: reduce) { .vc-track { scroll-behavior: auto; } }

/* ---------- 3D cedar tree ---------- */
.mode-switch { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.mode-switch button { border: 2px solid var(--emerald); background: #fff; color: var(--emerald); font: inherit; font-weight: 700;
  padding: 10px 20px; border-radius: 30px; cursor: pointer; }
.mode-switch button.active { background: var(--emerald); color: #fff; }
.t3d { position: relative; height: min(78vh, 720px); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  background: radial-gradient(ellipse at 50% 30%, #0f5a44 0%, #07392b 55%, #041f17 100%); }
.t3d-canvas { position: absolute; inset: 0; }
.t3d-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.t3d-label, .t3d-tip { position: absolute; left: 0; top: 0; pointer-events: none; display: none; white-space: nowrap; will-change: transform; }
.t3d-label { background: var(--gold); color: #fff; font-weight: 800; padding: 5px 14px; border-radius: 20px; box-shadow: var(--shadow); }
.t3d-tip { background: rgba(255,255,255,.96); color: var(--charcoal); padding: 6px 12px; border-radius: 10px; box-shadow: var(--shadow-lg);
  display: none; text-align: center; }
.t3d-tip b, .t3d-tip small { display: block; } .t3d-tip small { color: #667; }
.t3d-tip img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.t3d-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #d8ecde; font-size: 1.4rem; pointer-events: none; }
.t3d-tools { position: absolute; top: 12px; inset-inline-end: 12px; display: flex; flex-direction: column; gap: 8px; }
.t3d-tools button, .t3d-journey button { border: 0; border-radius: 10px; background: rgba(255,255,255,.9); color: var(--emerald);
  font: inherit; font-weight: 700; padding: 8px 12px; cursor: pointer; }
.t3d-tools button { width: 42px; height: 42px; border-radius: 50%; padding: 0; font-size: 1.2rem; }
.t3d-hint { position: absolute; bottom: 8px; inset-inline: 12px; text-align: center; color: #bfdccf; font-size: .8rem; pointer-events: none; }
.t3d-journey { position: absolute; top: 12px; inset-inline-start: 12px; max-width: calc(100% - 80px); flex-direction: column; gap: 8px;
  background: rgba(4,31,23,.82); color: #fff; padding: 12px 14px; border-radius: 14px; backdrop-filter: blur(6px); }
.t3d-journey .j-text b, .t3d-journey .j-text small { display: block; } .t3d-journey small { color: var(--gold); }
.j-btns { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) { .t3d { height: 72vh; } .t3d-hint { font-size: .72rem; } }

/* ---------- Family around the world ---------- */
.world-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; margin-top: 18px; align-items: start; }
.world-map { padding: 10px; } .world-map svg { width: 100%; height: auto; display: block; }
.wm { cursor: pointer; } .wm:focus { outline: none; } .wm:focus circle:last-of-type, .wm.sel circle:last-of-type { stroke: var(--gold); stroke-width: 3; }
.wm .pulse { animation: wmpulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes wmpulse { 0% { transform: scale(.7); opacity: .55; } 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wm .pulse { animation: none; } }
.world-side { max-height: 560px; overflow: auto; } .world-list, .world-people { list-style: none; margin: 0; padding: 0; }
.world-list button { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; text-align: start; background: none; border: 0;
  border-bottom: 1px solid #eee; padding: 10px 4px; font: inherit; cursor: pointer; color: var(--charcoal); }
.world-list button:hover { background: #f2f7f2; } .world-list b { color: var(--emerald); } .world-list small { width: 100%; color: #78817b; }
.world-people li { padding: 6px 4px; border-bottom: 1px dashed #e5e5e5; }
@media (max-width: 860px) { .world-layout { grid-template-columns: 1fr; } }

/* ---------- nav "More", bell, heritage ---------- */
.nav-more { position: relative; } .nav-more summary { list-style: none; cursor: pointer; padding: 8px 12px; font-weight: 700; color: var(--emerald); border-radius: 10px; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more > div { position: absolute; inset-inline-start: 0; top: 100%; z-index: 60; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 190px; padding: 6px; display: flex; flex-direction: column; }
.nav-more > div a { padding: 9px 12px; border-radius: 8px; } .nav-more > div a:hover { background: #f2f7f2; }
.bell { background: #d33; color: #fff; border-radius: 10px; padding: 0 5px; font-size: .7rem; margin-inline-start: 2px; }
@media (max-width: 860px) { .nav-more > div { position: static; box-shadow: none; } }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.photo-grid img { width: 100%; height: 170px; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow); }
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 3px solid var(--gold); padding-inline-start: 18px; }
.timeline li { margin: 0 0 16px; position: relative; } .timeline li::before { content: ''; position: absolute; inset-inline-start: -26px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--emerald); border: 2px solid #fff; }
.timeline b { color: var(--emerald); margin-inline-end: 8px; }
textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #d5ddd8; border-radius: 10px; }

.kin-result { font-size: 1.15rem; font-weight: 800; color: var(--emerald); background: #eef6f1; border-inline-start: 5px solid var(--gold); padding: 14px 16px; border-radius: 10px; margin-bottom: 14px; }
