/* =========================================================
   FiqhQA — style.css
   صوتان في التصميم: خط "IBM Plex Sans Arabic" لصوت النظام،
   وخط "Amiri" لصوت المصدر الفقهي (الإجابات والنصوص المسترجعة).
   ========================================================= */

:root {
  --g950: #071F1C;
  --g900: #0B2F2A;
  --g800: #10403A;
  --g700: #1A5A50;
  --g500: #2E7A6C;
  --gold: #C9A04F;
  --gold-d: #946B22;
  --white: #FFFFFF;
  --grey50: #F3F5F2;
  --grey100: #E6EAE5;
  --grey300: #C5CDC7;
  --ink: #132320;
  --muted: #56655F;

  --sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --naskh: "Amiri", "Traditional Arabic", "Times New Roman", serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --wrap: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--white);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.35; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 1rem; top: -60px; background: var(--gold); color: var(--g950); padding: .5rem 1rem; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: 1rem; }
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 1rem/1 var(--sans);
  padding: .95rem 1.6rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); color: var(--g950); }
.btn--gold:hover { background: #D8B264; }
.btn--ghost { border-color: rgba(255,255,255,.35); color: var(--white); background: transparent; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--sm { padding: .6rem 1.1rem; font-size: .92rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(11, 47, 42, .0);
  transition: background .3s, box-shadow .3s;
}
.topbar.is-solid { background: rgba(7, 31, 28, .94); backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(201,160,79,.25); }
.topbar__inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; }
.brand__mark { width: 30px; height: 30px; color: var(--gold); }
.nav { display: flex; gap: 1.4rem; margin-inline-start: auto; }
.nav a { color: rgba(255,255,255,.78); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--gold); }
.menu { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; }
.menu span { display: block; height: 2px; background: var(--white); margin: 7px 0; transition: transform .25s; }
.menu[aria-expanded="true"] span:first-child { transform: translateY(4.5px) rotate(45deg); }
.menu[aria-expanded="true"] span:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 85% 10%, var(--g800), transparent 60%), var(--g900);
  color: var(--white);
  padding: calc(140px + env(safe-area-inset-top, 0px)) 0 3.5rem;
}
.hero__geo {
  position: absolute; width: 760px; height: 760px;
  inset-inline-end: -220px; top: 40px;
  color: rgba(201, 160, 79, .16);
  pointer-events: none;
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3.5rem; align-items: center; }
.hero__lab { color: var(--gold); font-size: .95rem; font-weight: 500; }
.hero__title {
  font-size: clamp(4rem, 11vw, 8.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  margin: 1.2rem 0 1rem;
  direction: ltr; text-align: right;
}
.hero__lead { font-family: var(--naskh); font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.6; }
.hero__lead::after { content: ""; display: block; width: 140px; height: 3px; background: var(--gold); margin-top: 1.2rem; }
.hero__sub { margin-top: 1.4rem; max-width: 36em; color: rgba(255,255,255,.78); font-size: 1.05rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* بطاقة الورقة: مثل ورقة مخطوطة عليها الحاشية */
.sheet {
  margin: 0; position: relative;
  background: var(--white); color: var(--ink);
  border-radius: var(--r-lg);
  padding: 1.6rem 1.7rem 1.4rem;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.5);
  transform: rotate(-1.2deg);
}
.sheet__cap { font-size: .8rem; color: var(--gold-d); font-weight: 600; }
.sheet__q { font-weight: 600; font-size: 1.05rem; margin-top: .4rem; padding-bottom: .9rem; border-bottom: 1px solid var(--grey100); }
.sheet__a { border-inline-start: 3px solid var(--gold); padding-inline-start: 1rem; margin-top: 1rem; font-family: var(--naskh); font-size: 1.15rem; line-height: 1.9; }
.sheet__cite { color: var(--g700); font-size: 1rem; margin-top: .4rem; }
.sheet__trace { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 1.2rem 0 0; }
.sheet__trace li { font-size: .74rem; padding: .2rem .6rem; border-radius: 999px; background: var(--grey50); color: var(--g700); border: 1px solid var(--grey100); }
.sheet__trace li:last-child { background: var(--g700); color: var(--white); border-color: var(--g700); }

.hero__facts {
  position: relative;
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 4rem 0 0; padding: 1.6rem 0 0;
  border-top: 1px solid rgba(255,255,255,.14);
}
.hero__facts div { padding-inline: 1.2rem; border-inline-start: 1px solid rgba(201,160,79,.5); }
.hero__facts dt { color: rgba(255,255,255,.62); font-size: .9rem; }
.hero__facts dd { margin: .2rem 0 0; font-size: 1.9rem; font-weight: 700; color: var(--gold); direction: ltr; text-align: right; }
.hero__facts s { color: rgba(255,255,255,.4); font-weight: 400; font-size: 1.2rem; text-decoration-thickness: 2px; }
.hero__note { margin-top: 1rem; font-size: .85rem; color: rgba(255,255,255,.5); }

/* ---------- Sections ---------- */
.sec { padding: 6rem 0; }
.sec--grey { background: var(--grey50); }
.sec__head { max-width: 46rem; margin-bottom: 3rem; }
.kicker { color: var(--g500); font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }
.sec__head h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 700; }
.sec__intro { margin-top: 1rem; color: var(--muted); font-size: 1.08rem; }
.sec__head--light .kicker { color: var(--gold); }
.sec__head--light h2 { color: var(--white); }

/* Problem */
.problem { display: grid; grid-template-columns: .9fr 1.1fr; gap: 4rem; align-items: center; }
.bignum { font-size: clamp(4.5rem, 10vw, 8rem); font-weight: 700; line-height: 1; color: var(--g700); direction: ltr; text-align: right; letter-spacing: -.03em; }
.problem__fig p:last-child { margin-top: 1rem; max-width: 22em; color: var(--muted); }
.problem__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }
.problem__list li { border-inline-start: 3px solid var(--gold); padding-inline-start: 1.2rem; }
.problem__list h3 { font-size: 1.3rem; }
.problem__list p { color: var(--muted); }
.gap { margin-top: 4rem; padding: 2rem 2.2rem; border-radius: var(--r-md); background: var(--g900); color: var(--white); }
.gap h3 { font-size: 1.2rem; color: var(--gold); margin-bottom: .6rem; }
.gap p { color: rgba(255,255,255,.8); max-width: 70em; }

/* Solution */
.contrib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--g900); }
.contrib article { padding: 1.8rem 1.6rem 0 1.6rem; border-inline-start: 1px solid var(--grey300); }
.contrib article:first-child { border-inline-start: 0; padding-inline-start: 0; }
.contrib h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.contrib p { color: var(--muted); }

/* How */
.flow { list-style: none; margin: 0 0 3.5rem; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; counter-reset: f; }
.flow__step {
  position: relative; background: var(--grey50); border: 1px solid var(--grey100);
  border-radius: var(--r-md); padding: 1rem; display: flex; flex-direction: column; gap: .3rem; justify-content: center; min-height: 120px;
}
.flow__step:not(:last-child)::after {
  content: ""; position: absolute; inset-inline-end: -.68rem; top: 50%;
  width: .55rem; height: .55rem; border-top: 2px solid var(--gold); border-left: 2px solid var(--gold);
  transform: translateY(-50%) rotate(-45deg);
}
.flow__step b { font-size: 1.02rem; }
.flow__step span { font-size: .84rem; color: var(--muted); line-height: 1.6; }
.flow__step--dark { background: var(--g900); border-color: var(--g900); }
.flow__step--dark b { color: var(--white); } .flow__step--dark span { color: rgba(255,255,255,.65); }
.flow__step--green { background: var(--g700); border-color: var(--g700); }
.flow__step--green b { color: var(--white); } .flow__step--green span { color: rgba(255,255,255,.8); }
.flow__step--split { padding: .5rem; gap: .5rem; }
.flow__step--split div { background: var(--white); border-radius: var(--r-sm); padding: .5rem .7rem; display: flex; flex-direction: column; }
.how-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; }
.how-why h3 { font-size: 1.2rem; margin: 0 0 .5rem; }
.how-why p { color: var(--muted); margin-bottom: 1.8rem; max-width: 38em; }
.formula { background: var(--g900); color: var(--white); border-radius: var(--r-lg); padding: 2rem; }
.formula__title { color: var(--gold); font-weight: 600; }
.formula__eq { white-space: nowrap; overflow-x: auto; font: 500 1.12rem/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; margin: .6rem 0; text-align: center; padding: .8rem; border: 1px dashed rgba(201,160,79,.5); border-radius: var(--r-sm); }
.formula > p:not(.formula__title):not(.formula__eq) { color: rgba(255,255,255,.7); font-size: .95rem; }
.specs { margin: 1.4rem 0 0; display: grid; gap: .6rem; }
.specs div { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(255,255,255,.1); padding-top: .6rem; font-size: .9rem; }
.specs dt { color: rgba(255,255,255,.6); }
.specs dd { margin: 0; text-align: left; }

/* ---------- Demo ---------- */
.demo-sec { background: var(--g950); padding: 6rem 0; position: relative; }
.demo {
  background: var(--g900);
  border: 1px solid rgba(201,160,79,.3);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 3vw, 2.2rem);
  color: var(--white);
}
.demo__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.mode { font-size: .82rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(201,160,79,.14); color: var(--gold); border: 1px solid rgba(201,160,79,.4); }
.mode--live { background: rgba(46,122,108,.25); color: #8FD9C7; border-color: rgba(143,217,199,.5); }
.seg { display: inline-flex; background: var(--g950); border-radius: 999px; padding: 4px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .4rem 1rem; border-radius: 999px; font-size: .88rem; cursor: pointer; color: rgba(255,255,255,.7); direction: ltr; }
.seg input:checked + span { background: var(--white); color: var(--g900); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }

.ask textarea {
  width: 100%; resize: vertical; min-height: 96px;
  font: 400 1.15rem/1.8 var(--sans);
  color: var(--ink); background: var(--white);
  border: 2px solid transparent; border-radius: var(--r-md);
  padding: 1rem 1.2rem;
}
.ask textarea:focus { outline: none; border-color: var(--gold); }
.ask__row { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-top: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  font: 400 .88rem/1.4 var(--sans);
  background: transparent; color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  padding: .45rem .9rem; cursor: pointer; text-align: right;
}
.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip--out { border-style: dashed; }
.ask__btn { flex-shrink: 0; min-width: 160px; }

.steps { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; }
.steps li {
  font-size: .78rem; text-align: center; padding: .55rem .3rem;
  border-radius: var(--r-sm); background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.4); border-bottom: 2px solid transparent;
  transition: color .25s, background .25s, border-color .25s;
}
.steps li.is-active { color: var(--white); background: rgba(201,160,79,.16); border-color: var(--gold); }
.steps li.is-done { color: rgba(255,255,255,.85); border-color: var(--g500); }
.steps li.is-fail { color: #F3B8A8; border-color: #C9654B; }

.out { margin-top: 1.4rem; }
@media (max-width: 760px) {
  .demo__bar .seg { flex-wrap: wrap; }
  .demo__bar .seg { width: 100%; border-radius: var(--r-md); }
  .demo__bar .seg label { flex: 1 1 45%; }
  .demo__bar .seg span { text-align: center; padding: .4rem .5rem; font-size: .8rem; }
}
.empty { border: 1px dashed rgba(255,255,255,.2); border-radius: var(--r-md); padding: 2.2rem; text-align: center; color: rgba(255,255,255,.6); }

.result { display: grid; grid-template-columns: 1.35fr .65fr; gap: 1.2rem; }
.answer { background: var(--white); color: var(--ink); border-radius: var(--r-md); padding: 1.6rem 1.8rem; }
.answer__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.answer__head h3 { font-size: 1rem; color: var(--g700); }
.answer__body { font-family: var(--naskh); font-size: 1.28rem; line-height: 2.05; border-inline-start: 3px solid var(--gold); padding-inline-start: 1.1rem; }
.answer__cite { margin-top: .7rem; font-family: var(--naskh); color: var(--g700); font-size: 1.1rem; }
.answer__note { margin-top: 1rem; font-size: .82rem; color: var(--muted); background: var(--grey50); border-radius: var(--r-sm); padding: .6rem .8rem; }
.answer__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.answer__meta span { font-size: .76rem; padding: .2rem .6rem; border-radius: 999px; background: var(--grey50); color: var(--muted); }
.copy { font: 500 .82rem var(--sans); background: none; border: 1px solid var(--grey300); color: var(--muted); border-radius: 999px; padding: .3rem .8rem; cursor: pointer; }
.copy:hover { border-color: var(--g700); color: var(--g700); }

.fail { background: #FFF7F3; color: var(--ink); border-radius: var(--r-md); padding: 1.6rem 1.8rem; border-inline-start: 4px solid #C9654B; }
.fail h3 { font-size: 1.15rem; color: #9A3F28; margin-bottom: .4rem; }
.fail p { color: var(--muted); }
.fail p + p { margin-top: .5rem; }

.side { display: grid; gap: 1.2rem; align-content: start; }
.meter { background: var(--g800); border-radius: var(--r-md); padding: 1.3rem; }
.meter__top { display: flex; justify-content: space-between; align-items: baseline; }
.meter__label { font-size: .9rem; color: rgba(255,255,255,.75); }
.meter__val { font-size: 1.9rem; font-weight: 700; color: var(--gold); direction: ltr; }
.meter__track { height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); margin: .6rem 0; overflow: hidden; }
.meter__fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(to left, var(--gold), var(--g500)); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.meter__level { font-weight: 600; font-size: .95rem; }
.meter__hint { font-size: .76rem; color: rgba(255,255,255,.55); margin-top: .4rem; line-height: 1.6; }

.sources { margin-top: 1.2rem; }
.sources > h3 { font-size: 1rem; color: var(--gold); margin-bottom: .8rem; }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.src { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-md); padding: 1rem 1.1rem; }
.src__top { display: flex; gap: .7rem; align-items: flex-start; }
.src__rank { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--g950); font-weight: 700; font-size: .85rem; }
.src__book { font-weight: 600; font-size: .9rem; flex: 1; line-height: 1.6; padding-top: .15rem; }
.src__ref { font-size: .76rem; color: rgba(255,255,255,.5); margin-top: .3rem; padding-inline-start: calc(28px + .7rem); }
.src__text { font-family: var(--naskh); font-size: 1.05rem; line-height: 1.9; color: rgba(255,255,255,.88); margin: .6rem 0; }
.src__scores { display: flex; flex-wrap: wrap; gap: .3rem; }
.src__scores span { font-size: .72rem; padding: .15rem .5rem; border-radius: 99px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.65); direction: ltr; unicode-bidi: isolate; }

.banner { margin-bottom: 1rem; font-size: .86rem; padding: .7rem 1rem; border-radius: var(--r-sm); background: rgba(201,160,79,.12); color: #F0D9A6; border: 1px solid rgba(201,160,79,.35); }

.disclaimer { margin-top: 1.6rem; font-size: .92rem; line-height: 1.8; padding: 1rem 1.2rem; border-radius: var(--r-md); background: rgba(201,160,79,.1); border: 1px solid rgba(201,160,79,.4); color: rgba(255,255,255,.9); }
.disclaimer strong { color: var(--gold); }

.loading .answer__body { color: transparent; background: linear-gradient(90deg, var(--grey100) 0 40%, var(--grey50) 50%, var(--grey100) 60% 100%) 0 0 / 300% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--r-sm); min-height: 6rem; }
@keyframes shimmer { to { background-position: -100% 0; } }

/* ---------- Results ---------- */
.res { display: grid; grid-template-columns: 1.4fr .6fr; gap: 2rem; align-items: stretch; }
.chart { margin: 0; background: var(--grey50); border-radius: var(--r-lg); padding: 1.8rem; }
.chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; margin-bottom: 1.4rem; }
.chart figcaption b { font-size: 1.15rem; }
.legend { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; direction: ltr; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-inline-start: .6rem; }
.lg--gem, .bar--gem { background: var(--gold); }
.lg--sil, .bar--sil { background: var(--g700); }
.bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; height: 300px; align-items: end; }
.bars__group { display: flex; flex-direction: column; height: 100%; }
.bars__pair { flex: 1; display: flex; gap: .5rem; align-items: flex-end; justify-content: center; border-bottom: 1.5px solid var(--grey300); }
.bar { position: relative; width: min(56px, 40%); border-radius: 6px 6px 0 0; height: 0; transition: height 1.1s cubic-bezier(.2,.8,.2,1); }
.chart.is-in .bar { height: calc(var(--v) * 1%  * 1.4); }
.bar em { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 700; font-size: .82rem; padding-bottom: .2rem; white-space: nowrap; direction: ltr; }
.bars__group p { text-align: center; margin-top: .6rem; font-size: .92rem; color: var(--muted); }
.bars__group--win p { font-weight: 700; color: var(--g700); }
.res__side { display: grid; gap: 1rem; }
.kpi { background: var(--g900); color: var(--white); border-radius: var(--r-md); padding: 1.3rem 1.4rem; display: flex; flex-direction: column; justify-content: center; }
.kpi__n { font-size: 1.9rem; font-weight: 700; color: var(--gold); direction: ltr; text-align: right; }
.kpi p:last-child { font-size: .9rem; color: rgba(255,255,255,.75); }

.table-wrap { margin-top: 2.5rem; overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--grey100); }
.tbl { width: 100%; border-collapse: collapse; min-width: 760px; font-size: .95rem; }
.tbl caption { text-align: right; padding: 1rem 1.2rem; font-weight: 600; caption-side: top; color: var(--muted); font-size: .9rem; }
.tbl th, .tbl td { padding: .8rem 1rem; text-align: center; border-top: 1px solid var(--grey100); }
.tbl th:first-child, .tbl td:first-child { text-align: right; }
.tbl thead th { background: var(--grey50); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.tbl td { font-variant-numeric: tabular-nums; }
.tbl .hl td { background: #EAF3F0; }
.tbl .hl--best td { font-weight: 700; color: var(--g700); }

.lessons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 3.5rem; }
.lessons div { border-top: 2px solid var(--gold); padding-top: 1rem; }
.lessons h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.lessons p { color: var(--muted); font-size: .97rem; }

/* ---------- Data ---------- */
.source { border-inline-start: 4px solid var(--gold); padding: .4rem 0 .4rem 0; padding-inline-start: 1.4rem; margin-bottom: 2.5rem; }
.source__label { font-size: .88rem; color: var(--muted); }
.source__title { font-family: var(--naskh); font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.7; }
.source__via { color: var(--g700); }
.dstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 0 0 3rem; }
.dstats div { display: flex; flex-direction: column-reverse; justify-content: flex-end; border-inline-start: 2px solid var(--gold); padding-inline-start: 1rem; }
.dstats dd { margin: 0; font-size: 2.6rem; font-weight: 700; color: var(--g700); line-height: 1.1; direction: ltr; text-align: right; }
.dstats dt { color: var(--muted); font-size: .92rem; }
.prep { list-style: none; counter-reset: p; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem; }
.prep li { counter-increment: p; background: var(--white); border: 1px solid var(--grey100); border-radius: var(--r-md); padding: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.prep li::before { content: counter(p); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--g900); color: var(--gold); font-size: .85rem; font-weight: 700; margin-bottom: .3rem; }
.prep b { color: var(--g700); }
.prep span { font-size: .88rem; color: var(--muted); line-height: 1.65; }
.fields { margin-top: 1.8rem; }
.fields--muted { margin-top: .6rem; color: var(--muted); font-size: .92rem; }

/* ---------- Safety ---------- */
.safety { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.safety > div { border-radius: var(--r-lg); padding: 2rem; }
.safety > div:first-child { background: var(--g900); color: var(--white); }
.safety > div:last-child { background: var(--grey50); border: 1px solid var(--grey100); }
.safety h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.safety > div:first-child h3 { color: var(--gold); }
.ticks, .dashes { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.ticks li, .dashes li { position: relative; padding-inline-start: 1.8rem; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .55em; width: 14px; height: 8px; border-bottom: 2px solid var(--gold); border-left: 2px solid var(--gold); transform: rotate(-45deg); }
.dashes li::before { content: ""; position: absolute; inset-inline-start: 0; top: .85em; width: 12px; height: 2px; background: var(--muted); }
.ticks li { color: rgba(255,255,255,.88); }
.roadmap { margin-top: 3rem; }
.roadmap h3 { font-size: 1.2rem; margin-bottom: 1.2rem; }
.roadmap ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--grey100); border: 1px solid var(--grey100); border-radius: var(--r-md); overflow: hidden; }
.roadmap li { background: var(--white); padding: 1.2rem; color: var(--muted); font-size: .93rem; }
.roadmap li b { display: block; color: var(--g700); font-size: 1rem; margin-bottom: .2rem; }

/* ---------- Team ---------- */
.team { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.team li { background: var(--white); border-radius: var(--r-md); padding: 1.6rem; display: flex; flex-direction: column; gap: .3rem; border: 1px solid var(--grey100); }
.team__av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--g900); color: var(--gold); font-weight: 700; margin-bottom: .6rem; direction: ltr; }
.team b { font-size: 1.1rem; text-align: right; }
.team li > span:last-child { color: var(--muted); font-size: .92rem; }

/* ---------- Sanad voice agent ---------- */
.sec--dark-agent { background: var(--g900); }
.sec--dark-agent .sec__intro { color: rgba(255,255,255,.75); }
.agent { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.4rem; }
.agent .sec__head { margin-inline: auto; }
.agent elevenlabs-convai { width: min(100%, 760px); }
.agent__card {
  width: min(100%, 760px);
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: start;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(201,160,79,.35);
  border-radius: var(--r-md);
  padding: 1rem;
  color: var(--white);
}
.agent__avatar {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--g950);
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.agent__card h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.agent__card p { color: rgba(255,255,255,.75); font-size: .94rem; }

/* ---------- CTA & footer ---------- */
.cta { background: var(--g900); color: var(--white); padding: 5rem 0; position: relative; overflow: hidden; }
.cta__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2rem; }
.cta h2 { font-family: var(--naskh); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.3rem); max-width: 22em; line-height: 1.7; }
.cta__actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.foot { background: var(--g950); color: rgba(255,255,255,.55); font-size: .88rem; padding: 1.6rem 0; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .flow { grid-template-columns: repeat(3, 1fr); }
  .flow__step:nth-child(3)::after { display: none; }
  .prep { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 920px) {
  .nav {
    position: fixed; inset-inline: 0; top: calc(72px + env(safe-area-inset-top, 0px));
    flex-direction: column; gap: 0; background: var(--g950); padding: .5rem 1.25rem 1.25rem;
    transform: translateY(-120%); transition: transform .3s; visibility: hidden;
  }
  .nav.is-open { transform: none; visibility: visible; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 1.05rem; }
  .menu { display: block; margin-inline-start: auto; }
  .topbar__cta { display: none; }
  .hero__grid, .problem, .how-grid, .res, .result, .safety { grid-template-columns: 1fr; }
  .sheet { transform: none; }
  .hero__facts { grid-template-columns: repeat(2, 1fr); row-gap: 1.4rem; }
  .contrib, .lessons, .team { grid-template-columns: 1fr; }
  .contrib article, .contrib article:first-child { border-inline-start: 0; padding-inline: 0; border-bottom: 1px solid var(--grey300); padding-bottom: 1.6rem; }
  .dstats { grid-template-columns: repeat(2, 1fr); row-gap: 1.6rem; }
  .roadmap ul { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .res__side { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .sec, .demo-sec { padding: 4rem 0; }
  .hero { padding-top: calc(110px + env(safe-area-inset-top, 0px)); }
  .flow { grid-template-columns: 1fr; }
  .flow__step { min-height: 0; }
  .flow__step:not(:last-child)::after { inset-inline-end: auto; left: 50%; top: auto; bottom: -.62rem; transform: translateX(-50%) rotate(-135deg); display: block; }
  .flow__step--split { flex-direction: row; }
  .flow__step--split div { flex: 1; }
  .prep, .roadmap ul, .res__side { grid-template-columns: 1fr; }
  .ask__row { flex-direction: column; align-items: stretch; }
  .ask__btn { width: 100%; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .bars { height: 240px; gap: .8rem; }
  .answer, .fail { padding: 1.2rem; }
  .answer__body { font-size: 1.15rem; }
  .gap, .safety > div { padding: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .chart .bar { height: calc(var(--v) * 1% * 1.4); }
}
