:root {
  --bg: #f6f5ef;
  --surface: #fffefa;
  --surface-2: #f0f0e7;
  --ink: #173c30;
  --muted: #748078;
  --green: #0b513b;
  --green-2: #0f6b4c;
  --gold: #c8a45c;
  --line: rgba(24,67,49,.12);
  --shadow: 0 18px 50px rgba(26,56,42,.08);
  --radius: 24px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
}

body.dark {
  --bg: #081b16;
  --surface: #10271f;
  --surface-2: #17342a;
  --ink: #edf4e9;
  --muted: #a2b4a8;
  --green: #d1b779;
  --green-2: #e1c98b;
  --gold: #d5b66f;
  --line: rgba(220,235,221,.13);
  --shadow: 0 18px 50px rgba(0,0,0,.2);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px 5%;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 43px;
  height: 43px;
  border-radius: 15px;
  background: var(--green);
  color: #f8e9bd;
  display: grid;
  place-items: center;
  font-family: Amiri, serif;
  font-size: 30px;
}

.brand b { display: block; font-size: 18px; line-height: 1.3; }
.brand small { display: block; color: var(--muted); font-size: 10px; }

nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 13px;
}

nav a:hover { color: var(--green-2); }

.theme-toggle, .icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
}

.mobile-menu { display: none; }

.section-wrap {
  width: min(1160px, 90%);
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: 1fr .85fr;
  gap: 45px;
  align-items: center;
  padding-top: 65px;
  padding-bottom: 42px;
  min-height: 510px;
}

.eyebrow {
  color: var(--green-2);
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.35;
  margin: 18px 0;
}

.hero h1 em {
  font-family: Amiri, serif;
  font-style: normal;
  color: var(--green-2);
}

.hero-copy > p {
  max-width: 510px;
  color: var(--muted);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 13px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform .2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--green);
  color: #fff8e7;
}

.btn-quiet {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-small {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 11px;
}

.hero-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
  color: var(--muted);
  font-family: Amiri, serif;
  font-size: 17px;
}

.hero-note small {
  font: 11px "IBM Plex Sans Arabic", sans-serif;
}

.hero-art {
  min-height: 400px;
  position: relative;
  display: grid;
  place-items: center;
}

.arch-outer {
  width: min(335px, 85%);
  height: 390px;
  border: 1px solid #c7a765;
  border-radius: 180px 180px 25px 25px;
  padding: 12px;
  background: linear-gradient(145deg, #0a503b, #082d23 75%);
  box-shadow: 0 35px 75px rgba(7,52,37,.22);
}

.arch-inner {
  height: 100%;
  border: 1px solid #d7b86c;
  border-radius: 170px 170px 17px 17px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #1a7653, #0b4a36 55%, #082b21);
}

.arch-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#e9d59a 1px, transparent 1.5px);
  background-size: 23px 23px;
  opacity: .35;
}

.moon {
  position: absolute;
  top: 55px;
  right: 55px;
  font-size: 60px;
  color: #e5c879;
}

.star { position: absolute; color: #f3d990; }
.star-a { left: 65px; top: 90px; font-size: 28px; }
.star-b { right: 80px; top: 170px; font-size: 20px; }

.lantern {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  font-size: 105px;
  color: #cdb36e;
}

.arch-caption {
  position: absolute;
  bottom: 48px;
  left: 0;
  right: 0;
  text-align: center;
  color: #f1dfad;
  font-family: Amiri, serif;
  font-size: 23px;
}

.floating-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow);
}

.floating-chip > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 23px;
}

.floating-chip b, .floating-chip small { display: block; }
.floating-chip b { font-size: 12px; }
.floating-chip small { font-size: 10px; color: var(--muted); }
.chip-top { top: 45px; right: -5px; }
.chip-bottom { bottom: 30px; left: -5px; }

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 19px;
}

.stat-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 15px;
  color: var(--gold);
  font-size: 24px;
  flex-shrink: 0;
}

.stat-card small, .stat-card b, .stat-card span:not(.stat-icon) {
  display: block;
}

.stat-card small, .stat-card span:not(.stat-icon) {
  color: var(--muted);
  font-size: 10px;
}

.stat-card b { font-size: 15px; }

.section-block { padding-top: 80px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: 30px;
  margin: 5px 0;
}

.section-heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.section-ornament { color: var(--gold); font-size: 38px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quran-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 17px;
  align-items: start;
}

.surah-panel { padding: 18px; position: sticky; top: 95px; }
.field-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 8px; }

.text-field, .select-field {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 11px;
  padding: 11px;
  font-size: 12px;
}

.surah-list {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  max-height: 490px;
  overflow: auto;
}

.surah-option {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px;
  background: transparent;
  color: var(--ink);
  width: 100%;
}

.surah-option:hover, .surah-option.active {
  background: var(--surface-2);
  border-color: var(--line);
}

.surah-number {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid #c8a45c;
  border-radius: 8px;
  font-size: 10px;
  flex-shrink: 0;
}

.surah-option b, .surah-option small { display: block; }
.surah-option b { font-size: 12px; }
.surah-option small { color: var(--muted); font-size: 10px; }

.reading-panel { padding: 23px; min-width: 0; }

.reading-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 17px;
}

.mini-label, .tiny-muted { font-size: 10px; color: var(--muted); }

.reading-top h3 {
  font-family: Amiri, serif;
  font-size: 29px;
  margin: 0;
}

.reading-top p { font-size: 11px; color: var(--muted); margin: 0; }

.round-action {
  width: 43px;
  height: 43px;
  border-radius: 50%;
  border: 1px solid #c8a45c;
  background: var(--surface-2);
  color: var(--green-2);
}

.audio-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.audio-row .select-field { width: auto; max-width: 180px; padding: 7px; }
.audio-row audio { height: 35px; max-width: 240px; width: 100%; margin-right: auto; }

.ayah-container { padding: 18px 0; }

.basmala {
  text-align: center;
  font-family: Amiri, serif;
  font-size: 27px;
  color: var(--green-2);
  padding: 15px 0 24px;
}

.ayah {
  font-family: Amiri, serif;
  font-size: 24px;
  line-height: 2.3;
  text-align: justify;
  color: var(--ink);
}

.ayah-num {
  display: inline-grid;
  place-items: center;
  border: 1px solid #c8a45c;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  font: 11px "IBM Plex Sans Arabic", sans-serif;
  color: var(--gold);
  margin: 0 6px;
}

.reading-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.loading {
  color: var(--muted);
  font-size: 12px;
  padding: 18px;
  text-align: center;
}

.error-box {
  padding: 15px;
  background: #a55a1910;
  border: 1px solid #a55a1930;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
}

.prayer-panel { padding: 23px; }

.prayer-location {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.location-symbol {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 14px;
  color: var(--gold);
  font-size: 25px;
}

.prayer-location > div:nth-child(2) { flex: 1; }
.prayer-location b, .prayer-location small { display: block; }
.prayer-location b { font-size: 14px; }
.prayer-location small { font-size: 10px; color: var(--muted); }

.city-form {
  display: flex;
  gap: 9px;
  margin-top: 18px;
  max-width: 390px;
}

.city-form .text-field { flex: 1; }

.prayer-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 23px;
}

.prayer-time {
  padding: 15px 8px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.prayer-time.active {
  background: var(--green);
  color: #fff6db;
  border-color: transparent;
}

.prayer-time span, .prayer-time b { display: block; }
.prayer-time span { font-size: 11px; }
.prayer-time b { font-size: 18px; margin-top: 5px; direction: ltr; }

.fine-print {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 16px;
}

.daily-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}

.dhikr-panel, .adhkar-panel { padding: 23px; }

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--green-2);
  font-size: 10px;
  font-weight: 700;
}

.text-btn {
  border: 0;
  background: none;
  color: var(--green-2);
  font-size: 11px;
  font-weight: 700;
  padding: 5px;
}

.dhikr-panel h3, .adhkar-panel h3 {
  font-size: 19px;
  margin: 14px 0;
}

.dhikr-ar {
  font-family: Amiri, serif;
  text-align: center;
  font-size: 28px;
  color: var(--green-2);
}

.counter-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 10px 0 20px;
}

.tasbeeh-button {
  width: 125px;
  height: 125px;
  border-radius: 50%;
  border: 8px solid var(--surface-2);
  outline: 1px solid #c8a45c;
  background: linear-gradient(145deg, #0f6b4c, #073728);
  color: #fff4d7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tasbeeh-button span { font-size: 39px; line-height: 1; }
.tasbeeh-button small { font-size: 10px; }

.counter-number b, .counter-number small { display: block; }
.counter-number b { font-size: 38px; font-weight: 500; line-height: 1.2; }
.counter-number small { color: var(--muted); font-size: 11px; }

.phrase-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}

.phrase-chip {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 30px;
  font-size: 10px;
}

.phrase-chip.active {
  border-color: var(--gold);
  color: var(--green-2);
  background: var(--surface-2);
}

.adhkar-list { display: grid; }

.dhikr-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.dhikr-item:last-child { border: 0; }

.dhikr-item p {
  font-family: Amiri, serif;
  font-size: 20px;
  margin: 0 0 5px;
}

.dhikr-item div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.dhikr-item small, .dhikr-item b { font-size: 10px; }
.dhikr-item small { color: var(--muted); }
.dhikr-item b { color: var(--green-2); }

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
}

.knowledge-card { padding: 22px; }

.knowledge-icon, .tool-icon {
  width: 49px;
  height: 49px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 28px;
  margin-bottom: 15px;
}

.knowledge-card h3 { font-size: 17px; margin: 10px 0; }

.knowledge-card > p {
  color: var(--muted);
  font-size: 12px;
  min-height: 55px;
}

.knowledge-card .hadith-text {
  font-family: Amiri, serif;
  font-size: 23px;
  color: var(--green-2);
  min-height: 0;
}

.knowledge-card .hadith-source {
  font-size: 10px;
  min-height: 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 17px;
}

.tool-card { padding: 22px; }
.tool-card h3 { font-size: 17px; margin: 0 0 5px; }
.tool-card > p { font-size: 12px; color: var(--muted); margin: 0 0 16px; }

.search-form { display: flex; gap: 8px; }
.search-form .text-field { flex: 1; }
.search-results { font-size: 12px; margin-top: 12px; }

.search-result {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.search-result button {
  color: var(--green-2);
  border: 0;
  background: none;
  font-weight: 700;
}

.qibla-result, .hijri-date {
  margin-top: 12px;
  color: var(--green-2);
  font-size: 13px;
  font-weight: 700;
}

.quiz-question { font-size: 13px; font-weight: 700; margin: 10px 0; }
.quiz-options { display: flex; gap: 8px; flex-wrap: wrap; }

.quiz-options button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 11px;
}

.quiz-feedback {
  font-size: 11px;
  margin-top: 7px;
  color: var(--green-2);
  min-height: 22px;
}

.closing-quote {
  text-align: center;
  padding-top: 80px;
  padding-bottom: 65px;
}

.closing-quote > span { font-size: 30px; color: var(--gold); }

.closing-quote p {
  font-family: Amiri, serif;
  font-size: clamp(25px, 4vw, 38px);
  color: var(--green-2);
  margin: 7px 0;
}

.closing-quote small { font-size: 11px; color: var(--muted); }

.footer {
  background: #082e23;
  color: #f5edd8;
  padding: 35px 5% 28px;
  display: flex;
  align-items: center;
  gap: 25px;
  flex-wrap: wrap;
}

.footer-brand .brand-mark { background: #f0dfae; color: #0b513b; }
.footer-brand small { color: #c2cdbd; }
.footer > p { font-size: 11px; color: #c2cdbd; margin-left: auto; }
.footer-links { display: flex; gap: 15px; font-size: 11px; color: #d9d6c4; }
.footer > small { width: 100%; border-top: 1px solid #ffffff1c; padding-top: 15px; font-size: 10px; color: #aab8ad; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--green);
  color: #fff4d7;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  transition: .25s;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  nav { gap: 12px; }
  .hero { gap: 20px; }
  .prayer-grid { grid-template-columns: repeat(3, 1fr); }
  .quran-layout { grid-template-columns: 220px 1fr; }
  .ayah { font-size: 22px; }
}

@media (max-width: 680px) {
  .topbar { min-height: 68px; gap: 9px; }
  .mobile-menu { display: block; margin-right: auto; order: 3; }
  .theme-toggle { order: 2; width: 38px; height: 38px; }

  .topbar nav {
    display: none;
    position: absolute;
    top: 68px;
    right: 4%;
    left: 4%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .topbar nav.open { display: flex; }
  .topbar nav a { padding: 9px 12px; }
  .section-wrap { width: 90%; }

  .hero {
    grid-template-columns: 1fr;
    padding-top: 40px;
    gap: 5px;
  }

  .hero h1 { font-size: 42px; }
  .hero-copy > p { font-size: 13px; }
  .hero-art { min-height: 335px; margin-top: 10px; }
  .arch-outer { height: 320px; width: 265px; }
  .moon { top: 45px; right: 47px; font-size: 52px; }
  .lantern { font-size: 85px; }
  .arch-caption { bottom: 39px; font-size: 19px; }
  .chip-top { top: 22px; right: -2px; }
  .chip-bottom { bottom: 13px; left: -2px; }

  .floating-chip { padding: 9px; }
  .floating-chip > span { width: 32px; height: 32px; }

  .quick-stats { grid-template-columns: 1fr; gap: 9px; }
  .stat-card { padding: 13px; }
  .section-block { padding-top: 58px; }
  .section-heading h2 { font-size: 25px; }
  .section-heading p { font-size: 11px; }
  .section-ornament { font-size: 29px; }

  .quran-layout { grid-template-columns: 1fr; }
  .surah-panel { position: static; }
  .surah-list {
    display: flex;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 5px;
  }

  .surah-option {
    min-width: 120px;
    width: auto;
    background: var(--bg);
    border-color: var(--line);
  }

  .reading-panel { padding: 14px; }
  .reading-top h3 { font-size: 25px; }
  .ayah { font-size: 22px; line-height: 2.2; }
  .audio-row audio { max-width: 100%; margin: 5px 0 0; width: 100%; }

  .prayer-panel { padding: 15px; }
  .prayer-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .prayer-time { padding: 12px 5px; }
  .prayer-time b { font-size: 16px; }

  .daily-grid, .knowledge-grid, .tools-grid { grid-template-columns: 1fr; }
  .dhikr-panel, .adhkar-panel, .knowledge-card, .tool-card { padding: 18px; }
  .knowledge-card > p { min-height: 0; }

  .footer { gap: 14px; }
  .footer > p { width: 100%; margin: 0; }
  .footer-links { width: 100%; flex-wrap: wrap; }
  .closing-quote { padding-top: 55px; padding-bottom: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
  }


/* ─────────────────────────────────────────────────────────────
   Al Huda refresh · warm editorial mobile-first interface
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #f7f3ef;
  --surface: #fffdf9;
  --surface-2: #f1e8e3;
  --ink: #292733;
  --muted: #7d7881;
  --green: #4d3b63;
  --green-2: #a85450;
  --gold: #d09a5b;
  --line: rgba(77, 59, 99, .14);
  --shadow: 0 18px 46px rgba(64, 44, 57, .09);
  --radius: 22px;
}

body {
  background:
    radial-gradient(circle at 10% 5%, rgba(208, 154, 91, .12), transparent 22rem),
    linear-gradient(180deg, var(--bg) 0%, #fffdf9 42%, var(--bg) 100%);
  color: var(--ink);
}

body.dark {
  --bg: #151522;
  --surface: #202031;
  --surface-2: #2b2a40;
  --ink: #f7f0e9;
  --muted: #b6adba;
  --green: #8170a8;
  --green-2: #ee9a83;
  --gold: #e0b56f;
  --line: rgba(238, 224, 218, .14);
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
  background: radial-gradient(circle at 10% 5%, rgba(238, 154, 131, .12), transparent 22rem), var(--bg);
}

.topbar {
  min-height: 74px;
  padding: 10px max(16px, 5%);
  background: rgba(247, 243, 239, .86);
  border-bottom-color: rgba(77, 59, 99, .08);
  box-shadow: 0 8px 25px rgba(64, 44, 57, .05);
  backdrop-filter: blur(18px);
}

body.dark .topbar { background: rgba(21, 21, 34, .88); }

.brand { gap: 11px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--green), #2f2740);
  color: #ffe7c7;
  box-shadow: 0 8px 18px rgba(77, 59, 99, .2);
}
.brand b { letter-spacing: -.02em; }

nav a { transition: color .2s ease; }
nav a:hover { color: var(--green-2); }

.theme-toggle, .icon-btn {
  width: 42px;
  height: 42px;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 4px 12px rgba(64, 44, 57, .05);
}

.hero {
  padding-top: clamp(42px, 7vw, 78px);
  padding-bottom: 35px;
}
.hero h1 { letter-spacing: -.04em; }
.hero h1 em, .eyebrow, .qibla-result, .hijri-date { color: var(--green-2); }
.hero-copy > p { line-height: 2; }

.btn {
  min-height: 44px;
  border-radius: 14px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--green-2), #c36a5d);
  color: #fff8f2;
  box-shadow: 0 10px 20px rgba(168, 84, 80, .18);
}
.btn-primary:hover { box-shadow: 0 14px 24px rgba(168, 84, 80, .24); }
.btn-quiet { background: var(--surface); border-color: var(--line); }
.btn-outline:hover, .btn-quiet:hover { border-color: var(--green-2); color: var(--green-2); }

.hero-note { color: var(--muted); }

.hero-art::before {
  content: "";
  position: absolute;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background: rgba(208, 154, 91, .11);
  filter: blur(2px);
}
.arch-outer {
  position: relative;
  z-index: 1;
  border-color: #d6a567;
  background: linear-gradient(145deg, #554269, #27233b 78%);
  box-shadow: 0 35px 75px rgba(52, 35, 62, .2);
}
.arch-inner {
  background: radial-gradient(ellipse at 50% 38%, #80648b, #4d3b63 56%, #29233d);
  border-color: rgba(245, 201, 145, .8);
}
.arch-inner::before { background-image: radial-gradient(#f4cf98 1px, transparent 1.5px); }
.moon { color: #f1c983; }
.star { color: #ffdba5; }
.lantern { color: #e5b975; }
.arch-caption { color: #ffe5c0; }

.floating-chip {
  z-index: 2;
  border-color: rgba(77, 59, 99, .12);
  box-shadow: 0 16px 34px rgba(64, 44, 57, .12);
}
.floating-chip > span { color: var(--green-2); }

.stat-card, .panel {
  border-color: rgba(77, 59, 99, .12);
  box-shadow: var(--shadow);
}
.stat-card { transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 22px 44px rgba(64, 44, 57, .13); }
.stat-icon, .knowledge-icon, .tool-icon { color: var(--green-2); }

.section-heading h2 { letter-spacing: -.03em; }
.section-ornament { color: var(--gold); }

.text-field, .select-field {
  min-height: 44px;
  background: rgba(255, 253, 249, .74);
  border-color: var(--line);
}
body.dark .text-field, body.dark .select-field { background: rgba(32, 32, 49, .8); }
.text-field:focus, .select-field:focus { border-color: var(--green-2); }
.surah-option { min-height: 48px; }
.surah-option:hover, .surah-option.active { background: var(--surface-2); border-color: rgba(168, 84, 80, .22); }
.surah-number { border-color: rgba(208, 154, 91, .8); }
.round-action { border-color: rgba(168, 84, 80, .45); color: var(--green-2); }

.ayah { color: var(--ink); }
.ayah-num { background: var(--surface-2); color: var(--green-2); }
.reading-footer { border-top-color: var(--line); }

.prayer-time.active {
  background: linear-gradient(135deg, var(--green), #756093);
  color: #fff8f2;
}
.location-symbol { color: var(--green-2); }

.tag { color: var(--green-2); }
.text-btn { color: var(--green-2); }
.dhikr-ar, .dhikr-item b, .knowledge-card .hadith-text, .closing-quote p { color: var(--green-2); }
.tasbeeh-button {
  outline-color: #d09a5b;
  background: linear-gradient(145deg, var(--green), #2a233b);
  box-shadow: 0 14px 24px rgba(77, 59, 99, .2);
}
.phrase-chip.active { border-color: var(--green-2); color: var(--green-2); }

.quiz-options button { min-height: 42px; }
.quiz-options button:hover { border-color: var(--green-2); color: var(--green-2); }

.footer {
  background: linear-gradient(135deg, #29233b, #463555);
  color: #fff4e7;
}
.footer-brand .brand-mark { background: #f5d6aa; color: #4d3b63; }
.footer-brand small, .footer > p, .footer-links { color: #dbc9d0; }
.footer > small { color: #b9aab8; }
.toast { background: var(--green); color: #fff5eb; }

.mobile-bottom-nav { display: none; }

@media (max-width: 680px) {
  body { padding-bottom: 84px; }
  .topbar { min-height: 66px; padding: 9px 14px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
  .brand b { font-size: 16px; }
  .brand small { font-size: 9px; }
  .mobile-menu { width: 40px; height: 40px; }
  .theme-toggle { width: 40px; height: 40px; }
  .section-wrap { width: min(92%, 520px); }

  .hero {
    min-height: auto;
    padding-top: 35px;
    padding-bottom: 20px;
    gap: 0;
  }
  .hero h1 { font-size: clamp(38px, 11vw, 50px); line-height: 1.32; margin: 14px 0; }
  .hero-copy > p { font-size: 13px; line-height: 1.95; }
  .hero-actions { gap: 9px; margin-top: 19px; }
  .hero-actions .btn { flex: 1; min-width: 0; padding-inline: 10px; font-size: 12px; }
  .hero-note { justify-content: center; margin-top: 22px; font-size: 16px; }
  .hero-art { min-height: 315px; margin-top: 12px; }
  .hero-art::before { width: 290px; height: 290px; }
  .arch-outer { width: 245px; height: 300px; }
  .arch-inner { border-radius: 160px 160px 17px 17px; }
  .chip-top { right: -4px; top: 13px; }
  .chip-bottom { left: -4px; bottom: 8px; }
  .floating-chip { padding: 8px; border-radius: 15px; }
  .floating-chip > span { width: 31px; height: 31px; font-size: 19px; }
  .floating-chip b { font-size: 11px; }
  .floating-chip small { font-size: 9px; }

  .quick-stats { gap: 8px; }
  .stat-card { padding: 12px; border-radius: 17px; }
  .stat-icon { width: 40px; height: 40px; border-radius: 12px; }
  .section-block { padding-top: 54px; }
  .section-heading { align-items: flex-start; gap: 12px; }
  .section-heading h2 { font-size: 26px; }
  .section-heading p { line-height: 1.7; }

  .panel { border-radius: 19px; }
  .surah-panel { padding: 14px; }
  .reading-panel { padding: 14px; }
  .reading-top { align-items: flex-start; }
  .reading-top h3 { font-size: 26px; }
  .audio-row { align-items: stretch; }
  .audio-row label { width: 100%; }
  .audio-row .select-field { max-width: none; width: 100%; }
  .audio-row audio { height: 40px; }
  .ayah { font-size: 23px; line-height: 2.15; text-align: right; }

  .prayer-panel { padding: 14px; }
  .prayer-location .btn { width: 100%; }
  .city-form, .search-form { max-width: none; width: 100%; }
  .city-form .btn, .search-form .btn { min-width: 82px; }
  .prayer-grid { gap: 6px; }
  .prayer-time { padding: 11px 3px; border-radius: 13px; }
  .prayer-time span { font-size: 10px; }
  .prayer-time b { font-size: 15px; }

  .daily-grid, .knowledge-grid, .tools-grid { gap: 12px; }
  .dhikr-panel, .adhkar-panel, .knowledge-card, .tool-card { padding: 17px; }
  .counter-wrap { gap: 22px; }
  .tasbeeh-button { width: 116px; height: 116px; }
  .phrase-chip { min-height: 38px; padding-inline: 11px; }
  .knowledge-card > p { line-height: 1.8; }
  .tool-card h3 { font-size: 18px; }

  .closing-quote { padding-top: 50px; padding-bottom: 44px; }
  .footer { padding: 30px 5% 28px; }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 40;
    padding: 8px 5px;
    border: 1px solid rgba(77, 59, 99, .14);
    border-radius: 20px;
    background: rgba(255, 253, 249, .9);
    box-shadow: 0 16px 35px rgba(54, 37, 52, .18);
    backdrop-filter: blur(18px);
  }
  body.dark .mobile-bottom-nav { background: rgba(32, 32, 49, .92); }
  .mobile-bottom-nav a {
    display: grid;
    justify-items: center;
    gap: 1px;
    min-height: 48px;
    padding: 4px 2px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 18px;
    transition: color .2s ease, background .2s ease;
  }
  .mobile-bottom-nav a:first-child,
  .mobile-bottom-nav a:hover { color: var(--green-2); background: var(--surface-2); }
  .mobile-bottom-nav small { font-size: 9px; line-height: 1.2; }
}


/* Separate surah index and Quran reader pages */
.quran-page-actions { display: flex; justify-content: flex-start; margin: -8px 0 16px; }
.quran-reading-only { grid-template-columns: 1fr; }
.surah-index-page { max-width: 760px; }
.surah-index-card { padding: 18px; }
.surah-index-card .surah-panel { position: static; box-shadow: none; border: 0; padding: 0; }
@media (max-width: 680px) {
  .quran-page-actions { margin-top: -8px; }
  .surah-index-card { padding: 14px; }
}


/* Current-page state for the mobile dock */
@media (max-width: 680px) {
  .mobile-bottom-nav { grid-template-columns: repeat(6, 1fr); }
  .mobile-bottom-nav a.active { color: var(--green-2); background: var(--surface-2); }
  .mobile-bottom-nav a:first-child:not(.active) { color: var(--muted); background: transparent; }
}


/* ورد يومي شخصي ومحتوى متجدد */
.stat-card-reading { position: relative; padding-inline-end: 82px; }
.stat-card-reading .btn { position: absolute; inset-inline-end: 14px; bottom: 14px; }
.daily-focus-section { padding-top: 28px; }
.daily-focus {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  align-items: center;
  padding: 25px;
  background: linear-gradient(135deg, rgba(255,253,249,.92), rgba(241,232,227,.8));
  overflow: hidden;
  position: relative;
}
.daily-focus::before {
  content: "✦";
  position: absolute;
  inset-inline-start: 24px;
  top: 12px;
  color: var(--gold);
  font-size: 42px;
  opacity: .45;
}
.daily-focus-copy h2 { margin: 7px 0; font-size: clamp(22px, 3vw, 30px); }
.daily-focus-copy p { margin: 0 0 8px; color: var(--muted); font-family: Amiri, serif; font-size: 23px; line-height: 1.8; }
.daily-focus-copy small { color: var(--green-2); font-size: 11px; }
.daily-focus-actions { display: grid; gap: 10px; }
.wird-progress { display: grid; gap: 7px; }
.wird-progress b { font-size: 13px; }
.wird-progress > span { height: 9px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.wird-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-2), var(--gold)); transition: width .25s ease; }
.wird-presets { display: flex; gap: 7px; flex-wrap: wrap; }
.wird-presets button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 11px; }
.wird-presets button.active, .wird-presets button:hover { color: var(--green-2); border-color: var(--green-2); background: var(--surface-2); }
.daily-focus-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.install-app-btn { border: 0; background: transparent; color: var(--green-2); font: inherit; font-size: 11px; font-weight: 700; text-align: start; padding: 4px 0; cursor: pointer; }
.install-app-btn:hover { text-decoration: underline; }
body.dark .daily-focus { background: linear-gradient(135deg, rgba(32,32,49,.94), rgba(43,42,64,.9)); }
@media (max-width: 680px) {
  .stat-card-reading { padding-inline-end: 12px; padding-bottom: 52px; }
  .stat-card-reading .btn { inset-inline-end: 12px; bottom: 10px; }
  .daily-focus-section { padding-top: 18px; }
  .daily-focus { grid-template-columns: 1fr; gap: 17px; padding: 18px; }
  .daily-focus::before { inset-inline-start: 13px; top: 3px; font-size: 30px; }
  .daily-focus-copy p { font-size: 21px; line-height: 1.75; }
  .daily-focus-actions { padding-top: 3px; }
  .daily-focus-buttons .btn { flex: 1; }
}


/* المفضلة والملاحظات والتحدي الأسبوعي */
.reading-footer { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.reading-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-inline-start: auto; }
.notes-box { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.notes-box label { font-size: 12px; font-weight: 700; }
.notes-box textarea { width: 100%; resize: vertical; min-height: 72px; border: 1px solid var(--line); border-radius: 13px; padding: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 12px; }
.notes-box textarea:focus { outline: 3px solid rgba(168,84,80,.18); border-color: var(--green-2); }
.weekly-challenge-section { padding-top: 25px; }
.weekly-challenge { display: grid; grid-template-columns: 1fr .8fr; gap: 20px; align-items: center; padding: 21px 24px; background: linear-gradient(135deg, var(--surface), var(--surface-2)); }
.weekly-challenge h2 { margin: 5px 0; font-size: 22px; }
.weekly-challenge p { margin: 0; color: var(--muted); font-size: 12px; }
.challenge-progress { display: grid; gap: 9px; }
.challenge-progress > b { font-size: 13px; }
.challenge-progress > span { height: 8px; overflow: hidden; border-radius: 99px; background: var(--bg); }
.challenge-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-2), var(--gold)); transition: width .25s ease; }
.challenge-progress button:disabled { opacity: .65; cursor: default; }
.favorites-list { display: grid; gap: 6px; margin: 8px 0; }
.favorite-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 11px; }
.favorite-item:hover { border-color: var(--green-2); }
.favorite-item .surah-number { width: 26px; height: 26px; flex-shrink: 0; }
.favorite-item b, .favorite-item small { display: block; }
.favorite-item b { font-size: 11px; }
.favorite-item small { color: var(--muted); font-size: 9px; }
.favorite-item > span:last-child { margin-inline-start: auto; color: var(--green-2); }
@media (max-width: 680px) {
  .reading-actions { width: 100%; margin-inline-start: 0; }
  .reading-actions .btn { flex: 1; }
  .notes-box .btn { justify-self: start; }
  .weekly-challenge { grid-template-columns: 1fr; gap: 15px; padding: 18px; }
  .weekly-challenge h2 { font-size: 20px; }
}


/* مخطط الختمة المرن */
.khatma-panel { margin-top: 22px; padding: 24px; }
.khatma-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.khatma-heading h3 { margin: 5px 0; font-size: 24px; }
.khatma-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.khatma-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--surface-2); color: var(--gold); font-size: 29px; flex-shrink: 0; }
.khatma-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 19px; }
.khatma-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.khatma-controls [hidden] { display: none; }
.khatma-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.khatma-summary > div { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.khatma-summary small, .khatma-summary b { display: block; }
.khatma-summary small { color: var(--muted); font-size: 10px; }
.khatma-summary b { margin-top: 3px; font-size: 13px; }
.khatma-progress { height: 9px; margin: 15px 0 13px; overflow: hidden; border-radius: 99px; background: var(--bg); }
.khatma-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-2), var(--gold)); transition: width .25s ease; }
.khatma-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.khatma-actions .text-btn { margin-inline-start: auto; }
@media (max-width: 680px) {
  .khatma-panel { padding: 18px; }
  .khatma-heading { align-items: flex-start; }
  .khatma-heading h3 { font-size: 21px; }
  .khatma-mark { width: 45px; height: 45px; font-size: 22px; }
  .khatma-controls { grid-template-columns: 1fr; }
  .khatma-summary { grid-template-columns: 1fr 1fr; }
  .khatma-summary > div:last-child { grid-column: 1 / -1; }
  .khatma-actions .btn { flex: 1; }
  .khatma-actions .text-btn { width: 100%; margin-inline-start: 0; text-align: start; }
}


/* صقل تجربة القراءة والمتابعة */
.audio-row { display: grid; gap: 8px; }
.audio-row .tiny-muted { padding-inline: 3px; }
.surah-stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.surah-stepper span { color: var(--muted); font-size: 11px; }
.surah-stepper .btn { min-width: 125px; }
#wirdStreakText { display: block; color: var(--green-2); font-size: 10px; margin-top: 2px; }
.khatma-summary { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 680px) {
  .surah-stepper { flex-wrap: wrap; }
  .surah-stepper span { order: -1; width: 100%; text-align: center; }
  .surah-stepper .btn { flex: 1; min-width: 0; }
  .khatma-summary { grid-template-columns: 1fr 1fr; }
  .khatma-summary > div:last-child { grid-column: auto; }
}

/* قصص الأنبياء */
.prophets-hero { padding-top: 42px; padding-bottom: 70px; }
.prophets-hero .section-heading h1 { margin: 7px 0; font-size: clamp(32px, 5vw, 56px); }
.prophets-notice { display: flex; gap: 12px; align-items: center; margin: 24px 0 18px; padding: 14px 17px; border: 1px solid rgba(200,164,92,.35); border-radius: 16px; background: rgba(200,164,92,.10); color: var(--muted); font-size: 12px; }
.prophets-notice b { color: var(--ink); white-space: nowrap; }
.prophets-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0; }
.prophet-search { position: relative; display: flex; align-items: center; width: min(100%, 450px); }
.prophet-search span { position: absolute; inset-inline-end: 14px; color: var(--muted); font-size: 20px; z-index: 1; }
.prophet-search input { padding-inline-end: 45px; }
.prophet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.prophet-card { padding: 20px; border-radius: 22px; transition: transform .2s ease, box-shadow .2s ease; }
.prophet-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.prophet-card-top { display: flex; justify-content: space-between; align-items: center; }
.prophet-number { color: var(--gold); font-family: Amiri, serif; font-size: 27px; }
.prophet-card h2 { margin: 13px 0 2px; font-family: Amiri, serif; font-size: 26px; }
.prophet-card h3 { margin: 0 0 9px; color: var(--green-2); font-size: 13px; }
.prophet-card > p { color: var(--muted); font-size: 12px; line-height: 2; min-height: 72px; }
.story-toggle { margin-top: 8px; }
.prophet-details { border-top: 1px solid var(--line); margin-top: 17px; padding-top: 15px; }
.prophet-details[hidden] { display: none; }
.story-text { white-space: pre-line; font-family: Amiri, serif; font-size: 20px; line-height: 2.05; }
.lesson-list, .story-refs { display: grid; gap: 7px; margin-top: 16px; padding: 13px; border-radius: 14px; background: var(--surface-2); font-size: 12px; }
.lesson-list b, .story-refs b { color: var(--green-2); }
.lesson-list span { color: var(--muted); }
.story-refs span { color: var(--muted); line-height: 1.8; }
.empty-state { grid-column: 1 / -1; padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); }
@media (max-width: 900px) { .prophet-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) {
  .prophets-hero { padding-top: 25px; padding-bottom: 40px; }
  .prophets-notice { display: grid; gap: 3px; margin-top: 17px; }
  .prophets-notice b { white-space: normal; }
  .prophets-toolbar { align-items: stretch; flex-direction: column; }
  .prophet-search { width: 100%; }
  .prophet-grid { grid-template-columns: 1fr; gap: 12px; }
  .prophet-card { padding: 17px; }
  .prophet-card > p { min-height: 0; }
  .story-text { font-size: 19px; }
}


/* مسار الورد اليومي الواضح */
.wird-guide { margin: 20px 0 18px; padding: 22px; border: 1px solid rgba(200,164,92,.28); background: linear-gradient(135deg, var(--surface), rgba(200,164,92,.08)); }
.wird-guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.wird-guide-head h3 { margin: 9px 0 2px; font-size: 24px; }
.wird-guide-head p { margin: 0; color: var(--muted); font-size: 12px; }
.wird-guide-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--green); color: #f8e9bd; font-size: 24px; }
.wird-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.wird-step { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); }
a.wird-step:hover { border-color: var(--gold); transform: translateY(-2px); }
.wird-step.active { border-color: rgba(15,107,76,.4); box-shadow: inset 0 0 0 1px rgba(15,107,76,.08); }
.wird-step-number { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 50%; background: var(--green); color: #fff8e7; font-size: 12px; font-weight: 700; }
.wird-step b, .wird-step small { display: block; }
.wird-step b { font-size: 12px; }
.wird-step small { color: var(--muted); font-size: 10px; line-height: 1.6; }
.wird-step > span:last-child { margin-inline-start: auto; color: var(--gold); }
.wird-guide-footer { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.wird-guide-footer b { color: var(--green-2); font-size: 13px; }
.wird-guide-footer .btn { margin-inline-start: auto; }
.khatma-heading p b { color: var(--green-2); }
@media (max-width: 680px) {
  .wird-guide { padding: 17px; }
  .wird-guide-head h3 { font-size: 21px; }
  .wird-steps { grid-template-columns: 1fr; gap: 8px; }
  .wird-step { min-height: 58px; }
  .wird-guide-footer { flex-wrap: wrap; }
  .wird-guide-footer .btn { margin-inline-start: 0; width: 100%; }
}


/* تثبيت صفوف المسار في RTL والهاتف */
.wird-step { display: grid !important; grid-template-columns: 29px minmax(0, 1fr) 18px; align-items: center; width: 100%; }
.wird-step > div { min-width: 0; }
.wird-step-number { grid-column: 1; }
.wird-step > div { grid-column: 2; }
.wird-step > span:last-child { grid-column: 3; margin-inline-start: 0; text-align: center; }


/* بوصلة القبلة الجديدة */
.qibla-tool { overflow: hidden; }
.qibla-tool .card-topline { margin-bottom: 10px; }
.qibla-compass { --compass-purple: #4d3b63; --compass-orange: #e29b08; position: relative; width: min(100%, 294px); aspect-ratio: 1; margin: 18px auto 15px; border-radius: 50%; background: #fbf8ef; box-shadow: 0 0 0 11px rgba(77,59,99,.06), 0 0 0 12px rgba(226,155,8,.35), 0 20px 35px rgba(77,59,99,.16); overflow: hidden; }
.qibla-compass::before { content: ""; position: absolute; inset: 9%; border: 1px solid rgba(77,59,99,.15); border-radius: 50%; }
.compass-ticks { position: absolute; inset: 0; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #788c54 0deg 1.5deg, transparent 1.5deg 15deg); mask: radial-gradient(circle, transparent 0 72%, #000 72.5% 78%, transparent 78.5%); -webkit-mask: radial-gradient(circle, transparent 0 72%, #000 72.5% 78%, transparent 78.5%); }
.compass-direction { position: absolute; z-index: 2; color: #4a4a4a; font-size: 18px; font-weight: 700; }
.compass-direction.north { top: 3%; left: 50%; transform: translateX(-50%); }
.compass-direction.east { right: 4%; top: 50%; transform: translateY(-50%); }
.compass-direction.south { bottom: 3%; left: 50%; transform: translateX(-50%); }
.compass-direction.west { left: 4%; top: 50%; transform: translateY(-50%); }
.compass-degree { position: absolute; z-index: 2; color: #6a7e45; font-size: 14px; }
.degree-north { top: 25%; left: 50%; transform: translateX(-50%); }.degree-east { right: 24%; top: 50%; transform: translateY(-50%); }.degree-south { bottom: 24%; left: 50%; transform: translateX(-50%); }.degree-west { left: 22%; top: 50%; transform: translateY(-50%); }
.qibla-needle { position: absolute; z-index: 4; left: 50%; top: 50%; width: 0; height: 0; transform: translate(-50%, -50%) rotate(0deg); transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.needle-red { position: absolute; left: -8px; top: -91px; width: 16px; height: 92px; background: #f05449; clip-path: polygon(50% 0, 100% 100%, 50% 84%, 0 100%); filter: drop-shadow(0 3px 3px rgba(0,0,0,.15)); }
.needle-gold { position: absolute; left: -8px; top: 0; width: 16px; height: 78px; background: var(--compass-orange); clip-path: polygon(50% 100%, 100% 0, 50% 16%, 0 0); }
.qibla-needle::after { content: ""; position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; background: var(--compass-orange); box-shadow: 0 0 0 5px rgba(255,255,255,.75); }
.kaaba-marker { position: absolute; z-index: 5; right: 8%; top: 64%; display: grid; place-items: center; width: 48px; height: 48px; border: 5px solid var(--compass-orange); border-radius: 50%; background: #fffdf6; font-size: 24px; filter: drop-shadow(0 5px 5px rgba(77,59,99,.15)); }
.qibla-reading { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 9px 0 13px; color: var(--muted); font-size: 12px; }
.qibla-reading b { color: #5c8b19; font-size: 27px; line-height: 1; }
.qibla-tool > .btn { display: flex; margin-inline: auto; background: var(--compass-purple); }
.qibla-tool .qibla-result { color: var(--compass-purple); text-align: center; font-size: 11px; line-height: 1.8; }
body.dark .qibla-compass { background: #f6f1e6; }
@media (max-width: 680px) { .qibla-compass { width: min(100%, 275px); } }

.qibla-tool > #qiblaBtn { background: #4d3b63 !important; color: #fff8e7 !important; border-color: #4d3b63 !important; }


/* مكتبة الأذكار الموسّعة */
.adhkar-library { padding-bottom: 72px; }
.adhkar-library h1 { margin: 7px 0; font-size: clamp(30px, 5vw, 54px); }
.adhkar-method { display: flex; gap: 12px; align-items: center; margin: 22px 0 16px; padding: 13px 16px; border: 1px solid rgba(200,164,92,.34); border-radius: 15px; background: rgba(200,164,92,.1); color: var(--muted); font-size: 11px; line-height: 1.8; }
.adhkar-method b { color: var(--ink); white-space: nowrap; }
.adhkar-search { position: relative; display: block; margin: 16px 0; }
.adhkar-search span { position: absolute; top: 7px; right: 14px; color: var(--muted); font-size: 22px; z-index: 1; }
.adhkar-search input { width: 100%; padding-inline-end: 44px; }
.adhkar-categories { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 17px 0 28px; }
.adhkar-category { display: grid; min-height: 105px; align-content: center; gap: 2px; padding: 10px; border: 0; border-radius: 16px; color: #fff; text-align: right; box-shadow: 0 9px 17px rgba(30,30,40,.14); transition: transform .2s, filter .2s; }
.adhkar-category:hover, .adhkar-category.active { transform: translateY(-3px); filter: saturate(1.12) brightness(1.05); box-shadow: 0 12px 23px rgba(30,30,40,.2); }
.adhkar-category span { font-size: 29px; line-height: 1; opacity: .8; }.adhkar-category b { font-size: 14px; }.adhkar-category small { font-size: 9px; opacity: .76; }
.color-all { background: linear-gradient(135deg,#45556c,#26384f); }.color-blue { background: linear-gradient(135deg,#1882c4,#075295); }.color-purple { background: linear-gradient(135deg,#7b329b,#30114f); }.color-magenta { background: linear-gradient(135deg,#bf2a98,#67065c); }.color-cyan { background: linear-gradient(135deg,#20aec0,#08738e); }.color-green { background: linear-gradient(135deg,#22a84b,#087125); }.color-orange { background: linear-gradient(135deg,#f29b21,#a63d05); }.color-gold { background: linear-gradient(135deg,#e2b200,#926800); }.color-lime { background: linear-gradient(135deg,#70c60a,#2d7b05); }.color-violet { background: linear-gradient(135deg,#bd59d0,#6c1c98); }.color-teal { background: linear-gradient(135deg,#1cc1be,#087f82); }.color-navy { background: linear-gradient(135deg,#2873a9,#183e72); }.color-rose { background: linear-gradient(135deg,#cf5b68,#8a1f52); }.color-red { background: linear-gradient(135deg,#e05948,#8d1720); }.color-aqua { background: linear-gradient(135deg,#2dc3cc,#087d9b); }.color-slate { background: linear-gradient(135deg,#6d8491,#354a5e); }.color-indigo { background: linear-gradient(135deg,#6863bb,#30276e); }
.adhkar-library-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }.adhkar-library-head h2 { margin: 0; font-size: 21px; }
.adhkar-list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.adhkar-card { position: relative; overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow); }.adhkar-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: currentColor; opacity: .75; }.adhkar-card-top { display: flex; justify-content: space-between; align-items: center; }.adhkar-card-top .tag { color: var(--muted); background: var(--surface-2); }.adhkar-index { color: var(--gold); font-family: Amiri,serif; font-size: 25px; }.adhkar-card h3 { margin: 10px 0 7px; font-family: Amiri,serif; font-size: 21px; }.adhkar-text { margin: 0; color: var(--ink); font-family: Amiri,serif; font-size: 22px; line-height: 2; }.adhkar-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }.adhkar-meta b { color: var(--green-2); }.adhkar-copy { margin-top: 13px; }
@media (max-width: 900px) { .adhkar-categories { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 680px) { .adhkar-method { display: grid; gap: 2px; }.adhkar-categories { grid-template-columns: repeat(2,1fr); gap: 8px; }.adhkar-category { min-height: 88px; }.adhkar-category b { font-size: 12px; }.adhkar-list-grid { grid-template-columns: 1fr; }.adhkar-card { padding: 17px; }.adhkar-text { font-size: 20px; } }


/* بطاقة الورد اليومية — نمط القراءة الواضح */
.wird-reader-card { margin: 18px 0 22px; overflow: hidden; padding: 0 21px 20px; background: #fffefa; border-color: rgba(37,67,35,.18); }
.wird-reader-top { display: flex; justify-content: space-between; padding-top: 19px; color: #385e2d; font-size: 16px; }
.wird-reader-verse { display: grid; place-items: center; min-height: 170px; color: #4e4d4d; font-family: Amiri, serif; font-size: clamp(25px, 5vw, 37px); font-weight: 700; text-align: center; }
.wird-reader-range { display: grid; gap: 0; color: #385e2d; font-size: 16px; font-weight: 700; }
.wird-reader-range > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(60,80,60,.18); }
.wird-reader-range > div span { direction: rtl; white-space: nowrap; }
.wird-reader-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.wird-read-btn, .wird-done-btn { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 22px; border: 0; border-radius: 13px; font-size: 20px; font-weight: 700; }
.wird-read-btn { background: #347900; color: #fff; }.wird-done-btn { background: #f0c900; color: #111; }.wird-read-btn:hover, .wird-done-btn:hover { filter: brightness(1.06); transform: translateY(-2px); }
.wird-current-progress { margin-top: 48px; padding-top: 30px; border-top: 1px solid rgba(60,80,60,.18); }.wird-current-progress h3 { margin: 0 0 16px; color: #4d4b4b; font-size: 23px; }.wird-progress-track { height: 17px; overflow: hidden; border-radius: 100px; background: #d7d8d7; }.wird-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: #4d8d0b; transition: width .35s ease; }.wird-progress-numbers { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; color: #4b4a4a; font-size: 18px; font-weight: 700; }.wird-guide-footer { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }.wird-guide-footer b { color: #347900; font-size: 14px; }.wird-guide-footer .btn { margin-inline-start: auto; }
@media (max-width: 680px) { .wird-reader-card { padding-inline: 14px; }.wird-reader-top { font-size: 15px; }.wird-reader-verse { min-height: 145px; font-size: 28px; }.wird-reader-range { font-size: 14px; }.wird-reader-actions { gap: 8px; }.wird-read-btn, .wird-done-btn { min-height: 54px; padding: 0 13px; font-size: 16px; }.wird-current-progress { margin-top: 35px; padding-top: 23px; }.wird-current-progress h3 { font-size: 20px; }.wird-progress-numbers { font-size: 15px; }.wird-guide-footer { flex-wrap: wrap; }.wird-guide-footer .btn { margin-inline-start: 0; width: 100%; } }

.wird-plan-picker { margin-top: 18px; padding: 13px 0 2px; border-top: 1px solid rgba(60,80,60,.18); color: #4c4b4b; font-size: 13px; }.wird-plan-picker > b { display: block; margin-bottom: 9px; }.wird-plan-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }.wird-plan-options button { min-height: 38px; border: 1px solid #d6dbd0; border-radius: 9px; background: #f5f6f1; color: #385e2d; font: inherit; font-size: 12px; font-weight: 700; }.wird-plan-options button.active, .wird-plan-options button:hover { border-color: #347900; background: #347900; color: #fff; }.wird-plan-picker label { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; }.wird-plan-picker label input { width: 80px; min-height: 32px; padding: 4px 8px; border: 1px solid #d6dbd0; border-radius: 8px; background: #fff; color: #333; font: inherit; }.wird-plan-picker small { display: block; margin-top: 8px; color: #7c7b78; font-size: 10px; }
@media (max-width: 680px) { .wird-plan-options { gap: 5px; }.wird-plan-options button { font-size: 11px; padding-inline: 2px; } }

.wird-plan-options button.active { background: #347900 !important; color: #fff !important; border-color: #347900 !important; }

.wird-plan-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; }.wird-plan-row label { display: flex; align-items: center; gap: 7px; color: #666; font-size: 11px; }.wird-plan-row select { min-height: 32px; padding: 4px 9px; border: 1px solid #d6dbd0; border-radius: 8px; background: #fff; color: #385e2d; font: inherit; font-size: 11px; }
.wird-control-panel { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }.wird-control-panel > div:first-child { display: flex; align-items: baseline; justify-content: space-between; color: var(--muted); font-size: 11px; }.wird-control-panel > div:first-child b { color: #347900; font-size: 15px; }.wird-control-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 11px; }.wird-control-buttons button { min-height: 39px; padding: 4px 5px; border: 1px solid #d3d9ce; border-radius: 9px; background: #f6f7f3; color: #385e2d; font: inherit; font-size: 11px; font-weight: 700; }.wird-control-buttons button:hover { border-color: #347900; background: #edf5e9; }.wird-control-buttons button:last-child { border-color: #347900; background: #347900; color: #fff; }.wird-reset-btn { display: block; margin: 11px auto 0; border: 0; background: transparent; color: #8b5a5a; font: inherit; font-size: 10px; cursor: pointer; }.wird-reset-btn:hover { color: #bd3f3f; }
@media (max-width: 680px) { .wird-plan-row { align-items: flex-start; flex-direction: column; }.wird-plan-row label { width: 100%; justify-content: space-between; }.wird-plan-row select { flex: 1; }.wird-control-buttons { grid-template-columns: repeat(2,1fr); }.wird-control-buttons button { min-height: 42px; font-size: 12px; } }

.wird-reader-actions { grid-template-columns: 1fr; }.wird-read-btn { justify-content: center; gap: 14px; }


/* ورد خفيف وسريع للمس */
@media (max-width: 680px) {
  .wird-reader-card { margin: 10px 0 14px; padding: 0 11px 12px; border-radius: 16px; }
  .wird-reader-top { padding-top: 12px; font-size: 13px; }
  .wird-reader-verse { min-height: 102px; font-size: 23px; }
  .wird-reader-range { font-size: 12px; }
  .wird-reader-range > div { padding: 7px 0; }
  .wird-plan-picker { margin-top: 10px; padding-top: 9px; font-size: 11px; }
  .wird-plan-picker > b { margin-bottom: 6px; }
  .wird-plan-options { gap: 4px; }
  .wird-plan-options button { min-height: 33px; font-size: 10px; }
  .wird-plan-row { gap: 5px; margin-top: 6px; }
  .wird-plan-row label { font-size: 10px; }
  .wird-plan-row select, .wird-plan-picker label input { min-height: 29px; font-size: 10px; }
  .wird-plan-picker small { margin-top: 5px; font-size: 9px; }
  .wird-reader-actions { margin-top: 10px; }
  .wird-read-btn { min-height: 43px; border-radius: 10px; font-size: 15px; }
  .wird-current-progress { margin-top: 17px; padding-top: 13px; }
  .wird-current-progress h3 { margin-bottom: 9px; font-size: 17px; }
  .wird-progress-track { height: 10px; }
  .wird-progress-numbers { margin-top: 10px; font-size: 12px; }
  .wird-control-panel { margin-top: 13px; padding-top: 10px; }
  .wird-control-buttons { gap: 5px; margin-top: 7px; }
  .wird-control-buttons button { min-height: 35px; border-radius: 8px; font-size: 10px; }
  .wird-reset-btn { margin-top: 7px; font-size: 9px; }
  .wird-read-btn:hover, .wird-done-btn:hover, .wird-plan-options button:hover { transform: none; }
}
.wird-plan-options button, .wird-control-buttons button, .wird-read-btn, .wird-reset-btn { -webkit-tap-highlight-color: transparent; }
.wird-plan-options button:active, .wird-control-buttons button:active, .wird-read-btn:active { transform: scale(.97); transition: none; }
@media (prefers-reduced-motion: reduce) { .wird-progress-track i { transition: none; } }

/* بوصلة حية: علامة الكعبة تدور مع اتجاه الهاتف */
.qibla-needle { will-change: transform; transition: transform .18s linear; }
.qibla-needle .kaaba-marker { right: auto; top: -122px; left: -24px; width: 48px; height: 48px; }
.qibla-compass.is-live { box-shadow: 0 0 0 11px rgba(77,59,99,.06), 0 0 0 12px rgba(52,121,0,.6), 0 20px 35px rgba(52,121,0,.2); }
.qibla-compass.is-live::after { content: "القبلة"; position: absolute; left: 50%; top: 8px; z-index: 6; transform: translateX(-50%); padding: 3px 8px; border-radius: 999px; background: #347900; color: #fff; font-size: 10px; font-weight: 700; }
.qibla-result { min-height: 2.8em; }

/* قرآن الورد داخل الصفحة */
.wird-quran-panel { margin-top: 22px; padding: 22px; }
.wird-quran-panel h3 { margin: 8px 0 3px; font-size: 23px; }
.wird-quran-intro { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.wird-quran-text { max-height: 620px; overflow: auto; padding: 8px 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); scroll-behavior: smooth; }
.wird-quran-page { padding: 15px 14px 18px; border-bottom: 1px solid var(--line); }
.wird-quran-page:last-child { border-bottom: 0; }
.wird-quran-page-label { display: inline-block; margin-bottom: 8px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--green-2); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 10px; font-weight: 700; }
.wird-quran-page p { margin: 0; color: var(--ink); font-family: Amiri, serif; font-size: 25px; line-height: 2.25; text-align: justify; }
.ayah-number { display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; margin: 0 .12em; border: 1px solid var(--gold); border-radius: 50%; color: var(--green-2); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: .42em; vertical-align: middle; }
.wird-quran-loading, .wird-quran-error { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 12px; }
.wird-quran-error { color: #a85450; }
@media (max-width: 680px) {
  .wird-quran-panel { padding: 16px; }
  .wird-quran-panel h3 { font-size: 20px; }
  .wird-quran-text { max-height: 560px; }
  .wird-quran-page p { font-size: 22px; line-height: 2.15; }
}

/* فتح القصة كاملة داخل كل block */
.story-label { display: inline-block; margin-bottom: 8px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--green-2); font-size: 11px; font-weight: 700; }
.story-toggle { min-width: 145px; }

/* صفحة الورد المستقلة */
.wird-reading-page { min-height: 100vh; background: var(--bg); }
.wird-reading-header { display:flex; align-items:center; justify-content:space-between; width:min(100% - 32px, 980px); margin:auto; padding:18px 0; }
.wird-reading-header-actions { display:flex; align-items:center; gap:10px; }
.wird-back-link { color:var(--muted); font-size:12px; }
.wird-reading-main { width:min(100% - 32px, 860px); margin:20px auto 70px; }
.wird-setup-card, .wird-reader-only { padding:clamp(20px, 4vw, 42px); }
.wird-setup-card h1, .wird-reader-only h1 { margin:7px 0; font-size:clamp(30px, 5vw, 48px); }
.wird-setup-lead { color:var(--muted); margin:0 0 25px; }
.wird-step-card { display:grid; grid-template-columns:auto 1fr; gap:17px; align-items:start; padding:21px; margin-top:14px; border:1px solid var(--line); border-radius:22px; background:var(--surface-2); }
.wird-step-number { display:grid; place-items:center; width:42px; height:42px; border-radius:14px; background:var(--green-2); color:#fff; font-family:Amiri,serif; font-size:25px; }
.wird-step-content h2 { margin:8px 0 14px; font-size:21px; }
.wird-field-label { display:grid; gap:7px; margin-top:12px; color:var(--muted); font-size:12px; }
.wird-field-label .select-field, .wird-field-label .text-field { width:100%; }
.wird-field-hint { display:block; margin-top:9px; color:var(--muted); line-height:1.7; }
.wird-plan-preview { display:grid; gap:4px; padding:18px; margin:18px 0; border:1px solid rgba(200,164,92,.35); border-radius:18px; background:rgba(200,164,92,.1); }
.wird-plan-preview span, .wird-plan-preview small { color:var(--muted); font-size:11px; }
.wird-plan-preview strong { color:var(--green-2); font-size:20px; }
.wird-start-button, .reader-complete { width:100%; border:0; border-radius:16px; padding:16px 18px; background:var(--green-2); color:#fff; font:inherit; font-weight:700; cursor:pointer; }
.wird-start-button span { margin-inline-start:8px; }
.reader-progress-head, .reader-meta, .reader-controls, .reader-bottom-note { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.reader-meta { margin:16px 0; padding:11px 14px; border-radius:12px; background:var(--surface-2); color:var(--muted); font-size:12px; }
.wird-pages { overflow:hidden; border:1px solid var(--line); border-radius:18px; background:var(--surface); }
.wird-reading-page { min-height:470px; padding:28px clamp(18px, 5vw, 58px); background:linear-gradient(180deg, var(--surface), rgba(200,164,92,.05)); }
.wird-page-label { width:max-content; margin:0 auto 25px; padding:5px 12px; border-radius:999px; background:var(--surface-2); color:var(--green-2); font-size:11px; }
.wird-reading-page p { margin:0; font-family:Amiri,serif; font-size:clamp(24px, 3vw, 34px); line-height:2.35; text-align:justify; }
.wird-ayah-number { display:inline-grid; place-items:center; width:1.45em; height:1.45em; margin:0 .12em; border:1px solid var(--gold); border-radius:50%; color:var(--green-2); font-family:"IBM Plex Sans Arabic",sans-serif; font-size:.42em; vertical-align:middle; }
.reader-controls { margin-top:14px; }
.reader-control { flex:1; min-height:48px; border:1px solid var(--line); border-radius:13px; background:var(--surface); color:var(--ink); cursor:pointer; font:inherit; font-size:12px; }
.reader-control:disabled { opacity:.4; cursor:not-allowed; }
.reader-complete { flex:1.3; min-height:48px; }
.reader-bottom-note { margin-top:16px; color:var(--muted); font-size:11px; }
.reader-bottom-note a { color:var(--green-2); }
@media (max-width:680px) { .wird-reading-header { width:min(100% - 22px, 860px); } .wird-reading-main { width:min(100% - 22px, 860px); margin-top:8px; } .wird-step-card { padding:16px; gap:11px; } .wird-step-content h2 { font-size:18px; } .reader-progress-head { align-items:flex-start; } .wird-reading-page { min-height:520px; padding:24px 16px; } .wird-reading-page p { font-size:25px; line-height:2.25; } .reader-controls { flex-wrap:wrap; } .reader-complete { order:-1; flex-basis:100%; } }

/* قارئ القرآن: صفحة واحدة مع تنقّل أفقي */
.quran-pages-shell { display:grid; grid-template-columns:42px minmax(0,1fr) 42px; align-items:center; gap:8px; }
.quran-page-track { min-width:0; overflow:hidden; display:block; touch-action:pan-y; }
.quran-page-slide { display:none; min-height:420px; padding:18px 10px 8px; }
.quran-page-slide:first-child, .quran-page-slide[data-page-index="0"] { display:block; }
.quran-page-label { width:max-content; margin:0 auto 18px; padding:5px 12px; border:1px solid var(--line); border-radius:999px; color:var(--green-2); background:var(--surface-2); font-size:11px; }
.quran-page-text { text-align:right; }
.quran-page-arrow { width:38px; height:52px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); color:var(--green-2); font-size:25px; cursor:pointer; }
.quran-page-arrow:disabled { opacity:.3; cursor:not-allowed; }
.quran-page-status { display:flex; justify-content:center; align-items:center; gap:12px; margin-top:8px; color:var(--green-2); font-size:12px; }
.quran-page-status small { color:var(--muted); font-size:10px; }
@media (max-width:680px) { .quran-pages-shell { grid-template-columns:32px minmax(0,1fr) 32px; gap:4px; } .quran-page-arrow { width:32px; height:46px; font-size:20px; } .quran-page-slide { min-height:480px; padding-inline:2px; } .quran-page-status { flex-direction:column; gap:2px; } }

.quran-page-slide.active { display:block; }

.wird-pages { touch-action: pan-y; }

/* Al Huda assistant — ثابت، صغير، ومناسب للهاتف */
.chatbot-launcher {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  background: var(--green);
  color: #f8e9bd;
  box-shadow: 0 14px 30px rgba(7, 45, 32, .24);
  display: grid;
  place-items: center;
  z-index: 90;
  transition: transform .2s ease, box-shadow .2s ease;
}
.chatbot-launcher:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(7, 45, 32, .3); }
.chatbot-launcher-mark { font: 700 31px/1 Amiri, serif; }
.chatbot-launcher-dot { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; width: 8px; height: 8px; border-radius: 50%; background: #e7bb67; box-shadow: 0 0 0 3px var(--green); }
.chatbot-panel {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(154px + env(safe-area-inset-bottom));
  width: min(372px, calc(100vw - 28px));
  max-height: min(670px, calc(100dvh - 184px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(12, 39, 28, .22);
  z-index: 91;
  animation: chatbot-rise .22s ease both;
}
.chatbot-panel[hidden] { display: none; }
@keyframes chatbot-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.chatbot-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; background: linear-gradient(135deg, var(--green), var(--green-2)); color: #fff8e7; }
.chatbot-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chatbot-header-mark { width: 37px; height: 37px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.28); font: 700 24px/1 Amiri, serif; }
.chatbot-title-wrap strong, .chatbot-title-wrap small { display: block; }
.chatbot-title-wrap strong { font-size: 14px; line-height: 1.3; }
.chatbot-title-wrap small { margin-top: 2px; opacity: .75; font-size: 9px; }
.chatbot-header-actions { display: flex; gap: 5px; }
.chatbot-icon-button { width: 30px; height: 30px; padding: 0; border: 1px solid rgba(255,255,255,.26); border-radius: 9px; background: rgba(255,255,255,.1); color: inherit; font-size: 18px; }
.chatbot-toolbar { padding: 8px 14px 5px; border-bottom: 1px solid var(--line); }
.chatbot-toolbar label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.chatbot-toolbar select { min-width: 112px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: 11px; }
.chatbot-messages { flex: 1; min-height: 110px; max-height: 360px; padding: 13px 12px 6px; overflow: auto; display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--surface) 92%, var(--surface-2)); }
.chatbot-message { max-width: 88%; padding: 8px 11px; border-radius: 14px; font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.chatbot-message.is-assistant { align-self: flex-start; border: 1px solid var(--line); border-start-start-radius: 5px; background: var(--surface); }
.chatbot-message.is-user { align-self: flex-end; border-start-end-radius: 5px; background: var(--green); color: #fff8e7; }
.chatbot-typing { color: var(--muted); font-style: italic; }
.chatbot-chips { display: flex; gap: 6px; padding: 8px 12px 4px; overflow-x: auto; border-top: 1px solid var(--line); }
.chatbot-chips button { flex: 0 0 auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--green-2); font-size: 10px; white-space: nowrap; }
.chatbot-form { display: flex; align-items: flex-end; gap: 7px; padding: 8px 12px; }
.chatbot-form textarea { flex: 1; min-height: 38px; max-height: 100px; resize: none; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 12px; line-height: 1.5; }
.chatbot-send { width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--green); color: #fff8e7; font-size: 20px; font-weight: 700; }
.chatbot-send:disabled { opacity: .5; cursor: wait; }
.chatbot-footer { display: grid; gap: 2px; padding: 5px 12px 10px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.chatbot-footer small { color: var(--green-2); font-size: 9px; }
@media (min-width: 760px) {
  .chatbot-launcher { bottom: 24px; }
  .chatbot-panel { bottom: 92px; }
}
@media (max-width: 480px) {
  .chatbot-launcher { inset-inline-end: 12px; width: 52px; height: 52px; border-radius: 16px; }
  .chatbot-panel { inset-inline-end: 10px; width: calc(100vw - 20px); max-height: calc(100dvh - 165px); border-radius: 19px; }
  .chatbot-messages { max-height: min(43dvh, 310px); }
}
@media (prefers-reduced-motion: reduce) { .chatbot-panel, .chatbot-launcher { animation: none; transition: none; } }

.chatbot-source-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.chatbot-source-links a { color: var(--green-2); text-decoration: underline; text-underline-offset: 2px; }

/* Chatbot readability pass — مساحة أكبر ووزن بصري أخف */
.chatbot-panel {
  width: min(450px, calc(100vw - 28px));
  max-height: min(760px, calc(100dvh - 145px));
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: 0 16px 42px rgba(12, 39, 28, .14);
}
.chatbot-header { padding: 16px 18px; }
.chatbot-toolbar { padding: 10px 16px 7px; }
.chatbot-messages {
  min-height: 180px;
  max-height: 520px;
  padding: 18px 16px 10px;
  gap: 11px;
  background: color-mix(in srgb, var(--surface) 97%, var(--bg));
}
.chatbot-message {
  max-width: 94%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.9;
  font-weight: 400;
}
.chatbot-message.is-assistant { background: color-mix(in srgb, var(--surface) 96%, var(--surface-2)); }
.chatbot-chips { padding: 10px 16px 5px; gap: 8px; }
.chatbot-chips button { padding: 7px 11px; font-size: 11px; }
.chatbot-form { padding: 10px 16px; gap: 9px; }
.chatbot-form textarea { min-height: 46px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.chatbot-send { width: 46px; height: 46px; border-radius: 14px; }
.chatbot-footer { padding: 6px 16px 12px; font-size: 10px; }
.chatbot-footer small { font-size: 10px; }
@media (max-width: 480px) {
  .chatbot-panel { inset-inline-end: 8px; width: calc(100vw - 16px); max-height: calc(100dvh - 125px); border-radius: 20px; }
  .chatbot-messages { max-height: min(52dvh, 430px); min-height: 190px; }
}
