/* ═════════════════════════════════════════════════
   NamazApp — modernized design system
   ═════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg: #0a0e1a;
  --bg-2: #0d1220;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Text */
  --fg: #eaf0fa;
  --fg-2: rgba(234, 240, 250, 0.62);
  --fg-3: rgba(234, 240, 250, 0.42);
  --fg-dim: var(--fg-2);

  /* Accent */
  --accent: #14b8a6;
  --accent-bright: #2dd4bf;
  --accent-soft: rgba(20, 184, 166, 0.14);
  --accent-glow: 0 0 32px rgba(20, 184, 166, 0.28);
  --bg-elev: var(--surface);
  --bg-card: var(--surface-2);

  /* Status */
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* Shape */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadow */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);

  /* Motion */
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --t-fast: 0.15s;
  --t-base: 0.25s;
  --t-slow: 0.4s;
}

* { box-sizing: border-box; }
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(20, 184, 166, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--fg);
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

main {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px 120px;
}

/* ═════════════════════════════════════════════════
   Header
   ═════════════════════════════════════════════════ */

.app-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 16px 18px;
  max-width: 620px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.app-header h1 {
  margin: 0;
  position: relative;
  display: inline-block;
  line-height: 1;
}
.brand-logo {
  height: 84px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 18px rgba(20, 184, 166, 0.25));
}
.brand-suffix {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 8px;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(20, 184, 166, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}
.brand-arabic {
  position: absolute;
  top: 34px;
  left: 100%;
  margin-left: 8px;
  font-size: 28px;
  font-family: "Amiri Quran", "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 1px;
  opacity: 0.9;
  white-space: nowrap;
  line-height: 1;
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 14px 8px 16px;
  border-radius: 999px;
  margin-top: 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease);
}
.location-pill:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.location-pill:active { transform: scale(0.97); }
.location-pill .location-edit {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.location-line {
  margin-top: 4px;
  font-size: 13px;
  color: var(--fg-2);
}

.location-panel {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px;
  animation: slideDown var(--t-base) var(--ease);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.location-panel-inner {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 8px;
  box-shadow: var(--shadow);
}
.location-panel-row {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background var(--t-fast) var(--ease);
}
.link-btn:hover { background: var(--accent-soft); }

.city-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}
.city-results:empty { display: none; }
.city-result {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.city-result:hover {
  border-color: var(--accent);
  background: var(--surface-3);
}
.city-result:active { transform: scale(0.99); }
.city-result .meta {
  display: block;
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 2px;
}

/* ═════════════════════════════════════════════════
   Tabs — top on desktop, floating bottom pill on mobile
   ═════════════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 6px;
  max-width: 620px;
  margin: 16px auto 8px;
  padding: 6px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 999px;
  position: sticky;
  top: 12px;
  z-index: 30;
  box-shadow: var(--shadow);
}
.tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--fg-2);
  padding: 10px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t-base) var(--ease),
              color var(--t-base) var(--ease);
}
.tab:hover { color: var(--fg); }
.tab.active {
  background: var(--accent);
  color: #001b16;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(20, 184, 166, 0.3);
}

@media (max-width: 600px) {
  .tabs {
    position: fixed;
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    margin: 0;
    width: auto;
    max-width: none;
  }
  .tab { font-size: 13px; padding: 10px 8px; }
}

/* ═════════════════════════════════════════════════
   Tab panels with fade-in
   ═════════════════════════════════════════════════ */

.tab-panel { display: none; animation: fadeIn var(--t-slow) var(--ease); }
.tab-panel.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═════════════════════════════════════════════════
   Next-prayer hero banner
   ═════════════════════════════════════════════════ */

.next-banner {
  position: relative;
  background:
    radial-gradient(ellipse 80% 100% at 50% 0%, rgba(20, 184, 166, 0.25) 0%, transparent 70%),
    linear-gradient(135deg, rgba(20, 184, 166, 0.18) 0%, rgba(99, 102, 241, 0.12) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.next-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
}
.next-banner.hidden { display: none; }
.banner-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent-bright);
  font-weight: 600;
}
.banner-prayer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.5px;
}
.banner-icon { font-size: 30px; }
.banner-time {
  margin-top: 8px;
  font-size: 14px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.banner-sep { margin: 0 6px; opacity: 0.4; }

/* ═════════════════════════════════════════════════
   Method picker
   ═════════════════════════════════════════════════ */

.method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.method-row label {
  font-size: 13px;
  color: var(--fg-2);
  font-weight: 500;
}
.method-row select,
.detail-pickers select {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
}
.method-row select:hover { border-color: var(--accent); }

/* ═════════════════════════════════════════════════
   Prayer list
   ═════════════════════════════════════════════════ */

.prayer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.prayer-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: var(--radius);
  transition: background var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease);
}
.prayer-row:hover { background: var(--surface-2); transform: translateX(2px); }
.prayer-row.next {
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 100%);
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}
.prayer-row.passed { opacity: 0.45; }
.prayer-icon { font-size: 22px; }
.prayer-name {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.2px;
}
.prayer-time {
  font-variant-numeric: tabular-nums;
  color: var(--fg-2);
  font-weight: 500;
  font-size: 15px;
}
.prayer-row.next .prayer-time {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.status-line {
  text-align: center;
  color: var(--fg-2);
  font-size: 13px;
  margin-top: 16px;
  min-height: 1.2em;
}

/* ═════════════════════════════════════════════════
   Compass / Qibla
   ═════════════════════════════════════════════════ */

.compass-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.compass {
  position: relative;
  width: min(340px, 82vw);
  height: min(340px, 82vw);
}
.compass-rose {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background:
    radial-gradient(circle at center,
      rgba(20, 184, 166, 0.06) 0%,
      var(--surface) 50%,
      var(--bg-2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    var(--shadow-lg);
  transition: transform var(--t-base) var(--ease);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.cardinal {
  position: absolute;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-2);
  letter-spacing: 0.5px;
}
.cardinal.n { top: 12px; left: 50%; transform: translateX(-50%); color: var(--danger); font-weight: 700; }
.cardinal.e { right: 14px; top: 50%; transform: translateY(-50%); }
.cardinal.s { bottom: 12px; left: 50%; transform: translateX(-50%); }
.cardinal.w { left: 14px; top: 50%; transform: translateY(-50%); }

.rose-ticks {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      rgba(255,255,255,0.18) 0 1deg, transparent 1deg 30deg,
      rgba(255,255,255,0.18) 30deg 31deg, transparent 31deg 60deg,
      rgba(255,255,255,0.18) 60deg 61deg, transparent 61deg 90deg,
      rgba(255,255,255,0.18) 90deg 91deg, transparent 91deg 120deg,
      rgba(255,255,255,0.18) 120deg 121deg, transparent 121deg 150deg,
      rgba(255,255,255,0.18) 150deg 151deg, transparent 151deg 180deg,
      rgba(255,255,255,0.18) 180deg 181deg, transparent 181deg 210deg,
      rgba(255,255,255,0.18) 210deg 211deg, transparent 211deg 240deg,
      rgba(255,255,255,0.18) 240deg 241deg, transparent 241deg 270deg,
      rgba(255,255,255,0.18) 270deg 271deg, transparent 271deg 300deg,
      rgba(255,255,255,0.18) 300deg 301deg, transparent 301deg 330deg,
      rgba(255,255,255,0.18) 330deg 331deg, transparent 331deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 60%, black 60%, black 75%, transparent 75%);
          mask: radial-gradient(circle, transparent 60%, black 60%, black 75%, transparent 75%);
}

.qibla-arrow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: center center;
  transition: transform var(--t-base) var(--ease);
  filter: drop-shadow(0 0 14px rgba(20, 184, 166, 0.55));
  color: var(--accent-bright);
}
.qibla-svg { width: 100%; height: 100%; display: block; }
.kaaba-tip {
  position: absolute;
  left: 50%;
  top: 6%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}
.compass-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 5px rgba(20, 184, 166, 0.18),
    0 0 16px rgba(20, 184, 166, 0.5);
  z-index: 2;
}

.qibla-arrow.aligned {
  filter: drop-shadow(0 0 18px rgba(74, 222, 128, 0.7));
  color: #4ade80;
}

.qibla-aligned {
  display: block;
  text-align: center;
  margin: 18px auto 0;
  background: rgba(74, 222, 128, 0.14);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  width: fit-content;
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.3); }
  50%      { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}

.qibla-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 28px 0 14px;
}
.stat {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
  transition: border-color var(--t-base) var(--ease);
}
.stat:hover { border-color: var(--border-strong); }
.stat-label {
  font-size: 11px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.primary-btn {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #001b16;
  border: none;
  padding: 14px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.25);
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-base) var(--ease),
              filter var(--t-fast) var(--ease);
}
.primary-btn:hover { filter: brightness(1.08); box-shadow: 0 8px 28px rgba(20, 184, 166, 0.4); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn:disabled { opacity: 0.5; cursor: default; }
.primary-btn.hidden { display: none; }

/* ═════════════════════════════════════════════════
   Generic helpers
   ═════════════════════════════════════════════════ */

.hidden { display: none !important; }
.spacer { flex: 1; }

.icon-btn {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  color: var(--fg);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.94); }

/* ═════════════════════════════════════════════════
   Quran — list
   ═════════════════════════════════════════════════ */

.quran-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 16px;
}
.quran-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.search-input {
  width: 100%;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 16px;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  margin-bottom: 14px;
  transition: border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.search-input::placeholder { color: var(--fg-3); }
.search-input:focus {
  border-color: var(--accent);
  background: var(--surface-2);
}

.surah-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.surah-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  gap: 12px;
  transition: background var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease),
              transform var(--t-fast) var(--ease);
}
.surah-row:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
  transform: translateX(2px);
}
.surah-num {
  width: 32px;
  height: 32px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.surah-info { display: flex; flex-direction: column; min-width: 0; }
.surah-name-en {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.surah-meta {
  font-size: 12px;
  color: var(--fg-2);
  margin-top: 3px;
}
.surah-name-ar {
  font-size: 20px;
  color: var(--fg);
  font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
}

/* ═════════════════════════════════════════════════
   Quran — detail
   ═════════════════════════════════════════════════ */

.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
}
.detail-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.detail-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color var(--t-fast) var(--ease);
}
.picker:hover { border-color: var(--border-strong); }
.picker span {
  font-size: 11px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 500;
}
.picker select {
  background: transparent;
  border: none;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 2px 0;
  cursor: pointer;
}

.detail-header {
  background:
    radial-gradient(ellipse 70% 100% at 50% 0%, rgba(20, 184, 166, 0.18) 0%, transparent 65%),
    linear-gradient(135deg, rgba(20, 184, 166, 0.10) 0%, transparent 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
  margin-bottom: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.detail-header .ar {
  font-size: 32px;
  font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  margin-bottom: 6px;
  color: var(--fg);
}
.detail-header .en-translation {
  font-size: 13px;
  color: var(--fg-2);
}
.detail-header .meta {
  font-size: 12px;
  color: var(--fg-3);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.detail-toggles {
  display: flex;
  gap: 8px;
  margin: 14px 0 6px;
  flex-wrap: wrap;
}
.toggle-pill {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--fg-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--t-base) var(--ease);
}
.toggle-pill:hover { background: var(--surface-2); color: var(--fg); }
.toggle-pill[data-on="true"] {
  background: var(--accent);
  color: #001b16;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.25);
}

.font-size-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.font-size-label {
  font-size: 11px;
  color: var(--fg-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-right: auto;
  font-weight: 500;
}
.size-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.size-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
}
.size-btn:active { transform: scale(0.92); }
.size-btn:disabled { opacity: 0.4; cursor: default; }
.size-btn:disabled:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--fg);
}
.size-value {
  font-size: 13px;
  color: var(--fg-2);
  font-variant-numeric: tabular-nums;
  min-width: 42px;
  text-align: center;
  font-weight: 500;
}

.bismillah {
  text-align: center;
  font-size: 24px;
  font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  color: var(--accent-bright);
  margin: 12px 0 18px;
}
.bismillah.hidden { display: none; }

.ayah-list {
  display: grid;
  gap: 10px;
}
.ayah-list.hide-translation .ayah-translation { display: none; }
.ayah-list.hide-transliteration .ayah-translit { display: none; }

.ayah-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color var(--t-base) var(--ease);
}
.ayah-card:hover { border-color: var(--border-strong); }
.ayah-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ayah-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fav-btn {
  background: transparent;
  border: none;
  color: var(--fg-3);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.fav-btn:hover { color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.fav-btn.active { color: #ef4444; }
.fav-btn:active { transform: scale(0.85); }

.ayah-arabic {
  font-size: var(--quran-arabic-size, 26px);
  line-height: 2;
  text-align: right;
  direction: rtl;
  font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  margin-bottom: 12px;
  color: var(--fg);
}
.ayah-translit {
  font-size: 14px;
  font-style: italic;
  color: #b8cce5;
  margin-bottom: 8px;
  line-height: 1.6;
}
.ayah-translation {
  font-size: 14px;
  color: var(--fg-2);
  line-height: 1.6;
}

/* ═════════════════════════════════════════════════
   Page mode
   ═════════════════════════════════════════════════ */

.page-view {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  margin-top: 8px;
  box-shadow: var(--shadow);
}
.page-view .page-text {
  font-size: var(--quran-arabic-size, 26px);
  line-height: 2.3;
  text-align: justify;
  direction: rtl;
  font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
}
.page-view .page-bismillah {
  text-align: center;
  font-size: 24px;
  font-family: "Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  color: var(--accent-bright);
  margin-bottom: 16px;
}
.page-view .ayah-marker {
  color: var(--accent);
  font-weight: 700;
  margin: 0 6px;
}

/* ═════════════════════════════════════════════════
   Mobile fine-tuning
   ═════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .app-header { padding: 28px 16px 14px; }
  .brand-logo { height: 64px; }
  .brand-arabic { font-size: 22px; top: 30px; }
  .next-banner { padding: 22px 18px; }
  .banner-prayer { font-size: 24px; }
  .compass { width: min(300px, 78vw); height: min(300px, 78vw); }
  .stat-value { font-size: 18px; }
  .qibla-stats { gap: 6px; }
}

/* Reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
