/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  /* Layered background atmosphere */
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(var(--green-rgb), 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(var(--gold-rgb), 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 80% at 50% 50%, rgba(var(--blue-rgb), 0.03) 0%, transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  /* Prevent content from hiding under iOS home bar */
  padding-bottom: var(--safe-bottom);
}

/* Scrollbars — refined */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--blue-rgb), 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--blue-rgb), 0.38); }
* { scrollbar-width: thin; scrollbar-color: rgba(125,211,252,0.2) transparent; }

.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

.hidden { display: none !important; }

/* Focus — WCAG AA */
:focus-visible {
  outline: 2.5px solid rgba(var(--blue-rgb), 0.7);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Tap highlight removal for native feel on mobile */
a, button, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER — Sticky, Glassmorphic
   ═══════════════════════════════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  /* iOS: push below notch */
  padding-top: calc(12px + var(--safe-top));
  padding-left: calc(20px + var(--safe-left));
  padding-right: calc(20px + var(--safe-right));
  padding-bottom: 12px;
  background: rgba(8, 14, 28, 0.78);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 200;
  flex-wrap: wrap;
  box-shadow: 0 2px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(var(--gold-rgb), 0.06);
}

/* Brand */
.brand { display: flex; gap: 14px; align-items: center; }

.brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg,
    rgba(var(--green-rgb),0.22),
    rgba(var(--gold-rgb),0.16));
  border: 1px solid rgba(var(--gold-rgb),0.22);
  font-size: 21px;
  box-shadow: var(--shadow-sm), var(--glow-gold);
  transition: transform var(--dur-normal) var(--ease-spring);
  flex-shrink: 0;
}
.brand-mark:hover { transform: scale(1.07) rotate(-4deg); }

.brand-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--white-soft) 20%, rgba(var(--gold-rgb),0.85) 80%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-subtitle {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* Language selector — inline, clean */
#langSelect {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  min-width: 44px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
  appearance: none;
  -webkit-appearance: none;
}
#langSelect:hover {
  border-color: rgba(var(--gold-rgb),0.28);
  background: rgba(255,255,255,0.08);
}

/* Top Nav */
.top-nav {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — Polished, tactile, accessible
   ═══════════════════════════════════════════════════════════════ */
.btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--fg);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  /* Minimum touch target iOS HIG: 44px */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent);
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
  pointer-events: none;
}
.btn:hover { background: rgba(255,255,255,0.10); border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.96); }
/* No double-tap zoom on mobile */
.btn { touch-action: manipulation; }

.btn-primary {
  background: linear-gradient(135deg, rgba(var(--green-rgb),0.28), rgba(var(--blue-rgb),0.16));
  border-color: rgba(var(--green-rgb),0.28);
  color: var(--white-soft);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(var(--green-rgb),0.38), rgba(var(--blue-rgb),0.22));
  border-color: rgba(var(--green-rgb),0.4);
  box-shadow: var(--shadow-sm), var(--glow-green);
}

.btn-secondary { background: rgba(255,255,255,0.05); }
.btn-secondary:hover { background: rgba(255,255,255,0.09); }

/* Tab buttons — pill style with clear active state */
.btn-tab {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  min-height: 36px;
  transition: all var(--dur-fast) var(--ease-out);
}
.btn-tab::after { display: none; }
.btn-tab:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(var(--gold-rgb),0.18);
}
.btn-tab-active {
  background: linear-gradient(135deg,
    rgba(var(--gold-rgb),0.15),
    rgba(var(--green-rgb),0.12));
  border-color: rgba(var(--gold-rgb),0.25);
  color: var(--white-soft);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), var(--glow-gold);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT & CONTAINER
   ═══════════════════════════════════════════════════════════════ */
.container {
  max-width: var(--max);
  margin: 24px auto 60px;
  padding: 0 20px;
  padding-left: calc(20px + var(--safe-left));
  padding-right: calc(20px + var(--safe-right));
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS — Depth, glass, elegance
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: linear-gradient(160deg,
    rgba(17,30,58,0.88) 0%,
    rgba(14,24,50,0.93) 50%,
    rgba(10,20,42,0.96) 100%);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.15);
  padding: 22px;
  transition: box-shadow var(--dur-normal) ease,
              border-color var(--dur-normal) ease;
  position: relative;
  overflow: hidden;
}
/* Sheen line on top edge */
.card::before {
  content: "";
  position: absolute; top: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
  pointer-events: none;
}
.card:hover {
  border-color: rgba(var(--gold-rgb),0.12);
  box-shadow: var(--shadow-xl),
    inset 0 1px 0 rgba(255,255,255,0.07),
    var(--glow-gold);
}
.card.subtle {
  background: rgba(14,24,48,0.45);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
}
.card.subtle::before { display: none; }
.card.subtle:hover { box-shadow: var(--shadow-sm); border-color: var(--border-hover); }

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
.h1 {
  margin: 0;
  font-family: var(--display);
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: var(--tracking-title);
  line-height: var(--lh-title);
}

.h2 {
  margin: 0;
  font-family: var(--display);
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: var(--tracking-title);
  line-height: 1.35;
}

.h3 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: var(--fs-h3);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.meta {
  color: var(--muted);
  font-size: var(--fs-meta);
  font-family: var(--mono);
  line-height: 1.45;
}

.label {
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
  font-family: var(--mono);
  letter-spacing: var(--tracking-ui);
  line-height: 1.35;
}

.value {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

.hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--fs-label);
  line-height: 1.5;
}

/* Arabic text */
.arabic {
  font-family: var(--arabic);
  font-size: clamp(1.375rem, 1.2rem + 0.45vw, 1.625rem);
  line-height: 2;
  direction: rtl;
  text-align: right;
  letter-spacing: 0.01em;
}

/* Home / card typography refinements */
.home-quran-strip-title-v3f,
.home-tools-head-v3f .h2,
.home-prayer-city-v3f {
  letter-spacing: 0.015em;
}

.home-tool-label {
  font-size: 0.95rem;
  line-height: 1.25;
  font-weight: 600;
}

.time-name {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.3;
}

.time-value {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Responsive typography tuning */
@media (max-width: 700px) {
  .h1 { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.4rem); }
  .h2 { font-size: clamp(1.0625rem, 0.98rem + 0.25vw, 1.2rem); }
  .meta, .label, .hint { font-size: 0.8rem; }
  .home-tool-label { font-size: 0.88rem; }
}

/* ═══════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════════════════ */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
@media (min-width: 880px) { .grid { grid-template-columns: 1fr 1fr; } }

.field label {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

select, input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--fg);
  outline: none;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
  /* iOS: prevent zoom on focus */
  font-size: max(16px, 14px);
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
select:hover, input:hover {
  border-color: rgba(var(--gold-rgb),0.22);
  background: var(--input-hover);
}
select:focus, input:focus {
  border-color: rgba(var(--gold-rgb),0.45);
  box-shadow: 0 0 0 3px rgba(var(--gold-rgb),0.1);
  background: var(--input-hover);
}
input::placeholder { color: rgba(234,240,255,0.28); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1; min-width: 140px; }
.row-actions { margin-top: 16px; justify-content: space-between; gap: 14px; }

/* ═══════════════════════════════════════════════════════════════
   CARD HEADER
   ═══════════════════════════════════════════════════════════════ */
.card-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 10px; margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   STATUS & DIVIDER
   ═══════════════════════════════════════════════════════════════ */
.status { flex: 1; min-height: 20px; color: var(--muted); font-size: 12px; font-family: var(--mono); }
.divider {
  margin: 18px 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb),0.12), transparent);
}

/* ═══════════════════════════════════════════════════════════════
   SCREEN BACKGROUNDS
   ═══════════════════════════════════════════════════════════════ */
.screen { position: relative; }
.screen::before {
  content: "";
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: -2; opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.screen:not(.hidden)::before { opacity: 1; }

/* ── Prayer — warm green/gold atmosphere (mosque warmth) ───── */
#screenPrayer::before {
  background:
    radial-gradient(ellipse 70% 50% at 30% 20%, rgba(var(--green-rgb), 0.10) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 75% 80%, rgba(var(--gold-rgb), 0.08) 0%, transparent 65%),
    linear-gradient(180deg, #080e1c 0%, #0c1a2e 40%, #080e1c 100%);
}

/* ── Quran — golden parchment glow ─────────────────────────── */
#screenQuran::before {
  background:
    radial-gradient(ellipse 65% 45% at 50% 15%, rgba(var(--gold-rgb), 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 20% 85%, rgba(var(--green-rgb), 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #0a1020 0%, #0e182e 40%, #080e1c 100%);
}

/* ── Qibla — cool blue compass feel ────────────────────────── */
#screenQibla::before {
  background:
    radial-gradient(ellipse 60% 55% at 50% 30%, rgba(var(--blue-rgb), 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 70% 75%, rgba(var(--purple-rgb), 0.06) 0%, transparent 60%),
    linear-gradient(180deg, #080e1c 0%, #0b1528 40%, #080e1c 100%);
}

/* ── Radio — purple/blue ambient ───────────────────────────── */
#screenRadio::before {
  background:
    radial-gradient(ellipse 55% 50% at 25% 25%, rgba(var(--purple-rgb), 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 60% 45% at 80% 70%, rgba(var(--blue-rgb), 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #090f1e 0%, #0d1830 40%, #080e1c 100%);
}

/* ── Calendar — subtle gold/green celestial ────────────────── */
#screenCalendar::before {
  background:
    radial-gradient(ellipse 70% 40% at 60% 10%, rgba(var(--gold-rgb), 0.09) 0%, transparent 65%),
    radial-gradient(ellipse 50% 55% at 30% 90%, rgba(var(--green-rgb), 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #080e1c 0%, #0c1628 40%, #080e1c 100%);
}


/* ═══════════════════════════════════════════════════════════════
   DAILY AYAH CARD
   ═══════════════════════════════════════════════════════════════ */
.daily-ayah-card {
  background: linear-gradient(160deg,
    rgba(20, 34, 62, 0.90) 0%,
    rgba(14, 26, 50, 0.95) 100%) !important;
  border-color: rgba(var(--gold-rgb), 0.18) !important;
  position: relative;
}
.daily-ayah-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(var(--gold-rgb),0.5) 30%,
    rgba(var(--green-rgb),0.4) 70%,
    transparent 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   PRAYER TIMES — Sub-nav & Grid
   ═══════════════════════════════════════════════════════════════ */
.prayer-sub-nav {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.prayer-dropdown { position: relative; display: inline-block; }

.prayer-dropdown-toggle {
  background: linear-gradient(135deg, rgba(var(--green-rgb),0.22), rgba(var(--gold-rgb),0.14));
  color: var(--white-soft);
  border: 1px solid rgba(var(--gold-rgb),0.22);
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  min-width: 210px;
  justify-content: center;
  transition: all var(--dur-normal) var(--ease-out);
  min-height: 48px;
  box-shadow: var(--shadow-sm), var(--glow-green);
}
.prayer-dropdown-toggle:hover { filter: brightness(1.12); transform: translateY(-2px); box-shadow: var(--shadow-md), var(--glow-green); }
.prayer-dropdown-toggle.open { border-radius: var(--radius-pill) var(--radius-pill) var(--radius) var(--radius); }
.dropdown-chevron { transition: transform var(--dur-normal); font-size: 10px; }
.prayer-dropdown-toggle.open .dropdown-chevron { transform: rotate(180deg); }

.prayer-dropdown-menu {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  background: rgba(14, 24, 50, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(var(--gold-rgb),0.15);
  border-top: 2px solid rgba(var(--green-rgb),0.4);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden; z-index: 100;
  box-shadow: var(--shadow-lg);
}
.prayer-dropdown-menu.show { display: block; animation: slideDown 0.18s var(--ease-out); }
@keyframes slideDown { from { opacity:0; transform:translateY(-6px);} to { opacity:1; transform:none; } }

.prayer-menu-item {
  padding: 14px 20px; cursor: pointer;
  transition: background var(--dur-fast);
  font-family: var(--sans); font-size: 14px;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.prayer-menu-item:last-child { border-bottom: none; }
.prayer-menu-item:hover { background: rgba(var(--green-rgb),0.10); }
.prayer-menu-item.active { background: rgba(var(--green-rgb),0.14); color: rgba(var(--green-rgb),1); font-weight: 600; }

.prayer-view { display: none; }
.prayer-view.active { display: block; animation: fadeIn 0.3s var(--ease-out); }

/* Prayer Times Grid */
.times-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .times-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .times-grid { grid-template-columns: repeat(3, 1fr); } }

.time-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px;
  background: rgba(255,255,255,0.03);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: all var(--dur-normal) ease;
  position: relative; overflow: hidden;
  min-height: 56px;
}
.time-card::before {
  content: "";
  position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, rgba(var(--green-rgb),0.7), rgba(var(--gold-rgb),0.5));
  border-radius: 0 2px 2px 0; opacity: 0;
  transition: opacity var(--dur-normal) ease;
}
.time-card:hover { background: rgba(255,255,255,0.055); border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.time-card:hover::before { opacity: 1; }
.time-name { color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.time-value { font-family: var(--mono); font-size: 15px; font-weight: 600; }

/* Next Prayer */
.next-prayer { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* No City Message */
.no-city-message { text-align: center; padding: 60px 20px; color: var(--muted); }
.no-city-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.55; }
.no-city-message h3 { color: var(--fg); margin: 0 0 10px; font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.no-city-message p { margin: 0 0 28px; font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════
   SELECT CITY / CITY CARDS
   ═══════════════════════════════════════════════════════════════ */
.saved-cities-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.city-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
}
.city-card:hover {
  border-color: rgba(var(--green-rgb),0.3);
  box-shadow: var(--shadow-sm), var(--glow-green);
  transform: translateY(-1px);
  background: rgba(var(--green-rgb),0.04);
}
.city-card.active-city {
  border-color: rgba(var(--green-rgb),0.4);
  background: rgba(var(--green-rgb),0.08);
}

/* ── City card header row ── */
.city-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.city-card-left { flex: 1; min-width: 0; }
.city-card-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.city-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.city-card-sep { opacity: 0.4; }
.city-next-prayer { color: var(--accent); font-weight: 600; }
.city-card-remaining { opacity: 0.7; }
.city-local-time { opacity: 0.8; }

/* ── Prayer times grid ── */
.city-prayers-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.city-prayer-cell {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs, 8px);
  padding: 6px 4px;
  text-align: center;
}
.city-prayer-cell.city-prayer-next {
  border-color: rgba(var(--accent-rgb, var(--green-rgb)),0.4);
  background: rgba(var(--green-rgb),0.07);
}
.city-prayer-cell-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.city-prayer-cell-time {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}
.city-prayer-cell.city-prayer-next .city-prayer-cell-time {
  color: var(--accent, #10b981);
}

/* ── Actions ── */
.city-card-actions { display: flex; gap: 8px; }
.city-delete-btn {
  background: none; border: none;
  color: var(--rose); font-size: 1.1rem;
  cursor: pointer; padding: 8px 10px; border-radius: var(--radius-xs);
  transition: background var(--dur-fast);
  min-height: 44px; min-width: 44px;
  display: flex; align-items: center; justify-content: center;
}
.city-delete-btn:hover { background: rgba(var(--rose-rgb),0.12); }
.no-cities-text { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; line-height: 1.7; }
.add-city-btn { width: 100%; padding: 15px; font-size: 15px; font-weight: 600; margin-top: 8px; }
.add-city-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.add-city-header .h2 { margin: 0; flex: 1; }
.back-btn { white-space: nowrap; font-family: var(--mono); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   RAMADAN CARD
   ═══════════════════════════════════════════════════════════════ */
#ramadanCard {
  border-color: rgba(var(--purple-rgb),0.2) !important;
  background: rgba(var(--purple-rgb),0.04) !important;
}

/* ═══════════════════════════════════════════════════════════════
   PRAYER TRACKER
   ═══════════════════════════════════════════════════════════════ */
.tracker-prayer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
@media (max-width: 580px) { .tracker-prayer-grid { grid-template-columns: repeat(3, 1fr); } }

.tracker-prayer-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: rgba(255,255,255,0.03);
  cursor: pointer; user-select: none;
  transition: all var(--dur-normal) var(--ease-out);
  position: relative; overflow: hidden;
  min-height: 80px;
  touch-action: manipulation;
}
.tracker-prayer-btn:hover { background: rgba(255,255,255,0.06); border-color: var(--border-hover); }
.tracker-prayer-btn:active { transform: scale(0.95); }
.tracker-prayer-btn .prayer-icon { font-size: 22px; line-height: 1; }
.tracker-prayer-btn .prayer-name { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.tracker-prayer-btn .prayer-status { font-family: var(--mono); font-size: 11px; }

.tracker-prayer-btn[data-status="ontime"] { border-color: rgba(var(--green-rgb),0.4); background: rgba(var(--green-rgb),0.08); }
.tracker-prayer-btn[data-status="ontime"] .prayer-status { color: rgba(var(--green-rgb),1); }
.tracker-prayer-btn[data-status="ontime"]::after { content:""; position:absolute; inset:0; background: linear-gradient(135deg,rgba(var(--green-rgb),0.07),transparent); pointer-events:none; }
.tracker-prayer-btn[data-status="late"] { border-color: rgba(var(--gold-rgb),0.4); background: rgba(var(--gold-rgb),0.08); }
.tracker-prayer-btn[data-status="late"] .prayer-status { color: var(--gold); }
.tracker-prayer-btn[data-status="missed"] { border-color: rgba(var(--rose-rgb),0.3); background: rgba(var(--rose-rgb),0.07); }
.tracker-prayer-btn[data-status="missed"] .prayer-status { color: var(--rose); }
.tracker-prayer-btn[data-status="none"] { border-color: var(--border); background: rgba(255,255,255,0.03); }
.tracker-prayer-btn[data-status="none"] .prayer-status { color: var(--muted); }

/* Tracker Grid */
.tracker-dow {
  display: grid; grid-template-columns: repeat(7,1fr);
  gap: 6px; margin-bottom: 6px;
  color: var(--muted); font-family: var(--mono); font-size: 10px;
  text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}
.tracker-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }
.tracker-day {
  aspect-ratio: 1; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; user-select: none;
  transition: all var(--dur-fast) ease;
  position: relative; min-height: 44px;
  touch-action: manipulation;
}
.tracker-day:hover { border-color: rgba(var(--blue-rgb),0.3); background: rgba(var(--blue-rgb),0.06); }
.tracker-day.selected { outline: 2px solid rgba(var(--blue-rgb),0.5); background: rgba(var(--blue-rgb),0.08); }
.tracker-day.today { outline: 2px solid rgba(var(--purple-rgb),0.45); }
.tracker-day.outside { opacity: 0.28; pointer-events: none; }
.tracker-day.future { opacity: 0.5; }
.tracker-day .day-num { font-family: var(--mono); font-size: 11px; font-weight: 700; }
.tracker-day .day-dots { display: flex; gap: 2px; }
.tracker-day .day-dot { width: 4px; height: 4px; border-radius: 50%; }

.tracker-day[data-score="5"] { background: rgba(var(--green-rgb),0.16); border-color: rgba(var(--green-rgb),0.28); }
.tracker-day[data-score="4"] { background: rgba(var(--green-rgb),0.11); border-color: rgba(var(--green-rgb),0.20); }
.tracker-day[data-score="3"] { background: rgba(var(--green-rgb),0.07); border-color: rgba(var(--green-rgb),0.13); }
.tracker-day[data-score="2"] { background: rgba(var(--gold-rgb),0.09); border-color: rgba(var(--gold-rgb),0.16); }
.tracker-day[data-score="1"] { background: rgba(var(--gold-rgb),0.05); border-color: rgba(var(--gold-rgb),0.11); }
.tracker-day[data-score="0"] { background: rgba(var(--rose-rgb),0.07); border-color: rgba(var(--rose-rgb),0.13); }

/* Heatmap */
.tracker-prayer-rows { display: flex; flex-direction: column; gap: 8px; }
.tracker-prayer-row { display: flex; align-items: center; gap: 10px; }
.tracker-prayer-label { width: 58px; flex-shrink: 0; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted); text-align: right; letter-spacing: 0.04em; text-transform: uppercase; }
.tracker-heatmap-row { display: flex; gap: 3px; flex-wrap: wrap; flex: 1; }
.tracker-heat-cell { width: 10px; height: 10px; border-radius: 3px; background: rgba(255,255,255,0.06); transition: background var(--dur-fast) ease; }
.tracker-heat-cell[data-val="ontime"] { background: rgba(var(--green-rgb),0.9); }
.tracker-heat-cell[data-val="late"] { background: rgba(var(--gold-rgb),0.72); }
.tracker-heat-cell[data-val="missed"] { background: rgba(var(--rose-rgb),0.52); }
.tracker-heat-cell:hover { outline: 1px solid rgba(255,255,255,0.35); transform: scale(1.4); }

/* ═══════════════════════════════════════════════════════════════
   QURAN READER
   ═══════════════════════════════════════════════════════════════ */
.browse-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 920px) { .browse-grid { grid-template-columns: 1.5fr 1fr; } }

.browse-col {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); padding: 14px;
  background: rgba(255,255,255,0.02);
}

.juz-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
@media (min-width: 680px) { .juz-grid { grid-template-columns: repeat(6,1fr); } }
@media (min-width: 980px) { .juz-grid { grid-template-columns: repeat(10,1fr); } }

.juz-tile {
  border: 1px solid var(--border); background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm); padding: 10px;
  text-align: center; cursor: pointer; user-select: none;
  transition: all var(--dur-fast) var(--ease-out);
  position: relative; overflow: hidden; min-height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.juz-tile::after {
  content:""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(var(--green-rgb),0.08), rgba(var(--gold-rgb),0.05));
  opacity: 0; transition: opacity var(--dur-fast) ease; pointer-events: none;
}
.juz-tile:hover { background: rgba(255,255,255,0.07); border-color: rgba(var(--green-rgb),0.22); box-shadow: var(--shadow-sm), var(--glow-green); transform: translateY(-1px); }
.juz-tile:hover::after { opacity: 1; }
.juz-tile:active { transform: scale(0.96); }
.juz-num { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.juz-sub { color: var(--muted); font-family: var(--mono); font-size: 10px; margin-top: 3px; }

/* ── Hijri / Gregorian pill toggle ───────────────────────────── */
.hijri-pill {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid rgba(255,255,255,0.13);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s;
  flex-shrink: 0;
}
.hijri-pill:hover {
  border-color: rgba(var(--green-rgb), 0.5);
}
.hijri-pill-seg {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  color: rgba(234,240,255,0.35);
  background: transparent;
  transition: background 0.18s, color 0.18s;
  line-height: 1.4;
}
/* Active segment — set by JS adding .hijri-pill--hijri class */
.hijri-pill--gregorian #hijriPillG,
.hijri-pill:not(.hijri-pill--hijri) #hijriPillG {
  background: rgba(var(--green-rgb), 0.85);
  color: #fff;
  border-radius: 20px 0 0 20px;
}
.hijri-pill--hijri #hijriPillH {
  background: rgba(var(--green-rgb), 0.85);
  color: #fff;
  border-radius: 0 20px 20px 0;
}

.reader-settings { border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); border-radius: var(--radius); padding: 14px; margin: 10px 0 12px; }

/* ── Reader mode option cards ─────────────────────────────── */
.reader-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 600px) {
  .reader-mode-grid { grid-template-columns: 1fr; }
}
.reader-mode-card {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  padding: 12px 14px;
  transition: border-color 0.18s, background 0.18s;
  user-select: none;
}
.reader-mode-card:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}
/* Hide the native checkbox — card itself is the visual */
.reader-mode-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.reader-mode-card-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.reader-mode-card-header {
  display: flex;
  align-items: center;
  gap: 7px;
}
.reader-mode-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-hover);
  font-size: 11px;
  font-weight: 700;
  color: transparent;        /* hidden when unchecked */
  background: transparent;
  flex-shrink: 0;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
}
.reader-mode-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.18s;
  letter-spacing: 0.02em;
}
.reader-mode-desc {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(234,240,255,0.35);
  line-height: 1.4;
  padding-left: 25px;   /* align under title, past the checkmark */
}
/* ── Active / checked state ───────────────────────────────── */
.reader-mode-card:has(input:checked) {
  border-color: rgba(var(--green-rgb), 0.55);
  background: rgba(var(--green-rgb), 0.07);
}
.reader-mode-card:has(input:checked) .reader-mode-check {
  border-color: rgba(var(--green-rgb), 0.8);
  background: rgba(var(--green-rgb), 0.85);
  color: #fff;
}
.reader-mode-card:has(input:checked) .reader-mode-title {
  color: rgba(var(--green-rgb), 1);
  color: #22a07f;
}
.reader-mode-card:has(input:checked) .reader-mode-desc {
  color: rgba(234,240,255,0.55);
}
.toggle { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); user-select: none; cursor: pointer; }
.toggle input { width: auto; cursor: pointer; }
.audio-panel { border: 1px solid rgba(255,255,255,0.06); background: linear-gradient(135deg, rgba(var(--green-rgb),0.03), rgba(var(--blue-rgb),0.03)); border-radius: var(--radius); padding: 14px; margin: 10px 0 12px; }
.audio-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 880px) { .audio-grid { grid-template-columns: 1fr 1fr 1fr; } }
.audio-actions { margin-top: 10px; justify-content: flex-start; }
.reader-controls { display: flex; justify-content: flex-end; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.reader { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,0.02); padding: 14px; max-height: 70vh; overflow: auto; }
.page-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 6px; }
.page-meta { font-family: var(--mono); color: var(--muted); font-size: 12px; }

/* Mushaf */
.reader.mushafPaged {
  overflow: hidden; padding: 16px;
  background:
    radial-gradient(200px 200px at 15% 10%, rgba(var(--gold-rgb),0.06), transparent 60%),
    radial-gradient(250px 250px at 85% 20%, rgba(var(--green-rgb),0.04), transparent 60%),
    linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.06));
}
.mushaf-book {
  position: relative; border-radius: 22px; padding: 16px;
  background: linear-gradient(180deg, rgba(245,232,199,0.10), rgba(245,232,199,0.02));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: var(--shadow-xl);
  height: calc(70vh - 80px); overflow: hidden;
}
.mushaf-book::before {
  content:""; position: absolute; top: 10px; bottom: 10px; left: 50%; width: 18px;
  transform: translateX(-50%); border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.28), rgba(255,255,255,0.08));
  opacity: 0.5; pointer-events: none;
}
.mushaf-spread { display: grid; grid-template-columns: 1fr; gap: 14px; height: 100%; direction: rtl; }
@media (min-width: 940px) { .mushaf-spread { grid-template-columns: 1fr 1fr; } }
.mushaf-page {
  position: relative; border-radius: var(--radius); padding: 16px;
  background: radial-gradient(240px 240px at 25% 20%, rgba(0,0,0,0.04), transparent 70%), linear-gradient(180deg, var(--paper-1), var(--paper-2));
  color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.10); overflow: hidden; height: 100%;
}
.mushaf-page::before {
  content:""; position: absolute; inset: 10px; border-radius: var(--radius-sm);
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: inset 0 0 0 3px var(--frame-1), inset 0 0 0 7px var(--frame-2), inset 0 0 0 11px var(--frame-3);
  pointer-events: none; opacity: 0.85;
}
.mushaf-inner { position: relative; z-index: 1; padding: 10px 14px; height: 100%; overflow-y: auto; overflow-x: hidden; }
.surah-header { display: flex; align-items: center; justify-content: center; text-align: center; margin: 6px 0 14px; font-weight: 800; color: rgba(28,36,48,0.92); }
.surah-header .plaque { padding: 10px 16px; border-radius: var(--radius-pill); background: linear-gradient(135deg, rgba(var(--gold-rgb),0.08), rgba(var(--green-rgb),0.06)); border: 1px solid rgba(0,0,0,0.14); box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), var(--shadow-xs); font-family: var(--mono); font-size: 12px; direction: ltr; }
.ayah { padding: 10px 8px; border-radius: var(--radius-sm); border: 1px solid rgba(0,0,0,0.06); background: rgba(255,255,255,0.18); margin-bottom: 10px; cursor: pointer; transition: background var(--dur-fast) ease; position: relative; }
.ayah:last-child { margin-bottom: 0; }
.ayah:hover { background: rgba(255,255,255,0.28); }
.ayah.active { outline: 2px solid rgba(var(--green-rgb),0.4); background: rgba(var(--green-rgb),0.10); }
.ayah-ref { color: rgba(28,36,48,0.55); font-family: var(--mono); font-size: 11px; margin-bottom: 8px; direction: ltr; }
.ayah-end { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 10px; margin-inline-start: 8px; border-radius: var(--radius-pill); border: 1px solid rgba(0,0,0,0.18); box-shadow: inset 0 0 0 2px rgba(var(--gold-rgb),0.45), inset 0 1px 0 rgba(255,255,255,0.5); background: rgba(255,255,255,0.35); color: rgba(28,36,48,0.95); font-family: var(--mono); font-size: 12px; direction: rtl; }

/* Translations */
.mushaf-translation { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(0,0,0,0.08); color: rgba(28,36,48,0.70); font-size: 11px; line-height: 1.45; font-family: var(--sans); direction: ltr; text-align: left; }
.scroll-translation { display: block; margin-top: 8px; color: var(--fg); font-size: 14px; line-height: 1.65; font-family: var(--sans); direction: ltr; text-align: left; }

/* Plain scroll */
.reader.plain { overflow: auto; background: rgba(255,255,255,0.02); color: var(--fg); }
.reader.plain .ayah { background: rgba(255,255,255,0.04); border: 1px solid var(--border); }
.reader.plain .ayah:hover { background: rgba(255,255,255,0.07); }
.reader.plain .ayah-ref { color: var(--muted); }
.reader.plain .arabic { color: var(--fg); }
.reader.plain .ayah-end { border-color: rgba(255,255,255,0.22); color: rgba(233,238,252,0.9); background: rgba(255,255,255,0.08); box-shadow: none; }

/* ═══════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════ */
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.calendar-title { text-align: center; flex: 1; min-width: 220px; }
.cal-month { font-family: var(--display); font-weight: 700; letter-spacing: 0.05em; font-size: 18px; }
.cal-sub { color: var(--muted); font-family: var(--mono); font-size: 12px; margin-top: 4px; }
.calendar-layout { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 980px) { .calendar-layout { grid-template-columns: 1.3fr 0.7fr; } }

.dow { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; margin-bottom: 8px; color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.dow div { text-align: center; padding: 6px 0; border: 1px solid rgba(255,255,255,0.05); border-radius: 10px; background: rgba(255,255,255,0.02); }
.calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; }

.day {
  border: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.03);
  border-radius: 14px; min-height: 70px; padding: 8px;
  cursor: pointer; user-select: none;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: all var(--dur-fast) ease;
  touch-action: manipulation;
}
.day:hover { background: rgba(255,255,255,0.06); border-color: var(--border-hover); }
.day.muted { opacity: 0.38; }
.day.today { outline: 2px solid rgba(var(--purple-rgb),0.4); background: rgba(var(--purple-rgb),0.08); box-shadow: var(--glow-purple); }
.day.selected { outline: 2px solid rgba(var(--blue-rgb),0.4); background: rgba(var(--blue-rgb),0.08); box-shadow: var(--glow-blue); }
.greg { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.hij { color: var(--muted); font-family: var(--mono); font-size: 11px; text-align: right; }
.cal-side { border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); background: rgba(255,255,255,0.02); padding: 14px; }
.cal-detail { margin-top: 10px; }
.cal-detail .label { color: var(--muted); font-size: 12px; }
.cal-detail .value { font-family: var(--mono); font-size: 13px; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   QIBLA COMPASS
   ═══════════════════════════════════════════════════════════════ */
.qibla-container { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 24px 0; }
@media (min-width: 880px) { .qibla-container { flex-direction: row; justify-content: center; gap: 48px; } }
.qibla-compass { position: relative; width: 280px; height: 280px; flex-shrink: 0; }
.compass-ring {
  position: relative; width: 100%; height: 100%; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.11);
  background:
    radial-gradient(circle at 40% 35%, rgba(var(--blue-rgb),0.06), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(15,26,51,0.96), rgba(8,14,28,0.99));
  box-shadow:
    0 0 0 6px rgba(var(--blue-rgb),0.08),
    0 0 0 12px rgba(var(--purple-rgb),0.05),
    0 0 0 18px rgba(var(--green-rgb),0.04),
    0 16px 48px rgba(0,0,0,0.55);
  transition: transform 0.3s ease;
}
.compass-n, .compass-e, .compass-s, .compass-w { position: absolute; font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--muted); }
.compass-n { top: 12px; left: 50%; transform: translateX(-50%); color: var(--rose); }
.compass-e { right: 12px; top: 50%; transform: translateY(-50%); }
.compass-s { bottom: 12px; left: 50%; transform: translateX(-50%); }
.compass-w { left: 12px; top: 50%; transform: translateY(-50%); }
.compass-needle { position: absolute; top: 50%; left: 50%; width: 4px; height: 100px; margin-left: -2px; margin-top: -100px; background: linear-gradient(180deg, var(--rose) 0%, var(--rose) 50%, rgba(255,255,255,0.18) 50%); border-radius: 4px; transform-origin: bottom center; transition: transform 0.3s ease; z-index: 2; }
.compass-needle::after { content:""; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.14); border: 2px solid rgba(255,255,255,0.24); }
.compass-kaaba { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin-left: -20px; margin-top: -120px; display: flex; align-items: center; justify-content: center; font-size: 24px; transform-origin: 20px 140px; transition: transform 0.3s ease; z-index: 3; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.55)); }
.qibla-info { display: flex; flex-direction: column; gap: 14px; }
.qibla-detail { border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; background: rgba(255,255,255,0.03); transition: all var(--dur-fast) ease; }
.qibla-detail:hover { background: rgba(255,255,255,0.06); border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.qibla-detail .label { color: var(--muted); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; }
.qibla-detail .value { font-family: var(--mono); font-size: 15px; margin-top: 5px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   RADIO PLAYER
   ═══════════════════════════════════════════════════════════════ */
.radio-player { border: 1px solid rgba(255,255,255,0.06); background: linear-gradient(135deg, rgba(var(--purple-rgb),0.04), rgba(var(--blue-rgb),0.04)); border-radius: var(--radius); padding: 18px; margin-top: 12px; }
.radio-now-playing { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.radio-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; background: linear-gradient(135deg, rgba(var(--green-rgb),0.22), rgba(var(--gold-rgb),0.16)); border: 1px solid rgba(var(--gold-rgb),0.22); flex-shrink: 0; box-shadow: var(--shadow-sm); transition: box-shadow 0.3s ease; }
.radio-icon.playing { animation: radioPulse 1.6s ease-in-out infinite; box-shadow: var(--shadow-sm), var(--glow-green); }
@keyframes radioPulse { 0%,100% { box-shadow: var(--shadow-sm), 0 0 0 0 rgba(var(--green-rgb),0.32); } 50% { box-shadow: var(--shadow-sm), 0 0 0 14px rgba(var(--green-rgb),0); } }
.radio-channel-name { font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.03em; }
.radio-channel-desc { color: var(--muted); font-family: var(--mono); font-size: 12px; margin-top: 5px; }
.radio-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.radio-volume { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 150px; }
.radio-volume input[type="range"] { flex: 1; height: 5px; border-radius: 3px; -webkit-appearance: none; appearance: none; background: rgba(255,255,255,0.12); outline: none; padding: 0; border: none; cursor: pointer; min-height: auto; }
.radio-volume input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, rgba(var(--green-rgb),0.85), rgba(var(--blue-rgb),0.85)); cursor: pointer; border: 2px solid rgba(255,255,255,0.3); transition: transform var(--dur-fast) var(--ease-spring); box-shadow: var(--shadow-xs); }
.radio-volume input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
.radio-volume input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, rgba(var(--green-rgb),0.85), rgba(var(--blue-rgb),0.85)); cursor: pointer; border: 2px solid rgba(255,255,255,0.3); }

.radio-channel-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .radio-channel-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .radio-channel-grid { grid-template-columns: 1fr 1fr 1fr; } }

.radio-channel-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; background: rgba(255,255,255,0.03); cursor: pointer; user-select: none; transition: all var(--dur-fast) var(--ease-out); position: relative; overflow: hidden; min-height: 72px; touch-action: manipulation; }
.radio-channel-card::after { content:""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(var(--green-rgb),0.05), transparent); opacity: 0; transition: opacity var(--dur-fast) ease; pointer-events: none; }
.radio-channel-card:hover { background: rgba(255,255,255,0.06); border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.radio-channel-card:hover::after { opacity: 1; }
.radio-channel-card:active { transform: scale(0.98); }
.radio-channel-card.active { outline: 2px solid rgba(var(--green-rgb),0.45); background: rgba(var(--green-rgb),0.07); box-shadow: var(--glow-green); }
.radio-channel-card.active::after { opacity: 1; }
.radio-channel-card .channel-name { font-weight: 700; font-family: var(--display); font-size: 14px; margin-bottom: 4px; letter-spacing: 0.02em; }
.radio-channel-card .channel-desc { color: var(--muted); font-family: var(--mono); font-size: 11px; line-height: 1.4; }
.radio-channel-card .channel-lang { display: inline-block; margin-top: 7px; padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(var(--green-rgb),0.09); border: 1px solid rgba(var(--green-rgb),0.18); color: rgba(var(--green-rgb),0.9); font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.05em; }

/* ── Radio Category Filter ─────────────────────────────────── */
.radio-category-filter {
  display: flex;
  gap: 8px;
  padding: 12px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.radio-category-filter::-webkit-scrollbar { display: none; }

.radio-cat-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: var(--radius-pill);
  background: rgba(var(--gold-rgb), 0.06);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.radio-cat-btn:hover {
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--text);
}
.radio-cat-btn.active {
  background: rgba(var(--gold-rgb), 0.18);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* ── Station Count ─────────────────────────────────────────── */
.radio-station-count {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 4px 0 8px;
  font-family: var(--mono);
}

/* ── Channel Meta Row (lang + category badge) ──────────────── */
.channel-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.channel-cat-badge {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--green-rgb), 0.12);
  color: var(--green);
  font-family: var(--mono);
}

/* ── Radio Management Toolbar ──────────────────────────────── */
.radio-manage-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  flex-wrap: wrap;
}
.radio-manage-btn {
  padding: 6px 14px;
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: var(--radius-pill);
  background: rgba(var(--gold-rgb), 0.06);
  color: var(--muted);
  font-size: 0.82rem;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.25s ease;
}
.radio-manage-btn:hover { background: rgba(var(--gold-rgb), 0.12); color: var(--fg); }
.radio-manage-btn.active { background: rgba(var(--green-rgb), 0.15); border-color: var(--green-islamic); color: var(--green-light); }
.radio-manage-btn.add-btn { border-color: rgba(var(--green-rgb), 0.3); color: var(--green-light); }
.radio-manage-btn.restore-btn { border-color: rgba(var(--gold-rgb), 0.3); color: var(--gold); }

/* ── Delete Button on Cards ────────────────────────────────── */
.radio-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 80, 80, 0.3);
  border-radius: 50%;
  background: rgba(255, 80, 80, 0.12);
  color: #ff5050;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}
html[dir="rtl"] .radio-delete-btn { right: auto; left: 6px; }
.radio-delete-btn:hover { background: rgba(255, 80, 80, 0.3); transform: scale(1.15); }

/* ── Custom Badge ──────────────────────────────────────────── */
.channel-custom-badge {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--gold);
  font-family: var(--mono);
}

/* ── Empty State ───────────────────────────────────────────── */
.radio-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
}

/* ── Load More Button ──────────────────────────────────────── */
.radio-load-more-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  border: 1px dashed rgba(var(--gold-rgb), 0.3);
  border-radius: var(--radius-lg);
  background: rgba(var(--gold-rgb), 0.06);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.radio-load-more-btn:hover {
  background: rgba(var(--gold-rgb), 0.12);
  border-color: var(--gold);
}


/* ── Add Station Modal ─────────────────────────────────────── */
.radio-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.radio-modal {
  background: linear-gradient(160deg, rgba(17,30,58,0.99), rgba(10,20,42,0.99));
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
}
.radio-modal-title {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--gold);
  margin: 0 0 20px;
}
.radio-modal-field {
  margin-bottom: 14px;
}
.radio-modal-field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.radio-modal-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.9rem;
}
.radio-modal-field input:focus {
  outline: none;
  border-color: var(--gold);
}
.radio-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   ZAKAT — shares layout with general card          ← existing
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   ZAKAT — shares layout with general card
   ═══════════════════════════════════════════════════════════════ */
/* Zakat result highlights */
.zakat-result { padding: 18px; border-radius: var(--radius); border: 1px solid rgba(var(--gold-rgb),0.22); background: linear-gradient(135deg, rgba(var(--gold-rgb),0.07), rgba(var(--green-rgb),0.05)); }


/* ── Zakat Hawl Checkbox — Custom Styled ───────────────────── */
#zakatHawlRow {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(var(--purple-rgb), 0.06);
  border: 1px solid rgba(var(--purple-rgb), 0.18);
  margin-bottom: 16px;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
#zakatHawlRow:hover {
  background: rgba(var(--purple-rgb), 0.10);
  border-color: rgba(var(--purple-rgb), 0.28);
}

/* RTL: flip checkbox to right side */
html[dir="rtl"] #zakatHawlRow {
  flex-direction: row-reverse;
}

/* Hide native checkbox */
#zakatHawl {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom checkbox box */
.zakat-hawl-check {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid rgba(var(--purple-rgb), 0.4);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: all 0.25s ease;
  position: relative;
}

/* Checkmark — hidden by default */
.zakat-hawl-check::after {
  content: '';
  width: 6px;
  height: 11px;
  border: solid transparent;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-top: -2px;
}

/* Checked state — purple glow + visible checkmark */
#zakatHawl:checked ~ .zakat-hawl-check,
#zakatHawlRow.checked .zakat-hawl-check {
  background: rgba(var(--purple-rgb), 0.85);
  border-color: rgba(var(--purple-rgb), 0.9);
  box-shadow: 0 0 12px rgba(var(--purple-rgb), 0.35);
}

#zakatHawl:checked ~ .zakat-hawl-check::after,
#zakatHawlRow.checked .zakat-hawl-check::after {
  border-color: #fff;
  transform: rotate(45deg) scale(1);
}

/* Focus ring for accessibility */
#zakatHawl:focus-visible ~ .zakat-hawl-check {
  outline: 2.5px solid rgba(var(--purple-rgb), 0.7);
  outline-offset: 3px;
}

/* Hawl label styling */
.zakat-hawl-label {
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
  flex: 1;
}
.zakat-hawl-title {
  color: rgba(var(--purple-rgb), 1);
  font-weight: 700;
  font-size: 14px;
}
.zakat-hawl-desc {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════════════════════ */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1fr 1fr; } .about-dedication { grid-column: 1/-1; } }
.about-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(255,255,255,0.03); padding: 18px; box-shadow: var(--shadow-xs); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.about-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.about-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.about-title { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: 0.03em; }
.about-body { font-size: 14px; line-height: 1.8; color: var(--fg); }
.about-body p { margin: 0 0 10px; }
.about-list { margin: 0; padding-left: 18px; color: var(--fg); font-size: 14px; line-height: 1.8; }
.about-list li { margin: 6px 0; }
.about-lang { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 8px; }
.about-lang-label { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.09em; }
.about-lang-chip { font-family: var(--mono); font-size: 12px; padding: 5px 10px; border-radius: var(--radius-pill); border: 1px solid rgba(255,255,255,0.10); background: rgba(255,255,255,0.04); color: var(--fg); }
.about-ar { font-family: var(--arabic); font-size: 18px; line-height: 2.1; color: rgba(234,240,255,0.97); padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(var(--gold-rgb),0.07), rgba(var(--green-rgb),0.06)); border: 1px solid rgba(var(--gold-rgb),0.18); }
.about-ar p { margin: 0 0 12px; }
.about-en { padding: 2px; }
.about-divider { height: 1px; margin: 14px 0; background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb),0.22), transparent); }

/* ═══════════════════════════════════════════════════════════════
   QURAN ENHANCED (Bookmarks, WbW, Hifz, Tafsir)
   ═══════════════════════════════════════════════════════════════ */
/* Ayah actions */
.ayah-actions { position: absolute; top: 6px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity var(--dur-fast); z-index: 2; }
.ayah { position: relative; }
.ayah:hover .ayah-actions { opacity: 1; }
.ayah-action-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 4px 8px; font-size: 14px; cursor: pointer; transition: all var(--dur-fast); line-height: 1; color: var(--fg); min-height: 32px; min-width: 32px; display: flex; align-items: center; justify-content: center; }
.ayah-action-btn:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.2); transform: scale(1.1); }
.ayah-action-btn.bookmarked { background: rgba(var(--gold-rgb),0.16); border-color: rgba(var(--gold-rgb),0.32); }
.mushaf-page .ayah-actions { right: 6px; top: 4px; }
.mushaf-page .ayah-action-btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); color: rgba(28,36,48,0.8); }
.mushaf-page .ayah-action-btn:hover { background: rgba(0,0,0,0.12); }
.mushaf-page .ayah-action-btn.bookmarked { background: rgba(var(--gold-rgb),0.16); border-color: rgba(var(--gold-rgb),0.26); }

/* Word-by-Word */
.quran-word { cursor: default; transition: background var(--dur-fast), color var(--dur-fast); border-radius: 4px; padding: 0 2px; }
.wbw-active .quran-word { cursor: pointer; }
.wbw-active .quran-word:hover { background: rgba(var(--blue-rgb),0.15); outline: 1px solid rgba(var(--blue-rgb),0.3); }
.mushaf-page .wbw-active .quran-word:hover { background: rgba(var(--green-rgb),0.12); outline-color: rgba(var(--green-rgb),0.25); }

/* Word Tooltip */
.word-tooltip { position: fixed; z-index: 9999; background: rgba(12,22,46,0.97); backdrop-filter: blur(14px); border: 1px solid rgba(var(--blue-rgb),0.22); border-radius: var(--radius); padding: 12px 16px; min-width: 160px; max-width: 280px; box-shadow: 0 12px 40px rgba(0,0,0,0.55), var(--glow-blue); pointer-events: none; animation: tooltipFadeIn 0.2s ease; }
@keyframes tooltipFadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.word-tooltip-arabic { font-family: var(--arabic); font-size: 22px; text-align: center; color: var(--gold); margin-bottom: 6px; direction: rtl; }
.word-tooltip-transliteration { font-family: var(--mono); font-size: 12px; font-style: italic; color: rgba(var(--blue-rgb),0.9); text-align: center; margin-bottom: 4px; }
.word-tooltip-translation { font-size: 13px; color: var(--white-soft); text-align: center; line-height: 1.45; }

/* Hifz mode */
.hifz-active .quran-word { cursor: pointer; background: rgba(var(--purple-rgb),0.15); color: transparent !important; border-radius: 4px; padding: 0 3px; user-select: none; transition: all 0.25s ease; border-bottom: 2px dashed rgba(var(--purple-rgb),0.45); }
.hifz-active .quran-word:hover { background: rgba(var(--purple-rgb),0.26); }
.hifz-active .quran-word.revealed { color: inherit !important; background: rgba(var(--green-rgb),0.13); border-bottom-color: rgba(var(--green-rgb),0.3); }
.mushaf-page .hifz-active .quran-word { background: rgba(100,80,160,0.13); border-bottom-color: rgba(100,80,160,0.32); }
.mushaf-page .hifz-active .quran-word.revealed { background: rgba(var(--green-rgb),0.11); border-bottom-color: rgba(var(--green-rgb),0.26); }
.hifz-active .ayah-end { color: inherit !important; }

/* Tafsir Modal */
.tafsir-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tafsir-modal.hidden { display: none !important; }
.tafsir-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(5px); }
.tafsir-modal-content { position: relative; z-index: 1; background: linear-gradient(160deg, rgba(17,30,58,0.99), rgba(10,20,42,0.99)); border: 1px solid rgba(var(--blue-rgb),0.16); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl), var(--glow-blue); max-width: 700px; width: 100%; max-height: 82vh; display: flex; flex-direction: column; overflow: hidden; }
.tafsir-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tafsir-modal-body { padding: 20px 22px; overflow-y: auto; font-size: 14px; line-height: 1.85; color: var(--fg); }
.tafsir-modal-body .tafsir-arabic { font-family: var(--arabic); font-size: 20px; line-height: 2.1; text-align: center; padding: 16px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(var(--gold-rgb),0.07), rgba(var(--green-rgb),0.06)); border: 1px solid rgba(var(--gold-rgb),0.16); direction: rtl; margin-bottom: 16px; }
.tafsir-modal-body .tafsir-text { font-size: 14px; line-height: 1.95; }
.tafsir-modal-body .tafsir-text p { margin: 0 0 12px; }

/* Bookmarks */
.bookmarks-list { max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.bookmark-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(255,255,255,0.03); cursor: pointer; transition: all var(--dur-fast); }
.bookmark-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(var(--gold-rgb),0.22); }
.bookmark-item .bm-icon { font-size: 20px; flex-shrink: 0; }
.bookmark-item .bm-content { flex: 1; min-width: 0; }
.bookmark-item .bm-ref { font-family: var(--display); font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.bookmark-item .bm-arabic { font-family: var(--arabic); font-size: 16px; line-height: 1.9; direction: rtl; text-align: right; color: rgba(234,240,255,0.9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-item .bm-note { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 4px; font-family: var(--mono); }
.bookmark-item .bm-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.bookmark-item .bm-action-btn { background: none; border: 1px solid rgba(255,255,255,0.10); border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; color: var(--muted); transition: all var(--dur-fast); min-height: 32px; display: flex; align-items: center; }
.bookmark-item .bm-action-btn:hover { background: rgba(255,255,255,0.08); color: var(--fg); }

/* Repeat indicator */
.repeat-indicator { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-pill); background: rgba(var(--purple-rgb),0.11); border: 1px solid rgba(var(--purple-rgb),0.22); font-family: var(--mono); font-size: 11px; color: rgba(var(--purple-rgb),0.9); }

/* ═══════════════════════════════════════════════════════════════
   CONTACT FORM
   ═══════════════════════════════════════════════════════════════ */
.contact-form textarea:focus, .contact-form input:focus, .contact-form select:focus {
  outline: none;
  border-color: rgba(var(--green-rgb),0.42);
  box-shadow: 0 0 0 3px rgba(var(--green-rgb),0.10);
}
.contact-form textarea {
  width: 100%; padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.contact-form textarea:hover { border-color: rgba(var(--gold-rgb),0.22); }

/* Star Rating */
.rating-stars { display: flex; gap: 6px; margin-top: 4px; }
.star-btn { background: none; border: 1px solid rgba(255,255,255,0.10); border-radius: 8px; font-size: 26px; cursor: pointer; padding: 5px 9px; color: var(--muted); transition: all var(--dur-fast); line-height: 1; min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
.star-btn:hover { color: rgba(var(--gold-rgb),0.85); border-color: rgba(var(--gold-rgb),0.3); transform: scale(1.18); }
.star-btn.active { color: var(--gold); border-color: rgba(var(--gold-rgb),0.4); background: rgba(var(--gold-rgb),0.08); text-shadow: 0 0 12px rgba(var(--gold-rgb),0.35); }
@media (max-width: 580px) { .rating-stars { justify-content: center; } .star-btn { font-size: 30px; padding: 6px 10px; } }

/* Send button states */
#contactSendBtn.sending { opacity: 0.7; pointer-events: none; }
#contactSendBtn .btn-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.25); border-top-color: white; border-radius: 50%; animation: btnSpin 0.65s linear infinite; margin-right: 6px; vertical-align: middle; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Contact links */
.contact-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: rgba(255,255,255,0.03); color: var(--fg); text-decoration: none; font-family: var(--mono); font-size: 13px; transition: all var(--dur-fast); min-height: 44px; }
.contact-link:hover { background: rgba(255,255,255,0.06); border-color: rgba(var(--green-rgb),0.3); color: rgba(var(--green-rgb),1); }
.contact-link-icon { font-size: 18px; }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeIn    { from { opacity:0; transform:translateY(8px);  } to { opacity:1; transform:none; } }
@keyframes slideUp   { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes shimmer   { 0% { background-position:-200% 0; } 100% { background-position:200% 0; } }
@keyframes ken-burns { 0% { transform:scale(1); } 100% { transform:scale(1.05); } }

.animate-fade-in    { animation: fadeIn    0.32s var(--ease-out) forwards; }
.animate-slide-up   { animation: slideUp   0.4s  var(--ease-out) forwards; }
.animate-shimmer    { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent); background-size: 200% 100%; animation: shimmer 2s ease-in-out infinite; }
.animate-ken-burns  { animation: ken-burns 20s ease-in-out infinite alternate; }

.delay-75  { animation-delay: 75ms; }
.delay-150 { animation-delay: 150ms; }
.delay-225 { animation-delay: 225ms; }
.delay-300 { animation-delay: 300ms; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.app-footer {
  color: var(--muted);
  border-top: 1px solid rgba(var(--gold-rgb),0.08);
  padding: 24px 20px calc(24px + var(--safe-bottom));
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  background: rgba(8,14,28,0.6);
}

/* ═══════════════════════════════════════════════════════════════
   RTL SUPPORT
   ═══════════════════════════════════════════════════════════════ */
html[dir="rtl"] { direction: rtl; text-align: right; }
html[dir="rtl"] .top-nav, html[dir="rtl"] .tab-bar { direction: rtl; }
html[dir="rtl"] .tab-bar { flex-direction: row-reverse; }
html[dir="rtl"] .time-card { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .cal-grid { direction: rtl; }
html[dir="rtl"] .cal-side, html[dir="rtl"] .card { text-align: right; }
html[dir="rtl"] select, html[dir="rtl"] input, html[dir="rtl"] button { text-align: inherit; }
html[dir="rtl"] .tracker-grid { direction: rtl; }
.quran-ayah-text { direction: rtl !important; text-align: right !important; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 580px) {
  .app-header { padding: 10px 14px calc(10px + var(--safe-top)); gap: 8px; }
  .brand-subtitle { display: none; }
  .top-nav { gap: 4px; }
  .btn-tab { padding: 7px 10px; font-size: 11px; min-height: 36px; }
  .container { margin: 14px auto 36px; padding: 0 12px; gap: 14px; }
  .card { padding: 16px; border-radius: var(--radius); }
  .h1 { font-size: 18px; }
  .h2 { font-size: 15px; }
  .qibla-compass { width: 240px; height: 240px; }
  .compass-kaaba { margin-top: -100px; transform-origin: 20px 120px; }
  .compass-needle { height: 80px; margin-top: -80px; }
  .mushaf-book { height: calc(65vh - 60px); }
  .day { min-height: 58px; padding: 6px; border-radius: 10px; }
  .greg { font-size: 12px; }
  .hij { font-size: 10px; }
  .radio-now-playing { flex-direction: column; text-align: center; }
  .tafsir-modal { padding: 10px; }
  .tafsir-modal-content { max-height: 92vh; }
  .tafsir-modal-body { padding: 14px 16px; }
  .word-tooltip { max-width: 220px; }
  .ayah-actions { opacity: 0.7; }
  .tracker-day { min-height: 40px; border-radius: 7px; }
  .tracker-day .day-num { font-size: 10px; }
  .tracker-heat-cell { width: 8px; height: 8px; }
  .tracker-prayer-label { width: 44px; font-size: 10px; }
}

@media (min-width: 581px) and (max-width: 960px) {
  .qibla-compass { width: 260px; height: 260px; }
}

/* Large desktop enhancement */
@media (min-width: 1200px) {
  .container { padding: 0 28px; }
  .card { padding: 26px; }
  .h1 { font-size: 24px; }
  .h2 { font-size: 19px; }
}

/* ═══════════════════════════════════════════════════════════════
   PRINT
   ═══════════════════════════════════════════════════════════════ */
@media print {
  .app-header, .app-footer, .top-nav, .btn, .audio-panel,
  .reader-controls, .page-nav, .radio-controls { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; background: white; }
  body { background: white; color: black; }
  .reader { max-height: none; overflow: visible; }
}

/* ═══════════════════════════════════════════════════════════════
   iOS-SPECIFIC FIXES
   ═══════════════════════════════════════════════════════════════ */

/* Prevent overscroll bounce showing white */
html { background: var(--navy-deep); }

/* Fix select element arrows on iOS */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(234,240,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Momentum scrolling for scroll containers */
.reader, .bookmarks-list, .mushaf-inner, .tafsir-modal-body {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Prevent text selection flicker on button taps */
.btn, .juz-tile, .time-card, .city-card, .tracker-prayer-btn,
.tracker-day, .day, .radio-channel-card {
  -webkit-user-select: none;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════════════
   ENHANCEMENTS v3 — All 8 features
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   1. SCROLL-ENTRANCE ANIMATIONS
   Cards & sections fade-slide in as they enter the viewport
   ───────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger siblings */
.reveal:nth-child(2) { transition-delay: 60ms; }
.reveal:nth-child(3) { transition-delay: 120ms; }
.reveal:nth-child(4) { transition-delay: 180ms; }
.reveal:nth-child(5) { transition-delay: 240ms; }

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ─────────────────────────────────────────────────────────────
   2. SHARE THIS AYAH BUTTON
   ───────────────────────────────────────────────────────────── */
.ayah-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
  background: linear-gradient(135deg, rgba(var(--gold-rgb),0.10), rgba(var(--green-rgb),0.08));
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.ayah-share-btn:hover {
  background: linear-gradient(135deg, rgba(var(--gold-rgb),0.18), rgba(var(--green-rgb),0.13));
  border-color: rgba(var(--gold-rgb), 0.4);
  box-shadow: var(--glow-gold);
  transform: translateY(-1px);
}
.ayah-share-btn:active { transform: scale(0.96); }
.ayah-share-btn .share-icon { font-size: 15px; }

/* Share success flash */
.ayah-share-btn.shared {
  border-color: rgba(var(--green-rgb), 0.4);
  background: linear-gradient(135deg, rgba(var(--green-rgb),0.14), rgba(var(--green-rgb),0.08));
  color: rgba(var(--green-rgb), 1);
}

/* ─────────────────────────────────────────────────────────────
   3. PRAYER TIME PROGRESS BAR
   Gold bar showing progress through current prayer window
   ───────────────────────────────────────────────────────────── */
.prayer-progress-wrap {
  margin-top: 16px;
  margin-bottom: 4px;
}
.prayer-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}
.prayer-progress-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.prayer-progress-pct {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}
.prayer-progress-track {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.prayer-progress-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg,
    rgba(var(--green-rgb), 0.9),
    rgba(var(--gold-rgb), 0.95));
  border-radius: var(--radius-pill);
  transition: width 1s var(--ease-out);
  box-shadow: 0 0 10px rgba(var(--gold-rgb), 0.35);
}
/* Animated shimmer on fill */
.prayer-progress-fill::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShimmer 2.5s ease-in-out infinite;
}
@keyframes progressShimmer {
  0%   { transform: translateX(-60px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateX(60px); opacity: 0; }
}
.prayer-progress-milestones {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}
.prayer-progress-milestones span {
  font-family: var(--mono);
  font-size: 10px;
  color: rgba(var(--gold-rgb), 0.55);
}

/* ─────────────────────────────────────────────────────────────
   4. HIJRI DATE IN HEADER
   ───────────────────────────────────────────────────────────── */
.header-hijri {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(var(--gold-rgb), 0.75);
  letter-spacing: 0.04em;
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(var(--gold-rgb), 0.15);
  background: rgba(var(--gold-rgb), 0.05);
  transition: all var(--dur-fast);
}
.header-hijri:hover {
  border-color: rgba(var(--gold-rgb), 0.28);
  background: rgba(var(--gold-rgb), 0.09);
  color: var(--gold);
}
@media (max-width: 480px) {
  .header-hijri { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   5. ANIMATED COUNTDOWN DOT (Next Prayer)
   ───────────────────────────────────────────────────────────── */
.next-prayer-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green-islamic);
  box-shadow: 0 0 0 0 rgba(var(--green-rgb), 0.55);
  animation: prayerPulse 2s ease-in-out infinite;
  margin-right: 7px;
  vertical-align: middle;
  flex-shrink: 0;
}
@keyframes prayerPulse {
  0%   { box-shadow: 0 0 0 0   rgba(var(--green-rgb), 0.6); }
  50%  { box-shadow: 0 0 0 8px rgba(var(--green-rgb), 0);   }
  100% { box-shadow: 0 0 0 0   rgba(var(--green-rgb), 0.6); }
}
/* Wrap next-prayer value to accommodate dot */
#nextPrayerValue {
  display: flex;
  align-items: center;
}
/* Countdown urgency — turns gold when < 30 min */
.countdown-urgent {
  color: var(--gold) !important;
  animation: countdownBlink 1.5s ease-in-out infinite;
}
@keyframes countdownBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ─────────────────────────────────────────────────────────────
   6. TAB UNDERLINE INDICATOR
   Sliding gold underline replaces the pill background
   ───────────────────────────────────────────────────────────── */
.top-nav {
  position: relative;
}
/* Sliding indicator bar — injected by JS */
.tab-indicator {
  position: absolute;
  bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, rgba(var(--gold-rgb),0.4), var(--gold), rgba(var(--gold-rgb),0.4));
  border-radius: var(--radius-pill);
  transition: left 0.28s var(--ease-out), width 0.28s var(--ease-out);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(var(--gold-rgb), 0.5);
}
/* Refined active tab — lighter than before, relies on underline for emphasis */
.btn-tab-active {
  background: rgba(var(--gold-rgb), 0.08) !important;
  border-color: rgba(var(--gold-rgb), 0.18) !important;
  color: var(--white-soft) !important;
  box-shadow: none !important;
}

/* ─────────────────────────────────────────────────────────────
   7. HAPTIC FEEDBACK — visual ripple companion
   The JS does vibrate(); CSS provides the visual ripple burst
   ───────────────────────────────────────────────────────────── */
@keyframes rippleBurst {
  0%   { transform: scale(0.85); box-shadow: 0 0 0 0   rgba(var(--green-rgb),0.45); }
  40%  { transform: scale(1.04); box-shadow: 0 0 0 12px rgba(var(--green-rgb),0.15); }
  100% { transform: scale(1);    box-shadow: 0 0 0 18px rgba(var(--green-rgb),0);    }
}
.tracker-prayer-btn.tapped {
  animation: rippleBurst 0.38s var(--ease-out) forwards;
}

/* ─────────────────────────────────────────────────────────────
   8. PULL-TO-REFRESH INDICATOR
   ───────────────────────────────────────────────────────────── */
.ptr-indicator {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(var(--green-rgb), 0.15);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(var(--green-rgb), 0.22);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(var(--green-rgb), 1);
  transform: translateY(-100%);
  transition: transform 0.28s var(--ease-out);
  pointer-events: none;
}
.ptr-indicator.ptr-visible { transform: translateY(0); }
.ptr-indicator.ptr-loading { background: rgba(var(--gold-rgb),0.12); color: var(--gold); border-color: rgba(var(--gold-rgb), 0.22); }

.ptr-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(var(--green-rgb), 0.2);
  border-top-color: rgba(var(--green-rgb), 0.9);
  border-radius: 50%;
  animation: ptrSpin 0.65s linear infinite;
}
.ptr-loading .ptr-spinner {
  border-color: rgba(var(--gold-rgb), 0.2);
  border-top-color: var(--gold);
}
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* Arrow icon that rotates as user pulls */
.ptr-arrow {
  font-size: 16px;
  transition: transform 0.2s ease;
  display: inline-block;
}
.ptr-indicator.ptr-ready .ptr-arrow { transform: rotate(180deg); }

/* ─────────────────────────────────────────────────────────────
   9. HIJRI-PRIMARY CALENDAR TITLE
   ───────────────────────────────────────────────────────────── */
.calendar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

/* Main Hijri title — enlarged, gold tint */
#calMonthTitle {
  font-family: var(--display) !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  background: linear-gradient(135deg, var(--white-soft) 30%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Arabic Hijri month line */
#calHijriArabicLine {
  font-family: var(--arabic);
  font-size: 1.05rem;
  color: rgba(var(--gold-rgb), 0.72);
  direction: rtl;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

/* Gregorian sub-line — demoted */
#calSubTitle {
  font-family: var(--mono) !important;
  font-size: 0.78rem !important;
  color: var(--muted) !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   DAILY AYAH — FLOATING PILL + MODAL (Option 3)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Floating pill button ────────────────────────────────────── */
.ayah-pill {
  position: fixed;
  bottom: calc(72px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  right: 18px;
  z-index: 800;

  display: flex;
  align-items: center;
  gap: 7px;

  padding: 10px 16px 10px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(var(--gold-rgb), 0.30);
  background: linear-gradient(135deg,
    rgba(var(--navy-card-rgb, 17,30,54), 0.92),
    rgba(var(--navy-elevated-rgb, 22,34,64), 0.96));
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.45),
    0 0 0 1px rgba(var(--gold-rgb), 0.10),
    0 0 18px rgba(var(--gold-rgb), 0.12);

  color: var(--white-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.22s var(--ease-out),
              box-shadow 0.22s var(--ease-out),
              border-color 0.22s;
  will-change: transform;
  min-height: 44px;
}

.ayah-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--gold-rgb), 0.50);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.50),
    0 0 0 1px rgba(var(--gold-rgb), 0.18),
    0 0 28px rgba(var(--gold-rgb), 0.20);
}

.ayah-pill:active {
  transform: scale(0.95);
}

.ayah-pill-icon {
  font-size: 17px;
  line-height: 1;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(var(--gold-rgb), 0.5));
}

.ayah-pill-label {
  color: rgba(var(--white-soft-rgb, 234,240,255), 0.90);
  white-space: nowrap;
}

/* New-verse indicator dot */
.ayah-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px rgba(var(--gold-rgb), 0.7);
  animation: pillDotPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pillDotPulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* Hide dot once modal has been opened today */
.ayah-pill-dot.seen { display: none; }

/* ─── Modal backdrop ──────────────────────────────────────────── */
/* Backdrop covers full viewport; modal snaps flush under header   */
.ayah-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(4, 8, 18, 0.82);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease-out);
}
.ayah-modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ─── Modal card ──────────────────────────────────────────────── */
.ayah-modal {
  position: relative;
  width: min(680px, 94vw);
  /* --ayah-max-h set dynamically by JS = viewport - header height */
  max-height: var(--ayah-max-h, calc(100vh - 80px));
  display: flex;
  flex-direction: column;
  background: #0d1829;
  background-image:
    radial-gradient(ellipse 70% 35% at 50% 0%,   rgba(197,150,74,0.12) 0%, transparent 65%),
    radial-gradient(ellipse 55% 40% at 50% 100%, rgba(24,117,96,0.08)  0%, transparent 65%);
  border: 1px solid rgba(197, 150, 74, 0.30);
  border-top: none;
  border-radius: 0 0 20px 20px;
  box-shadow:
    0 16px 80px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(197, 150, 74, 0.07) inset;
  transform: translateY(-24px);
  opacity: 0;
  transition:
    transform 0.34s cubic-bezier(0.32, 0.72, 0, 1),
    opacity   0.22s var(--ease-out);
  will-change: transform, opacity;
  overflow: hidden;
}
.ayah-modal-backdrop.open .ayah-modal {
  transform: translateY(0);
  opacity: 1;
}

/* ─── Header row — always visible, never scrolls ─────────────── */
.ayah-modal-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 20px;
  background: rgba(197, 150, 74, 0.07);
  border-bottom: 1px solid rgba(197, 150, 74, 0.16);
}

/* Title + ref — left side */
.ayah-modal-title-wrap {
  flex: 1;
  min-width: 0;
}
.ayah-modal-title {
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gold);
  -webkit-text-fill-color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ayah-modal-ref {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(234, 240, 255, 0.55);
  margin-top: 3px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action buttons — right side, all three in a row */
.ayah-modal-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* Base style for all three icon buttons */
.ayah-modal-actions .ayah-action-btn,
.ayah-modal-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(234, 240, 255, 0.60);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Share + Refresh — gold accent on hover */
.ayah-modal-actions .ayah-action-btn:hover {
  background: rgba(197, 150, 74, 0.13);
  border-color: rgba(197, 150, 74, 0.30);
  color: var(--gold);
  transform: translateY(-1px);
}
.ayah-modal-actions .ayah-action-btn:active {
  transform: scale(0.90);
}

/* Close — rose accent on hover */
.ayah-modal-actions .ayah-action-close:hover,
.ayah-modal-close:hover {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.28);
  color: #fb7185;
  transform: translateY(-1px);
}

/* Divider line before close button */
.ayah-modal-actions .ayah-action-close {
  margin-left: 4px;
  border-left: 1px solid rgba(255,255,255,0.07);
  padding-left: 4px;
  border-radius: 0 9px 9px 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: transparent;
  border-top: none;
  border-bottom: none;
  border-right: none;
  width: auto;
  padding: 0 4px 0 10px;
  color: rgba(234, 240, 255, 0.45);
  font-size: 13px;
}
.ayah-modal-actions .ayah-action-close:hover {
  background: transparent;
  border-color: transparent;
  border-left-color: rgba(255,255,255,0.07);
  color: #fb7185;
  transform: none;
}

/* ─── Scrollable body — grows/shrinks with any ayah length ───── */
.ayah-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* ─── Bismillah ornament ──────────────────────────────────────── */
.ayah-modal-ornament {
  text-align: center;
  padding: 16px 20px 2px;
  font-family: var(--arabic);
  font-size: 1.9rem;
  color: rgba(197, 150, 74, 0.80);
  line-height: 1.5;
  user-select: none;
  text-shadow: 0 0 20px rgba(197,150,74,0.30);
}

/* ─── Arabic verse ────────────────────────────────────────────── */
.ayah-modal-arabic {
  font-size: clamp(17px, 3.5vw, 24px);
  line-height: 2.3;
  text-align: center;
  direction: rtl;
  padding: 14px 18px 12px;
  background: rgba(197,150,74,0.05);
  border-top: 1px solid rgba(197,150,74,0.11);
  border-bottom: 1px solid rgba(197,150,74,0.11);
  margin: 6px 14px;
  border-radius: 12px;
  color: #eaf0ff;
  text-shadow: 0 0 28px rgba(197,150,74,0.12);
}

/* ─── Translation ─────────────────────────────────────────────── */
.ayah-modal-translation {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.80;
  color: rgba(234, 240, 255, 0.68);
  text-align: center;
  font-style: italic;
  padding: 10px 22px 6px;
}

/* ─── Share button ────────────────────────────────────────────── */
.ayah-modal-body .ayah-share-btn {
  display: flex;
  margin: 10px auto 2px;
}

/* ─── Mobile: full width, flush corners ──────────────────────── */
@media (max-width: 639px) {
  .ayah-modal { width: 100%; border-radius: 0 0 14px 14px; }
}

/* ─── Hide the original inline card (safety net) ─────────────── */
.daily-ayah-card { display: none !important; }

/* ── Scope Quran reader ayah-action-btn so it doesn't override modal ── */
.ayah .ayah-action-btn,
.mushaf-page .ayah-action-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 14px;
  width: auto; height: auto;
  min-height: 32px; min-width: 32px;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE NAVIGATION FIX
   Replace wrapping tab bar with horizontal scroll strip on mobile.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  .top-nav {
    /* Full-width scrollable strip — no wrapping */
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    gap: 4px;
  }
    /* Fix: let dropdowns overflow when open (iOS PWA) */
  .top-nav.dropdown-open {
    overflow: visible;
  }
  /* Hide scrollbar but keep functionality */
  .top-nav::-webkit-scrollbar { display: none; }
  .top-nav { -ms-overflow-style: none; scrollbar-width: none; }

  .btn-tab {
    flex-shrink: 0;
    scroll-snap-align: start;
    font-size: 12px;
    padding: 8px 11px;
    min-height: 40px;
  }

  /* Stack header vertically on small screens */
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-bottom: 8px;
  }
  .app-header > .brand { width: 100%; }

  /* Language select sits inline with brand on mobile */
  #langSelect { margin-left: auto; }
}

/* ═══════════════════════════════════════════════════════════════
   EXTRACTED INLINE STYLES → NAMED CLASSES
   Replaces one-off style="" attributes scattered through the HTML.
   ═══════════════════════════════════════════════════════════════ */

/* Tracker stat cards */
.tracker-stat-card {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
}
.tracker-stat-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 700;
}
.tracker-stat-value--green  { color: rgba(var(--green-rgb), 1); }
.tracker-stat-value--gold   { color: rgba(var(--gold-rgb),  1); }
.tracker-stat-value--blue   { color: rgba(var(--blue-rgb),  1); }
.tracker-stat-value--purple { color: rgba(var(--purple-rgb),1); }

/* Ramadan card time values */
.ramadan-time-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
}
.ramadan-time-value--imsak  { color: rgba(var(--purple-rgb), 1); }
.ramadan-time-value--iftar  { color: rgba(var(--green-rgb),  1); }
.ramadan-countdown {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}

/* Zakat display values */
.zakat-nisab-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}
.zakat-nisab-value--gold   { color: rgba(var(--gold-rgb),  1); }
.zakat-nisab-value--silver { color: rgba(var(--blue-rgb),  1); }
.zakat-due-amount {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  color: rgba(var(--green-rgb), 1);
}

/* Contact form */
.contact-textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
}
.contact-textarea:focus {
  outline: 2.5px solid rgba(var(--blue-rgb), 0.7);
  outline-offset: 2px;
}

/* Contact success state */
.contact-success {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(var(--green-rgb), 0.08);
  border: 1px solid rgba(var(--green-rgb), 0.2);
  text-align: center;
}
.contact-success-icon  { font-size: 28px; margin-bottom: 6px; }
.contact-success-title { font-size: 14px; font-weight: 600; color: rgba(var(--green-rgb), 1); }

/* EmailJS disclosure notice */
.emailjs-notice {
  margin-top: 14px;
  text-align: center;
  line-height: 1.7;
}
.emailjs-notice a { color: rgba(var(--gold-rgb), 0.9); }

/* Tracker month title */
.tracker-month-name {
  font-size: 18px;
  font-weight: 700;
}
/* ═══════════════════════════════════════════════════════════════
   ADHAN SETTINGS — append to styles.css
   ═══════════════════════════════════════════════════════════════ */

/* Card wrapper */
.adhan-card {
  background: var(--card-bg, #161b22);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px;
  margin-top: 16px;
  overflow: hidden;
  position: relative;
}

/* Header */
.adhan-card-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.adhan-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #e8eaf0);
}
.adhan-card-sub {
  font-size: 12px;
  color: var(--meta, #7a8499);
  margin-top: 2px;
}

/* Permission banner */
.adhan-perm-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.02);
}
.adhan-perm-granted { background: rgba(63,182,139,0.06); border-bottom-color: rgba(63,182,139,0.25); }
.adhan-perm-denied  { background: rgba(224,92,92,0.06);  border-bottom-color: rgba(224,92,92,0.25);  }
.adhan-perm-icon { font-size: 20px; flex-shrink: 0; }
.adhan-perm-text { flex: 1; }
.adhan-perm-title { font-size: 13px; font-weight: 600; color: var(--text, #e8eaf0); }
.adhan-perm-desc  { font-size: 11px; color: var(--meta, #7a8499); line-height: 1.4; margin-top: 2px; }
.adhan-perm-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: #d4af5f;
  color: #0d1117;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, opacity 0.2s;
}
.adhan-perm-btn:hover:not(:disabled) { background: #e8c97a; }
.adhan-perm-btn:disabled { opacity: 0.6; cursor: default; }

/* Prayer tabs */
.adhan-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 14px 16px 0;
}
.adhan-tabs::-webkit-scrollbar { display: none; }
.adhan-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 30px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--meta, #7a8499);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.adhan-tab:hover { border-color: rgba(212,175,95,0.35); color: var(--text, #e8eaf0); }
.adhan-tab-active {
  background: rgba(212,175,95,0.12);
  border-color: rgba(212,175,95,0.4);
  color: #e8c97a;
}
.adhan-tab-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

/* Panel */
#adhanPanel { padding: 16px 16px 0; }

.adhan-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  margin-bottom: 14px;
}
.adhan-panel-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #e8eaf0);
}
.adhan-panel-time { font-size: 12px; color: var(--meta, #7a8499); margin-top: 2px; }

/* Badge */
.adhan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-top: 4px;
}
.adhan-badge-on  { background: rgba(63,182,139,0.15); color: #3fb68b; }
.adhan-badge-off { background: rgba(255,255,255,0.06); color: var(--meta, #7a8499); }
.adhan-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* Master toggle row */
.adhan-master-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  margin-bottom: 12px;
}
.adhan-master-label { font-size: 13px; font-weight: 600; color: var(--text, #e8eaf0); }
.adhan-master-sub   { font-size: 11px; color: var(--meta, #7a8499); margin-top: 2px; }

/* Toggle switch */
.adhan-toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.adhan-toggle input { opacity: 0; width: 0; height: 0; }
.adhan-toggle-track {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s;
}
.adhan-toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--meta, #7a8499);
  transition: all 0.25s;
}
.adhan-toggle input:checked + .adhan-toggle-track {
  background: rgba(212,175,95,0.18);
  border-color: rgba(212,175,95,0.45);
}
.adhan-toggle input:checked + .adhan-toggle-track::after {
  left: calc(100% - 19px);
  background: #d4af5f;
}

/* Settings card */
.adhan-settings-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}
.adhan-settings-card-disabled { opacity: 0.4; pointer-events: none; }

/* Setting rows */
.adhan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  transition: background 0.15s;
}
.adhan-row-last { border-bottom: none; }
.adhan-row-hidden { display: none; }
.adhan-row-left { flex: 1; min-width: 0; }
.adhan-row-label { font-size: 13px; font-weight: 500; color: var(--text, #e8eaf0); }
.adhan-row-sub   { font-size: 11px; color: var(--meta, #7a8499); margin-top: 2px; }
.adhan-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Select */
.adhan-sel-wrap { position: relative; }
.adhan-select {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  color: var(--text, #e8eaf0);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 26px 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  min-width: 130px;
}
.adhan-select:focus { border-color: rgba(212,175,95,0.4); }
.adhan-select option { background: #1c2330; }
.adhan-sel-chev {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  color: var(--meta, #7a8499);
  font-size: 10px;
  pointer-events: none;
}

/* Test button */
.adhan-test-btn {
  padding: 6px 11px;
  border-radius: 7px;
  border: 1px solid rgba(212,175,95,0.35);
  background: rgba(212,175,95,0.1);
  color: #e8c97a;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.adhan-test-btn:hover { background: rgba(212,175,95,0.2); }

/* Footer hint */
.adhan-footer-hint {
  font-size: 11px;
  color: var(--meta, #7a8499);
  padding: 8px 2px 2px;
  margin-bottom: 14px;
}

/* Save bar */
.adhan-save-bar {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}
.adhan-save-btn {
  flex: 1;
  padding: 11px;
  border-radius: 10px;
  border: none;
  background: #d4af5f;
  color: #0d1117;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.adhan-save-btn:hover  { background: #e8c97a; transform: translateY(-1px); }
.adhan-save-btn:active { transform: translateY(0); }
.adhan-apply-all-btn {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: transparent;
  color: var(--meta, #7a8499);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.adhan-apply-all-btn:hover { border-color: rgba(212,175,95,0.35); color: var(--text, #e8eaf0); }

/* UI feedback toast (separate from adhan trigger toast) */
.adhan-ui-toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--card-bg, #1c2330);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--text, #e8eaf0);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.adhan-ui-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS MODAL
   ═══════════════════════════════════════════════════════════════ */

/* ── Gear button in header ────────────────────────────────────── */
.settings-gear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(var(--gold-rgb), 0.2);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.25s;
  padding: 0;
}
.settings-gear-btn:hover {
  background: rgba(var(--green-rgb), 0.12);
  border-color: rgba(var(--green-rgb), 0.4);
  color: rgba(var(--green-rgb), 1);
  transform: rotate(45deg);
}
.settings-gear-btn:focus-visible {
  outline: 2px solid rgba(var(--green-rgb), 0.6);
  outline-offset: 2px;
}

/* ── Modal backdrop ───────────────────────────────────────────── */
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.settings-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal box ────────────────────────────────────────────────── */
.settings-modal {
  background: var(--card);
  border: 1px solid rgba(var(--gold-rgb), 0.14);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.settings-modal-backdrop.open .settings-modal {
  transform: translateY(0) scale(1);
}

/* ── Header ───────────────────────────────────────────────────── */
.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.settings-modal-title {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--display);
  letter-spacing: 0.03em;
  color: var(--white-soft);
}
.settings-modal-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.settings-close-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.settings-close-btn:hover { background: rgba(251,113,133,0.12); color: var(--danger); }

/* ── Body ─────────────────────────────────────────────────────── */
.settings-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-modal-body::-webkit-scrollbar { width: 4px; }
.settings-modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Field ────────────────────────────────────────────────────── */
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--white-soft);
  letter-spacing: 0.02em;
}
.settings-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.settings-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.settings-select {
  width: 100%;
  padding: 10px 32px 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--fg);
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s, background 0.15s;
}
.settings-select:focus {
  outline: none;
  border-color: rgba(var(--green-rgb), 0.5);
  background: rgba(255,255,255,0.08);
}
.settings-sel-chev {
  position: absolute;
  right: 10px;
  color: var(--muted);
  pointer-events: none;
  font-size: 11px;
}

/* ── City display ─────────────────────────────────────────────── */
.settings-city-display {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  font-size: 13px;
  color: rgba(var(--green-rgb), 0.9);
  font-family: var(--mono);
}
.settings-city-btn {
  align-self: flex-start;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid rgba(var(--green-rgb), 0.3);
  background: rgba(var(--green-rgb), 0.08);
  color: rgba(var(--green-rgb), 0.9);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.settings-city-btn:hover {
  background: rgba(var(--green-rgb), 0.16);
  border-color: rgba(var(--green-rgb), 0.5);
}

/* ── Adhan preview ────────────────────────────────────────────── */
.settings-adhan-preview {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
}
.settings-adhan-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.settings-adhan-label {
  font-size: 11px;
  color: var(--muted);
  min-width: 110px;
}
.settings-adhan-file {
  font-family: var(--mono);
  font-size: 11px;
  color: rgba(197,150,64,0.9);
  background: rgba(197,150,64,0.07);
  padding: 2px 6px;
  border-radius: 4px;
}
.settings-adhan-jafari {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(197,150,64,0.85);
  letter-spacing: 0.02em;
}

/* ── Daily Habits section (inside settings modal) ─────────────── */
.settings-habit-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.settings-habit-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.settings-habit-sub {
  margin-top: 10px;
  padding: 10px 0 2px;
  border-top: 1px solid var(--line);
}
.settings-habit-sub.hidden {
  display: none;
}
/* reuse ob-toggle, ob-chip, ob-check-row from onboarding styles
   but override colours to match the settings light/dark theme */
#settingsHabitsSection .ob-toggle-track {
  background: var(--muted);
}
#settingsHabitsSection .ob-toggle input:checked + .ob-toggle-track {
  background: var(--accent, #059669);
}
#settingsHabitsSection .ob-check-row {
  border-color: var(--line);
  background: var(--card-bg, rgba(0,0,0,0.03));
  color: var(--text);
}
#settingsHabitsSection .ob-check-row.checked {
  background: rgba(52,211,153,0.08);
  border-color: rgba(52,211,153,0.35);
}
#settingsHabitsSection .ob-check-label {
  color: var(--text);
}
#settingsHabitsSection .ob-check-row.checked .ob-check-label {
  color: #059669;
}
#settingsHabitsSection .ob-check-box {
  border-color: var(--muted);
  background: transparent;
}
#settingsHabitsSection .ob-chip {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}
#settingsHabitsSection .ob-chip.selected {
  background: rgba(52,211,153,0.12);
  border-color: #34d399;
  color: #059669;
}
#settingsHabitsSection .ob-custom-input {
  background: var(--input-bg, rgba(0,0,0,0.05));
  border-color: var(--line);
  color: var(--text);
}

/* ── Footer ───────────────────────────────────────────────────── */
.settings-modal-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.settings-status {
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
}
.settings-footer-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.settings-cancel-btn {
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-cancel-btn:hover { background: rgba(255,255,255,0.05); }
.settings-save-btn {
  padding: 9px 20px;
  border-radius: 10px;
  border: none;
  background: rgba(var(--green-rgb), 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.settings-save-btn:hover { background: rgba(var(--green-rgb), 1); }
.settings-save-btn:active { transform: scale(0.97); }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .settings-modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
  }
  .settings-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   ISTIKHĀRA MODULE
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero Card ─────────────────────────────────────────────── */

.istikhara-hero-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  border-color: rgba(var(--gold-rgb), 0.18);
}

.istikhara-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 70% 20%,
    rgba(var(--gold-rgb), 0.07) 0%,
    transparent 60%),
    radial-gradient(ellipse at 20% 80%,
    rgba(var(--green-rgb), 0.08) 0%,
    transparent 55%);
}

.istikhara-geo-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      60deg,
      transparent,
      transparent 38px,
      rgba(var(--gold-rgb), 0.03) 38px,
      rgba(var(--gold-rgb), 0.03) 39px
    ),
    repeating-linear-gradient(
      -60deg,
      transparent,
      transparent 38px,
      rgba(var(--gold-rgb), 0.03) 38px,
      rgba(var(--gold-rgb), 0.03) 39px
    );
}

.istikhara-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 28px 32px;
  gap: 12px;
}

.istikhara-hero-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 0 18px rgba(var(--gold-rgb), 0.35));
  animation: istikhara-float 6s ease-in-out infinite;
}

@keyframes istikhara-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.istikhara-hero-title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin: 0;
  text-shadow: 0 0 40px rgba(var(--gold-rgb), 0.3);
}

.istikhara-hero-subtitle {
  font-size: 1.05rem;
  color: var(--white-soft);
  font-style: italic;
  margin: 0;
  opacity: 0.88;
}

.istikhara-hero-body {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 4px 0;
}

.istikhara-hero-hadith {
  margin-top: 4px;
}

.istikhara-hadith-ref {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--gold);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  letter-spacing: 0.02em;
}

.istikhara-privacy-pill {
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(var(--green-rgb), 0.08);
  border: 1px solid rgba(var(--green-rgb), 0.15);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  margin-top: 6px;
}

/* ── Steps ─────────────────────────────────────────────────── */

.istikhara-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.istikhara-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  transition: background var(--dur-normal) ease, border-color var(--dur-normal) ease;
}

.istikhara-step:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(var(--gold-rgb), 0.1);
}

.istikhara-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--green-rgb), 0.25), rgba(var(--gold-rgb), 0.12));
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  color: var(--gold-light);
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(var(--gold-rgb), 0.12);
}

.istikhara-step-body {
  flex: 1;
  min-width: 0;
}

.istikhara-step-title {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 3px;
}

.istikhara-step-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

.istikhara-note {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── Duʿā Card ─────────────────────────────────────────────── */

.istikhara-dua-card {
  border-color: rgba(var(--gold-rgb), 0.12);
}

.dua-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
}

.dua-tab-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) ease;
  font-family: var(--sans);
}

.dua-tab-btn.active {
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--gold-light);
  border: 1px solid rgba(var(--gold-rgb), 0.2);
}

.dua-tab-btn:hover:not(.active) {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

.dua-frame {
  position: relative;
  background: linear-gradient(160deg,
    rgba(var(--gold-rgb), 0.04) 0%,
    rgba(17, 30, 54, 0.6) 50%,
    rgba(var(--green-rgb), 0.04) 100%);
  border: 1px solid rgba(var(--gold-rgb), 0.16);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
  min-height: 140px;
}

.dua-ornament-top,
.dua-ornament-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(var(--gold-rgb), 0.3);
  font-size: 1.2rem;
  line-height: 1;
  pointer-events: none;
}

.dua-ornament-top { top: 8px; }
.dua-ornament-bottom { bottom: 8px; }

.dua-text {
  display: block;
  line-height: 1.95;
  color: var(--fg);
  transition: opacity var(--dur-normal) ease;
}

.dua-arabic {
  font-family: var(--arabic);
  font-size: clamp(1.2rem, 3.5vw, 1.55rem);
  text-align: center;
  letter-spacing: 0.01em;
  color: var(--white-soft);
}

.dua-translit {
  font-size: 0.92rem;
  font-style: italic;
  text-align: center;
  color: rgba(234, 240, 255, 0.82);
  line-height: 2;
}

.dua-translation {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--muted);
  text-align: center;
}

.dua-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ── Journal Form ──────────────────────────────────────────── */

.istikhara-form {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.istikhara-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.istikhara-form-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.03em;
}

.istikhara-form-status {
  font-size: 0.82rem;
  font-weight: 500;
}

.istikhara-field-group {
  margin-bottom: 14px;
}

.istikhara-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.istikhara-required { color: var(--danger); }
.istikhara-optional { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.78rem; }

.istikhara-input,
.istikhara-select,
.istikhara-textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 0.9rem;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
  outline: none;
  -webkit-appearance: none;
}

.istikhara-input:focus,
.istikhara-select:focus,
.istikhara-textarea:focus {
  border-color: rgba(var(--gold-rgb), 0.35);
  background: var(--input-hover);
  box-shadow: 0 0 0 2px rgba(var(--gold-rgb), 0.08);
}

.istikhara-input::placeholder,
.istikhara-textarea::placeholder { color: rgba(234, 240, 255, 0.25); }

.istikhara-textarea { resize: vertical; min-height: 72px; }

.istikhara-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c5964a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.istikhara-select option { background: var(--navy-card); color: var(--fg); }

.istikhara-row {
  display: flex;
  gap: 12px;
}

.istikhara-field-half { flex: 1; min-width: 0; }

.istikhara-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fg);
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.istikhara-check-label:hover {
  border-color: rgba(var(--gold-rgb), 0.25);
  background: var(--input-hover);
}

.istikhara-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--green-islamic);
  cursor: pointer;
  flex-shrink: 0;
}

.istikhara-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.istikhara-save-btn {
  flex: 1;
  min-width: 120px;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 0.92rem;
}

.istikhara-clear-btn {
  padding: 11px 16px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ── Journal List Divider ──────────────────────────────────── */

.istikhara-divider {
  position: relative;
  text-align: center;
  margin: 8px 0 12px;
}

.istikhara-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.istikhara-divider span {
  position: relative;
  background: var(--navy-card);
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.istikhara-privacy-note {
  font-size: 0.77rem;
  color: rgba(234, 240, 255, 0.35);
  text-align: center;
  margin-bottom: 16px;
}

/* ── Entry Cards ───────────────────────────────────────────── */

.istikhara-entry-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 10px;
  transition: border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
}

.istikhara-entry-card:hover {
  border-color: rgba(var(--gold-rgb), 0.14);
  box-shadow: var(--shadow-sm);
}

.entry-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.entry-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.3;
  flex: 1;
}

.entry-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-seeking {
  background: rgba(var(--blue-rgb), 0.12);
  color: var(--blue-soft);
  border: 1px solid rgba(var(--blue-rgb), 0.2);
}

.status-decided {
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--gold-light);
  border: 1px solid rgba(var(--gold-rgb), 0.2);
}

.status-complete {
  background: rgba(var(--green-rgb), 0.12);
  color: var(--green-light);
  border: 1px solid rgba(var(--green-rgb), 0.2);
}

.entry-card-meta {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.entry-meta-prayed { color: var(--green-light); }
.entry-meta-notprayed { color: rgba(234, 240, 255, 0.3); }

.entry-card-preview {
  font-size: 0.85rem;
  color: rgba(234, 240, 255, 0.6);
  line-height: 1.5;
  margin-bottom: 6px;
}

.entry-card-outcome {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.entry-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-danger-sm {
  color: var(--rose);
  border-color: rgba(251, 113, 133, 0.2);
}

.btn-danger-sm:hover {
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.35);
}

/* ── Empty State ───────────────────────────────────────────── */

.istikhara-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px;
  gap: 10px;
}

.istikhara-empty-icon {
  font-size: 2.4rem;
  opacity: 0.4;
}

.istikhara-empty-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.istikhara-empty-sub {
  font-size: 0.83rem;
  color: rgba(234, 240, 255, 0.35);
  max-width: 320px;
  line-height: 1.6;
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 480px) {
  .istikhara-hero-content { padding: 32px 20px 28px; }
  .istikhara-row { flex-direction: column; }
  .dua-arabic { font-size: 1.15rem; }
  .istikhara-form { padding: 16px; }
}


/* ── Prayer / Clock ─────────────────────────────────────────── */
.clock-date-row       { display: flex; align-items: center; gap: 7px; }
.row-gap-sm           { gap: 6px; }
.tz-hint              { margin-top: 4px; }
.row-actions--mt      { margin-top: 10px; }
.hint--mt             { margin-top: 12px; }
.hint--mt-sm          { margin-top: 8px; }
.hint--mb             { margin-bottom: 12px; }
.hint--mt             { margin-top: 12px; }

/* ── Ramadan Card ───────────────────────────────────────────── */
.ramadan-grid                    { grid-template-columns: 1fr 1fr; }
.ramadan-time-card               { flex-direction: column; align-items: stretch; gap: 8px; }
.ramadan-time-card--imsak        { border-color: rgba(167,139,250,0.2); background: rgba(167,139,250,0.04); }
.ramadan-time-card--iftar        { border-color: rgba(24,117,96,0.25);  background: rgba(24,117,96,0.04); }
.ramadan-row                     { display: flex; justify-content: space-between; align-items: center; }
.ramadan-label                   { font-size: 13px; font-weight: 600; }
.ramadan-label--imsak            { color: rgba(167,139,250,0.9); }
.ramadan-label--iftar            { color: rgba(24,117,96,0.9); }
.ramadan-note                    { margin-top: 2px; }
.ramadan-divider                 { margin: 4px 0; }
.ramadan-status--imsak           { color: rgba(167,139,250,0.7); }
.ramadan-status--iftar           { color: rgba(24,117,96,0.7); }
.ramadan-hint                    { margin-top: 12px; }

/* ── Tracker ────────────────────────────────────────────────── */
.tracker-month-title             { text-align: center; margin-bottom: 16px; }
.tracker-stats-grid              { grid-template-columns: repeat(4,1fr); margin-bottom: 16px; }
.tracker-legend                  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tracker-legend-item             { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; }
.tracker-legend-dot              { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tracker-legend-dot--full        { background: rgba(24,117,96,0.9); }
.tracker-legend-dot--most        { background: rgba(24,117,96,0.5); }
.tracker-legend-dot--some        { background: rgba(197,150,64,0.6); }
.tracker-legend-dot--none        { background: rgba(251,113,133,0.5); }
.tracker-legend-dot--empty       { background: rgba(255,255,255,0.1); }
.tracker-legend-ontime           { color: rgba(24,117,96,1); }
.tracker-legend-late             { color: rgba(197,150,64,1); }
.tracker-legend-missed           { color: rgba(251,113,133,1); }
.heatmap-legend                  { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 10px; }
.heatmap-legend-swatch           { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.heatmap-legend-swatch--0        { background: rgba(255,255,255,0.06); }
.heatmap-legend-swatch--1        { background: rgba(24,117,96,0.3); }
.heatmap-legend-swatch--2        { background: rgba(24,117,96,0.6); }
.heatmap-legend-swatch--3        { background: rgba(24,117,96,0.9); }
.btn-danger-soft                 { color: var(--danger); border-color: rgba(251,113,133,0.3); }

/* ── Quran / Shared small buttons ───────────────────────────── */
.hifz-controls                   { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-sm-text                     { font-size: 12px; padding: 6px 12px; }
.btn-danger-text                 { color: var(--danger); }
.bookmarks-empty                 { text-align: center; padding: 20px; }

/* ── Calendar ───────────────────────────────────────────────── */
.jaafari-options-row             { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jaafari-label                   { font-size: 13px; font-weight: 600; }
.jaafari-select                  { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--fg); font-size: 13px; cursor: pointer; }
.jaafari-status                  { font-size: 12px; }
.btn-muted                       { background: var(--muted); }

/* ── Zakat ──────────────────────────────────────────────────── */
.zakat-privacy-note              { margin-bottom: 16px; padding: 12px; border-radius: var(--radius-sm); background: rgba(24,117,96,0.06); border: 1px solid rgba(24,117,96,0.15); }
.zakat-nisab-card                { margin-bottom: 16px; }
.zakat-nisab-grid                { grid-template-columns: 1fr 1fr; margin-top: 8px; }
.zakat-nisab-values              { grid-template-columns: 1fr 1fr; margin-top: 12px; }
.zakat-nisab-card-item           { flex-direction: column; align-items: center; gap: 4px; }
.link-gold                       { color: rgba(197,150,64,1); text-decoration: underline; }
.link-silver                     { color: rgba(125,211,252,1); text-decoration: underline; }
.grid-flush                      { margin-top: 0; }
.zakat-results                   { margin-top: 0; }
.zakat-results-rows              { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.zakat-results-row               { display: flex; justify-content: space-between; }
.zakat-row-bold                  { font-weight: 600; }
.zakat-divider                   { margin: 4px 0; }
.zakat-mono                      { font-family: var(--mono); font-weight: 600; }
.zakat-mono--danger              { color: var(--danger); }
.zakat-mono--large               { font-weight: 700; font-size: 16px; }
.zakat-status-message            { text-align: center; padding: 16px; border-radius: var(--radius-sm); margin-bottom: 12px; }
.zakat-due-row                   { display: flex; justify-content: center; align-items: baseline; gap: 8px; }
.zakat-due-label                 { font-size: 14px; color: var(--muted); }

/* ── Privacy ────────────────────────────────────────────────── */
.privacy-promise                 { padding: 16px; border-radius: var(--radius); background: rgba(24,117,96,0.06); border: 1px solid rgba(24,117,96,0.15); margin-bottom: 16px; }
.privacy-promise-title           { font-size: 15px; font-weight: 700; color: rgba(24,117,96,1); margin-bottom: 8px; }
.privacy-promise-body            { font-size: 13px; line-height: 1.7; color: var(--text); }
.privacy-grid                    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.privacy-item                    { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.privacy-item-icon               { font-size: 20px; flex-shrink: 0; }
.privacy-item-title              { font-size: 13px; font-weight: 600; }
.privacy-item-meta               { font-size: 11px; }
.privacy-inventory               { grid-template-columns: 1fr; }
.privacy-total-row               { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: var(--radius); background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.privacy-total-label             { font-size: 14px; font-weight: 600; }
.privacy-total-size              { font-family: var(--mono); font-size: 20px; font-weight: 700; color: rgba(125,211,252,1); }
.privacy-backup-actions          { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.privacy-wipe-section            { text-align: center; padding: 20px 0; }
.privacy-wipe-desc               { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.btn-wipe                        { background: rgba(251,113,133,0.1); border-color: rgba(251,113,133,0.3); color: var(--danger); font-size: 16px; padding: 14px 28px; border-radius: var(--radius); }

/* ── pcal (Prayer Calendar) — from previous session ────────── */
.pcal-card        { max-width: 900px; margin: 0 auto; }
.pcal-header      { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.pcal-controls    { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 20px; }
.pcal-field-city  { flex: 1; min-width: 180px; }
.pcal-field-month { min-width: 120px; }
.pcal-field-year  { min-width: 90px; }
.pcal-btn         { padding: 9px 20px; font-size: 14px; white-space: nowrap; align-self: flex-end; }

/* ═══════════════════════════════════════════════════════════════
   HOME SCREEN — compact layout overrides
   ═══════════════════════════════════════════════════════════════ */

/* ── Kill every divider (line + any pseudo-element) in home ── */
#homeScreenContent .divider,
#homeScreenContent .divider *,
#homePrayerCard .divider {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
#homeScreenContent .divider::before,
#homeScreenContent .divider::after,
#homePrayerCard .divider::before,
#homePrayerCard .divider::after {
  display: none !important;
  content: none !important;
}

/* ── Compact cards ── */
#homeScreenContent .card {
  padding: 12px 14px !important;
  margin-bottom: 8px !important;
}

/* ── Bigger bolder section titles ── */
#homeScreenContent .h2,
#homeScreenContent h2,
#homeScreenContent h3 {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  margin: 0 0 1px !important;
}

/* ── Tighter card-head ── */
#homeScreenContent .card-head {
  margin-bottom: 8px !important;
  padding-bottom: 0 !important;
}
#homeScreenContent .card-head .meta {
  font-size: 0.75rem !important;
  margin-top: 1px !important;
}

/* ── Compact next-prayer strip ── */
#homeScreenContent .next-prayer,
#homePrayerCard .next-prayer {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 7px 10px !important;
  margin: 6px 0 0 !important;
  gap: 0 !important;
  min-height: 0 !important;
  background: rgba(255,255,255,0.04) !important;
  border-radius: 8px !important;
}
#homeScreenContent .next-prayer::before,
#homeScreenContent .next-prayer::after,
#homePrayerCard .next-prayer::before,
#homePrayerCard .next-prayer::after {
  display: none !important;
  content: none !important;
}
#homeScreenContent .next-prayer .label,
#homePrayerCard .next-prayer .label {
  font-size: 0.7rem !important;
  line-height: 1.2 !important;
  opacity: 0.6 !important;
  margin: 0 0 1px !important;
  padding: 0 !important;
}
#homeScreenContent .next-prayer .value,
#homePrayerCard .next-prayer .value {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── home-next-prayer (new class name) ── */
.home-next-prayer {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 7px 10px !important;
  margin: 6px 0 0 !important;
  background: rgba(255,255,255,0.04) !important;
  border-radius: 8px !important;
}
.home-next-prayer::before,
.home-next-prayer::after { display: none !important; content: none !important; }
.home-np-label {
  font-size: 0.7rem !important;
  line-height: 1.2 !important;
  opacity: 0.6 !important;
  margin: 0 0 1px !important;
}
.home-np-value {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}
.home-np-countdown { color: var(--accent, #d4a43a) !important; }

/* ── Prayer times grid ── */
#homeScreenContent .home-times-grid {
  gap: 6px !important;
  margin-bottom: 0 !important;
}
#homeScreenContent .home-time-card { padding: 7px 10px !important; }
#homeScreenContent .home-time-card .time-name { font-size: 0.72rem !important; }
#homeScreenContent .home-time-card .time-value {
  font-size: 1rem !important;
  font-weight: 700 !important;
}

/* ── Prayer action buttons ── */
#homeScreenContent .home-prayer-actions {
  margin-top: 8px !important;
  gap: 6px !important;
}

/* ── Tools ── */
#homeScreenContent .home-tools-grid { gap: 6px !important; }
#homeScreenContent .home-tool-btn { padding: 8px 10px !important; }
#homeScreenContent .home-links-row { gap: 6px !important; margin-top: 4px !important; }
#homeScreenContent .home-link-pill { padding: 5px 12px !important; font-size: 0.82rem !important; }

/* ── Quran widget ── */
#homeQuranDailyCard .card-head { margin-bottom: 6px !important; }

/* ═══════════════════════════════════════════════════════════════
   HOME V2 — compact, mobile-first landing page
   ═══════════════════════════════════════════════════════════════ */
#homeScreenContent {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#homeScreenContent .card {
  padding: 16px !important;
}

#homePrayerCard.home-prayer-card-v2 {
  padding: 16px !important;
}

#homeScreenContent .home-prayer-head,
#homeScreenContent .home-tools-head,
#homeScreenContent .home-quran-head {
  margin-bottom: 10px !important;
  align-items: flex-start !important;
}

#homeScreenContent .home-kicker {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

#homeScreenContent .home-prayer-city {
  margin: 0;
}

#homeScreenContent .home-live-clock {
  text-align: right;
}

#homeScreenContent .home-live-clock .prayer-live-clock-time {
  font-size: 1.05rem !important;
  line-height: 1.05;
}

#homeScreenContent .home-live-clock .prayer-live-clock-date {
  font-size: 0.82rem !important;
  color: var(--accent, #d4a43a);
}

#homeScreenContent .home-times-grid {
  gap: 8px !important;
  margin-bottom: 0 !important;
}

#homeScreenContent .home-time-card {
  min-height: 52px !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  background: rgba(255,255,255,0.035) !important;
}

#homeScreenContent .home-time-card .time-name {
  font-size: 0.86rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--accent, #d4a43a) !important;
}

#homeScreenContent .home-time-card .time-value {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
}

#homeScreenContent .home-time-icon {
  opacity: 0.9;
  font-size: 0.95rem;
}

#homeScreenContent .home-next-prayer.compact {
  margin-top: 10px !important;
  padding: 10px 12px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 12px !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px !important;
}

#homeScreenContent .home-next-prayer.compact .np-left,
#homeScreenContent .home-next-prayer.compact .np-right {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

#homeScreenContent .home-np-label {
  margin: 0 !important;
  font-size: 0.76rem !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72 !important;
}

#homeScreenContent .home-np-value {
  margin: 0 !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
}

#homeScreenContent .home-inline-note-spaced {
  margin-top: 10px;
}

#homeScreenContent .home-prayer-actions.compact-actions {
  margin-top: 10px !important;
  gap: 8px !important;
}

#homeScreenContent .home-prayer-actions.compact-actions .btn,
#homeScreenContent .home-qd-btn {
  min-height: 38px !important;
  padding: 8px 12px !important;
  font-size: 0.92rem !important;
}

#homeScreenContent .home-quran-card-v2 {
  padding: 14px 16px !important;
}

#homeScreenContent .home-qd-streak {
  color: var(--accent, #d4a43a);
  font-size: 0.83rem;
  font-weight: 600;
}

#homeScreenContent .home-qd-pos {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

#homeScreenContent .home-qd-progress-wrap {
  margin-top: 4px;
}

#homeScreenContent .home-qd-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

#homeScreenContent .home-qd-progress-label {
  color: var(--muted);
  font-size: 0.9rem;
}

#homeScreenContent .home-qd-progress-pct {
  color: var(--accent, #d4a43a);
  font-size: 0.92rem;
  font-weight: 700;
}

#homeScreenContent .home-qd-bar {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

#homeScreenContent .home-qd-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent, #d4a43a);
  transition: width 0.4s ease;
}

#homeScreenContent .home-qd-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#homeScreenContent .home-tools-card-v2 {
  padding-top: 14px !important;
}

#homeScreenContent .home-tools-grid-v2 {
  display: flex !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

#homeScreenContent .home-tool-btn {
  width: 110px;
  min-width: 110px;
  min-height: 70px;
  padding: 10px 8px !important;
  border-radius: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}

#homeScreenContent .home-tool-icon {
  font-size: 1.35rem;
  line-height: 1;
}

#homeScreenContent .home-tool-label {
  font-size: 0.83rem;
  text-align: center;
  line-height: 1.2;
}

#homeScreenContent .home-more-tools-row {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

#homeScreenContent .home-subtle-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

#homeScreenContent .home-links-row-v2 {
  display: flex;
  gap: 8px !important;
  flex-wrap: wrap;
  margin-top: 0 !important;
}

#homeScreenContent .home-link-pill {
  padding: 6px 12px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

@media (max-width: 720px) {
  #homeScreenContent .home-live-clock {
    min-width: fit-content;
  }

  #homeScreenContent .home-next-prayer.compact {
    flex-direction: column;
    align-items: flex-start !important;
  }

  #homeScreenContent .home-next-prayer.compact .np-right {
    align-self: stretch;
  }

  #homeScreenContent .home-tools-grid-v2 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #homeScreenContent .home-tool-btn {
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 520px) {
  #homeScreenContent .card {
    padding: 14px !important;
  }

  #homeScreenContent .home-prayer-head,
  #homeScreenContent .home-quran-head {
    gap: 8px !important;
  }

  #homeScreenContent .home-times-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #homeScreenContent .home-tool-btn {
    min-height: 64px;
  }
}
:root{

--qd-title:25px;
--qd-body:17px;
--qd-meta:14px;

}

.home-quran-strip-title-v3f{
font-size:var(--qd-title)!important;
}

.home-qd-progress-label-v3f{
font-size:var(--qd-body)!important;
}

.home-qd-pos-v3f{
font-size:var(--qd-meta)!important;
}
.home-quran-strip-v3f .home-qd-pos-v3f{
font-size:var(--qd-meta)!important;
}

.home-qd-progress-pct-v3f{
font-size:16px!important;
}
