/* فال انبیا — public landing + trial */
.fa-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  background: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(45, 212, 191, 0.16), transparent 55%),
    radial-gradient(ellipse 80% 60% at 90% 100%, rgba(16, 185, 129, 0.18), transparent 50%),
    linear-gradient(165deg, #0a1210 0%, #0f1816 45%, #0c1419 100%);
  border-bottom: 1px solid rgba(45, 212, 191, 0.15);
}
.fa-hero__ornament {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.3;
  background-image: radial-gradient(circle at 25% 35%, rgba(45, 212, 191, 0.35) 0, transparent 2px),
    radial-gradient(circle at 75% 65%, rgba(16, 185, 129, 0.3) 0, transparent 2px);
  background-size: 52px 52px;
}
.fa-hero__inner { position: relative; z-index: 1; text-align: center; max-width: 820px; margin: 0 auto; }
.fa-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.08);
  color: #5eead4;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.fa-hero h1 {
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  line-height: 1.35;
  color: #eef8f5;
  margin-bottom: 0.75rem;
}
.fa-hero__lead { color: #9fb8b0; font-size: 1.05rem; max-width: 640px; margin: 0 auto 1.5rem; }
.fa-hero__quote {
  font-style: italic;
  color: #5eead4;
  font-size: 1.05rem;
  margin: 1.25rem auto 1.75rem;
  padding: 0.75rem 1.25rem;
  border-right: 3px solid rgba(45, 212, 191, 0.55);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 0 12px 12px 0;
  max-width: 520px;
}
.fa-hero__actions { display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; }
.fa-unlimited-pill {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #5eead4;
  font-size: 0.78rem;
  font-weight: 700;
}

.fa-trial-wrap {
  background: linear-gradient(180deg, rgba(15, 24, 22, 0.6), rgba(12, 20, 25, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.fa-trial-wrap .tool-trial__quota.is-unlimited { color: #5eead4; }
.fa-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.fa-mode-btn {
  cursor: pointer;
  border: 1px solid var(--border, #2d3f56);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #8fa3bc);
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.fa-mode-btn.is-active {
  border-color: rgba(45, 212, 191, 0.65);
  color: #5eead4;
  background: rgba(45, 212, 191, 0.1);
}

.trial-anbiya-card {
  margin-top: 1rem;
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(45, 212, 191, 0.06), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(45, 212, 191, 0.22);
}
.trial-anbiya-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--muted, #8fa3bc);
  margin-bottom: 0.85rem;
}
.trial-anbiya-meta b { color: #5eead4; }
.trial-anbiya-name {
  font-size: 1.35rem;
  line-height: 1.6;
  color: #eef8f5;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.trial-anbiya-name-ar {
  font-size: 1.05rem;
  color: #9fb8b0;
  margin-bottom: 0.65rem;
}
.trial-anbiya-theme {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  font-size: 0.78rem;
  margin-bottom: 0.85rem;
}
.trial-anbiya-quote {
  font-size: 1.05rem;
  line-height: 2;
  color: #e8edf4;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}
.trial-anbiya-interp {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border-right: 3px solid rgba(16, 185, 129, 0.55);
}
.trial-anbiya-interp h4 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: #6ee7b7;
}
.trial-anbiya-interp p { margin: 0; line-height: 1.85; color: #c5cdd8; }

.anbiya-result {
  --anbiya-accent: #10b981;
  margin-top: 1rem;
  padding: clamp(1.1rem, 3vw, 1.75rem);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, color-mix(in srgb, var(--anbiya-accent) 18%, transparent), transparent 55%),
    linear-gradient(160deg, rgba(12, 18, 22, 0.92), rgba(8, 12, 16, 0.96));
  border: 1px solid color-mix(in srgb, var(--anbiya-accent) 38%, rgba(227, 189, 77, 0.25));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.anbiya-result__hero {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 1.15rem 1.5rem;
  align-items: center;
}
@media (max-width: 640px) {
  .anbiya-result__hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .anbiya-result__id { align-items: center; }
  .anbiya-result__tags { justify-content: center; }
}
.anbiya-portrait {
  margin: 0;
  width: min(100%, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--anbiya-accent) 70%, #e3bd4d),
    0 0 28px color-mix(in srgb, var(--anbiya-accent) 35%, transparent);
}
.anbiya-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.anbiya-result__id { display: flex; flex-direction: column; min-width: 0; }
.anbiya-result__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.anbiya-chip {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #e8c96a;
  border: 1px solid rgba(227, 189, 77, 0.4);
  background: rgba(227, 189, 77, 0.1);
}
.anbiya-chip--symbol {
  color: #5eead4;
  border-color: color-mix(in srgb, var(--anbiya-accent) 55%, transparent);
  background: color-mix(in srgb, var(--anbiya-accent) 12%, transparent);
}
.anbiya-guidance,
.anbiya-story {
  margin-top: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
}
.anbiya-guidance {
  background: color-mix(in srgb, var(--anbiya-accent) 10%, rgba(0, 0, 0, 0.28));
  border-right: 3px solid var(--anbiya-accent);
}
.anbiya-story {
  background: rgba(227, 189, 77, 0.07);
  border-right: 3px solid rgba(227, 189, 77, 0.55);
}
.anbiya-guidance h4,
.anbiya-story h4 {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
}
.anbiya-guidance h4 { color: #5eead4; }
.anbiya-story h4 { color: #e8c96a; }
.anbiya-guidance p,
.anbiya-story p {
  margin: 0;
  line-height: 1.85;
  color: #c5cdd8;
}
.anbiya-result__note {
  font-size: 0.82rem;
  color: var(--muted, #8fa3bc);
  margin: 0.85rem 0 0;
  line-height: 1.7;
}
.anbiya-result__note--sm { font-size: 0.75rem; opacity: 0.9; }

.anbiya-gallery { margin-top: 1.5rem; }
.anbiya-gallery__head { text-align: center; margin-bottom: 1.15rem; }
.anbiya-gallery__head h3,
.anbiya-gallery__head h2 {
  margin: 0 0 0.35rem;
  color: #eef8f5;
  font-size: 1.2rem;
}
.anbiya-gallery__head p {
  margin: 0;
  color: var(--muted, #8fa3bc);
  font-size: 0.88rem;
}
.anbiya-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 0.75rem;
}
.anbiya-gal-card {
  --anbiya-accent: #10b981;
  cursor: pointer;
  appearance: none;
  font-family: inherit;
  text-align: center;
  color: inherit;
  background: rgba(8, 12, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 0.7rem 0.45rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.anbiya-gal-card:hover,
.anbiya-gal-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--anbiya-accent) 55%, rgba(227, 189, 77, 0.4));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  outline: none;
}
.anbiya-gal-card img {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--anbiya-accent) 65%, #e3bd4d);
}
.anbiya-gal-card__name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #eef8f5;
}
.anbiya-gal-card__theme {
  font-size: 0.7rem;
  color: var(--muted, #8fa3bc);
  line-height: 1.4;
}

.anbiya-view {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.anbiya-gallery { text-align: center; }
.anbiya-gallery > :not(.anbiya-view) { text-align: start; }
.anbiya-view__btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  color: var(--muted, #8fa3bc);
  background: transparent;
}
.anbiya-view__btn.is-active { background: #e3bd4d; color: #1a1406; font-weight: 700; }

.atree { max-width: 640px; margin-inline: auto; }
.atree[hidden], .anbiya-gallery__grid[hidden] { display: none; }
.atree__list { list-style: none; margin: 0; padding: 0; }
.atree__list .atree__list {
  margin-inline-start: 22px;
  padding-inline-start: 14px;
  border-inline-start: 1px dashed rgba(227, 189, 77, 0.35);
}
.atree__item { position: relative; padding: 4px 0; }
.atree__list .atree__list > .atree__item::before {
  content: "";
  position: absolute;
  inset-inline-start: -14px;
  top: 30px;
  width: 12px;
  border-top: 1px dashed rgba(227, 189, 77, 0.35);
}
.atree__item.is-chain::after {
  content: "";
  position: absolute;
  inset-inline-start: 27px;
  bottom: -4px;
  height: 8px;
  border-inline-start: 2px solid rgba(227, 189, 77, 0.45);
}
.atree-node {
  --anbiya-accent: #10b981;
  appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 340px);
  padding: 6px 12px 6px 6px;
  text-align: start;
  border-radius: 999px;
  background: rgba(8, 12, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.atree-node:hover,
.atree-node:focus-visible {
  outline: none;
  transform: translateX(-2px);
  border-color: color-mix(in srgb, var(--anbiya-accent) 55%, rgba(227, 189, 77, 0.4));
}
.atree-node img {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--anbiya-accent) 65%, #e3bd4d);
}
.atree-node__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.atree-node__name { font-weight: 700; font-size: 0.9rem; color: #eef8f5; }
.atree-node__theme { font-size: 0.72rem; color: var(--muted, #8fa3bc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atree-node__link {
  flex: none;
  font-size: 0.66rem;
  padding: 2px 8px;
  border-radius: 999px;
  color: #e3bd4d;
  background: rgba(227, 189, 77, 0.1);
}
.atree__unknown { margin-top: 1.25rem; }
.atree__unknown-title { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--muted, #8fa3bc); }
.atree__unknown-row { display: flex; flex-wrap: wrap; gap: 8px; }
.atree__unknown-row .atree-node { width: auto; }
.atree__note { margin: 1rem 0 0; font-size: 0.75rem; color: var(--muted, #8fa3bc); }

[data-theme="light"] .fa-page,
[data-theme="light"] .fa-page .section {
  background: #f6f4fb;
  color: #1f1b2e;
}
[data-theme="light"] .fa-trial-wrap {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
[data-theme="light"] .fa-mode-btn {
  color: #5c5470;
  background: #fff;
  border-color: #e2dcf0;
}
[data-theme="light"] .fa-mode-btn.is-active {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(16, 185, 129, 0.12);
}
[data-theme="light"] .anbiya-result,
[data-theme="light"] .trial-anbiya-card {
  background: linear-gradient(160deg, #ffffff, #f4f0ff);
  border-color: #e2dcf0;
  box-shadow: 0 12px 32px rgba(91, 60, 160, 0.1);
  color: #1f1b2e;
}
[data-theme="light"] .trial-anbiya-name { color: #1f1b2e; }
[data-theme="light"] .trial-anbiya-name-ar,
[data-theme="light"] .trial-anbiya-meta,
[data-theme="light"] .anbiya-result__note { color: #5c5470; }
[data-theme="light"] .trial-anbiya-meta b { color: #0f766e; }
[data-theme="light"] .trial-anbiya-theme {
  color: #0f766e;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}
[data-theme="light"] .trial-anbiya-quote {
  color: #1f1b2e;
  border-color: #e2dcf0;
}
[data-theme="light"] .anbiya-chip {
  color: #92400e;
  background: rgba(227, 189, 77, 0.22);
  border-color: rgba(180, 130, 20, 0.45);
}
[data-theme="light"] .anbiya-chip--symbol { color: #0f766e; }
[data-theme="light"] .trial-anbiya-interp,
[data-theme="light"] .anbiya-guidance,
[data-theme="light"] .anbiya-story {
  background: #f7f4ff;
}
[data-theme="light"] .trial-anbiya-interp h4,
[data-theme="light"] .anbiya-guidance h4 { color: #0f766e; }
[data-theme="light"] .anbiya-story h4 { color: #92400e; }
[data-theme="light"] .trial-anbiya-interp p,
[data-theme="light"] .anbiya-guidance p,
[data-theme="light"] .anbiya-story p { color: #3f3658; }
[data-theme="light"] .anbiya-gallery__head h2,
[data-theme="light"] .anbiya-gallery__head h3 { color: #1f1b2e; }
[data-theme="light"] .anbiya-gallery__head p { color: #5c5470; }
[data-theme="light"] .anbiya-gal-card {
  background: #ffffff;
  border-color: #e2dcf0;
  color: #1f1b2e;
  box-shadow: 0 8px 22px rgba(91, 60, 160, 0.08);
}
[data-theme="light"] .anbiya-gal-card:hover,
[data-theme="light"] .anbiya-gal-card:focus-visible {
  box-shadow: 0 14px 28px rgba(91, 60, 160, 0.14);
}
[data-theme="light"] .anbiya-gal-card__name { color: #1f1b2e; }
[data-theme="light"] .anbiya-gal-card__theme { color: #5c5470; }
[data-theme="light"] .anbiya-view {
  background: #ffffff;
  border-color: #e2dcf0;
}
[data-theme="light"] .anbiya-view__btn { color: #5c5470; }
[data-theme="light"] .atree-node {
  background: #ffffff;
  border-color: #e2dcf0;
  color: #1f1b2e;
  box-shadow: 0 6px 16px rgba(91, 60, 160, 0.08);
}
[data-theme="light"] .atree-node__name { color: #1f1b2e; }
[data-theme="light"] .atree-node__theme { color: #5c5470; }
[data-theme="light"] .atree-node__link {
  color: #92400e;
  background: rgba(227, 189, 77, 0.22);
}
[data-theme="light"] .atree__unknown-title,
[data-theme="light"] .atree__note { color: #5c5470; }

.anbiya-panel-card {
  border-radius: 16px;
  padding: 1.25rem;
  background: linear-gradient(160deg, rgba(45, 212, 191, 0.07), rgba(16, 185, 129, 0.06));
  border: 1px solid rgba(45, 212, 191, 0.2);
  margin-top: 1rem;
}
.anbiya-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.fh-mode-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.fh-mode-btn {
  cursor: pointer;
  border: 1px solid var(--border, #2d3f56);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted, #8fa3bc);
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
}
.fh-mode-btn.is-active {
  border-color: rgba(201, 162, 39, 0.65);
  color: #e8c96a;
  background: rgba(201, 162, 39, 0.1);
}

/* Desktop family tree: top-down chart; the indented list stays for phones. */
.atree-h { display: none; }
@media (min-width: 900px) {
  .atree { max-width: none; }
  .atree > .atree__list { display: none; }
  .atree-h {
    display: block;
    direction: ltr;
    overflow-x: auto;
    padding: 4px 0 12px;
    --line: rgba(227, 189, 77, 0.45);
  }
  .atree-h__list {
    display: flex;
    justify-content: center;
    position: relative;
    margin: 0;
    padding: 18px 0 0;
    list-style: none;
  }
  .atree-h__root { padding-top: 0; width: max-content; min-width: 100%; }
  .atree-h__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 2px 0;
  }
  .atree-h__item::before,
  .atree-h__item::after {
    content: "";
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 18px;
    border-top: 1px solid var(--line);
  }
  .atree-h__item::after { right: auto; left: 50%; border-left: 1px solid var(--line); }
  .atree-h__item:only-child::before,
  .atree-h__item:only-child::after { display: none; }
  .atree-h__item:only-child { padding-top: 0; }
  .atree-h__item:first-child::before,
  .atree-h__item:last-child::after { border: 0 none; }
  .atree-h__item:last-child::before { border-right: 1px solid var(--line); }
  .atree-h__list .atree-h__list::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: 18px;
    border-left: 1px solid var(--line);
  }
  .atree-h__root > .atree-h__item { padding-top: 0; }
  .atree-h__root > .atree-h__item::before,
  .atree-h__root > .atree-h__item::after { display: none; }

  .atree-h .atree-node {
    direction: rtl;
    flex-direction: column;
    gap: 4px;
    width: 68px;
    padding: 5px 1px 7px;
    border-radius: 14px;
    text-align: center;
  }
  .atree-h .atree-node:hover,
  .atree-h .atree-node:focus-visible { transform: translateY(-2px); }
  .atree-h .atree-node img { width: 46px; height: 46px; }
  .atree-h .atree-node__txt { align-items: center; }
  .atree-h .atree-node__name { font-size: 0.8rem; }
  .atree-h .atree-node__theme { display: none; }
  .atree-h .atree-node__link { font-size: 0.6rem; padding: 1px 6px; }
  .atree__unknown, .atree__note { text-align: center; }
  .atree__unknown-row { justify-content: center; }
}
