:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --ink: #1c1915;
  --muted: #6a6158;
  --line: #e3d8c8;
  --card: #fffcf8;
  --accent: #1b4334;
  --accent-deep: #12281f;
  --accent-soft: #e7f2ec;
  --gold: #b08958;
  --gold-soft: #e4c48a;
  --shadow: 0 18px 40px rgba(28, 25, 21, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
}

body { min-height: 100vh; }

h1, h2, .nasab, .brand, .section-title {
  font-family: var(--font-display);
}

a { color: inherit; }

button, input, textarea { font: inherit; color: inherit; }

button, .text-btn, summary { cursor: pointer; }

img { max-width: 100%; }

.sr, .hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.shell.narrow { width: min(760px, calc(100% - 2rem)); }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 252, 248, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-top);
}

.top-inner {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.8;
  font-size: 1.05rem;
  font-family: "Noto Naskh Arabic", "Amiri", serif;
}

.logo-seal {
  --seal: 3.1rem;
  position: relative;
  display: inline-block;
  width: var(--seal);
  height: var(--seal);
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  vertical-align: middle;
}

.logo-seal img {
  position: absolute;
  width: 160.9%;
  height: 160.9%;
  max-width: none;
  left: -30.77%;
  top: -22.37%;
}

.mark {
  --seal: 3.1rem;
}

.hero-copy h1.family-logo {
  display: grid;
  justify-items: center;
  width: min(100%, 34rem);
  margin: 0 0 0.4rem;
  padding: 0;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
}

.seal {
  --seal: min(16.5rem, 100%);
}

.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Noto Naskh Arabic", "Amiri", serif;
  font-weight: 600;
  line-height: 1.8;
}

.foot-brand .logo-seal {
  --seal: 2.4rem;
}

.nav-check {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.nav-toggle {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  font-weight: 700;
  display: none;
  align-items: center;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.nav a[aria-current="page"] {
  background: var(--accent);
  color: #fff;
}

.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"]:hover { color: #fff; }

.hero-band {
  background:
    radial-gradient(700px 280px at 100% 0%, rgba(228, 196, 138, 0.2), transparent 60%),
    linear-gradient(165deg, #245741 0%, #17382c 55%, #12281f 100%);
  color: #f6f0e4;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2.2rem 0 2.4rem;
}

.hero-copy h1, .page-hero h1, .profile h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.35;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--gold);
  font-weight: 700;
}

.hero-band .eyebrow, .page-hero .eyebrow { color: var(--gold-soft); }

.lede, .prose { margin: 0.8rem 0 0; }

.hero-copy .lede {
  color: rgba(246, 240, 228, 0.9);
  white-space: pre-line;
  font-size: 1.08rem;
  max-width: 38rem;
}

.hero-actions, .invite-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1.2rem;
}

.finder {
  background: var(--card);
  color: var(--ink);
  border-radius: 22px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.7rem;
}

.finder-title {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
}

.finder input, .contact-form input, .contact-form textarea, .top-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  min-height: 3rem;
}

.finder button, .contact-form button, .text-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  min-height: 3rem;
  padding: 0 1.2rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.text-btn.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.finder-note, .empty, .meta, .title, .label {
  color: var(--muted);
}

.finder-note { margin: 0; font-size: 0.92rem; }
.finder-note a { color: var(--accent); font-weight: 800; }

.band { padding: 2.2rem 0; }

.band.alt { background: #fffdf8; border-block: 1px solid var(--line); }

.section-title {
  margin: 0 0 1rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.4;
}

.stats, .cards, .steps ol, .hits, .people {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.8rem;
}

.stats li, .cards li, .side-card, .contact-side, .profile-head {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem 1.05rem;
}

.stats strong {
  display: block;
  font-size: 1.7rem;
  color: var(--accent);
  line-height: 1.3;
}

.stats span, .side-card span { color: var(--muted); }

.split, .about-layout, .contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.cards { display: grid; gap: 0.75rem; }

.cards a {
  display: block;
  margin: -1rem -1.05rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
}
.cards h3, .steps h3, .contact-side h2 { margin: 0 0 0.3rem; font-size: 1.08rem; }
.cards p, .steps p, .contact-side p { margin: 0; color: var(--muted); }

.text-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent);
  font-weight: 800;
}

.prose { color: var(--ink); white-space: pre-line; }
.prose.lead { font-size: 1.15rem; }

.steps ol {
  display: grid;
  gap: 0.8rem;
}

.steps li {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  background: var(--bg);
  border-radius: 16px;
  padding: 0.9rem;
}

.steps li > span {
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.invite {
  background: var(--accent-deep);
  color: #f6f0e4;
  padding: 2rem 0;
}

.invite h2 { margin: 0 0 0.35rem; }
.invite p { margin: 0; color: rgba(246, 240, 228, 0.82); }
.invite .text-btn { background: var(--gold-soft); color: #1c1915; }

.page-hero {
  background:
    radial-gradient(500px 180px at 100% 0%, rgba(228, 196, 138, 0.18), transparent 60%),
    linear-gradient(165deg, #245741, #17382c);
  color: #f6f0e4;
  padding: 2.4rem 0 2rem;
}

.page-hero .lede, .lede.light { color: rgba(246, 240, 228, 0.88); max-width: 40rem; }

.side-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: flex-start;
}

.side-card .eyebrow { color: var(--gold); }
.side-card strong { font-size: 2.4rem; color: var(--accent); line-height: 1; }
.side-card .text-btn { margin-top: 0.8rem; }

.contact-form, .contact-side {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.1rem;
}

.contact-form {
  display: grid;
  gap: 0.75rem;
}

.contact-form label, .profile label { display: grid; gap: 0.3rem; font-weight: 700; }

.contact-side p {
  display: grid;
  gap: 0.1rem;
  margin: 0.7rem 0 0;
}

.contact-side span { color: var(--muted); font-size: 0.88rem; }
.contact-side a { color: var(--accent); font-weight: 800; }

.banner { border-radius: 12px; padding: 0.7rem 0.8rem; margin: 0; }
.banner.ok { background: var(--accent-soft); color: var(--accent); }
.banner.bad { background: #f8e6e2; color: #8c2f2f; }
.contact-main { display: grid; gap: 0.75rem; align-content: start; }
.form-alert {
  margin: 0;
  color: #c62828;
  font-weight: 800;
  line-height: 1.7;
}
.form-alert a { color: #c62828; font-weight: 800; text-decoration: underline; }

.hits, .people {
  display: grid;
  gap: 0.7rem;
}

.hit, .tile, .start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.8rem 0.9rem;
  min-height: 4.6rem;
}

.hit:active, .tile:active { background: #f7f1e8; }

.avatar {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.avatar.xl {
  width: 4.4rem;
  height: 4.4rem;
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

.hit-body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.hit-body strong, .tile strong { font-size: 1.05rem; line-height: 1.4; }
.chev { color: var(--gold); font-size: 1.4rem; }

.profile { padding: 0 0 2.8rem; }

.lineage {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  white-space: nowrap;
  scrollbar-width: none;
}

.lineage::-webkit-scrollbar { display: none; }

.lineage a, .lineage .current {
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

.lineage .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.sep { color: var(--gold); }

.profile-hero {
  position: relative;
  color: #f6f0e4;
  padding: 2.15rem 0 0;
  background:
    radial-gradient(560px 240px at 100% -20%, rgba(228, 196, 138, 0.32), transparent 62%),
    radial-gradient(380px 200px at 0% 120%, rgba(228, 196, 138, 0.12), transparent 58%),
    linear-gradient(165deg, #2c6249 0%, #17382c 54%, #10241c 100%);
}

.profile-hero h1,
.profile-hero .profile-relation,
.profile-hero .title { color: #f6f0e4; }

.profile-hero h1 {
  font-size: clamp(2.15rem, 4.4vw, 3.15rem);
  line-height: 1.25;
}

.profile-hero .blessing,
.profile-hero .title { color: var(--gold-soft); }

.profile-hero .title {
  margin: 0.3rem 0 0;
  font-size: 1.08rem;
}

.profile-hero-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.95rem;
}

.profile-identity { min-width: 0; }

.profile .avatar.xl {
  margin: 0;
}

.profile-seal {
  margin-top: 0.35rem;
  width: 5.7rem;
  height: 5.7rem;
  font-family: var(--font-display);
  font-size: 2.35rem;
  color: #17382c;
  background: radial-gradient(circle at 35% 30%, #fff8ec, #e8cb90 58%, #c4a36a);
  box-shadow:
    0 0 0 4px rgba(228, 196, 138, 0.28),
    0 12px 28px rgba(0, 0, 0, 0.2);
}

.profile-relation {
  margin: 0.35rem 0 0;
  font-size: 1.12rem;
  line-height: 1.7;
  color: rgba(246, 240, 228, 0.9);
}

.profile-relation a {
  color: var(--gold-soft);
  font-weight: 800;
  text-decoration: none;
}

.profile-relation a:hover { text-decoration: underline; }

.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.profile-facts li {
  border: 1px solid rgba(228, 196, 138, 0.4);
  background: rgba(255, 252, 248, 0.08);
  color: #f6f0e4;
  border-radius: 999px;
  padding: 0.12rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.profile-hero .profile-actions { margin-top: 1.15rem; }

.profile-hero .share {
  background: rgba(255, 252, 248, 0.08);
  color: #f6f0e4;
  border-color: rgba(228, 196, 138, 0.45);
}

.profile-hero .share.solid {
  background: var(--gold-soft);
  color: #17382c;
  border-color: transparent;
}

.profile-hero .share:hover { background: rgba(255, 252, 248, 0.16); }
.profile-hero .share.solid:hover { background: #f3d7a4; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.2rem, 1fr));
  gap: 0.7rem;
  list-style: none;
  margin: 1.35rem 0 -2.15rem;
  padding: 0;
  position: relative;
  z-index: 2;
}

.profile-stats li {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.85rem 0.9rem 0.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.profile-stats li::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold-soft));
}

.profile-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--accent);
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

@media (max-width: 560px) {
  .profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-stats:has(li:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-stats strong { font-size: 1.55rem; }
  .profile-stats li { padding: 0.7rem 0.35rem 0.6rem; }
}

.profile-body { padding-top: 3.45rem; }

.profile-grid {
  display: grid;
  gap: 0.9rem;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.05rem 1.05rem 1.15rem;
  box-shadow: 0 12px 32px rgba(28, 25, 21, 0.05);
}

.profile-card h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
}

.profile-card h2 .count {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  min-width: 1.7rem;
  text-align: center;
  padding: 0.08rem 0.5rem;
}

.profile .label {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.profile .hit:hover,
.profile .tile:hover {
  border-color: #d9c7a8;
  background: #fffaf3;
}

.profile-card .empty {
  margin: 0;
  background: var(--bg);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
}

.profile .parents { grid-template-columns: 1fr; }

.lineage-card { margin-top: 0.9rem; }

.chain-wrap { position: relative; }

.chain-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0.35rem;
  left: 0;
  width: 2.4rem;
  pointer-events: none;
  background: linear-gradient(to left, rgba(255, 252, 248, 0), var(--card));
}

.chain {
  display: flex;
  align-items: flex-start;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0.15rem 0.1rem 0.35rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-soft) transparent;
}

.chain-item {
  position: relative;
  flex: 0 0 6.8rem;
  scroll-snap-align: start;
}

.chain-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 1.28rem;
  right: 50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(to left, var(--gold-soft), #e7d3ae);
  z-index: 0;
}

.chain-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

.chain-node .avatar {
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.chain-item.is-current .avatar {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(176, 137, 88, 0.45);
}

.chain-node strong {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  padding-inline: 0.2rem;
  font-size: 0.84rem;
  line-height: 1.35;
  font-weight: 800;
}

.chain-node:hover strong { color: var(--accent); }

.lineage-card .nasab {
  margin: 0.85rem 0 0;
  background: #fbf6ee;
  border-radius: 16px;
  padding: 0.95rem 1.05rem;
  border-inline-start: 4px solid var(--gold);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.nasab {
  margin: 0.55rem 0 0;
  font-size: 1.08rem;
  line-height: 2;
}

.nasab a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.nasab-word {
  color: var(--gold);
  font-weight: 800;
  margin-inline: 0.28rem;
}

.needs-doc {
  display: inline-block;
  margin-inline-start: 0.4rem;
  padding: 0.08rem 0.5rem 0.12rem;
  border-radius: 999px;
  background: #f4e4c6;
  color: #6d4b1d;
  font-family: "Cairo", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.6;
  vertical-align: middle;
}

.profile-hero .needs-doc {
  background: rgba(246, 240, 228, 0.14);
  color: #f6e7c4;
  border: 1px solid rgba(246, 231, 196, 0.45);
  font-size: 0.95rem;
}

.blessing {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.92em;
}

.ali-note {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92em;
  margin-inline-start: 0.25rem;
}

.nasab .ali-note a {
  color: var(--accent);
  font-weight: 800;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.share {
  border: 1px solid #cfe0d6;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  min-height: 2.8rem;
  padding: 0 1rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share.solid {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.share:disabled { opacity: 0.65; }

.page-hero .finder,
.kin-finder { margin-top: 1.2rem; }

.rels {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.rels label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.rels input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.rels label:focus-within,
.rels label:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.rels label:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pill {
  display: inline-block;
  width: fit-content;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  font-weight: 800;
  font-size: 0.82rem;
}

.kin-subject { margin: 0 0 1.2rem; }

.hit.current { border-color: var(--accent); }

.block { margin-top: 1.3rem; }
.block h2 { margin: 0 0 0.55rem; font-size: 1.15rem; }

.pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.tile { flex-direction: column; align-items: flex-start; gap: 0.1rem; min-height: 5.5rem; }

.foot {
  background: var(--accent-deep);
  color: rgba(246, 240, 228, 0.86);
  padding: 1.6rem 0 calc(1.4rem + var(--safe-bottom));
}

.foot-inner {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  display: grid;
  gap: 1rem;
}

.foot strong { color: #fff; font-size: 1.05rem; }
.foot p { margin: 0.2rem 0 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.foot a { color: var(--gold-soft); text-decoration: none; font-weight: 700; }

button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 759px) {
  .top-inner { position: relative; }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 0.35rem);
    min-width: 14rem;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.4rem;
    box-shadow: var(--shadow);
    z-index: 3;
  }
  .nav-check:checked ~ .nav { display: flex; }
  .nav a { padding: 0.7rem 0.8rem; }
}

@media (min-width: 700px) {
  .stats, .cards, .steps ol { grid-template-columns: 1fr 1fr; }
  .cards.three { grid-template-columns: 1fr 1fr; }
  .hits { grid-template-columns: 1fr 1fr; }
  .pair { grid-template-columns: 1fr 1fr; }
  .profile-hero-top {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.15rem;
  }
  .profile .parents,
  .profile-card .people {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  }
  .steps li:last-child { grid-column: 1 / -1; }
}

@media (min-width: 760px) {
  .nav-toggle { display: none; }
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 2.5rem;
    align-items: center;
    padding: 4.2rem 0 3.6rem;
  }
  .split, .contact-grid { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
  .page-about .side-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
  }
  .page-about .side-card .eyebrow { margin: 0; }
  .page-about .side-card .text-btn { margin-top: 0; margin-inline-start: auto; }
  .cards.three, .stats, .steps ol { grid-template-columns: 1fr 1fr 1fr; }
  .steps li:last-child { grid-column: auto; }
  .hits { grid-template-columns: 1fr 1fr 1fr; }
  .foot-inner { grid-template-columns: 1.4fr 1fr auto; align-items: center; }
  .invite-inner { justify-content: space-between; }
  .profile-seal {
    width: 6.4rem;
    height: 6.4rem;
    font-size: 2.6rem;
  }
  .profile-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .profile-card.wide { grid-column: 1 / -1; }
  .profile-grid > .profile-card:not(.wide) .people { grid-template-columns: 1fr; }
}

@media (min-width: 1100px) {
  .cards.three { grid-template-columns: 1fr 1fr 1fr; }
}

.cert-stage {
  width: min(1200px, calc(100% - 1.5rem));
  margin: 1.4rem auto 3rem;
}

.cert-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.cert-back {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.cert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cert-note {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.cert-frame {
  background: #f3eadc;
  border-radius: 6px;
  box-shadow: 0 22px 50px rgba(23, 56, 44, 0.16);
  overflow: hidden;
}

.cert-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 640px) {
  .cert-actions { width: 100%; }
  .cert-actions .share { flex: 1 1 auto; }
}

.help-phone {
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.55fr) minmax(0, 1fr);
  gap: 0.5rem;
}
.help-phone select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.8rem 0.7rem;
  min-height: 3rem;
}
.help-cats {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
}
.help-cats legend {
  flex: 1 0 100%;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.contact-form .help-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  min-height: 0;
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}
.contact-form .help-chip input {
  width: 0.95rem;
  height: 0.95rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.help-chip:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.help-code {
  letter-spacing: 0.45em;
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
}
.help-otp-lead { margin: 0; color: var(--muted); }
.help-form .ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  min-height: 2.6rem;
}
.help-form .linkish {
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 800;
  padding: 0;
  min-height: 0;
}
.help-form .linkish:disabled { color: var(--muted); }
.help-done { display: grid; gap: 0.8rem; }
.help-done .text-btn { justify-self: start; }

@media print {
  @page { size: landscape; }
  .page-cert .top,
  .page-cert .foot,
  .page-cert .cert-toolbar,
  .page-cert .cert-note { display: none !important; }
  .page-cert .cert-stage { width: 100%; margin: 0; }
  .page-cert .cert-frame { box-shadow: none; }
  .page-cert main { padding: 0; }
}

/* ==========================================================
   تجمع آل الجندلي الرفاعي على واتساب (العام لكافة الصفحات)
   ========================================================== */
.nav-whatsapp {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  background: #f0fdf4;
  color: #15803d !important;
  font-weight: 700 !important;
  padding: 0.35rem 0.85rem !important;
  border-radius: 999px !important;
  border: 1px solid #bbf7d0;
  transition: all 0.2s ease;
  margin-right: 0.25rem;
}

.nav-whatsapp:hover {
  background: #25D366 !important;
  color: #ffffff !important;
  border-color: #25D366 !important;
  transform: translateY(-1px);
}

.nav-whatsapp .whatsapp-icon {
  flex-shrink: 0;
}

.foot-whatsapp {
  color: #15803d !important;
  font-weight: 700;
}

.foot-whatsapp:hover {
  color: #25D366 !important;
  text-decoration: underline;
}

/* الزر العائم في زاوية الشاشة لكافة الصفحات */
.whatsapp-float-wrap {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  pointer-events: none;
}

.floating-whatsapp-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.42), 0 2px 6px rgba(0, 0, 0, 0.1);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.floating-whatsapp-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.55), 0 3px 8px rgba(0, 0, 0, 0.12);
  filter: brightness(1.05);
  color: #ffffff !important;
}

.floating-whatsapp-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.floating-whatsapp-text {
  letter-spacing: -0.2px;
}

@media (max-width: 640px) {
  .whatsapp-float-wrap {
    bottom: 1rem;
    left: 1rem;
  }
  .floating-whatsapp-btn {
    padding: 0.55rem 0.95rem;
    font-size: 0.8rem;
    gap: 0.45rem;
  }
  .floating-whatsapp-icon svg {
    width: 20px;
    height: 20px;
  }
}

.gender-picks {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.gender-picks legend {
  grid-column: 1 / -1;
  font-weight: 700;
}
.gender-btn {
  display: block;
  margin: 0;
}
.gender-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.gender-btn span {
  display: grid;
  place-items: center;
  min-height: 3.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  font-weight: 800;
  font-size: 1.15rem;
}
.gender-btn input:checked + span,
.gender-btn input:focus-visible + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.child-row {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
.child-row:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.contact-form .child-row .text-btn,
.contact-form .add-child {
  justify-self: start;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 2.6rem;
  padding: 0 1rem;
}
.father-results {
  display: grid;
  gap: 0.35rem;
  max-height: 22rem;
  overflow: auto;
}
.father-hit {
  text-align: start;
  min-height: 2.8rem;
  border-radius: 12px;
  background: var(--bg);
  color: inherit;
}
.add-picked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.8rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--accent-soft);
  font-weight: 700;
}
.add-picked .text-btn {
  background: transparent;
  color: var(--accent);
  min-height: 2.2rem;
  padding: 0;
  border-radius: 0;
}
.add-inline {
  margin-top: 0.8rem;
}
.add-inline button {
  background: transparent;
  color: var(--accent);
  min-height: 2.4rem;
  padding: 0;
}
.add-mine h2 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
}
.add-mine-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}
.add-mine-list li {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.add-mine-list span {
  display: inline-block;
  margin-inline-start: 0.4rem;
  color: var(--muted, #5d6b64);
  font-weight: 600;
}
.add-mine-list p {
  margin: 0.3rem 0 0;
}

