/* Tweaks panel */
.tweaks {
  position: fixed;
  bottom: 1.25rem;
  inset-inline-end: 1.25rem;
  width: 320px;
  max-height: 80vh;
  background: var(--bg-elev);
  border: 1px solid var(--c-line-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  z-index: 1000;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform .35s var(--ease), opacity .25s;
}
.tweaks.is-open { transform: none; opacity: 1; pointer-events: auto; }
.tweaks__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--c-cream-2);
}
.tweaks__title { font-family: var(--ff-en-ui); font-weight: 700; font-size: .85rem; letter-spacing: .15em; text-transform: uppercase; color: var(--g-800); }
.tweaks__close {
  border: none; background: none; color: var(--fg-muted);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
}
.tweaks__close:hover { background: var(--line); }
.tweaks__body { padding: 1rem 1.1rem 1.25rem; overflow: auto; display: grid; gap: 1.1rem; }

.tweak-row { display: grid; gap: .45rem; }
.tweak-row__label {
  display: flex; justify-content: space-between;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--fg-soft);
}
.tweak-row__label small { color: var(--fg-muted); font-weight: 400; font-family: var(--ff-mono); font-size: .72rem; }
.tweak-swatches { display: flex; gap: .4rem; flex-wrap: wrap; }
.tweak-swatch {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--line);
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.tweak-swatch:hover { transform: scale(1.1); }
.tweak-swatch.is-active { border-color: var(--g-700); transform: scale(1.1); box-shadow: 0 0 0 2px var(--c-paper) inset; }
.tweak-toggle {
  display: flex; justify-content: space-between; align-items: center;
  padding: .6rem .8rem;
  background: var(--c-cream-2);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.tweak-toggle input { appearance: none; width: 34px; height: 20px; background: var(--line); border-radius: 20px; position: relative; cursor: pointer; transition: background .2s; }
.tweak-toggle input:checked { background: var(--g-700); }
.tweak-toggle input::after {
  content: "";
  position: absolute; top: 2px; inset-inline-start: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.tweak-toggle input:checked::after { transform: translateX(14px); }
[dir="rtl"] .tweak-toggle input:checked::after { transform: translateX(-14px); }

.tweak-range { width: 100%; accent-color: var(--g-700); }
.tweak-variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.tweak-variants button {
  padding: .5rem;
  border: 1px solid var(--line);
  background: var(--c-paper);
  border-radius: var(--r-sm);
  font-size: .7rem;
  color: var(--fg-soft);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.tweak-variants button.is-active { background: var(--g-700); color: #fbf7ed; border-color: var(--g-700); }


/* ===== MOBILE ===== */
/* ===================================================
   MOBILE RESPONSIVE — consolidated overrides
   Breakpoints: 960 (tablet), 720 (phone-lg), 480 (phone-sm)
   =================================================== */

@media (max-width: 960px) {
  .section { padding-block: clamp(3.5rem, 7vw, 5rem); }
  .section-head { margin-bottom: 2rem; }
  .section-head h2 { font-size: clamp(1.85rem, 6vw, 2.6rem); line-height: 1.15; }
  .section-head .lede { font-size: 1rem; line-height: 1.6; }

  /* Hero */
  .hero { padding-top: 110px; padding-bottom: 4rem; min-height: auto; }
  .hero__wrap { gap: 2rem; min-height: auto; }
  .hero__title { font-size: clamp(2.4rem, 9vw, 3.6rem); }
  .hero__title-en { font-size: 1.1rem; margin-bottom: 1rem; }
  .hero__lede { font-size: 1rem; line-height: 1.7; margin-bottom: 1.5rem; }
  .hero__meta { gap: 1.25rem 2rem; padding-top: 1.25rem; }
  .hero__meta-item b { font-size: 1.5rem; }
  .hero__meta-item small { font-size: .78rem; }
  .hero__phones { min-height: 560px; margin-top: 1rem; }
  .hero__phone-ring { display: none; }
  .hero__scroll { display: none; }
  .hero__caption { min-width: 220px; padding: .6rem .9rem; gap: .75rem; }
  .hero__caption-idx { font-size: 1.3rem; }
  .hero__caption-idx span { font-size: .75rem; }
  .hero__caption-ar { font-size: 1rem; }

  /* Phone sizing */
  .phone { width: 260px; height: 540px; }

  /* Mobile nav */
  .nav__wrap { gap: 1rem; height: 64px; }
  .nav__links { display: none; }
  .nav__logo { width: 38px; height: 38px; }
  .nav__brand-ar { font-size: 1rem; }
  .nav__brand-en { font-size: .6rem; letter-spacing: .14em; }
  .nav__cta .btn--ghost { display: none; }
  .nav__cta { gap: .5rem; }
  .lang-switch { padding: .35rem .55rem; font-size: .7rem; }
  .btn { --pad-y: .7rem; --pad-x: 1.1rem; font-size: .9rem; }
  .btn--lg { --pad-y: .9rem; --pad-x: 1.4rem; font-size: 1rem; }
  .store-btn { min-width: 0; flex: 1 1 45%; padding: .7rem 1rem .7rem .9rem; gap: .6rem; }
  .store-btn__icon { width: 26px; height: 26px; }
  .store-btn__txt b { font-size: .95rem; }
  .store-btn__txt small { font-size: .6rem; }

  /* Grids */
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .tile { padding: 1.25rem; min-height: 240px; }
  .tile__title { font-size: 1.15rem; }
  .tile__icon { width: 44px; height: 44px; }
  .quran__grid, .audio__grid, .prayer__grid, .download__grid { grid-template-columns: 1fr; gap: 2rem; }
  .reviews__grid { grid-template-columns: 1fr; }
  .reciters { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .stat__num { font-size: 2.6rem; }
  .stat__label { font-size: 1rem; }

  /* Quran preview */
  .quran__preview { padding: 1.25rem; }
  .quran__surah-name { font-size: 1.3rem; }
  .quran__surah-num { width: 40px; height: 40px; font-size: .95rem; }
  .quran__ayahs { font-size: 1.05rem; line-height: 2.1; }
  .quran__controls { gap: .6rem; }
  .quran__control-btn { width: 36px; height: 36px; }
  .quran__control-btn--play { width: 48px; height: 48px; }

  /* Prayer card */
  .prayer-card { padding: 1.5rem; }
  .prayer-card__next-name { font-size: 1.75rem; }
  .prayer-card__next-time { font-size: 2.8rem; }
  .prayer-row { padding: .6rem .8rem; gap: .6rem; grid-template-columns: 24px 1fr auto auto; }
  .prayer-row__name { font-size: 1rem; }
  .prayer-row__time { font-size: 1rem; }
  .prayer-row__status { display: none; }

  /* Qibla */
  .qibla { width: 200px; height: 200px; }
  .qibla__needle { height: 74px; }

  /* Showcase */
  .showcase__stage { gap: .5rem; }
  .showcase__phone--side { display: none; }
  .showcase__caption h3 { font-size: 1.4rem; }
  .showcase__caption p { font-size: .95rem; }

  /* Trust band */
  .trust__wrap { justify-content: center; gap: 1.25rem 2rem; }
  .trust__items { gap: 1.25rem 2rem; justify-content: center; }
  .trust__label { width: 100%; text-align: center; }
  .trust__item { font-size: 1rem; }
  .trust__item svg { width: 18px; height: 18px; }

  /* Download card */
  .download { padding-block: 3.5rem; }
  .download__card { padding: 2rem 1.5rem; border-radius: 20px; }
  .download__card::after { width: 300px; height: 300px; inset-inline-end: -80px; top: -80px; }
  .download__title { font-size: 2rem; }
  .download__title-en { font-size: 1.2rem; }
  .download__lede { font-size: 1rem; }
  .download__qr { width: 170px; height: 170px; padding: .75rem; }
  .download__stores { gap: .6rem; }

  /* FAQ */
  .faq-item__btn { padding: 1rem 1.1rem; font-size: 1rem; gap: .6rem; }
  .faq-item__body p { padding: 0 1.1rem 1rem; font-size: .95rem; }

  /* Review */
  .review { padding: 1.25rem; }
  .review__text { font-size: 1rem; }
  .review__quote-mark { font-size: 3.5rem; }

  /* Footer */
  .footer { padding-block: 3rem 1.5rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
  .footer__brand { grid-column: span 2; }
  .footer__tag { max-width: none; }
  .footer__bottom { flex-direction: column; align-items: flex-start; gap: 1rem; }

  /* Reduce heavy patterns */
  .hero__bg::before { background-size: 22px 22px; }
  .hero__bg::after { background-size: 80px 100%; }
}

@media (max-width: 720px) {
  .container { width: min(100% - 1.25rem, var(--container)); }
  .container--wide { width: min(100% - 1.25rem, var(--container-wide)); }
  .hero { padding-top: 96px; text-align: center; }
  .hero__content { display: grid; justify-items: center; }
  .hero__lede, .hero__cta, .hero__meta { justify-self: center; }
  .hero__lede { margin-inline: auto; }
  .hero__cta, .hero__meta { justify-content: center; }
  .hero__title, .hero__title-en { text-align: center; }

  /* Stack download stores full-width */
  .download__stores .store-btn { flex: 1 1 100%; }

  /* Stats full 2col stays */
  .stats { padding-block: 3.5rem; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .tile--wide { grid-column: span 1; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__brand { grid-column: span 1; }
  .phone { width: 240px; height: 500px; }
  .hero__phones { min-height: 520px; }
  .hero__title { font-size: clamp(2.1rem, 10vw, 2.8rem); }
  .trust__items { gap: 1rem 1.5rem; }
  .stats__grid { gap: 1rem; }
  .stat { padding: .5rem; }
  .stat__num { font-size: 2.2rem; }
  .prayer-card { padding: 1.25rem; }
  .prayer-card__next { padding: 1rem; }
  .prayer-card__next-time { font-size: 2.4rem; }
  .prayer-row__time { font-size: .95rem; }
  .prayer-row__name { font-size: .95rem; }
  .qibla { width: 180px; height: 180px; }

  /* Tuck tweaks out of the way */
  .tweaks-panel { inset-inline: .5rem !important; bottom: .5rem !important; max-width: calc(100vw - 1rem) !important; }
}

/* Touch targets */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .nav__links a { padding: .6rem 0; }
  .faq-item__btn { min-height: 56px; }
  .reciter { padding: .9rem; }
  .quran__chip { padding: .5rem .9rem; }
}
